Construct a notebook windowed list model.
Optional
options: WindowedList.IModelOptionsPrivate
_emitProtected
_estimatedDefault widget size estimation
we always use estimateWidgetSize
Protected
_stateProtected
cellsProtected
cellsMapping between the cell ids and the cell estimated heights
This height is not refreshed with the changes to the document. It is only used to measure cells outside the viewport on CPU idle cycle to improve UX scrolling.
Top padding of the the outer window node.
Readonly
scrollThreshold used to decide if the cell should be scrolled to in the smart
mode.
Defaults to scrolling when less than a full line of the cell is visible.
Readonly
scrollThreshold used to decide if the cell should be scrolled to in the smart
mode.
Defaults to scrolling when the cell margin or more is invisible.
Static
DEFAULT_Default cell margin (top + bottom)
Static
DEFAULT_Default cell height
Static
DEFAULT_Default editor line height
List widget height
List widget height
Test whether the model is disposed.
Items list to be rendered
Items list to be rendered
Number of widgets to render in addition to those visible in the viewport.
Number of widgets to render in addition to those visible in the viewport.
Viewport scroll offset.
Viewport scroll offset.
A signal emitted when any model state changes.
Total number of widgets in the list
Total number of widgets in the list
Whether windowing is active or not.
This is true by default.
Whether windowing is active or not.
Get the scroll offset to display an item in the viewport.
By default, the list will scroll as little as possible to ensure the item is fully visible (auto
).
You can control the alignment of the item though by specifying a second alignment parameter.
Acceptable values are:
auto - Automatically align with the top or bottom minimising the amount scrolled,
If alignPreference
is given, follow such preferred alignment.
If item is smaller than the viewport and fully visible, do not scroll at all.
smart - If the item is significantly visible, don't scroll at all (regardless of whether it fits in the viewport).
If the item is less than one viewport away, scroll so that it becomes fully visible (following the auto
heuristics).
If the item is more than one viewport away, scroll so that it is centered within the viewport (center
if smaller than viewport, top-center
otherwise).
center - Align the middle of the item with the middle of the viewport (it only works well for items smaller than the viewport).
top-center - Align the top of the item with the middle of the viewport (works well for items larger than the viewport).
end - Align the bottom of the item to the bottom of the list.
start - Align the top of item to the top of the list.
An item is considered significantly visible if:
scrollDownThreshold
when below the viewportscrollUpThreshold
when above the viewport.Item index
Optional
align: ScrollToAlignWhere to align the item in the viewport
Optional
margin: numberThe proportion of viewport to add when aligning with the top/bottom of the list.
Optional
precomputed: { Precomputed values to use when windowing is disabled.
Optional
alignPreference: BaseScrollToAlignmentAllows to override the alignment of item when the auto
heuristic decides that the item needs to be scrolled into view.
The needed scroll offset
Compute the items range to display.
It returns null
if the range does not need to be updated.
The current items range to display
Return the viewport top position and height for range spanning from
startIndex
to stopIndex
.
First item in viewport index
Last item in viewport index
The viewport top position and its height
Protected
onCallback on list changes
List items
List change
WindowedListModel caches offsets and measurements for each index for performance purposes. This method clears that cached data for all items after (and including) the specified index.
The list will automatically re-render after the index is reset.
Notebook view model for the windowed list.