One Tag, Any Surface: CanvasXpress as a Figure Primitive for AI Agents
The way people produce charts is changing. More and more, a figure is not drawn by a person dragging handles in a tool — it is emitted by an AI assistant, in whatever surface that assistant happens to live: a chat artifact, a notebook cell, a document, a rendered HTML preview. For that world, a charting library needs a property that was never important before: an agent must be able to emit one thing that just works, everywhere, with nothing to install and nothing to choose.
CanvasXpress now has that one thing. It is a web component — a single <canvas-xpress> tag — that takes a portable figure spec and renders a live, interactive, reproducible chart in any HTML surface. No build step, no bundler, no "which of a dozen integrations do I use here." One tag.
Why "one tag" is the whole point
Software integrations are usually a menu: there is an approach for notebooks, another for a particular dashboard framework, another for an observable notebook, an iframe for everything else. A human developer picks the right one for their context. An AI agent will not do that. An agent emits a single block of output and moves on. If rendering a chart requires choosing the correct integration for the current host, agents will simply reach for whatever is most uniform — and historically that has meant hand-rolling a one-off drawing instead of using any library at all.
The web component collapses the menu to a single entry. The agent emits one tag with an inline spec (or a src= pointing at one), and the component loads the engine itself on first use and renders the figure. The same tag works in a full HTML page, in dynamically injected content, in notebook output, in a React/JSX surface. The agent does not have to know which it is in.
<script src="https://www.canvasxpress.org/dist/canvas-xpress.js"></script>
<canvas-xpress spec='{
"data": { "y": { "vars": ["Q1","Q2","Q3"], "smps": ["Revenue"],
"data": [[42],[55],[61]] } },
"config": { "graphType": "Bar" }
}'></canvas-xpress>
That is a complete, live chart in an otherwise bare page whose only script is the component loader.
Live, not a picture
The reason this matters more for CanvasXpress than it would for a plotting library that returns images: the thing the agent emits is a figure, not a screenshot. It hovers. It inspects. It re-configures. It exports. When a competitor returns a PNG, the data is gone — you cannot hover a value, you cannot see the underlying numbers, you cannot restyle it. A CanvasXpress figure emitted through the component keeps all of that, in any surface that renders HTML. Agents increasingly run in exactly those surfaces, which is why targeting them directly pays off.
Reproducible by construction
The second property is reproducibility, and it is where the "figure is code" idea becomes concrete. The emitted spec is the figure. There is no hidden state, no server-side rendering context — the chart can regenerate itself from its own {data, config} spec. The spec round-trips: a live chart can hand back the exact configuration that produced it. And it carries a provenance hash, so you can verify that a given spec is the one that drew a given figure.
For anyone who has fought to reproduce a chart six months later, this is the quiet killer feature. The artifact an agent shares is not a static image that decays into "how did we make this again?" It is runnable, inspectable, re-styleable code in the user's own words.
One format, provably rendered the same way
A portable spec is only trustworthy if every surface renders it identically. CanvasXpress names the interchange format — a versioned figure schema — and ships a host-agnostic validator that any adopter can run, in the browser or on the command line, with no dependencies. There is a conformance set of reference specs spanning the chart genres, and a conformance page that renders them all live through the component so you can confirm, yes/no, that a given host draws the canonical specs correctly. An agent can emit once and trust the result, because the result is defined.
How an agent emits a figure, per host
The component comes with a single matrix that answers one question — how does an agent emit a CanvasXpress figure on host X? — with a working example for each host: a full HTML page, dynamically injected content, notebook output, a React/JSX surface, and the Claude app view backed by the published-dashboard tool. The pattern is the same everywhere: the same spec, the same tag. That uniformity is the deliverable.
A shareable, reproducible figure link
Finally, there is a share surface. A spec can be encoded into a compact URL fragment — the figure travels entirely in the link, decoded and rendered client-side, with no account and no backend. Open the link and you get the live figure, a "view source spec" toggle, a copy button, and a provenance hash that matches whether computed in the browser or on a server. It is the public, honest artifact the whole model produces: a chart that is also its own source.
The bigger picture
None of this is a new chart feature. It is a unification of substrate CanvasXpress already had — a portable spec, a deterministic round-trip, signed provenance, a public tool that generates and validates and renders, and a dozen host embeds — into a single primitive an agent can reach for reflexively. The bet is simple and falsifiable: make emitting a correct, live, reproducible figure frictionless on the hosts people already work in, and that figure becomes the natural thing to emit. For an agent, and for the person reading what it produced, "one tag that just works" is worth more than any number of options.