Add browser chart operation with ECharts for data visualization#162
Add browser chart operation with ECharts for data visualization#162ClickerMonkey merged 13 commits intomainfrom
Conversation
Co-authored-by: ClickerMonkey <421233+ClickerMonkey@users.noreply.github.com>
Co-authored-by: ClickerMonkey <421233+ClickerMonkey@users.noreply.github.com>
…ping Co-authored-by: ClickerMonkey <421233+ClickerMonkey@users.noreply.github.com>
Co-authored-by: ClickerMonkey <421233+ClickerMonkey@users.noreply.github.com>
…iscriminated union schemas, and browser-only metadata Co-authored-by: ClickerMonkey <421233+ClickerMonkey@users.noreply.github.com>
|
Addressed all feedback in commit b13c20d:
All changes have been committed and the build passes successfully. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
packages/cletus/src/tools/artist.ts
Outdated
| { "chartGroup": "partToWhole", "title": "Market Share", "data": [{"name": "Apple", "value": 28}, {"name": "Samsung", "value": 22}], "defaultVariant": "pie" } | ||
|
|
||
| {{modeInstructions}}`, | ||
| schema: z.discriminatedUnion('chartGroup', [ |
There was a problem hiding this comment.
Remove global tool properties from above, change schema to that plus chart: z.union(all types) discriminated union is an untested zod type in aeye
There was a problem hiding this comment.
Done in commit 7f108e2. Removed ...globalToolProperties from all chart schemas and changed the tool schema from discriminatedUnion to:
schema: z.object({
chart: ChartConfigSchema,
...globalToolProperties,
})where ChartConfigSchema is a union of all chart schemas.
packages/cletus/src/tools/artist.ts
Outdated
| }); | ||
|
|
||
| // Chart display schemas - one for each chart group | ||
| const ChartDataPointSchema = z.object({ |
There was a problem hiding this comment.
Move the schemas out of this function so the inferred types can also be exported so the operation definition can go off the types to be precise and not have types duplicated
There was a problem hiding this comment.
Done in commit 7f108e2. Moved all chart schemas to a new exported file artist_schemas.ts that exports:
- Individual chart schemas (PartToWholeChartSchema, etc.)
- ChartConfigSchema (union of all schemas)
- ChartConfig type (inferred from schema)
- ChartDataPoint type
The operation now uses ChartConfig type from the exported schemas, eliminating type duplication.
…oolProperties, replace any types Co-authored-by: ClickerMonkey <421233+ClickerMonkey@users.noreply.github.com>
|
Addressed all feedback in commit 7f108e2:
The tool now accepts |
Co-authored-by: ClickerMonkey <421233+ClickerMonkey@users.noreply.github.com>
Moved chart-related types and schemas from tools/artist_schemas.ts and operations/artist.tsx to helpers/artist.ts for better organization and reuse. Updated imports across affected files. Also removed unused @types/echarts and @types/zrender dependencies from package.json and package-lock.json.
Integrates KaTeX and math support in markdown rendering using remark-math and rehype-katex. Updates build to copy KaTeX CSS and inject it into HTML. Refactors chart and diagram operation renderers to support custom summary classes and moves their definitions. Adjusts chart variantOptions schema for stricter typing. Minor UI and prop improvements for message and operation components.
Refactored MessageItem to memoize and reuse markdown components for better performance and consistency. In MainPage, replaced the browser confirm dialog for chat deletion with a custom modal requiring the user to type 'DELETE' to confirm, improving UX and preventing accidental deletions. Also ensured chat metadata is cleared when switching chats. In artist chart operations, preserved global chart options (like title and background) across variant changes.
Introduces a new ChartViewer component for fullscreen and interactive chart viewing, including variant toggling and download functionality. Refactors ChartDisplay in artist.tsx to use ClickableChart, improving code reuse and user experience. Enhances ECharts theming for dark mode with consistent axis and tooltip styling. Updates DiagramViewer layout for better centering and responsiveness.
anytypes with proper types (ChartDataPoint, EChartsOption, etc.)chartinput property containing ChartConfigOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.