返回顶部
d

data-viz命令行数据可视化

Create data visualizations from the command line. Generate charts, graphs, and plots from CSV/JSON data without leaving the terminal.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 0.1.0
安全检测
已通过
1,292
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

data-viz

技能名称: data-viz
详细描述:

数据可视化

从CSV、JSON或管道数据创建基于终端的图表和可视化。

使用YouPlot快速可视化

YouPlot(uplot)可在终端中创建Unicode图表。

条形图

bash
echo -e Apple,30\nBanana,45\nCherry,20\nDate,35 | uplot bar -d, -t 水果销量

折线图

bash
seq 1 20 | awk {print $1, sin($1/3)*10+10} | uplot line -t 正弦波

直方图

bash
awk BEGIN{for(i=0;i<1000;i++)print rand()} | uplot hist -t 随机分布 -n 20

散点图

bash
awk BEGIN{for(i=0;i<100;i++)print rand()100, rand()100} | uplot scatter -t 随机点

从CSV文件

bash

从CSV生成条形图


cat sales.csv | uplot bar -d, -H -t 月度销量

带表头的折线图

cat timeseries.csv | uplot line -d, -H -t 股票价格

从JSON(配合jq)

bash

从JSON提取数据并绘图


curl -s https://api.example.com/data | jq -r .items[] | \(.name),\(.value) | uplot bar -d,

Termgraph(Python替代方案)

简单的水平条形图:

bash
echo -e 2020 50\n2021 75\n2022 90\n2023 120 | termgraph

带颜色:

bash
echo -e 销售额 150\n成本 80\n利润 70 | termgraph --color green

Gnuplot(高级)

用于出版级图表:

bash

快速折线图


gnuplot -e set terminal dumb; plot sin(x)

从数据文件

gnuplot -e set terminal dumb; plot data.txt with lines

迷你图

内联微型图表:

bash

使用spark(如果已安装)


echo 1 5 22 13 5 | spark

输出:▁▂█▅▂

纯bash迷你图

data=1 5 22 13 5; min=$(echo $data | tr \n | sort -n | head -1); max=$(echo $data | tr \n | sort -n | tail -1); for n in $data; do printf \u258$((7-7*($n-$min)/($max-$min))); done; echo

ASCII表格

将数据格式化为表格:

bash

使用column


echo -e 姓名,分数,等级\nAlice,95,A\nBob,82,B\nCarol,78,C | column -t -s,

使用csvlook(csvkit)

cat data.csv | csvlook

实际应用示例

股票价格图表

bash

获取并绘制股票数据(使用Alpha Vantage免费API)


curl -s https://www.alphavantage.co/query?function=TIMESERIESDAILY&symbol=AAPL&apikey=demo | \
jq -r .[Time Series (Daily)] | to_entries | .[:20] | reverse | .[] | \(.key) \(.value[4. close]) | \
uplot line -t AAPL股票价格

系统指标

bash

CPU使用率随时间变化


for i in {1..20}; do
top -bn1 | grep Cpu(s) | awk {print 100-$8}
sleep 1
done | uplot line -t CPU使用率%

API响应时间

bash

测量并绘制响应时间


for i in {1..10}; do
curl -s -o /dev/null -w %{time_total}\n https://example.com
done | uplot line -t 响应时间(秒)

提示

  • - 使用-d,表示逗号分隔数据,-d\t表示制表符分隔
  • 数据包含表头时使用-H
  • 通过管道连接head或tail限制数据点数量
  • 配合jq进行JSON数据提取
  • 使用watch实现实时更新图表:watch -n1 command | uplot bar

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 data-viz-1776419994 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 data-viz-1776419994 技能

通过命令行安装

skillhub install data-viz-1776419994

下载

⬇ 下载 data-viz v0.1.0(免费)

文件大小: 2.33 KB | 发布时间: 2026-4-17 19:38

v0.1.0 最新 2026-4-17 19:38
- Initial release of data-viz skill for terminal-based data visualization.
- Generate charts, plots, and graphs directly from CSV/JSON or piped data using YouPlot, termgraph, and gnuplot.
- Supports bar charts, line charts, histograms, scatter plots, sparklines, and ASCII tables.
- Includes real-world command-line examples for system metrics, stock prices, and API response times.
- Guidance for using tools like jq and csvkit for easy data extraction and formatting.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部