datavis

GitHub

提供基于D3.js等工具的数据可视化技能,涵盖视觉编码、色彩设计、力导向图及响应式SVG。支持数据管道构建与叙事结构策划,旨在创建美观、准确且无障碍的交互式图表和数据故事。

bundled/skills/datavis/SKILL.md foryourhealth111-pixel/Vibe-Skills

Trigger Scenarios

构建交互式数据可视化 设计图表配色方案 选择比例尺和视觉编码 创建从API获取数据的数据管道 制作叙事驱动的数据故事 实现力导向网络或地理地图

Install

npx skills add foryourhealth111-pixel/Vibe-Skills --skill datavis -g -y
More Options

Non-standard path

npx skills add https://github.com/foryourhealth111-pixel/Vibe-Skills/tree/main/bundled/skills/datavis -g -y

Use without installing

npx skills use foryourhealth111-pixel/Vibe-Skills@datavis

指定 Agent (Claude Code)

npx skills add foryourhealth111-pixel/Vibe-Skills --skill datavis -a claude-code -g -y

安装 repo 全部 skill

npx skills add foryourhealth111-pixel/Vibe-Skills --all -g -y

预览 repo 内 skill

npx skills add foryourhealth111-pixel/Vibe-Skills --list

SKILL.md

Frontmatter
{
    "name": "datavis",
    "description": "Comprehensive data visualization toolkit for creating beautiful, mathematically elegant visualizations with D3.js, Chart.js, and custom SVG. Use when (1) building interactive data visualizations, (2) designing color palettes for charts, (3) choosing scales and visual encodings, (4) creating data pipelines from Census\/SEC\/Wikipedia APIs, (5) crafting narrative-driven data stories, (6) making perceptually accurate charts, or (7) implementing force-directed networks, timelines, or geographic maps."
}

Data Visualization Skill

Create beautiful, mathematically elegant, emotionally resonant data visualizations.

Philosophy: "Life is Beautiful"

Every visualization should:

  1. Reveal truth through data
  2. Evoke wonder through design
  3. Respect the viewer through accessibility
  4. Honor complexity through elegant simplification

Core Capabilities

1. Visual Encoding

Scale Selection:

Scale Use When Example
Linear Evenly distributed data Temperature
Log Multiple orders of magnitude Population (100 to 1B)
Sqrt Encoding area (circles) Bubble chart radius
Time Temporal data Dates

Perceptual Honesty - Area scales with square of radius, so use sqrt:

// WRONG: Linear radius exaggerates large values
const badScale = d3.scaleLinear().domain([0, max]).range([0, maxRadius]);

// RIGHT: Sqrt maintains perceptual accuracy
const goodScale = d3.scaleSqrt().domain([0, max]).range([0, maxRadius]);

2. Color Design

Palette Types:

  • Categorical - Distinct hues for nominal data (max 8)
  • Sequential - Single hue gradient for ordered data
  • Diverging - Two hues meeting at meaningful midpoint

Colorblind-Safe Palette (8 colors):

const colorblindSafe = [
  '#332288', '#117733', '#44AA99', '#88CCEE',
  '#DDCC77', '#CC6677', '#AA4499', '#882255'
];

Always use redundant encoding - don't rely on color alone:

node.attr('fill', d => colorScale(d.category))
    .attr('d', d => symbolScale(d.category)); // Shape too!

3. D3.js Patterns

Force Simulation:

const simulation = d3.forceSimulation(nodes)
  .force('charge', d3.forceManyBody().strength(-300))
  .force('link', d3.forceLink(links).id(d => d.id))
  .force('center', d3.forceCenter(width/2, height/2))
  .force('collision', d3.forceCollide().radius(d => d.r + 2));

Responsive SVG:

const svg = d3.select('#chart')
  .append('svg')
  .attr('viewBox', `0 0 ${width} ${height}`)
  .attr('preserveAspectRatio', 'xMidYMid meet');

Touch-Friendly (44x44px minimum):

node.append('circle')
  .attr('class', 'hit-area')
  .attr('r', Math.max(actualRadius, 22))
  .attr('fill', 'transparent');

4. Narrative Structure

Three Acts:

  1. Invitation - What draws viewer in? Why should they care?
  2. Discovery - What patterns emerge? What surprises?
  3. Reflection - What should they feel/understand/do?

Progressive Disclosure:

