surfacevisualizationrender
Visualizationpipeline · returns table

RENDER

Render a chart specification to PNG image

Table-in, table-out — composes downstream of SELECTs.

visualizationllmpipeline-composableimage

Syntax

THEN RENDER
THEN RENDER({{ width }}, {{ height }})
THEN RENDER({{ width }}, {{ height }}, {{ scale }})

Arguments

nametypedescription
width(optional)INTEGER
height(optional)INTEGER
scale(optional)INTEGER
_tableTABLE

About

PIPELINE cascade for rendering chart specifications to PNG images. Takes a chart spec (Vega-Lite, Plotly, or matplotlib code) and renders it to a base64-encoded PNG image. Auto-detects library from spec structure. Pure deterministic transformation - no LLM calls. Usage: SELECT * FROM data THEN TO_PLOTLY 'bar chart' THEN RENDER -- default 800x600 THEN RENDER(1200, 800) -- custom dimensions

Examples

Renders a data-driven Plotly chart to a PNG data URL

SELECT
  *
FROM
  (
    SELECT
      'plotly' AS format,
      '{"type":"bar","x":"category","y":"amount"}'::JSON AS config,
      'A' AS category,
      10 AS amount
    UNION ALL
    SELECT
      'plotly',
      '{"type":"bar","x":"category","y":"amount"}'::JSON,
      'B',
      20
  ) THEN RENDER (400, 300, 1) THEN PYTHON (
    'result = pd.DataFrame({"ok":[str(df.iloc[0]["image"]).startswith("data:image/png;base64,")]})'
  )

Nearby rabbit holes

same domain
Climb back to The Looking Glass