surfacepipelinerender_canvas
Pipelinepipeline · returns table

RENDER_CANVAS

Compose multiple panels into a canvas layout for visualization

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

pipelinellmpipeline-composabletext

Syntax

THEN RENDER_CANVAS
THEN RENDER_CANVAS('{{ layout_type }}')
THEN RENDER_CANVAS('{{ layout_type }}', {{ dim1 }})
THEN RENDER_CANVAS('{{ layout_type }}', {{ dim1 }}, {{ dim2 }})

Arguments

nametypedescription
layout_type(optional)VARCHAR
dim1(optional)INTEGER
dim2(optional)INTEGER
_tableTABLE

About

PIPELINE cascade for composing multiple visualization panels into a canvas layout. Uses pure Python - no LLM calls. Supports two layout modes: GRID Layout (cell-based positioning): SELECT * FROM CANVAS( PANEL('Team', 1, 1, employees), PANEL('Metrics', 2, 1, metrics) ) WITH GRID(2, 1) FLOATING Layout (pixel-based positioning): SELECT * FROM CANVAS( PANEL('Chart', 50, 50, chart_data, width := 400, height := 300), PANEL('Info', 500, 50, info_data, width := 200, height := 150) ) WITH FLOATING(800, 600) The CANVAS rewriter transforms these to: SELECT * FROM _canvas_panels THEN RENDER_CANVAS('grid', cols, rows) SELECT * FROM _canvas_panels THEN RENDER_CANVAS('floating', width, height)

Examples

Wraps panel rows into a canvas layout payload

SELECT
  'Notes' AS name,
  'Project kickoff' AS content,
  1 AS col,
  1 AS ROW THEN RENDER_CANVAS ('grid', 1, 1) THEN PYTHON (
    'result = pd.DataFrame({"ok":[df.iloc[0]["format"] == "canvas" and df.iloc[0]["canvas"]["layout"]["type"] == "grid"]})'
  )

Nearby rabbit holes

same domain
Climb back to The Looking Glass