xuansenpa1/skillrevise/d3-visualization
Claude Code and agent skill by xuansenpa1/skillrevise
- community
Checking that the SKILL.md file is still in the repository.
Build deterministic, verifiable data visualizations with D3.js (v6). Generate standalone HTML/SVG (and optional PNG) from local data files without external network dependencies. Use when tasks require charts, plots, axes/scales, legends, tooltips, or data-driven SVG output.
Install
npx vskill@latest install xuansenpa1/skillrevise/d3-visualizationSKILL.md
D3.js Visualization Skill
Use this skill to turn structured data (CSV/TSV/JSON) into clean, reproducible visualizations using D3.js. The goal is to produce stable outputs that can be verified by diffing files or hashing.
When to use
Activate this skill when the user asks for any of the following:
- “Make a chart/plot/graph/visualization”
- bar/line/scatter/area/histogram/box/violin/heatmap
- timelines, small multiples, faceting
- axis ticks, scales, legends, tooltips
- data-driven SVG output for a report or web page
- converting data to a static SVG or HTML visualization
If the user only needs a quick table or summary, don’t use D3—use a spreadsheet or plain markdown instead.
Inputs you should expect
- One or more local data files:
*.csv,*.tsv,*.json - A chart intent:
- chart type (or you infer the best type)
- x/y fields and aggregation rules
- sorting/filtering rules
- dimensions (width/height) and margins
- color rules (categorical / sequential)
- any labeling requirements (title, axis labels, units)
- Output constraints:
- “static only”, “no animation”, “must be deterministic”, “offline”, etc.
If details are missing, make reasonable defaults and document them in comments near the top of the output file.
Outputs you should produce
Prefer producing all of the following when feasible:
dist/chart.html— standalone HTML that renders the visualizationdist/chart.svg— exported SVG (stable and diff-friendly)- (Optional)
dist/chart.png— if the task explicitly needs a raster image
Always keep outputs in a predictable folder (default: dist/), unless the task specifies paths.
Determinism rules (non-negotiable)
To keep results stable across runs and machines:
Data determinism
- Sort input rows deterministically before binding to marks (e.g., by x then by category).
- Use stable grouping order (explicit
Array.from(grouped.keys()).sort()). - Avoid locale-dependent formatting unless fixed (use
d3.format,d3.timeFormatwith explicit formats).
Rendering determinism
- No randomness: do not use
Math.random()ord3-random. - No transitions/animations by default (transitions can introduce timing variance).
- Fixed
width,height,margin,viewBox. - Use explicit tick counts only when needed; otherwise rely on D3 defaults but keep domains fixed.
- Avoid layout algorithms with non-deterministic iteration unless you control seeds/iterations (e.g., force simulation). If a force layout is required:
- fix the tick count,
- fix initial positions deterministically (e.g., sorted nodes placed on a grid),
- run exactly N ticks and stop.
Offline + dependency determinism
- Do not load D3 from a CDN.
- Pin D3 to a specific version (default: d3@7.9.0).
- Prefer vendoring a minified D3 bundle (e.g.,
vendor/d3.v7.9.0.min.js) or bundling with a lockfile.
File determinism
- Stable SVG output:
- Avoid auto-generated IDs that may change.
- If you must use IDs (clipPath, gradients), derive them from stable strings (e.g.,
"clip-plot"). - Use LF line endings.
- Keep numeric precision consistent (e.g., round to 2–4 decimals if needed).
Recommended project layout
If the task doesn't specify an existing structure, use:
Interactive features (tooltips, click handlers, hover effects)
When the task requires interactivity (e.g., tooltips on hover, click to highlight):
Tooltip pattern (recommended)
- Create a tooltip element in HTML:
- Style with CSS using
.visibleclass for show/hide:
- Add event handlers to SVG elements:
Key points:
- Use
opacity: 0by default (notdisplay: none) for smooth transitions - Use
.classed('visible', true/false)to toggle visibility pointer-events: noneprevents tooltip from blocking mouse events- Position tooltip relative to mouse with
event.pageX/pageY
Click handlers for selection/highlighting
CSS for highlighting:
Conditional interactivity
Sometimes only certain elements should be interactive:
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdata/skillsbench/tasks/data-to-d3/environment/skills/d3-visualization/SKILL.md
Popularity
- Repository stars
- 56
- Repository forks
- 3
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/xuansenpa1/skillrevise/d3-visualization)