feat(export): row_data minimal — publish only the columns a chart encodes - #121
Merged
Conversation
…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"`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A third
export.row_datamode betweenincludeandexclude. Tracking issue.Today an
INTERACTchart inlines its whole result set into the dashboard page —datasetscarries every column the query returned, whether or not aVISUALISErole binds it — and a static SVG labels each mark with the exact values it was drawn from.excludefixes that by publishing PNGs only, at the cost of the interactivity.minimalkeeps the interactivity and prunes the rest:VISUALISEcolumns (required_columns()already computed exactly that list), so the inlineddatasetsblock and the tooltips carry those alone. Tooltip, zoom and legend filtering keep working — Vega needs nothing else.month; revenue; regioninstead ofmonth: 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 samegraphics-symbolrole as data marks.include. The local.data.jsonkeeps every column and is never published in any mode.source()filters resolve as usual — they name a column explicitly.bundle.jsonreportssecurity.row_data: "minimal".Invariant, documented and tested: a
minimalexport contains no information beyond what the rendered chart displays.Docs: new sections in the data-exposure guide and the configuration reference (the new
glyf.ymlblocks are load-checked by the drift guard), plus thesecurity.row_datarow 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 underinclude; the inlineddatasetsrows carry exactly the encoded columns with untouched values; interactivity survives with no build warning; mark labels name fields without values whileincludelabels 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 loadsminimaland names all three modes on a bad value.DRAWtypes (bar, line, scatter, area, pie) strip their mark labels and leak no unencoded value.