Repository navigation
feat(chartquery): add ChartQuery integration - #9890
josselinlbe wants to merge 1 commit into
Conversation
Adds ChartQuery tools, block, icon and generated docs: render a Chart.js v4 chart from its config, build a chart from a plain-language description, and create QR codes and barcodes. Every tool asks for share links so the output is a public image URL.
|
Someone is attempting to deploy a commit to the Sim Team on Vercel. A member of the Team first needs to authorize it. |
[Medium impact] The new behavior is limited to workflows that choose ChartQuery. The PR appears safe to merge, with a non-blocking issue that changes surrounding spaces in encoded text. Findings
SummaryAdds ChartQuery with four operations for charts, charts from prompts, QR codes, and barcodes.
|
| if (value === undefined || value === null) continue | ||
| if (typeof value === 'string' && value.trim() === '') continue | ||
| if (typeof value === 'number' && !Number.isFinite(value)) continue | ||
| body[key] = typeof value === 'string' ? value.trim() : value |
There was a problem hiding this comment.
chartQueryBody trims every string, including the data sent to QR code and barcode operations. Encoding " hello " sends "hello" instead, so the image contains a different value from the one supplied. Preserve payload strings as given; trim only fields where surrounding spaces are not meaningful.
| body[key] = typeof value === 'string' ? value.trim() : value | |
| body[key] = value |
Summary
Adds a ChartQuery integration: tools, block, icon and generated docs page. I work on ChartQuery, so this PR comes from the ChartQuery team.
Turn data into images with ChartQuery: render any Chart.js v4 chart from its config, describe a chart in plain language and let ChartQuery build it from your data, or generate QR codes and barcodes. Every operation stores the image and returns public links you can put in a message, an email or a document.
Operations:
chartquery_create_chart): Render a Chart.js v4 chart (bar, line, pie, doughnut, radar, scatter and more) from its config and get public links to the image.chartquery_create_chart_from_prompt): Describe a chart in plain language, optionally with raw CSV or JSON data, and get public links to the image ChartQuery builds from it.chartquery_create_qr_code): Generate a QR code for a URL, text, email, phone number or Wi-Fi network and get public links to the image.chartquery_create_barcode): Generate a barcode (Code 128, EAN-13, UPC-A, ITF-14, Code 39 and more) and get public links to the image.Every tool sends
share: true, so the API answers with JSON links (render_url,view_url, an embed snippet and the expiry) instead of binary image data, which keeps outputs usable by later blocks. Credentials are a ChartQuery API key on the block (AuthMode.ApiKey), sent as thex-api-keyheader. Every tool is an externalToolConfig.request(POST with a JSON body) against the ChartQuery API. The chart config accepts an object or a JSON string, and the block's code field has a wand that writes a Chart.js config from a description.Product update (if relevant)
Sim has no chart, QR code or barcode integration today. Workflows can now post a chart of table data to Slack, attach a QR code to an email, or write barcode images back to a product table. The block appears in the integrations catalog under Analytics with 4 templates and grounded skills; the docs page is
apps/docs/content/docs/integrations/chartquery.mdx.Type of Change
Testing
share: trueresponse of each endpoint. The same endpoints returned share links in live calls from our other integrations; these Sim tools have not been run live from a Sim instance yet.bun run lint,bun run type-check,bun run check:audits(all 62 audits),bun run apps/sim/scripts/check-canvas-sentences.ts --block=chartquery, and theblocksVitest suites (85 files, 795 tests) pass.check-block-registry.ts origin/stagingcould not run locally because my install skipped lifecycle scripts (node_modules/simstudio-ts-sdkmissing); the block is new, so no existing subblock id changes.Checklist
Screenshots/Videos