feat(viz): adopt plotly.js 3.6.0 attributes (richer OHLC hover, radial sunburst text, unified hover)#4085
Merged
Merged
Conversation
…l sunburst text, unified hover) Upgrades the dathere plotly fork pin to its plotly.js 3.0.1 -> 3.6.0 branch (feat/treemap-sunburst-traces @ aeb1e59, upstream PR plotly/plotly.rs#406) and adopts three new additive, non-breaking attributes in `viz`: - Candlestick/OHLC `hover_template`: clean Open/High/Low/Close readout with `<extra></extra>` to drop the trace-name box, plus a defensive `hover_template_fallback` (financial traces have known hover-variable gaps). - Sunburst `inside_text_orientation(Radial)`: label+value+percent runs along each ring's spoke so deep-path sectors stay legible (standalone + smart panel). - `x unified` hover (Layout `hover_mode`) scoped to ordered-x chart kinds (line, candlestick, ohlc) — one tooltip per x across series. Excludes scatter/bar/box; the smart dashboard builds its own layout and is untouched. Regenerates the example gallery (now CDN plotly 3.6.0) so the figures reflect the new attributes. Adds/extends tests for all three (viz_candlestick, viz_ohlc, viz_sunburst_standalone, new viz_line_unified_hover). Verified: 126 viz tests pass; clippy clean; candlestick hover confirmed to resolve %{open}/%{high}/%{low}/%{close} at runtime in a browser. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
`Sunburst::inside_text_orientation(Orientation::Radial)` serialized to `"insidetextorientation":"r"` — the shared `Orientation` enum's single-letter code (correct for bars/boxes/legends/sankey, wrong here). plotly.js 3.6.0 only accepts the full words `horizontal`/`radial`/`tangential`/`auto` and silently coerces `"r"` to the default `"auto"`, so the radial sunburst text was a no-op and the test locked in the invalid value. Fix in the dathere plotly fork by adding a sunburst-specific `InsideTextOrientation` enum that serializes to full words, leaving the general `Orientation` enum untouched. Re-pin `Cargo.lock` at the fork branch tip (3c185f8), switch the call site, drop the now-unused `Orientation` import, update the test to assert `"radial"`, and regenerate the gallery. Browser-verified against plotly.js 3.6.0: `_fullData` resolves the orientation to `"radial"` (not coerced to `"auto"`) and labels render radially along each ring's spoke. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…urst) Refresh the two LLM-dependent smart-dashboard gallery artifacts (smart_dict_treemap.html, smart_dict_sunburst.html) from the current qsv binary via describegpt `--dictionary infer` (local LM Studio, google/gemma-3-27b), and rebuild gallery.html to reference them. The sunburst dict figure now carries the valid `"insidetextorientation":"radial"` attribute (was the no-op `"r"`); both pages embed plotly.js 3.6.0 from the CDN. Browser-verified: 14 and 5 panels respectively, 0 render errors, sunburst resolves to radial. 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.
What
Upgrades the embedded plotly to plotly.js 3.6.0 (dathere fork branch
feat/treemap-sunburst-traces@aeb1e59, tracking upstream plotly/plotly.rs#406) and adopts three new additive, non-breaking attributes inviz.Changes
src/cmd/viz.rshover_template(build_candlestick) — a cleanOpen/High/Low/Closetooltip with<extra></extra>to suppress the trace-name box, plus a defensivehover_template_fallback("-")(financial traces have known per-point hover-variable gaps). The x/date is intentionally left to the unified-hover header.inside_text_orientation(Orientation::Radial)(hierarchy_trace) —label+value+percentruns along each ring's spoke, keeping deep-path sectors legible. Applies to both the standaloneviz sunburstsubcommand and theviz smarthierarchy panel (shared builder).x unifiedhover (Layout::hover_mode(HoverMode::XUnified)) — one tooltip per x across series, scoped to ordered-x chart kinds (line,candlestick,ohlc) at thebuild_layoutcall site. Excludes scatter/bar/box; the smart dashboard builds its own layout and is untouched.Gallery —
examples/viz/gen_gallery.pyCDN pin → 3.6.0; regeneratedgallery.html+ smart iframe pages so the figures reflect 3.6.0 and the new attributes.tests/test_viz.rs— extendedviz_candlestick/viz_ohlc/viz_sunburst_standalone; addedviz_line_unified_hover(assertslinegetsx unifiedwhilescatterdoes not).Verification
cargo build -F all_featuresclean; 126 viz tests pass;cargo clippyclean (the lone slice-index warning is pre-existing geo code, untouched here).%{open}/%{high}/%{low}/%{close}resolve to real values in a browser (headerMar 12, 2025,Open: 104.06 / High: 108.55 / Low: 101.85 / Close: 107.43).Notes
Cargo.lock). The patch comment tracks dropping it oncefetch: report improvements #406 is merged & released.smart_dict_*gallery pages are reused as-is (no LLM run), so their sunbursts pick upinsidetextorientationonly on a future LLM regeneration; the standalone and smart sunburst figures already have it.🤖 Generated with Claude Code