Skip to content

feat(export): row_data minimal — publish only the columns a chart encodes - #121

Merged
kannandreams merged 1 commit into
mainfrom
feat/row-data-minimal
Sep 2, 2026
Merged

feat(export): row_data minimal — publish only the columns a chart encodes#121
kannandreams merged 1 commit into
mainfrom
feat/row-data-minimal

Conversation

@kannandreams

Copy link
Copy Markdown
Collaborator

What

A third export.row_data mode between include and exclude. Tracking issue.

Today an INTERACT chart inlines its whole result set into the dashboard page — datasets carries every column the query returned, whether or not a VISUALISE role binds it — and a static SVG labels each mark with the exact values it was drawn from. exclude fixes that by publishing PNGs only, at the cost of the interactivity. minimal keeps the interactivity and prunes the rest:

  • Vega specs: the chart is built from the result pruned to the VISUALISE columns (required_columns() already computed exactly that list), so the inlined datasets block and the tooltips carry those alone. Tooltip, zoom and legend filtering keep working — Vega needs nothing else.
  • SVG marks: accessibility labels keep the field names and drop the values (month; revenue; region instead of month: 2026-03; revenue: 79000; region: East). Axis, legend and title labels stay: they describe text the page already shows. Marks are recognised by their label shape, not their ARIA role, because Vega gives axes and legends the same graphics-symbol role as data marks.
  • Column pruning only. Values are never rounded or transformed — a chart that disagrees with the warehouse is a worse problem than the precision an exact value reveals.
  • Compiled SQL is metadata and behaves as under include. The local .data.json keeps every column and is never published in any mode. source() filters resolve as usual — they name a column explicitly.
  • The public bundle.json reports security.row_data: "minimal".

Invariant, documented and tested: a minimal export contains no information beyond what the rendered chart displays.

Docs: new sections in the data-exposure guide and the configuration reference (the new glyf.yml blocks are load-checked by the drift guard), plus the security.row_data row in the bundle reference.

Testing

  • tests/test_row_data_minimal.py, 11 tests reading the exported bytes rather than trusting the configuration: a value from an unencoded column is absent from the whole site and present under include; the inlined datasets rows carry exactly the encoded columns with untouched values; interactivity survives with no build warning; mark labels name fields without values while include labels every mark with its row; axis/legend/title labels stay; compiled SQL and SVG are published; the local data file keeps every column; the manifest reports the mode; config loads minimal and names all three modes on a bad value.
  • Verified by hand that all five DRAW types (bar, line, scatter, area, pie) strip their mark labels and leak no unencoded value.
  • Full suite: 306 passed, 6 skipped (gated warehouse integration tests).

…rt encodes

A third mode between `include` and `exclude`. By default an interactive
chart inlines every column its query returned into the page, encoded or
not, and a static SVG labels each mark with the exact values it was drawn
from. `minimal` keeps the interactivity and removes what the picture does
not show:

- the chart is built from the result pruned to the VISUALISE columns, so
  the inlined Vega `datasets` block and the tooltips carry those alone;
- SVG mark labels keep the field names and drop the values; axis, legend
  and title labels stay, as they describe text the page already shows.

Column pruning only. Values are never rounded or transformed, because a
chart that disagrees with the warehouse is a worse problem than the
precision an exact value reveals. Compiled SQL is metadata and behaves as
under `include`; the local `.data.json` keeps every column and is never
published in any mode. The public bundle reports `security.row_data:
"minimal"`.
@kannandreams
kannandreams merged commit 30f3bd6 into main Sep 2, 2026
7 checks passed
@kannandreams
kannandreams deleted the feat/row-data-minimal branch September 2, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant