Render charts and dashboards straight from SQL — the ggplot-rs grammar of graphics, emitted as SVG.
Compatibility Matrix
This table covers all DuckDB releases that have not reached end-of-life, including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.
| Platform | 1.4.4 | 1.4.5 | 1.5.5 | 1.5.6 | 2.0.0 |
|---|---|---|---|---|---|
| Linux AMD64 | |||||
| Linux ARM64 | |||||
| macOS AMD64 | |||||
| macOS ARM64 | |||||
| Windows AMD64 | |||||
| Windows ARM64 | |||||
| WebAssembly |
Installing and Loading
INSTALL anofox_visualization FROM community;
LOAD anofox_visualization;
Example
-- One scalar plus convenience macros. Pass columns; get an SVG per group.
WITH sales AS (SELECT * FROM (VALUES ('app', 30), ('web', 22), ('api', 12)) t(ch, n))
SELECT anofox_bar(ch, n) FROM sales; -- <svg> bar chart
-- Any chart kind via anofox_xy(..., kind := ...), or the raw JSON spec:
SELECT anofox_render('{"rows":[{"c0":"a","c1":3}],"roles":[[0,"XAXIS"],[1,"BARCHART"]]}');
About anofox_visualization
anofox_visualization renders charts as SVG from inside DuckDB, using the ggplot-rs grammar-of-graphics engine. This community build provides the rendering surface:
- anofox_render(spec VARCHAR) -> VARCHAR — a JSON panel spec -> SVG
- anofox_bar / anofox_line / anofox_scatter / anofox_area (x, y)
- anofox_xy(x, y, kind := 'BARCHART', width := 640, height := 400)
- anofox_xyc(x, y, series, kind := 'BARCHART_STACKED')
The convenience macros aggregate rows via list(), so
SELECT anofox_bar(x, y) FROM t returns one SVG for the group. Chart kinds
include bars/lines/areas/points, distributions (histogram, boxplot, violin),
heatmaps, and WKT-geometry choropleth maps.
The full toolkit — an interactive in-browser dashboard builder, locked read-only dashboard serving, and a CLI — is available from a source build of the project at https://github.com/DataZooDE/anofox-visualization.
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| anofox_area | macro | Render an area chart of two columns as SVG. Shorthand for anofox_xy(x, y, kind := 'AREACHART'). | NULL | [SELECT anofox_area(x, y) FROM (VALUES ('Jan', 10), ('Feb', 20)) t(x, y)] |
| anofox_bar | macro | Render a bar chart of two columns as SVG. Shorthand for anofox_xy(x, y, kind := 'BARCHART'). | NULL | [SELECT anofox_bar(x, y) FROM (VALUES ('Jan', 10), ('Feb', 20)) t(x, y)] |
| anofox_line | macro | Render a line chart of two columns as SVG. Shorthand for anofox_xy(x, y, kind := 'LINECHART'). | NULL | [SELECT anofox_line(x, y) FROM (VALUES ('Jan', 10), ('Feb', 20)) t(x, y)] |
| anofox_render | scalar | Render a chart specification to an SVG string. The spec is JSON carrying 'rows' (the data), 'roles' (which column plays which part: XAXIS, BARCHART, CATEGORY, …) and optional 'width' and 'height'. The anofox_bar/_line/_scatter/_area/_xy/_xyc macros build this spec for you. | NULL | [anofox_render(json_object('rows', to_json([{c0: 'Jan', c1: 10}]), 'roles', '[[0,"XAXIS"],[1,"BARCHART"]]'::JSON))] |
| anofox_scatter | macro | Render a scatter plot of two columns as SVG. Shorthand for anofox_xy(x, y, kind := 'SCATTER'). | NULL | [SELECT anofox_scatter(x, y) FROM (VALUES (1.5, 10), (2.5, 20)) t(x, y)] |
| anofox_xy | macro | Aggregate two columns into a single-series chart and render it as SVG. 'kind' selects the mark (BARCHART, LINECHART, SCATTER, AREACHART); x becomes the axis and y the value. | NULL | [SELECT anofox_xy(x, y, kind := 'LINECHART') FROM (VALUES ('Jan', 10), ('Feb', 20)) t(x, y)] |
| anofox_xyc | macro | Aggregate three columns into a multi-series chart and render it as SVG, with 'series' splitting the data into categories. | NULL | [SELECT anofox_xyc(x, y, s) FROM (VALUES ('Jan', 10, 'EU'), ('Jan', 8, 'US')) t(x, y, s)] |
Overloaded Functions
This extension does not add any function overloads.
Added Types
This extension does not add any types.
Added Settings
| name | description | input_type | scope | aliases |
|---|---|---|---|---|
| datazoo_banner | Show the DataZoo feedback banner when an extension is loaded in an interactive terminal (at most once a day per extension). | BOOLEAN | GLOBAL | [] |