Skip to content

Graph Builder

The Graph Builder (Graph → "Graph Builder", Ctrl+G — or the quick toolbar or Quick Search) is a floating window with a left column palette, center canvas with X/Y drop zones, and right-side Color/Wrap drop zones. It is driven by InteractiveGraphBuilder (crates/leap-app/src/plots.rs) and the GraphBuilderPanel (crates/leap-app/src/report.rs).

Scatter with smoother

Box layer with wrap faceting

Histogram

Six layers

Toggle any of the six layers from the toolbar pills (GraphLayer::ALL):

  • Scatter — one Points series per color group (or selection-split if no group column). Optional Smoother overlay binned over X (10 bins of local average, excluded rows skipped). Labeled rows get a text tag with their row id.
  • Line — points sorted by X, drawn as a line with faint raw points and selection highlight; labeled rows are tagged.
  • Smooth — faint raw points plus a binned local average (24 bins) excluding excluded rows; the curve is labeled "Smoother".
  • Box — per-category (X) vertical box plot (min / Q1 / median / Q3 / max) over non-excluded rows.
  • Bar — per-category (X) mean (falls back to count) bars over non-excluded rows.
  • Histogram — binned Y histogram (12 bins) with background bars (all records) and a selected-row highlight overlay; bins skip excluded rows.

A spec is valid only when both X and Y are assigned; otherwise the canvas shows a hint. Hidden rows are dropped entirely before any drawing.

Roles and drop zones

  • Columns (left panel, searchable) — click a column to assign it to the currently armed role. Swatch color encodes the modeling type (teal = continuous, amber = ordinal, violet = nominal).
  • X / Y — assigned above or below the canvas; Color and Wrap — assigned to the right-side drop zones.
  • Each drop zone shows Role: <name> or Role: (empty) and a [x] clear button when assigned.
  • Assign via the active role (click the drop zone to arm it, then the column) or by clicking a column while a role is armed.

Smoother overlay

The "Smoother" checkbox on the toolbar adds a binned local-average line over the Scatter layer (10 bins, excluded rows skipped). It does not apply to other layers — the Smooth layer draws its own binned curve (24 bins).

Color grouping

Assigning a Color column splits series into groups (first-appearance order, 6-color theme-safe palette — teal/amber/violet/blue/rose/green — with a legend). Selection is then drawn as a contrasting highlight-point series on top.

Wrap faceting

Assigning a Wrap column facets the canvas into up to 6 facets (2 columns per row) — Wrap: <level> heading per facet, with up to 6 distinct levels; fewer than 2 levels render as a single plot. Hidden rows are omitted from facets.

Hidden-row omission and exclusion

builder_prep_rows drops hidden rows before drawing; excluded rows remain visible but are skipped by every summary statistic (smoothed curve, box/bar means/quartiles, histogram binning, linked brushing).

Linked brushing

Scatter / Line / Smooth layers support drag-rectangle brushing: drag a rect on the canvas to select the rows inside, a plain click clears the selection. The shared selection set (a SelectionSet) drives the grid, linked plots, histogram and the Graph Builder itself.

Actions

  • Reset — clears X/Y/Color/Wrap and returns the layer to Scatter.
  • Save Script to Table — appends a graph_builder TableScript to the sidebar (payload {"platform":"graph_builder","x":[x],"y":[y]}).
  • Export SVG — deterministic vector SVG export (see SVG Scripts).
  • Close — closes the window.

Related pages: