feat: add Vega-Lite chart library with Plotly/Vega-Lite toggle#88
Conversation
Describes the design for a global Plotly/Vega-Lite toggle in the agent panel header, with native spec generation per library. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9-task plan covering context/hook, UI toggle, types, API plumbing, backend system prompt, MCP tool schema, vega-embed widget, renderer routing, and manual testing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ry field Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix vega-embed memory leak: store view ref and finalize on cleanup/re-render - Reset error state on spec change in VegaLiteChartWidget - Make chart_spec.data optional (Vega-Lite specs don't include it) - Use Literal type for chart_library in Pydantic models Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: 26f6db5b070b
Resolve conflicts keeping both chart library toggle and answer duration features. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: a4860e3b2174
Update exportConversation to extract Vega-Lite specs from data attributes, replace rendered charts with placeholders, and re-render via Vega CDN in the exported HTML — mirroring the existing Plotly export pattern. Add data-vegalite-spec attribute and class to VegaLiteChartWidget for DOM-based spec extraction. Add run_vega_lite.html utility. Update README with dual chart library support, response time feature, and updated project structure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: d53fcb62dd4f
|
Claude finished @cyyeh's task in 2m 14s —— View job Code Review: feat: add Vega-Lite chart library with Plotly/Vega-Lite toggleTasks
Overall AssessmentThis is a well-structured feature addition. The dual-library approach is clean, the architecture follows existing patterns, and the code is generally readable. Below are specific findings by area. Code QualityPositive:
Issues:
Security
Performance
TestingNo automated tests were added or modified. This is consistent with the existing pattern in the repository, but the following scenarios would benefit from test coverage:
Documentation
Minor Nits
Summary: The PR is well-implemented and follows established patterns. The most actionable issues are the |
Summary
render_chartMCP tool accepts alibraryparameter for native Vega-Lite spec outputChartWidget(Plotly) orVegaLiteChartWidget(vega-embed) based on thelibraryfieldutils/run_vega_lite.htmlfor standalone Vega-Lite spec testingTest plan
🤖 Generated with Claude Code