Skip to content

Data Table

The Data Table is the table-first workbench surface. Cells live in a GridData model (crates/leap-app/src/grid.rs) with a row-number gutter, per-column headers showing name and units, and per-column modeling-type glyphs.

Classic Workbench light

Layout and rendering

  • Row-number gutter (gutter_header_w()-wide header cell labeled "row") aligned to body rows; gutter width in the body is 78 px and shows the row index plus compact state badges for excluded / hidden / labeled rows.
  • Headers show column name and, when the column is at least 135 px wide, name and units (e.g. temperature (°C)); the header is color-coded by modeling type (continuous / ordinal / nominal) with a matching glyph badge in the sidebar.
  • Up to 60 rows render at once (MAX_RENDERED_ROWS_LIMIT); ROW_HEIGHT is 22 px.

Interaction

  • Click a cell to focus the cursor; Enter starts an edit (or commits an in-progress edit); Escape cancels editing or clears selection.
  • Space toggles selection of the active row; Enter edits the cell; Esc clears selection.
  • Keyboard navigation: arrows, Tab / Shift+Tab (wrap across row boundaries), Ctrl+Left/Right (first/last column), Ctrl+Up/Down (top/bottom row), Ctrl+Home / Ctrl+End (table corners), PageUp / PageDown (20-row jumps), Shift+Up / Shift+Down (extend contiguous row selection via range_select).
  • Sorting and filtering: set a sort view (set_sort_view) or filter view (set_filter_view with CmpOp) on numeric columns; views persist inside .leapw workspace documents.
  • Cell editing: type raw values; set_cell parses the text (numbers, nulls, text) and applies the change; commit_edit returns an error and leaves the edit in place on failure. Undo/redo is available for cell edits and operations.

The left sidebar (crates/leap-app/src/sidebar.rs) has three stacked panes:

  • Table — dataset name, version, row/column counts, editable multiline table note (NoteChanged action), and the saved Scripts list (each row shows [kind] label plus a Run button that emits RunScript(<id>)).
  • Columns — one row per column with a modeling-type badge glyph ([C] Continuous / [O] Ordinal / [N] Nominal), name, type and units; clicking a row cycles the modeling type (Continuous → Ordinal → Nominal → Continuous) and emits ModelingTypeCycled.
  • Rows — live counts (Total / Selected / Excluded / Hidden / Labeled) plus action buttons: Clear Selection, Invert Selection, Exclude Selected, Clear Exclusions, Hide Selected, Unhide All, Label Selected, Clear Labels.

Related pages: