DataTable component provides a spreadsheet-like interface for viewing and editing the data in your graph. It automatically connects to GraphProvider and syncs all changes with your graph configuration.
Basic usage
Simply render theDataTable component inside a GraphProvider:
Props
TheDataTable component accepts optional configuration props:
| Prop | Type | Default | Description |
|---|---|---|---|
minCols | number | 26 | The minimum number of columns |
minRows | number | 50 | The minimum number of rows |
additionalEmptyCols | number | 1 | The number of empty columns to maintain at the end of the table |
additionalEmptyRows | number | 1 | The number of empty rows to maintain at the end of the table |
readOnly | boolean | false | Makes the table read only |
inert | boolean | false | Makes the table inert (no focus, clicks or hover events) |
Features
- Responsive – the table resizes to fit the container
- Cell editing – click, press Enter or start typing to edit
- Range selection – select multiple cells with mouse or Shift + arrows
- Keyboard navigation – arrow keys, Tab, Enter, Escape
- Clipboard – copy (Cmd/Ctrl+C), paste (Cmd/Ctrl+V), cut (Cmd/Ctrl+X)
- Undo/redo – Cmd/Ctrl+Z to undo, Cmd/Ctrl+Shift+Z to redo
- Delete – Backspace or Delete to clear cell values
- State sync – changes automatically update the graph config
Integration with editor components
TheDataTable works seamlessly with other editor components. You can combine it with editor panels and other controls:
Low-level primitive
For more control, you can useDataTablePrimitive which doesn’t connect to GraphProvider and requires manual state management. This is useful when you need a standalone table outside of the chart editing context.