package incr_dom_partial_render

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Height_cache keeps track of the rendered height of items so that scrolling to a given position can decide which elements to render accurately. This allows rows to have different heights and change height at runtime.

It only caches heights for rows that are currently in the list with a given key, so items will be dropped on changing a filter or sort, but this is only noticeable if the height guess is wrong and the user is paying very close attention to consistency of scroll positions.

The height_guess parameter is the default height in pixels returned for any item that is not in the cache. Rows that are measured to be exactly height_guess tall will not even be added to the cache. If most of your rows are a certain size you should determine the exact height returned to measure_heights in the typical case and use that as your guess.

type t
include Ppx_compare_lib.Comparable.S with type t := t
val compare : t Base__Ppx_compare_lib.compare
val sexp_of_t : t -> Sexplib0.Sexp.t
val empty : height_guess:float -> t
val height : t -> Row_id.t -> float

height t key will return the actual height of key if available, otherwise it returns height_guess

OCaml

Innovation. Community. Security.