app.components.grid
AG-Grid-based metadata table component.
Renders an interactive data grid below the tree visualization, populated from the same metadata loaded via the toolbar. Provides sorting, column-level filtering, row selection, and inline cell editing out of the box.
Rows default to tree traversal order (matching the SVG tip order).
Column types detected by app.csv/detect-column-type are mapped to AG-Grid filter types for type-appropriate filtering and sorting.
Reordering columns in the grid (via drag-and-drop) updates active-cols, which in turn reorders the SVG metadata columns.
Row selection is bidirectional: clicking tree leaves updates grid checkboxes, and clicking grid checkboxes updates tree markers.
All data columns (except the ID column) are editable. Edits are propagated back to metadata-rows via the :on-cell-edited callback, which causes both the grid and the SVG metadata overlay to update in sync.
col-def-for-type
(col-def-for-type col-type field-name)Returns AG-Grid columnDef properties appropriate for the detected column type.
:string-> text filter:numeric-> number filter with numeric valueGetter for correct sorting:date-> date filter with a YYYY-MM-DD comparator
cols->col-defs
(cols->col-defs active-cols)Converts active-cols (vector of {:key :label :width :type} maps) into AG-Grid columnDefs format.
Maps the detected column type to the appropriate AG-Grid filter and value handling. Enables sorting on every column. All columns except the first (ID) column are editable.
date-comparator
(date-comparator filter-date cell-value)Comparator for AG-Grid’s date filter.
Parses the cell value as a YYYY-MM-DD string and compares it to the filter date supplied by AG-Grid. Returns -1, 0, or 1.
MetadataGrid
(MetadataGrid props__5701__auto__)MetadataGrid*
(MetadataGrid* props__5701__auto__)Renders an AG-Grid table from metadata rows and column configs.
Only renders when metadata is loaded (active-cols is non-empty). Rows are ordered to match the tree tip traversal order by default. Users can sort by clicking column headers; clicking a third time clears the sort and reverts to tree order.
Column filters are type-aware: - Text columns get text contains/equals filters - Numeric columns get greater-than/less-than/range filters - Date columns get a date picker with range filtering
All data columns (except the ID/first column) support inline editing. Double-click a cell to edit; press Enter to commit or Escape to cancel. Edits propagate back through :on-cell-edited to update both the grid and the SVG metadata overlay.
Row selection is bidirectional: - Clicking grid checkboxes updates selected-ids in app state - External changes to selected-ids (e.g. from tree clicks) are reflected by programmatically selecting/deselecting rows
Dragging columns in the grid reorders the SVG metadata columns to match via the :on-cols-reordered callback.
Props: - :metadata-rows - vector of maps (keyword keys -> string values) - :active-cols - vector of column config maps from CSV parser - :tips - enriched leaf nodes in tree display order - :selected-ids - current set of selected ID strings (for sync) - :on-cols-reordered - callback receiving reordered active-cols vector - :on-selection-changed - callback receiving set of selected ID strings - :on-cell-edited - callback (fn [id-value field-kw new-value-str])
tree-ordered-rows
(tree-ordered-rows tips metadata-rows id-key)Reorders metadata-rows to match the tree tip traversal order.
Builds an index from the ID column values to the original rows, then walks the tips vector (which is in tree display order) and collects the matching metadata row for each tip. Tips without a matching metadata row are skipped.