dataviz
它能做什么
这项技能指导如何制作人们易于阅读的图表和数据可视化。适合在任何工具中制作图表、图形或仪表盘的人,无论是通过代码还是图片。
适用场景
- ✓当你即将创建任何图表、图形或数据可视化时。
- ✓当你需要选择无障碍且一致的图表配色时。
- ✓当你在排版仪表盘或统计卡片,并希望层级清晰的时候。
技能链接
https://github.com/JimLiu/baoyu-design/blob/main/skills/dataviz/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请制作一张图表,比较三款产品十二个月的销售额,并使用无障碍的配色。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会先根据数据的用途选择图表形式,再按含义分配颜色,并在绘制图表前用验证工具检查配色。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Data Visualization
A chart is read by people and executed by you. This skill turns "make it look good" into a procedure with checks, so the result is right by construction rather than by taste.
The method here is design-system-agnostic. Nothing in the procedure, the form heuristic, the six checks, or the mark specs is specific to one product. A design system supplies a small set of parameters (its ramps, a categorical order, a diverging pair, a status palette, a texture, its surfaces, its filter components); the method consumes them unchanged. A validated default palette is the reference instance, fully specified in references/palette.md. To target your brand, read that file's structure and substitute its values - touch nothing else.
The single most important habit: the color part is computable, so compute it. Never eyeball whether a palette is colorblind-safe - run
scripts/validate_palette.js.
The procedure - do these in order
Color comes LAST. Most bad charts pick colors first.
- Pick the form. What is the data's job - magnitude, identity, polarity, a single headline, change-over-time? The job picks the chart type, and sometimes the answer is not a chart (a stat tile or hero number). ->
references/choosing-a-form.md - Assign color by the job it does. Categorical (identity), sequential (magnitude), diverging (polarity), or status (state) - each has one rule. Assign categorical hues in fixed order, never cycled. ->
references/color-formula.md - VALIDATE the palette - run the script, don't reason about Delta E.
node scripts/validate_palette.js "<hex,hex,...>" --mode light(relative to this skill's base directory - or load it as<script type="module">in the chart's own page, where it readsdata-paletteoff<body>and logs aconsole.tablereport). It returns pass/fail on the lightness band, chroma floor, adjacent-pair CVD separation, the normal-vision floor, and contrast. Fix anything that FAILs before continuing. Re-run for--mode darkwith that mode's surface. - Apply mark specs & spacers. Thin marks, 4px rounded data-ends anchored to the baseline, 2px lines, >=8px markers, a 2px surface gap between fills (stacked segments and adjacent bars alike) and a 2px surface ring on overlapping marks, selective direct labels. ->
references/marks-and-anatomy.md - Add the hover layer - by default. An HTML/SVG chart is interactive; ship a crosshair+tooltip on line/area and a per-mark hover tooltip on bar/dot/cell. The only form that skips it is a bare stat tile with no plot. Hit targets bigger than the mark; filters in one row above the charts. ->
references/interaction.md - Final accessibility pass. For >= 2 series a legend is always present and <= 4 are also direct-labeled (a single series needs no legend box - the title names it), so identity is never color-alone; a table view exists; dark mode is selected - its own steps from the same ramps, validated against the dark surface, not an automatic flip; texture is available for the CVD/print/forced-colors case.
- Render it and look at it. The validator checks color, not layout - open or screenshot the output and eyeball it for label collisions, geometry, and overflow before calling it done.
Then check the result against references/anti-patterns.md - it is the catalog of what goes wrong. If your chart matches an entry, it's wrong.
Non-negotiables (true in every design system)
- Assign categorical hues in fixed order, never cycled. A 9th series is never a generated hue - it folds into "Other," small multiples, or composite encoding.
- One axis. Never a dual-axis chart (two y-scales). Two measures of different scale -> two charts, small multiples, or indexed to a common base. (This is the #1 chart mistake - see anti-patterns.)
- Color follows the entity, never its rank. A filter that changes the series count must not repaint the survivors.
- Sequential = one hue, light->dark. Diverging = two hues + a neutral gray midpoint. Never a rainbow; never a hue at the diverging midpoint.
- Run the validator before shipping any categorical palette. CVD Delta E >= 8 is the target (OKLab x100); 6-8 is a floor that is legal ONLY with secondary encoding. A normal-vision floor below 15 is a hard FAIL - full-color readers can't tell the pair apart; re-step it on the adjacent pairlist (secondary encoding does not excuse this one); under
--pairs allcut series or facet
常见问题
它只适用于某一个图表库吗?
不是。这种方法适用于任何输出形式,例如代码、SVG、PNG 或图表库。
颜色是如何选择的?
颜色根据其用途分配,例如标识或数值大小,然后再检查无障碍性。
它会检查色盲问题吗?
会。它使用验证工具检查配色,而不是依靠肉眼判断。
详情
作者的原始描述
Use this skill whenever you are about to create ANY chart, graph, plot, dashboard, or data visualization, in ANY output medium (HTML/React artifact, inline SVG, matplotlib/plotly/d3/Recharts, PNG). Read it BEFORE writing the first line of chart code, choosing chart colors, building a stat tile / KPI row, or laying out a dashboard. Teaches a design-system-agnostic method - form heuristic, color formula with a runnable validator, mark specs, interaction rules. Default palette in references/palette.md.
repo: JimLiu/baoyu-design
热度
- GitHub 星标
- 5.9k
- 排名
- #14535
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
claude-dashboard
5.9k帮你的智能体用图表、数字和表格构建实时的数据仪表盘,并附带来源面板,显示每个数字的出处。
claude-design-system
5.9k帮你的智能体以文件形式创建和编辑品牌设计系统,包含设计令牌、字体、组件和素材,并在本地编辑器中打开。
claude-design
5.9k帮你的智能体制作可编辑的设计画板画布,你可以并排查看,并在本地编辑器中进行调整。
claude-slides
5.9k帮你的智能体制作和修改可编辑的幻灯片,在本地幻灯片编辑器中打开,可演示并导出为 PDF、HTML 或 PowerPoint。