WestCoast Charts

v0.2.4
io.github.Lokumbus/west-coast-charts-agent Checked 19 hours ago Published 21 days ago

Validate, render (SVG/PNG) and describe WestCoast Charts specs headlessly, with a data table.

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

render_chart Render chart (SVG/PNG + verification table)

Render a West Coast Charts spec headlessly to SVG or PNG and return the image together with the verification table: the values, aggregates and text description that were actually drawn. Use it to produce a chart file or to check that a chart shows what you intended. Read the returned table instead of looking at the image when you cannot see images. Do not use it just to check option names (validate_chart is faster) or only for the numbers (describe_chart is cheaper). Behaviour: read-only, deterministic (same spec+seed => byte-identical output, animations off), no files written, no network. The…

ParameterTypeDescription
spec *objectWest Coast Charts options object, JSON only (no functions), the same object you pass to new WestCoastCharts(el, options). ApexCharts 4.x options are accepted. Example: {"chart":{"type":"bar"},"series"…
backgroundstringCSS colour behind the chart. PNG default '#ffffff'; SVG stays transparent unless set.
dataarrayOptional series array that replaces spec.series (keeps the spec reusable as a template).
deliverystringinline (default) embeds the SVG text/PNG bytes; link returns only a resource link wcc://renders/{id} plus the table (saves tokens; read the resource when needed).
formatstringOutput format. svg (default) is text and editable; png is a base64 image.
heightintegerCanvas height in px. Default spec.chart.height or 450.
scalenumberPNG pixel ratio 1-4. Default 1. Ignored for svg.
seedintegerRandom seed for layouts (network, facets). Same spec + seed => byte-identical output. Default 1.
themestringTheme. Default spec.theme.mode or the server default.
validatestringRun validate_chart first. strict (default) fails on errors, warn renders and reports, off skips.
widthintegerCanvas width in px. Default spec.chart.width or 800.

validate_chart Validate chart spec

Check a West Coast Charts spec without rendering. Returns structured issues, each with a stable code, the dotted option path, a message, a hint with the exact fix and, for typos or invented options, the suggested correct key (did-you-mean). Use it before render_chart when you wrote options from memory, and after every fix until ok is true. An invalid spec is a normal result (ok:false), not a tool error. It does not check whether the data makes sense; use describe_chart for that. Read-only, deterministic, fast (no rendering). Example: {"spec": {"chart": {"type": "radialColumn"}, "plotOptions":…

ParameterTypeDescription
spec *objectWest Coast Charts options object, JSON only (no functions), the same object you pass to new WestCoastCharts(el, options). ApexCharts 4.x options are accepted. Example: {"chart":{"type":"bar"},"series"…
dataarrayOptional series array that replaces spec.series (keeps the spec reusable as a template).

describe_chart Describe chart (verification table)

Return the verification table (wcc-describe/1) of a spec without producing an image: the text description, the data table as drawn (caption, columns, rows of formatted strings, total, truncated) and, from the full model, per-series and chart-level aggregates with their function (sum/mean/max/min/none), scales, extrema and hidden series. Aggregates follow the chart's semantics, e.g. p95 latencies are reported as a maximum, never summed. Use it to check, in text only, that a chart says what you intend, to write alt text, or to answer questions about a chart. Cheaper than render_chart; use render…

ParameterTypeDescription
spec *objectWest Coast Charts options object, JSON only (no functions), the same object you pass to new WestCoastCharts(el, options). ApexCharts 4.x options are accepted. Example: {"chart":{"type":"bar"},"series"…
dataarrayOptional series array that replaces spec.series (keeps the spec reusable as a template).
formatstringmarkdown (default): text + table + aggregates; json: the wcc-describe/1 object, then a second text item with the table source (both also in structuredContent.table / .tableSource).
heightintegerCanvas height in px. Default spec.chart.height or 450.
max_rowsintegerRows shown in markdown output. Default 50. json returns every row the core returned (see table.total/truncated).
seedintegerRandom seed for layouts (network, facets). Same spec + seed => byte-identical output. Default 1.
themestringTheme. Default spec.theme.mode or the server default.
widthintegerCanvas width in px. Default spec.chart.width or 800.

get_schema Get option schema slice

Return the JSON Schema (draft 2020-12) of West Coast Charts options, either the root or the slice at a dotted path. Deeper levels are collapsed to stubs with "x-wcc-keys" (child names) and "x-wcc-more" (the call that expands them), so answers stay small. Use it to look up the exact option names, types, enums and defaults before writing a spec, instead of guessing. Ask for the narrowest path you need; do not fetch the whole tree at high depth. Unknown paths fail with kind "not_found" and a did-you-mean hint. Read-only. Examples: {"path": "plotOptions.radialColumn"}, {"path": "xaxis.labels", "de…

ParameterTypeDescription
depthintegerLevels of nested properties to expand. Default 2; 0 returns only the node itself with its child keys.
pathstringDotted option path, e.g. 'plotOptions.bar' or 'chart.toolbar'. Omit for the root.

list_chart_types List chart types

List every chart type this server can render with its tier (premium true/false) and, for premium layers, the module that provides it. Use it to pick a valid chart.type, or to find a free alternative when a premium type fails with kind "license". Read-only, no arguments.

list_examples List curated examples

List curated West Coast Charts showcase examples, strongest first. Each entry has an id, chart type, title and premium flag; fetch the full spec with get_example. Use it to start from a proven spec instead of writing one from scratch. Filter by type or by words in the title. Returns metadata only, not specs. Read-only; paginated with offset/limit. Example: {"type": "heatmap", "limit": 5} or {"query": "latency"}

ParameterTypeDescription
limitintegerMax results. Default 20.
offsetintegerSkip this many results. Default 0.
premiumbooleantrue = only premium, false = only free examples.
querystringCase-insensitive words that must all appear in id or title.
typestringOnly examples of this chart.type, e.g. 'line'.

get_example Get example spec

Return the full JSON spec of one curated example (ids come from list_examples). The spec can be passed unchanged to render_chart or adapted. Read-only. Unknown ids fail with kind "not_found" and the closest ids in the hint. Example: {"id": "line-basic"}

ParameterTypeDescription
id *stringExample id from list_examples.