D3
D3.js is a JavaScript library for manipulating documents based on data.
18th July 2022
Time to read: 1 min
Data Visualisation
Computer-based visualisation systems provide visual representations of datasets designed to help people carry out tasks more effectively.
Install
npm install d3
D3 is written using ES2015 modules. Create a custom bundle using Rollup, Webpack, or your preferred bundler. To import D3 into an ES2015 application, either import specific symbols from specific D3 modules:
import {scaleLinear} from "d3-scale";
Or import everything into a namespace (here, d3
):
import * as d3 from "d3";
You can also import individual modules and combine them into a d3
object using Object.assign:
const d3 = await Promise.all([
import("d3-format"),
import("d3-geo"),
import("d3-geo-projection")
]).then(d3 => Object.assign({}, ...d3));