Editor: view-scoped data context — per-view dataset columns in hints and transforms

This commit is contained in:
2026-06-28 20:54:46 +03:00
parent e69430834a
commit a75ea5b59e
14 changed files with 547 additions and 244 deletions
+13 -10
View File
@@ -66,18 +66,21 @@ collection (`spec-fields`), config baking (`spec-config`), standalone export
- **M1 — data-model foundation** ✅ — `core/spec-data` classifier mirroring
`isNamedData`; `spec-refs` + `rendering` routed through it. Closes clash 1.
- **M2 — view-scoped editor context** — pure `dataContextAtPath(spec, path)`:
climb the cursor's JSON path to the nearest enclosing `data` (honoring
Vega-Lite's parent→child data inheritance), classify it, and collect
ancestor-chain derived fields. Rework `active-dataset` to be cursor-scoped and
thread the offset through the three Monaco providers and the facet/repeat
defaults. Resolve columns for every form: library ref, inline `values`,
named-inline, self-defined `datasets`, url (no static rows), generator (none).
- **M2 — view-scoped editor context** `dataBindingAtPath` (climb the cursor's
JSON path to the nearest enclosing `data`, honoring Vega-Lite's parent→child
inheritance) + `derivedFieldNamesAtPath` (ancestor-chain `as` outputs).
`active-dataset` is cursor-scoped (`dataInfoAt(text, offset)`), resolving columns
for every form (library ref case-insensitive, inline, named-inline, self-defined
`datasets`, url/generator → none); the three Monaco providers and the
facet/repeat defaults pass the cursor offset.
- **M4 — multi-view inspection** (pulled ahead of M3) — group the dataflow's
datasets into per-view input/resolved pairs (`result-data`) and add a view
selector to `DataInspector` (new interactive widget → `/council`). The data
inspector executes the live pipeline, so it is the place to review post-transform
rows (melt/fold/pivot/aggregate); today it surfaces one heuristic input/resolved
pair across the whole composition, with no per-view choice.
- **M3 — view-scoped extract** — seed Extract from the focused view's inline data
(reusing the cursor-scope machinery) and rewrite that view's `data`.
- **M4 — multi-view inspection** — group the dataflow's datasets into per-view
input/resolved pairs (`result-data`) and add a view selector to `DataInspector`
(new interactive widget → `/council`).
Delivery is incremental, one milestone per commit, verified against real behavior.
The consolidated data-model contract write-up into `docs/architecture` (05/08)