d3-viz

Create interactive data visualisations using d3.js with fine-grained control over SVG elements and transitions.

250|25|Updated Oct 17, 2025
Ready to run
npx skills add https://github.com/chrisvoncsefalvay/claude-d3js-skill --skill d3-viz-chrisvoncsefalvay
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: d3-viz
Source: https://github.com/chrisvoncsefalvay/claude-d3js-skill
Command: npx skills add https://github.com/chrisvoncsefalvay/claude-d3js-skill --skill d3-viz-chrisvoncsefalvay

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires d3, and includes references (resource) and assets (resource) components.

What problem does it solve? Building custom, publication-quality data visualisations that standard charting libraries cannot provide requires deep knowledge of SVG manipulation, data binding, and coordinate transforms. This Skill eliminates the constraint of pre-built chart types and enables bespoke visualisations with smooth interactions and precise visual encodings. ## Core Features & Use Cases - Custom Chart Types: Create novel visualisations beyond standard bars, lines, and pie charts (chord diagrams, hierarchies, network graphs, heatmaps). - Interactive Exploration: Implement pan, zoom, brush, and tooltip interactions with smooth transitions. - Multi-Framework Support: Works in vanilla JavaScript, React, Vue, Svelte, and other environments. - Use Case: You need to visualise customer flow through a funnel with animated transitions and hover tooltips showing conversion rates at each step. Standard charting libraries cannot replicate this exact layout and animation. Use d3.js to bind the data, define custom shapes, and choreograph transitions frame-by-frame. ## Quick Start Create an interactive scatter plot with d3 by defining scales for your data, binding data points to circle elements, and adding axis labels and tooltip interactions.

Frequently Asked Questions about d3-viz

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a bar chart with d3.js?▼

Define a band scale for categories and a linear scale for values, then use d3.selectAll to bind data to rectangle elements. Set x, y, width, and height attributes based on scale transformations. Add axes using d3.axisBottom and d3.axisLeft to complete the chart.

What is the difference between Pattern A and Pattern B for d3 integration?▼

Pattern A uses d3 to directly manipulate DOM elements and is recommended for complex visualisations with transitions and interactions. Pattern B uses d3 only for calculations (scales, layouts) and renders elements via your framework, better for simpler charts and framework-preferred declarative rendering.

How do I make a d3 visualisation responsive to container size?▼

Use window resize listeners or ResizeObserver to monitor container dimensions, then update SVG width and height attributes and redraw the visualisation. Call this on initial load and whenever the container resizes to maintain responsiveness.

Can d3.js visualisations work in React and Vue?▼

Yes, d3 works in any JavaScript environment. Use refs in React or template refs in Vue to access the SVG element, then apply d3 selections and manipulations. Manage state separately from d3's DOM updates to avoid conflicts.

What scales should I use for geographic visualisations?▼

Use d3.geoMercator for general maps or d3.geoAlbersUsa for US-specific projections. Set the domain to your GeoJSON feature collection and fit size to your SVG dimensions using fitSize for automatic centering and scaling.

Why are my d3 transitions not animating smoothly?▼

Ensure you call .transition() before changing attributes, use appropriate durations (500-1000ms for typical animations), and verify that elements have unique keys in data binding for proper object constancy across updates.