π¦ ClawHub
openclaw ggsql
by @fanzhidongyzby
Generate charts from tabular data using ggsql SQL syntax extension. Use when: user wants to visualize data as charts without Python/R. Supports: scatter plot...
β‘ When to Use
π‘ Examples
Example 1: Scatter Plot with Color
Input:
data: penguins.csv
chart_type: point
mapping:
x: bill_length_mm
y: bill_depth_mm
fill: species
options:
title: Penguin Bill Dimensions
x_label: Bill Length (mm)
y_label: Bill Depth (mm)
Generated SQL:
SELECT * FROM 'penguins.csv'
VISUALISE bill_length_mm AS x, bill_depth_mm AS y, species AS fill
DRAW point
LABEL
title => 'Penguin Bill Dimensions',
x => 'Bill Length (mm)',
y => 'Bill Depth (mm)'
Example 2: Histogram
Input:
data: sales.csv
chart_type: histogram
mapping:
x: revenue
options:
title: Revenue Distribution
binwidth: 1000
Generated SQL:
SELECT * FROM 'sales.csv'
VISUALISE revenue AS x
DRAW histogram
SETTING binwidth => 1000
LABEL title => 'Revenue Distribution'
Example 3: Faceted Scatter Plot
Input:
data: penguins.csv
chart_type: point
mapping:
x: bill_length_mm
y: bill_depth_mm
fill: species
options:
title: Penguins by Island
facet: island
Generated SQL:
SELECT * FROM 'penguins.csv'
VISUALISE bill_length_mm AS x, bill_depth_mm AS y, species AS fill
DRAW point
FACET island
LABEL title => 'Penguins by Island'
Example 4: Multi-layer Chart
Input:
data: sales.csv
chart_type: multi
mapping:
x: date
y: revenue
group: region
options:
title: Revenue Trend by Region
Generated SQL:
SELECT * FROM 'sales.csv'
VISUALISE date AS x, revenue AS y
DRAW line
MAPPING region AS color
DRAW point
MAPPING region AS fill
LABEL title => 'Revenue Trend by Region'
π Tips & Best Practices
TERMINAL
clawhub install openclaw-ggsql