Skip to content

Visualise: heatmap/sparkline/waterfall + analyse→dashboard handoff#22

Merged
moonlight-lupin merged 4 commits into
mainfrom
cursor/viz-blocks-and-analyse-handoff-3e24
Jul 18, 2026
Merged

Visualise: heatmap/sparkline/waterfall + analyse→dashboard handoff#22
moonlight-lupin merged 4 commits into
mainfrom
cursor/viz-blocks-and-analyse-handoff-3e24

Conversation

@moonlight-lupin

@moonlight-lupin moonlight-lupin commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

Extends data-visualise as an orchestrator for two artefacts that share the same metrics contract:

  1. HTML dashboard (viz.py) — offline SVG blocks + analysis.json → blocks handoff
  2. Excel chart workbook (workbook.py) — native openpyxl charts for analysts

HTML (viz.py)

  • New blocks: heatmap, sparkline, waterfall
  • suggest_blocks_from_analysis / blocks_from_analysis
  • Plan shortcuts: "blocks": "$analysis", {"type": "from_analysis"}

Excel (workbook.py)

  • Chart-only .xlsx with data ranges + embedded charts
  • OfficeCLI/AionUi-aligned chart_type names: column, bar, line, pie, doughnut, waterfall (stacked-bar bridge)
  • suggest_charts_from_analysis / charts_from_analysis
  • Format via "format": "xlsx" or .xlsx output suffix
  • OfficeCLI is a vocabulary reference only — not a runtime dependency

Orchestration

skills/data-visualise/SKILL.md chooses HTML vs Excel from reader intent; both can consume the same analysis.json.

Test plan

  • python3 tests/test_engine.py
  • python3 tests/test_agent_runtime.py
  • python3 tests/test_agent_schemas.py
Open in Web Open in Cursor 

cursoragent and others added 4 commits July 18, 2026 12:12
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
moonlight-lupin marked this pull request as ready for review July 18, 2026 13:10
@moonlight-lupin
moonlight-lupin merged commit eb78c78 into main Jul 18, 2026
3 checks passed
@moonlight-lupin
moonlight-lupin deleted the cursor/viz-blocks-and-analyse-handoff-3e24 branch July 19, 2026 02:02
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.

2 participants