feat(viz): KPI overview row, icicle charts & layout uirevision (plotly.rs #423)#4184
Merged
Conversation
…y.rs #423) Adopt dathere/plotly branch `feature/trace-type-additions` (PR plotly/plotly.rs#423, a strict superset of the prior pin) and use the new API in `viz`: - viz smart now leads with a full-width KPI overview row of plotly `Indicator` tiles: a built-in completeness gauge plus the headline numeric measures (sum for extensive, mean for intensive). A measure becomes a gauge when the data dictionary supplies a validated `x-qsv.gauge_range` (drawn only when the range actually contains the observed value; a range also forces the mean so it lands in-scale) and a "vs target" delta when it supplies `x-qsv.target` (a semantically-justified goal, never a fabricated prior-period baseline). Renders in both the inline and typed-grid paths and stays invisible to --max-charts, the panel-count notices, and the render-path thresholds (it is a domain band, not a cartesian subplot). HTML-only. - Add `viz icicle` subcommand and `--hierarchy-style icicle`, a level-aligned sibling of treemap/sunburst. - Set layout-level `uirevision` centrally in apply_theme so user zoom/pan/ selection/legend state survives the Plotly.newPlot re-renders that inject the fullscreen modebar button and recolor on theme toggle. describegpt emission of gauge_range/target is deferred; until then the hints are consumed from any dictionary that carries them, with completeness + number tiles working with no dictionary. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
…orev #3602) The leading KPI row is domain-positioned and consumes no cartesian axis, but it still occupies panel index 0 in `smart_grid_parts`, so `pos = n + 1` labelled the cartesian panels behind it x2..x9. With exactly MAX_SUBPLOTS (8) cartesian panels on the typed-grid path the 8th chart landed on x9, which the typed `Layout` (x1..x8) has no slot for — `assign_typed_axis` silently drops it, orphaning the trace onto the default axis. Subtract a one-slot `axis_offset` when the leading panel is the KPI row so the cartesian axes number x1..x8. The KPI row and geo panels never coexist in this assembler (geo forces the inline path for HTML; image exports carry no KPI row), so a single leading offset is sufficient. Adds a regression test that drives the exact 8-cartesian-panel boundary via `--max-charts 8`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…case The smart dashboards now lead with a KPI overview row (completeness gauge + top-measure number tiles); regenerated the 7 affected smart_*.html figures so they reflect it. Added a dedicated `viz icicle` example to gen_gallery.py so the new chart type is showcased (gallery is now 38 figures). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…en KPI-row lag (roborev #3604) The icicle code comment claimed a top-down default, but plotly leaves tiling.orientation at horizontal ("h") — root on the left, children fanning right (confirmed in plotly.rs Tiling docs + live render). The gallery description was already accurate; fixed the misleading code comment instead. Also documented, per developer deferral, that the LLM-dependent pre-generated dashboards intentionally lag the KPI/Completeness row until describegpt emits the gauge_range/target dictionary hints and they can be regenerated in one pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Adopts the stacked dathere/plotly branch
feature/trace-type-additions(plotly/plotly.rs#423) — a strict superset of the prior pin (0 behind, keeps every MapLibre map tracevizuses) — and puts the new API to work.What's new
KPI overview row (
viz smart)A full-width band of plotly
Indicatortiles leads every HTML dashboard:x-qsv.gauge_range/x-qsv.targetseam in the--dictionaryschema:gauge_rangealso forces the mean, so it lands in-scale) — otherwise it falls back to a plain number;--max-charts, the panel-count notices, and the render-path thresholds (it's a domain band, not a cartesian subplot). HTML-only.Icicle charts
New
viz iciclesubcommand and--hierarchy-style icicle— a level-aligned sibling of treemap/sunburst.Layout
uirevisionSet centrally in
apply_theme, so user zoom/pan/selection/legend state survives thePlotly.newPlotre-renders that inject the fullscreen modebar button and recolor on theme toggle. (The trace-leveluirevisionfrom #421 doesn't cover this — the layout-level attribute was still missing upstream and is added in #423.)Dropped as a phantom
z_order— every cartesian smart panel is single-trace, and the only overlaps are on map subplots where cartesianzorderis ignored by plotly.Testing
cargo test -F all_features viz— 271 pass (5 tests added/updated, incl. icicle standalone, KPI row, and dictionary gauge/delta).cargo clippyclean (no new warnings),cargo +nightly fmt.🤖 Generated with Claude Code