Skip to content

symfonic.core.tools.chart_tools

chart_tools

Chart tools — pure-compute chart specification generation.

No storage dependency. No protocol imports. Stateless.

generate_chart async

generate_chart(
    state: dict[str, Any],
    chart_type: str,
    data: dict[str, Any],
    title: str = "",
) -> dict[str, Any]

Generate a chart specification. Pure compute -- no storage dependency.

Source code in src/symfonic/core/tools/chart_tools.py
async def generate_chart(
    state: dict[str, Any],
    chart_type: str,
    data: dict[str, Any],
    title: str = "",
) -> dict[str, Any]:
    """Generate a chart specification. Pure compute -- no storage dependency."""
    return {
        "type": chart_type,
        "data": data,
        "title": title,
        "format": "json",
    }