30
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill lyndonkl/claude --skill d3-visualization- SKILL.md14.6 KB
Overview
This skill helps you build custom, interactive data visualizations with D3.js when you need low-level control over DOM, scales, shapes, layouts, and interactions. It is focused on creating bar/line/scatter charts from scratch, network graphs, hierarchies, and geographic maps, plus handling live updates and animated transitions. Use it when charting libraries cannot express your specific design or interaction requirements.
How this skill works
The skill provides step-by-step workflows and reusable patterns: set up an SVG container, create appropriate scales and axes, bind data with D3’s data join pattern, and generate shapes with path generators and layout algorithms. It includes update functions for rebinding new data with transitions, plus advanced layouts (force simulations, treemaps, geo projections) and interaction handlers (zoom, pan, drag, brush). Practical code snippets cover scales, joins, transitions, and common templates.
When to use it
- You need a bespoke visual design unsupported by chart libraries
- Building network diagrams, hierarchical layouts, or geographic maps
- Animating data changes and smooth transitions between states
- Creating linked views, brushes, zoom/pan, or custom drag behaviors
- Updating charts in real time or responding to complex data transforms
Best practices
- Encapsulate rendering in an update(data) function to handle changes cleanly
- Use appropriate scale types (scaleBand, scaleTime, scaleLinear) and recompute domains on updates
- Provide key functions in data joins to preserve object constancy during transitions
- Limit DOM elements or aggregate very large datasets for performance (>10k points)
- Separate layout computation from rendering; run heavy calculations off the main tick when possible
Example use cases
- Custom dashboard with linked bar chart, scatter plot, and brush selection
- Force-directed network visualization with draggable nodes and collision handling
- Time-series line chart with animated transitions and live streaming updates
- Choropleth map using GeoJSON with zoom, pan, and projection fitting
- Treemap or pack layout for visualizing hierarchical disk usage or organizational structure
FAQ
Choose D3 when you need fine-grained control over DOM, bespoke layouts (networks, trees, maps), custom interaction patterns, or animation details that higher-level chart libraries don’t expose.
How do I handle updates with animated transitions?
Encapsulate rendering in an update function, rebind data with a key function, update scale domains, and use selection.join() with .transition() to animate enter/update/exit changes.