Skip to content

feat: generate multiple charts per query in VegaLiteAgent#1927

Open
ghostiee-11 wants to merge 6 commits into
mainfrom
feat/vegalite-multiple-charts
Open

feat: generate multiple charts per query in VegaLiteAgent#1927
ghostiee-11 wants to merge 6 commits into
mainfrom
feat/vegalite-multiple-charts

Conversation

@ghostiee-11

@ghostiee-11 ghostiee-11 commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1916.
VegaLiteAgent could only ever produce a single plot. It now returns one or more charts from a single request: each chart opens in its own editable tab (vega-lite code beside the plot), plus a view-only "All" tab that stacks every plot when there are several. A chart whose spec fails to parse is skipped, so the others still render.

Screen.Recording.2026-07-19.at.9.58.11.AM.mp4

VegaLiteAgent previously produced only a single plot; it now returns one or
more charts.

- The declarative (VegaLiteSpec) and Altair (AltairSpec) response models take a
  list of chart specifications instead of a single spec or code block.
- Each chart becomes its own editable VegaLiteEditor, which the UI renders as a
  tab with the vega-lite code beside the plot. For multiple charts a view-only
  "All" overview that stacks every plot is appended last.
- A chart whose spec fails to parse is skipped so one malformed spec does not
  discard the charts that parsed; if none parse, generation retries.
- Add MultiChartEditor, a small display-only editor mirroring DocumentEditor.
Document that VegaLiteAgent can produce more than one chart from a single
request, each in its own editable tab alongside an "All" overview.
@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.69231% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.37%. Comparing base (59695a6) to head (3d88788).

Files with missing lines Patch % Lines
lumen/ai/agents/vega_lite.py 95.23% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1927      +/-   ##
==========================================
+ Coverage   71.22%   71.37%   +0.14%     
==========================================
  Files         198      198              
  Lines       34645    34745     +100     
==========================================
+ Hits        24677    24798     +121     
+ Misses       9968     9947      -21     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The "All" overview rendered each chart from a one-off snapshot, so editing a
chart in its own tab (or the polish pass) left the overview stale. Render each
overview plot from its editor's component so it updates with the chart.
When a chart's specification fails to parse it is skipped so the rest still
render, but the drop was only logged. Note it in the step output so the user
knows a chart was left out.
Drive a SQL + VegaLite plan that returns two charts and assert the exploration
tabs: an editable tab per chart plus a view-only "All" overview placed last and
opened by default (no code-editor split, unlike the chart tabs).
@ghostiee-11
ghostiee-11 requested a review from ahuang11 July 19, 2026 05:21
get_block_names decoded the template with the platform default codec, which
fails on Windows for templates with non-ASCII characters (e.g. the VegaLite
prompt). Decode as UTF-8, matching extract_block_source just below it.
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.

Allow generating multiple charts at once in one query

1 participant