PACKAGE · CHARTS

d3

Data-Driven Documents

WEEKLY DOWNLOADS 35.2M
STARS 114.0K
FORKS 22.6K
OPEN ISSUES 26
GZIP SIZE 95.7 kB
UNPACKED SIZE 881.5 kB
DEPENDENCIES 31
LAST UPDATED 1y ago
DOWNLOAD TRENDS

d3 downloads · last 12 months

Download trends for d31 download series from Nov 2025 to Oct 2026. Use left and right arrow keys to inspect monthly values.027.2M54.4M81.6M108.8MNov 2025FebMayAugOct 2026
d3
ABOUT D3

D3 is a JavaScript library for creating data visualizations, including charts and interactive graphics rendered with SVG. It addresses the work of mapping data to visual elements and coordinating changes as data or user interactions change, rather than providing a fixed set of chart components.

D3’s approach is to compose focused tools for working with data, visual encodings, shapes, layouts, and interaction. This suits developers who want to define a visualization’s appearance and behavior directly, and who are comfortable making decisions about scales, axes, marks, and updates instead of selecting a prebuilt chart configuration.

A typical D3 workflow binds data to document elements and uses selections to create, update, or remove those elements. APIs such as scales, shape generators, axes, and layouts support common visualization tasks, while event handling enables interactive views; these pieces can be combined for a particular chart rather than requiring one chart-specific component.

D3 can be used in browser projects that render SVG and can be integrated with UI frameworks by letting D3 calculate geometry or manage a clearly bounded part of the document. It also fits workflows that need custom chart behavior, direct control over SVG output, or multiple coordinated views, though framework integrations should define which system owns DOM updates.

The supplied package data lists version 7.9.2, an unpacked size of 881.5 kB, and a gzip bundle size of 95.7 kB, so the full package has a meaningful inclusion cost. Its 32.0M weekly downloads, 113.9K GitHub stars, 22.7K forks, and 21 open issues indicate a mature, actively used project; the listed license is ISC.

D3 does not remove the need to design chart semantics, layout, accessibility, or responsive behavior, and its lower-level approach can require more implementation work than a ready-made chart component. Its broad set of capabilities can also make selective imports and bundle inspection important when an application uses only a narrow part of the library.

WHEN TO USE
  • Build a custom SVG chart by binding records to elements with selections, then using scales and shape generators to map values into marks.
  • Create axes that correspond to your chosen scales with D3 axis APIs, especially when tick placement or formatting must match a bespoke chart design.
  • Generate layouts for visual forms such as hierarchical or network-style views when D3’s layout and geometry APIs fit the data structure.
  • Add chart interactions such as hover, click, or drag behavior through D3 event handling and update the affected SVG elements in response.
  • Coordinate multiple views from shared data by reusing scales, selections, and data transformations across separate SVG regions.
  • Use D3 alongside a UI framework when the framework owns application state and D3 is limited to calculating visualization geometry or updating a defined SVG subtree.
WHEN NOT TO USE
  • Choose a ready-made chart component if the required output is a standard chart and you do not need direct control over SVG marks, scales, or interaction behavior.
  • Avoid handing the same SVG subtree to both D3 and a UI framework; assign DOM ownership to one system or constrain D3 to a clearly isolated region.
  • Avoid the full package when a 95.7 kB gzip bundle is outside your budget; inspect imports and include only the D3 functionality the visualization uses.
  • Use a table or accessible text presentation instead of an SVG visualization when readers must compare exact values and chart interaction would obstruct that task.
  • Avoid D3’s lower-level APIs if the team cannot maintain custom chart geometry, axes, updates, and responsive behavior; use a higher-level charting approach instead.
  • Do not rely on D3 alone to establish accessible chart meaning; provide labels, descriptions, and an equivalent non-visual way to understand the data.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 8
d3 vs recharts ★ 27.8K · 68.7M/wk d3 vs chart.js ★ 67.8K · 17.7M/wk d3 vs highcharts ★ 241 · 3.6M/wk d3 vs echarts ★ 67.8K · 11.2M/wk d3 vs @joint/core ★ 5.4K · 78.9K/wk d3 vs @progress/kendo-react-charts ★ 241 · 51.4K/wk d3 vs @nivo/core ★ 14.1K · 2.1M/wk d3 vs @visx/visx ★ 21.1K · 129.1K/wk