📦 openclaw ggsql — OpenClaw ggsql

v1.0.0

使用 ggsql SQL 语法扩展从表格数据生成图表。适用场景:用户无需 Python/R 即可将数据可视化。支持:散点图...

0· 0·0 当前·0 累计
fanzhidongyzby 头像by @fanzhidongyzby (Florian)
0

运行时依赖

无特殊依赖

安装命令

点击复制
官方npx clawhub@latest install openclaw-ggsql
镜像加速npx clawhub@latest install openclaw-ggsql --registry https://cn.longxiaskill.com

技能文档

ggsql 可视化 技能

生成 图表s from tabular data using ggsql SQL syntax.

Overview

ggsql extends SQL with 可视化 capabilities based on the Grammar of Graphics. Write familiar SQL queries, 添加 可视化 clauses, and 获取 图表s - no Python/R needed.

When to Use

✅ USE this 技能 when:

"Visualize this data as a scatter plot" "创建 a histogram of X" "Draw a bar 图表 comparing Y across categories" "Plot time series data" "生成 heatmap from table" User provides tabular data and wants a 图表 When NOT to Use

❌ DON'T use this 技能 when:

Interactive/dynamic 图表s → use JavaScript libraries Complex statistical 可视化s → use Python/R Large-扩展 data 仪表盘s → use dedicated 工具s 3D 可视化s → use specialized software 输入 模式 data: 图表_type: point | line | bar | histogram | boxplot | violin | density | heatmap | pie m应用ing: x: # Required for most 图表s y: # Required for point, line, bar, boxplot fill: # Optional, for color encoding color: # Optional, for stroke color shape: # Optional, for point shapes size: # Optional, for point sizes options: title: <图表 title> # Optional subtitle: <图表 subtitle> # Optional x_label: # Optional y_label: # Optional binwidth: # For histogram facet: # For small multiples facet_by: # For 2D faceting 扩展_x: continuous | discrete | binned | 记录10 扩展_y: continuous | discrete | binned | 记录10 扩展_fill: continuous | discrete | binned

输出 SVG 图表 file (primary) PNG 图表 file (optional) Embedded base64 image for chat display 图表 Types and Templates Scatter Plot (point)

Required m应用ing: x, y Optional m应用ing: fill, color, shape, size

VISUALISE {x} AS x, {y} AS y, {fill} AS fill FROM {data_source} DRAW point LABEL title => '{title}', x => '{x_label}', y => '{y_label}'

Line 图表 (line)

Required m应用ing: x, y Optional m应用ing: color, linetype

VISUALISE {x} AS x, {y} AS y, {color} AS color FROM {data_source} DRAW line LABEL title => '{title}', x => '{x_label}', y => '{y_label}'

Bar 图表 (bar)

Required m应用ing: x, y (or auto-count with just x) Optional m应用ing: fill

SELECT {x}, COUNT() as count FROM {data_source} GROUP BY {x} VISUALISE {x} AS x, count AS y, {fill} AS fill DRAW bar LABEL title => '{title}', x => '{x_label}', y => '{y_label}'

Histogram (histogram)

Required m应用ing: x Optional m应用ing: fill, binwidth

VISUALISE {x} AS x, {fill} AS fill FROM {data_source} DRAW histogram 设置TING binwidth => {binwidth} LABEL title => '{title}', x => '{x_label}'

Boxplot (boxplot)

Required m应用ing: x, y (x categorical, y numeric) Optional m应用ing: fill

VISUALISE {x} AS x, {y} AS y, {fill} AS fill FROM {data_source} DRAW boxplot LABEL title => '{title}', x => '{x_label}', y => '{y_label}'

Heatmap (tile)

Required m应用ing: x, y, fill Optional m应用ing: none

VISUALISE {x} AS x, {y} AS y, {fill} AS fill FROM {data_source} DRAW tile 扩展 BINNED fill LABEL title => '{title}', x => '{x_label}', y => '{y_label}'

Density Plot (density)

Required m应用ing: x Optional m应用ing: fill

VISUALISE {x} AS x, {fill} AS fill FROM {data_source} DRAW density LABEL title => '{title}', x => '{x_label}'

Violin Plot (violin)

Required m应用ing: x, y (x categorical, y numeric) Optional m应用ing: fill

VISUALISE {x} AS x, {y} AS y, {fill} AS fill FROM {data_source} DRAW violin LABEL title => '{title}', x => '{x_label}', y => '{y_label}'

Pie 图表 (pie with polar projection)

Required m应用ing: fill Optional m应用ing: none

SELECT {fill}, COUNT() as count FROM {data_source} GROUP BY {fill} VISUALISE {fill} AS fill, count AS y DRAW bar PROJECT polar LABEL title => '{title}'

扩展 Types 扩展 Use Case Example CONTINUOUS Numeric values 扩展 CONTINUOUS x FROM [0, null] DISCRETE Categories 扩展 DISCRETE fill TO ['red', 'blue'] BINNED Binning continuous 扩展 BINNED fill ORDINAL Ordered categories 扩展 ORDINAL x 身份 Direct values 扩展 身份 color 记录10 记录 转换 扩展 CONTINUOUS y VIA 记录10 Faceting (Small Multiples) 1D Faceting VISUALISE {x} AS x, {y} AS y FROM {data_source} DRAW point FACET {facet_column}

2D Faceting VISUALISE {x} AS x, {y} AS y FROM {data_source} DRAW point FACET {facet_column} BY {facet_by_column}

Multi-layer 图表s

Combine multiple DRAW clauses:

VISUALISE {x} AS x, {y} AS y FROM {data_source} DRAW line M应用ING {group} AS color DRAW point M应用ING {group} AS fill LABEL title => '{title}'

Execution Methods Method 1: WASM Playground (Recommended for 测试) Visit https://ggsql.org/wasm/ Use built-in data设置s: ggsql:pen图形界面ns, ggsql:AIr质量 上传 CSV via "上传 Data" button 运行 SQL and save as SVG/PNG Method 2: 命令行工具 (Local Execution) # 安装 cargo 安装 ggsq

数据来源ClawHub ↗ · 中文优化:龙虾技能库