Logo FS-Skia-UI

Collections Module

Virtualization model for large scrolling lists: `visibleRange`/`init`/`update` over `CollectionModel`.

Functions and values

Function or value Description

init controlId itemCount rowHeight viewportHeight

Full Usage: init controlId itemCount rowHeight viewportHeight

Parameters:
    controlId : ControlId
    itemCount : int
    rowHeight : float
    viewportHeight : float

Returns: CollectionModel * CollectionEffect list

Build the initial `CollectionModel` for a `controlId` and emit its first `CollectionEffect` list.

controlId : ControlId
itemCount : int
rowHeight : float
viewportHeight : float
Returns: CollectionModel * CollectionEffect list

update msg model

Full Usage: update msg model

Parameters:
Returns: CollectionModel * CollectionEffect list

Apply a `CollectionMsg` to the `CollectionModel`, returning the next model and any effects.

msg : CollectionMsg
model : CollectionModel
Returns: CollectionModel * CollectionEffect list

visibleRange rowHeight viewportHeight scrollOffset totalItems overscan

Full Usage: visibleRange rowHeight viewportHeight scrollOffset totalItems overscan

Parameters:
    rowHeight : float
    viewportHeight : float
    scrollOffset : float
    totalItems : int
    overscan : int

Returns: VisibleRange

Compute the realized `VisibleRange` from row height, viewport height, scroll offset, item total, and an `overscan` buffer (Feature 114, additive trailing parameter). `overscan = 0` reproduces the pre-feature visible slice byte-identically; a positive `overscan` shifts `FirstIndex` back by up to `overscan` and widens `Count` by up to `2 * overscan`, edge-clamped so no index is `< 0` or `>= totalItems`. Negative `overscan` is treated as 0.

rowHeight : float
viewportHeight : float
scrollOffset : float
totalItems : int
overscan : int
Returns: VisibleRange

Type something to start searching.