Level 1: Overview → Level 2: Exploration → Level 3: Detail → Level 4: Context

5. Data Pipeline

Structure:

scripts/
├── 01_fetch_raw.py    # API calls with caching
├── 02_clean_data.py   # Transformation
├── 03_validate.py     # Quality checks
└── 04_export.py       # Final format

Source Documentation (every dataset needs):

  • URL, access date, update frequency
  • License and confidence level
  • Field descriptions and limitations

Scripts

Generate Color Palette

scripts/color-palette.py --type sequential --hue blue --steps 9
scripts/color-palette.py --type categorical --count 6 --colorblind-safe
scripts/color-palette.py --type diverging --low red --high blue

Analyze Data Distribution

scripts/analyze-distribution.py data.csv --column value
# Outputs: min, max, skew ratio, recommended scale

Scaffold D3 Project

scripts/d3-scaffold.py my-viz --type force-network
scripts/d3-scaffold.py my-viz --type timeline
scripts/d3-scaffold.py my-viz --type choropleth

Anti-Patterns to Avoid

  • 3D charts (distorts perception)
  • Pie charts with >6 categories
  • Dual y-axes
  • Rainbow color scales (perceptually uneven)
  • Truncated y-axes without disclosure
  • Animation without purpose

Quality Checklist

  • Scale choice justified for data distribution
  • Color palette is colorblind-safe
  • Minimum 44x44px touch targets
  • Clear entry point for viewer
  • Sources documented
  • Responsive on mobile

Version History

  • f627ab5 Current 2026-07-25 04:40

Same Skill Collection

bundled/skills/.system/skill-creator/SKILL.md
bundled/skills/.system/skill-installer/SKILL.md
bundled/skills/aeon/SKILL.md
bundled/skills/algorithmic-art/SKILL.md
bundled/skills/architecture-patterns/SKILL.md
bundled/skills/astropy/SKILL.md
bundled/skills/autonomous-builder/SKILL.md
bundled/skills/brainstorming/SKILL.md
bundled/skills/cancel-ralph/SKILL.md
bundled/skills/chembl-database/SKILL.md
bundled/skills/citation-management/SKILL.md
bundled/skills/claude-skills/SKILL.md
bundled/skills/clinical-reports/SKILL.md
bundled/skills/clinicaltrials-database/SKILL.md
bundled/skills/clinpgx-database/SKILL.md
bundled/skills/code-reviewer/SKILL.md
bundled/skills/coding-tutor/SKILL.md
bundled/skills/commit-with-reflection/SKILL.md
bundled/skills/comprehensive-research-agent/SKILL.md
bundled/skills/content-research-writer/SKILL.md
bundled/skills/context-fundamentals/SKILL.md
bundled/skills/context-hunter/SKILL.md
bundled/skills/create-plan/SKILL.md
bundled/skills/creating-data-visualizations/SKILL.md
bundled/skills/cs-foundations/SKILL.md
bundled/skills/dask/SKILL.md
bundled/skills/data-artist/SKILL.md
bundled/skills/data-quality-frameworks/SKILL.md
bundled/skills/data-storytelling/SKILL.md
bundled/skills/datacommons-client/SKILL.md
bundled/skills/denario/SKILL.md
bundled/skills/designing-experiments/SKILL.md
bundled/skills/detecting-data-anomalies/SKILL.md
bundled/skills/detecting-performance-regressions/SKILL.md
bundled/skills/dialectic/SKILL.md
bundled/skills/digital-brain/SKILL.md
bundled/skills/dnanexus-integration/SKILL.md
bundled/skills/doc/SKILL.md
bundled/skills/docs-review/SKILL.md
bundled/skills/docs-write/SKILL.md
bundled/skills/document-skills/docx/SKILL.md
bundled/skills/document-skills/pdf/SKILL.md
bundled/skills/document-skills/pptx/SKILL.md
bundled/skills/document-skills/SKILL.md
bundled/skills/documentation-lookup/SKILL.md
bundled/skills/docx-comment-reply/SKILL.md
bundled/skills/docx/SKILL.md
bundled/skills/edgartools/SKILL.md
bundled/skills/embedding-strategies/SKILL.md

Metadata

Files
0
Version
f627ab5
Hash
d6f3a480
Indexed
2026-07-25 04:40

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-07 06:43
浙ICP备14020137号-1 $방문자$