microcharts

v0.1.17
io.github.ganapativs/microcharts Checked 12 hours ago Published 2 months ago

Find, wire, and render microcharts — word-sized React charts with generated alt text.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

find_microchart Find a chart by question

Rank microcharts chart types against a plain-language question about data ("is it trending?", "error budget", "part to whole"). Returns candidates with the reason each matched. Start here when you know the question, not the chart.

ParameterTypeDescription
question *stringWhat the data needs to show, in plain language.
dataShapestringOptional filter, e.g. "number[]".
limitintegerMax results (default 6).

get_microchart Get a chart's props + example

Full wiring detail for one chart by slug: import paths, its props plus the shared props, data shape, best/avoid guidance, a copy-runnable example, and `sample` — the example as JSON props you can pass straight to render_microchart.

ParameterTypeDescription
slug *stringChart slug, e.g. "sparkline".

render_microchart Render a chart to SVG

Render a chart to a finished, self-contained SVG (styles embedded) plus its generated alt text — for surfaces that can't run React. Pass the series as `data`; put other props (value, target, curve, color, width) in `props`. Each chart takes its own data shape — get_microchart returns a valid `sample` to adapt.

ParameterTypeDescription
type *stringChart slug, e.g. "sparkline".
dataPrimary series (array), or a keyed object for charts that take one; omit for scalar charts.
formatstring`svg` (default) or `bare`.
propsobjectOther props (value, target, color, …).