Skip to content

<notatio-collection-table>

As authored: Descents, or Max(_) - Min(_). */ readonly source: string; readonly label: string; /** The expression over _, or undefined when it did not parse. */ readonly json: MathJsonExpression | undefined; readonly error: string; }

interface Row { /** The 1-based index in the SOURCE collection — At(expr, index) is this row. */ readonly index: number; readonly text: string; readonly glyph: string; readonly cells: readonly CellValue[]; }

const PAGE_SIZES = [10, 20, 50, 100]; const SORT_LIMITS = [500, 2000, 10000]; const SCAN_STEP = 20000; /** How long one scan slice may hold the main thread before yielding. */ const SLICE_MS = 12;

const GLYPH_KINDS = new Set<GlyphKind>([ "permutation", "partition", "tableau", "composition", "subset", "dyck", "tree", "binary-tree", "set-partition", "lattice", "diagram", ]);

/** <notatio-collection-table expr="Subsets(4)"> -- a paged table over a lazy indexed collection. Rows are produced by unranking (At(expr, i)), one page at a time, so a collection is never materialised: SymmetricGroup(20) pages as cheaply as Subsets(4), and the # column is the index that reproduces each row.

columns names statistics to apply to every row — a head (Descents) or any expression over the row _ (Max(_) - Min(_)), comma-separated, addable and removable live. filter is a predicate over _; it is answered like Filter, by scanning the source in the background, bounded by scan-limit and extendable from the UI, and the match count is exact once the scan has covered the whole source. Sorting by a column has to materialise that column, so it is bounded by sort-limit and the table says when the order covers only a prefix of the rows.

Stories in the playground·packages/notatio-lit/src/notatio-collection-table.ts· in Vue: <CollectionTable>

Attributes

AttributeTypeDefaultNotes
exprstring""The collection to enumerate, in notatio: Subsets(4), SymmetricGroup(5).
columnsstring""Statistic columns, comma-separated. A bare head applies to the row (Descents means Descents(_)); anything else is an expression over _.reflects
filterstring""A predicate over the row _, e.g. FixedPoints(_) == 0. Empty for no filter.reflects
sortstring""The column (as written in columns) the rows are ordered by. Empty for index order.reflects
descendingbooleanfalseSort descending rather than ascending.reflects
page-size
property pageSize
number20Rows per page.
pagenumber1The current page, 1-based.reflects
carrierstring""The carrier its rows inhabit -- the constructor head from @enumeratio/domains, e.g. Permutation. Set it and each row is handed to the columns and the filter AS that carrier, so a statistic of a permutation (Cycles, FixedPoints) can be asked for at all: those heads take the carrier, not a bare list. Leave it unset and rows stay bare lists, which only the list-function statistics accept.
glyphstring""Draw each row as a glyph too: permutation, subset, partition, dyck, …
nnumber0Ground-set size for the subset glyph; taken from the collection's first argument when 0.
scan-limit
property scanLimit
numberSCAN_STEPHow many source rows a filter scan covers before it pauses and offers to go on.
sort-limit
property sortLimit
number2000How many rows a sort materialises; past this the order covers only a prefix.
readonlybooleanfalseHide the editors (expression, columns, filter) and show only the table and pager.