d3-viz

Create custom interactive data visualisations with d3.js in any JavaScript environment.

Updated Jul 16, 2026
One-click install
npx skills add https://github.com/X-manist/Cohmira --skill d3-viz-x-manist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: d3-viz
Source: https://github.com/X-manist/Cohmira/tree/main/src/builtin-plugins/openmontage/.agents/skills/d3-viz
Command: npx skills add https://github.com/X-manist/Cohmira --skill d3-viz-x-manist

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Standard charting libraries limit you to predefined chart types, making it hard to build bespoke visualisations with custom layouts, transitions, or interactions. This Skill provides structured guidance and code patterns for building publication-quality, interactive visualisations with d3.js. ## Core Features & Use Cases - Custom Chart Patterns: Ready-to-adapt code for bar, line, scatter, pie, heatmap, chord, treemap, sunburst, force-directed network, and geographic visualisations. - Interactivity & Animation: Patterns for tooltips, zoom, pan, brush selection, drag, and smooth transitions with staggered or chained animations. - Scales & Colour Guidance: Detailed references covering linear, log, time, band, ordinal, sequential, and diverging scales, plus colour-blind-safe palette recommendations. - Use Case: A developer needs a force-directed network diagram with drag interactions and tooltips inside a React dashboard. The Skill provides the integration pattern, simulation setup, and event handling code to build it directly. ## Quick Start Ask the AI to create an interactive bar chart with tooltips and responsive sizing using d3.js for your dataset.

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?

Use d3.scaleBand for the categorical x-axis and d3.scaleLinear for the value y-axis, then bind data to rect elements with the join pattern. Set each rect's x, y, width, and height from the scales, and append axes with d3.axisBottom and d3.axisLeft.

How to use d3.js with React?

Two patterns work: let d3 manipulate the DOM directly inside a ref and effect, or use d3 only for calculations like scales and layouts while React renders the elements declaratively. Use direct DOM manipulation for complex transitions and interactions.

When should I use d3.js instead of a charting library?

Use d3.js for custom visual encodings, force-directed networks, geographic projections, choreographed transitions, or chart types unavailable in standard libraries. For 3D visualisations, use Three.js instead, as d3 is not designed for that.

Why are my d3 axes not appearing?

Axes fail when scale domains contain NaN or invalid values, when the axis is appended to the wrong group, or when transform translations are incorrect. Validate your data first and verify the axis group is appended inside the margined container.

How do I make a d3 chart responsive to window resizing?

Attach a window resize listener or a ResizeObserver to the container, read its bounding rectangle, update the SVG width and height attributes, and redraw the visualisation with the new dimensions. Return a cleanup function to remove the listener.

What colour scale should I use for colour-blind-safe d3 visualisations?

Use d3.interpolateViridis or d3.interpolateCividis for sequential data, d3.interpolatePuOr or d3.interpolateBrBG for diverging data, and the Okabe-Ito palette for categorical data. Avoid red-green combinations, which affect roughly 8% of males.