<Tally> component.
1
Describe the columns
createSchema validates the columns and resolves each one to a column type. key names the field that identifies a row. A column without a type is text.schema.ts
aggregate: 'sum' puts the sum of MRR in the footer. pin: 'left' keeps the account column in view while scrolling.2
Provide the rows
Rows are plain objects keyed by column id. Empty cells are
null, undefined or ''.rows.ts
3
Render the grid
createArraySource filters, sorts, groups and aggregates the rows in memory. useGrid creates the grid, loads it on mount and disposes it on unmount.accounts.tsx
label is the accessible name of the grid, and the name of exported CSV files.Create the source once.
useGrid recreates the grid when schema or source change identity, so
a source created on every render reloads the grid on every render.Type into the filter bar
The filter bar takes the query language. Each line below is one query.MRR > 2k and mrr > 2k are the same condition. Bare words such as acme search every searchable column. Parse errors carry the character offset of the problem.
Next
Data sources
Point the grid at a server instead of an array.
Query language
Everything the filter bar understands.