Documentation

@kanunilabs/pivotgrid


@kanunilabs/pivotgrid / PivotVirtualizationOptions

Interface: PivotVirtualizationOptions

How the pivot's body draws its rows (layout.virtualization, B.96). Every member is optional and the defaults are today's behaviour. Only ROWS: the data columns are still drawn in a window once there are more than 40 of them, whatever mode says (a pivot can have thousands of columns; drawing every column of every row is the one thing that cannot be made cheap).

Properties

mode?

optional mode?: boolean | "auto"

true (default): only the rows in view are drawn, plus a margin (overscanY). false: every row is drawn at once, so nothing is ever blank while scrolling; keep it to small tables, since a table of tens of thousands of rows takes seconds to draw and the page freezes meanwhile, again on every expand, collapse, sort or filter. 'auto': every row while there are at most threshold of them, a window above that. The count is the rows the table shows (subtotal rows and the grand-total row included), not the source rows. While every row is drawn and the columns are windowed (more than 40 data columns), each sideways scroll step redraws every row.


overscanY?

optional overscanY?: number

Rows drawn beyond the view, above it and below it alike (a whole number, 0 or more; anything else is ignored); a row only partly in view counts as in view. Not set: the margin of before, about 5 rows each side in React and 5 above / 10 below in plain JS. A wider margin keeps a short fast scroll from showing blank rows; every row of it is drawn on each scroll step.


placeholderRows?

optional placeholderRows?: boolean

While the rows of the part scrolled into view are not drawn yet (a jump to the end, a fast fling), that part shows row-height lines instead of a blank area, in the row-header block and the data alike. Default false. The colours are the CSS variables --pivot-placeholder-row-line (default --pivot-border) and --pivot-placeholder-row-bg (default transparent). No effect while every row is drawn.


threshold?

optional threshold?: number

The most rows mode: 'auto' draws at once (default 2000; a value that is not a finite number of 0 or more means the default). Ignored by the other modes.