Visualise: heatmap/sparkline/waterfall + analyse→dashboard handoff#22
Merged
moonlight-lupin merged 4 commits intoJul 18, 2026
Merged
Conversation
Add three offline SVG blocks that fit the existing HTML dashboard contract, and a declarative analysis.json → blocks mapper so data-analyse metrics can be drawn without recomputing figures or adopting an Excel/matplotlib export path. Co-authored-by: moonlight-lupin <moonlight-lupin@users.noreply.github.com>
Make data-visualise the HTML-vs-Excel orchestrator. Add workbook.py for native openpyxl charts using OfficeCLI-aligned chartType names (column, bar, line, pie, doughnut, waterfall), with analysis.json → chart specs parallel to the HTML handoff. Format is selected by plan format or .xlsx output suffix. Co-authored-by: moonlight-lupin <moonlight-lupin@users.noreply.github.com>
Clarify that neither path requires analysis.json: derive the same category/value series for HTML blocks and Excel chart specs, and reserve analyse for engine-exact or shared metrics. Co-authored-by: moonlight-lupin <moonlight-lupin@users.noreply.github.com>
…re follow-ups Addresses the three review findings on this PR. 1. The xlsx path ignored `theme`. `_run_visualise` passed `theme=` to the HTML dashboard but not to the workbook, and write_charts_xlsx/charts_from_analysis took no theme at all — the palette was hardcoded (DEFAULT_COLORS + the waterfall increase/decrease/total colours). A white-label firm's theme skinned the dashboard but left the Excel charts toolkit-teal, and the palette became a second copy that would drift from DEFAULT_THEME. Both entry points now take `theme` and resolve the series palette (and the waterfall colours) from the visualise theme via viz._resolve_theme, in the same token order as viz._series_palette, so one theme drives both artefacts. Per-chart `colors` / `increase_color` / … still override. viz is imported lazily (as viz imports workbook lazily) and any failure degrades to DEFAULT_COLORS rather than breaking chart generation. Regression test asserts a custom theme reaches the chart XML and the default does not. 2. Docs kept up: README skill table and COMPATIBILITY row now cover the second output format (openpyxl also *writes* the chart workbook — already a hard dependency, no new install); CHANGELOG entry added as 0.7.0. 3. .gitignore covers the new `*-selftest.xlsx` (existing patterns matched `*-selftest.html` and `*_selftest*.xlsx`, but not a hyphenated .xlsx). 93 pytest / 60 engine self-tests / data-lint / golden plans all green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
moonlight-lupin
marked this pull request as ready for review
July 18, 2026 13:10
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.
Summary
Extends
data-visualiseas an orchestrator for two artefacts that share the same metrics contract:viz.py) — offline SVG blocks +analysis.json→ blocks handoffworkbook.py) — native openpyxl charts for analystsHTML (
viz.py)heatmap,sparkline,waterfallsuggest_blocks_from_analysis/blocks_from_analysis"blocks": "$analysis",{"type": "from_analysis"}Excel (
workbook.py).xlsxwith data ranges + embedded chartschart_typenames:column,bar,line,pie,doughnut,waterfall(stacked-bar bridge)suggest_charts_from_analysis/charts_from_analysis"format": "xlsx"or.xlsxoutput suffixOrchestration
skills/data-visualise/SKILL.mdchooses HTML vs Excel from reader intent; both can consume the sameanalysis.json.Test plan
python3 tests/test_engine.pypython3 tests/test_agent_runtime.pypython3 tests/test_agent_schemas.py