Skip to content

API Reference parrot.flows.thales.rendering.charts

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.flows.thales.rendering.charts

View source

Chart rendering for the "Thales" deck renderer (FEAT-425 Module 4).

Two deterministic, dependency-free rendering paths, per the FEAT-273/SPK-1 convention (artifacts/spikes/spk1-rasterization/results.md):

  • :func:echarts_option_block — an ECharts option-JSON container for the interactive browser path.
  • :func:static_svg_chart — a bar/line SVG builder for the print/PDF path (weasyprint executes no JavaScript, so ECharts cannot render there).

Both accept the same chart payload shape produced by SlideSpec.charts (e.g. {"type": "bar", "labels": [...], "series": [{"name": ..., "data": [...]}]}). No timestamps, no uuids — element ids are derived deterministically from the chart's own content so identical input always renders identical output.

Function echarts_option_block

Build an ECharts option-JSON container for the interactive browser path.

echarts_option_block(chart: dict[str, Any]) -> str

Parameter Type Default Description
chart dict[str, Any] A chart payload (e.g. {"type": "bar", "labels": [...], "series": [{"name": ..., "data": [...]}]}).

Returns: str — A self-contained HTML fragment: a chart <div> plus an inline <script> that initializes ECharts against it. Deterministic — the element id is derived from the chart's own (sorted) content.

Function static_svg_chart

Build a deterministic, dependency-free static SVG chart (bar or line).

Used on the print/PDF path (weasyprint runs no JavaScript, so ECharts' interactive rendering is unavailable there).

static_svg_chart(chart: dict[str, Any]) -> str

Parameter Type Default Description
chart dict[str, Any] A chart payload, same shape as :func:echarts_option_block.

Returns: str — An inline <svg>...</svg> fragment.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally