D3.js: Interactive Data Visualizations

VerifiedSafe

Assists with building custom interactive data visualizations using D3.js, a low-level JavaScript library for binding data to DOM elements.

Sby Skills Guide Bot
DevelopmentIntermediate
7/28/2026
Claude CodeCursorWindsurfCodex
#d3#data-visualization#svg#interactive-charts#javascript

Recommended for

Automated summary

Guides the building of custom interactive D3.js data visualizations — scales, axes, shape generators, force simulations and hierarchical layouts — including React integration.

Strengths

  • Covers the end-to-end D3 workflow, from data binding with .join() through axes, shape generators (line, arc, pie, stack) and layouts (treemap, force, geoPath)
  • Gives explicit rules for picking scale types and deriving domains from the data with d3.extent()
  • Covers interactivity in detail: 750 ms transitions, tooltips, drag, zoom and brushing
  • Provides a clear React integration pattern (D3 for math, React for the DOM) plus responsiveness and accessibility guidance

Limitations

  • No runnable code samples; the guidance is instructional rather than copy-paste implementations
  • Assumes familiarity with the D3 v6+ API and SVG — it is not a beginner tutorial
  • Does not address dependency setup, testing, or performance tuning on large datasets
When to use it

Use it when you need bespoke charts, maps or network graphs with fine-grained control that off-the-shelf charting libraries cannot provide.

When not to use it

Skip it for standard business charts where a high-level library like Chart.js or Recharts is faster, or if you are not comfortable with SVG and core D3 concepts.

Security analysis

Safe
Quality score87/100

The skill is a pure instructional reference for using D3.js. It declares no tools, contains no executable snippets that touch the filesystem, network, or credentials, and involves no obfuscation or safety-disabling behavior. The only code mentioned is ordinary D3 API usage described in prose, so there is no meaningful execution risk in listing it.

No concerns found

How this analysis is made

Examples

React dashboard with shared scales
Build a responsive React dashboard from this API response: a time-series line chart with area fill and a grouped bar chart, sharing d3.scaleTime and d3.scaleLinear scales and regenerating the axes on resize.
Force-directed network graph
Create a force-directed network graph of these entity relationships using d3.forceSimulation with forceManyBody, forceLink and forceCenter — nodes as circles colored by category with d3.scaleOrdinal, draggable via d3.drag, plus zoom/pan and hover tooltips.
Choropleth map with tooltips
Make a choropleth map of these country values using d3.geoPath with a sequential color scale, and format the hover tooltip numbers with d3.format(',.0f').

name: d3 description: >- Assists with building custom interactive data visualizations using D3.js. Use when creating charts, graphs, maps, force layouts, or hierarchical diagrams that require fine-grained control beyond what charting libraries provide. Trigger words: d3, data visualization, chart, svg, scales, force graph, treemap, choropleth. license: Apache-2.0 compatibility: "No special requirements" metadata: author: terminal-skills version: "1.0.0" category: design tags: ["d3", "data-visualization", "charts", "svg", "interactive"]

D3.js

Overview

D3.js is a low-level JavaScript library for building custom, interactive data visualizations by binding data to DOM elements. It provides scales, axes, shape generators, geographic projections, force simulations, and hierarchical layouts, giving developers full control over the visual output while integrating with React through computed scales and layouts.

Instructions

  • When binding data, use .data(dataset).join("element") (D3 v6+) for the enter/update/exit pattern, setting attributes and styles from bound data via accessor functions.
  • When creating scales, choose the appropriate type (scaleLinear for continuous, scaleBand for categorical bars, scaleTime for dates, scaleOrdinal for color mapping) and always set domain from the data using d3.extent().
  • When building axes, create them with d3.axisBottom(scale) or d3.axisLeft(scale), configure ticks and format labels with d3.format(), and regenerate on resize.
  • When creating chart types, use shape generators (d3.line(), d3.area(), d3.arc(), d3.pie(), d3.stack()) and layout functions (d3.treemap(), d3.forceSimulation(), d3.geoPath()) for complex visualizations.
  • When adding interactivity, use transitions (.transition().duration(750)) for smooth data updates, tooltips on hover, and brushing/zooming for exploration.
  • When integrating with React, use D3 for math (scales, layouts, data transforms) and React for DOM rendering, computing values in useMemo and using useEffect with refs for D3-driven animations.

Examples

Example 1: Build a real-time dashboard with multiple chart types

User request: "Create a dashboard with line charts, bar charts, and a pie chart from API data"

Actions:

  1. Set up shared scales with d3.scaleTime() for the x-axis and d3.scaleLinear() for the y-axis
  2. Build a line chart using d3.line() with smooth curve interpolation and area fill
  3. Build a grouped bar chart using d3.scaleBand() with staggered enter transitions
  4. Build a donut chart using d3.pie() and d3.arc() with hover tooltips

Output: A responsive dashboard with animated charts that update smoothly when data changes.

Example 2: Create a force-directed network graph

User request: "Visualize relationships between entities as an interactive network graph"

Actions:

  1. Set up d3.forceSimulation() with forceManyBody, forceLink, and forceCenter
  2. Render nodes as circles with d3.scaleOrdinal() coloring by category
  3. Add drag interaction with d3.drag() to reposition nodes
  4. Implement zoom and pan with d3.zoom() and tooltips on hover

Output: An interactive force-directed graph with draggable nodes, color-coded categories, and zoom navigation.

Guidelines

  • Use D3 for scales, layouts, and data processing; let React handle DOM rendering in React apps.
  • Use .join() instead of manual enter/update/exit for simpler, cleaner data binding.
  • Always set scale domains from data (d3.extent()) rather than hardcoding ranges.
  • Use d3.format() for axis labels and tooltips: ",.0f" for thousands, "$.2f" for currency.
  • Add transitions of 750ms with easeCubicInOut for smooth data update animations.
  • Make visualizations responsive by recalculating scales on ResizeObserver callbacks.
  • Add aria-label to SVG elements and meaningful <title> tags for accessibility.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/d3-js-interactive-data-visualizations-ms47vpfb/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/d3-js-interactive-data-visualizations-ms47vpfb' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/d3-js-interactive-data-visualizations-ms47vpfb/download' --output '.skill-downloads/d3-js-interactive-data-visualizations-ms47vpfb/SKILL.md.part' && mv '.skill-downloads/d3-js-interactive-data-visualizations-ms47vpfb/SKILL.md.part' '.skill-downloads/d3-js-interactive-data-visualizations-ms47vpfb/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Environment declared by the author: No special requirements

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/d3-js-interactive-data-visualizations-ms47vpfb/SKILL.md' && test -s '.skill-downloads/d3-js-interactive-data-visualizations-ms47vpfb/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/d3' && cp -R '.skill-downloads/d3-js-interactive-data-visualizations-ms47vpfb' '.claude/skills/d3'

Cursor
test -f '.skill-downloads/d3-js-interactive-data-visualizations-ms47vpfb/SKILL.md' && test -s '.skill-downloads/d3-js-interactive-data-visualizations-ms47vpfb/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/d3' && cp -R '.skill-downloads/d3-js-interactive-data-visualizations-ms47vpfb' '.cursor/skills/d3'

Codex
test -f '.skill-downloads/d3-js-interactive-data-visualizations-ms47vpfb/SKILL.md' && test -s '.skill-downloads/d3-js-interactive-data-visualizations-ms47vpfb/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/d3' && cp -R '.skill-downloads/d3-js-interactive-data-visualizations-ms47vpfb' '.agents/skills/d3'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/d3-js-interactive-data-visualizations-ms47vpfb'

openskills read 'd3-js-interactive-data-visualizations-ms47vpfb'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/d3-js-interactive-data-visualizations-ms47vpfb/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills