surfacepipelineadd_styles
Pipelinepipeline · returns table

ADD_STYLES

Apply theme styling to a chart specification

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

pipelinellmpipeline-composabletext

Syntax

THEN ADD_STYLES
THEN ADD_STYLES({{ theme }})
THEN ADD_STYLES({{ theme }}, {{ custom }})

Arguments

nametypedescription
theme(optional)VARCHAR
custom(optional)VARCHAR
_tableTABLE

About

PIPELINE cascade for applying theme styling to chart specifications. Takes a chart spec and applies a theme (colors, fonts, backgrounds). Pure deterministic transformation - no LLM calls. Usage: SELECT * FROM data THEN TO_PLOTLY 'bar chart' THEN ADD_STYLES -- uses auto/default theme THEN ADD_STYLES('dark') -- explicit theme THEN ADD_STYLES('custom', '{"plotly": {"paper_bgcolor": "#000"}}') Available themes: auto, dark, light, midnight, paper

Examples

Applies the requested theme to a data-driven Plotly chart

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 ADD_STYLES ('paper') THEN PYTHON (
    'result = pd.DataFrame({"theme":[df.iloc[0]["theme"]]})'
  )

Nearby rabbit holes

same domain
Climb back to The Looking Glass