D3.js
D3.js (also known as D3, short for Data-Driven Documents) is a JavaScript library for producing dynamic, interactive data visualizations in web browsers.[src] It makes use of Scalable Vector Graphics (SVG), HTML5, and Cascading Style Sheets (CSS) standards.[src] It is the successor to the earlier Protovis framework.[src] Its development was noted in 2011, as version 2.0.0 was released in August 2011.[src] With the release of version 4.0.0 in June 2016, D3 was changed from a single library into a collection of smaller, modular libraries that can be used independently.[src]
D3.js (also known as D3, short for Data-Driven Documents) is a JavaScript library for producing dynamic, interactive data visualizations in web browsers.[src] It makes use of Scalable Vector Graphics (SVG), HTML5, and Cascading Style Sheets (CSS) standards.[src] It is the successor to the earlier Protovis framework.[src] Its development was noted in 2011, as version 2.0.0 was released in August 2011.[src] With the release of version 4.0.0 in June 2016, D3 was changed from a single library into a collection of smaller, modular libraries that can be used independently.[src] d3.selectAll("p") // select all elements .style("color", "lavender") // set style "color" to value "lavender" .attr("class", "squares") // set attribute "class" to value "squares" .attr("x", 50); // set attribute "x" (horizontal position) to value 50px The selection can be based on an HTML tag, class, identifier, attribute, or place in the hierarchy.[src] Once elements are selected, one can apply operations to them.[src] This includes getting and setting attributes, display texts, and styles (as in the above example).[src] Elements may also be added and removed.[src] This process of modifying, creating and removing HTML elements can be made dependent on data, which is the basic concept of D3.js.[src] d3.selectAll("p") // select all elements .transition("trans_1") // transition with name "trans_1" .delay(0) // transition starting 0ms after trigger .duration(500) // transitioning for 500ms .ease(d3.easeLinear) // transition easing progression is linear...[src] .style("color", "pink"); // ...[src] to color: pink // Data var countriesData = [ { name: "Ireland", income: 53000, life: 78, pop: 6378, color: "black" }, { name: "Norway", income: 73000, life: 87, pop: 5084, color: "blue" }, { name: "Tanzania", income: 27000, life: 50, pop: 3407, color: "grey" } ]; // Create SVG container var svg = d3.select("#hook").append("svg") .attr("width", 120) .attr("height", 120) .style("background-color", "#D0D0D0"); // Create SVG elements from data svg.selectAll("circle") // create virtual circle template .data(countriesData) // bind data .join("circle") // joins data to the selection and creates circle elements for each individual data .attr("id", function(d) { return d.name }) // set the circle's id according to the country name .attr("cx", function(d) { return d.income / 1000 }) // set the circle's horizontal position according to income .attr("cy", function(d) { return d.life }) // set the circle's vertical position according to life expectancy .attr("r", function(d) { return d.pop / 1000 * 2 }) // set the circle's radius according to country's population .attr("fill", function(d) { return d.color }); // set the circle's color according to country's color Generated SVG graphics are designed according to the provided data.[src] ==Community== D3.js is a popular toolset used by many individuals and organizations for data visualization.[src] Some organizations that use it include The New York Times, Airbnb, and MTV.[src] Mike Bostock created bl.ocks as a website for sharing D3 visualizations and code snippets, which used GitHub Gist to host the code.[src] He later created Observable as a place where programmers could make and share visualizations.[src] (Similar to bl.ocks but the code is all hosted on the observable site).[src] There are also D3 communities on many programming sites like CodePen.[src] ==References== ==Related projects== The Vega and Vega-Lite visualisation grammars are a declarative visualization specification built on parts of D3.js.[src] ==External links== D3.js Gallery , search for blocks by methods used D3 "reusable chart" libraries: C3 https://c3js.org Plotly https://plot.ly/javascript bl.ock.org and blockbuilder.org: popular early gallery system.[src] Observablehq.com : main D3js playground.[src]
27 sentences · 27 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"D3.js." encyclopegia.org, 2026, https://encyclopegia.org/wiki/d3-js. Accessed 28 November 2026.
Chicago
"D3.js." encyclopegia.org. Accessed November 28, 2026. https://encyclopegia.org/wiki/d3-js.
APA
encyclopegia.org. (2026). D3.js. Retrieved November 28, 2026, from https://encyclopegia.org/wiki/d3-js
Accessed November 28, 2026 · CC BY-SA 4.0 · citation page · JSON
Claims
| Predicate | Value | Source |
|---|---|---|
| release date | 2011 | Wikipedia |