Skip to content
Search

D3.js

lastmod 2021-07-09created 2021-02-254 edits

D3.js (D3 or Data-Driven Documents) is a JavaScript library for building dynamic, interactive information visualizations in web browsers. D3.js, a library from Protovis, is an information visualization library implemented on web standards such as SVG, HTML5, and CSS. Version 2.0.0 was released in August 2012, and 4.0.0 was released in June 2016.

The data visualization company Datameer officially uses D3.js as a core technology, and The New York Times has been using D3.js to produce interactive articles. OpenStreetMap's iD editor also uses D3.js. It also supports GeoJSON and Topojson, so it is used to display maps on the web as well.

API structure

The D3.js API has hundreds of functions, which can be grouped into the following logical units:

  • Selections
  • Transitions
  • Arrays
  • Math
  • Color
  • Scales
  • SVG
  • Time
  • Layouts
  • Geography
  • Geometry
  • Behaviors

What I learned from 10 years of developing the open-source visualization library d3.js

  • 10 Years of Open-Source Visualization / Mike Bostock / Observable
  • The most important thing in building a tool is teaching how to use it. Of all forms of documentation, examples are the most effective
  • Supporting users is a powerful research tool. Helping them lets you find defects quickly. But you can't help everyone, so don't make that the goal
  • Beware of impractical flourishes: technically pretty things like interaction/animation come at a cost. Focus on the static form above all
  • Visualization is a spectrum from exploration to explanation. Not every visualization serves the same purpose, so when designing, figure out where on the spectrum you are
  • In most cases, 80% of visualization work should be handling data. Visualization is the end result of analysis. d3-array and d3-dsv are used the most, and it's great to see tools like tidy.js and Arquero appear
  • Don't commit to a particular visualization form before actually putting the data in
  • 10% of the code causes 90% of the bugs
  • No matter how good your work is, someone on the internet will say something hurtful and you'll feel bad
  • Don't go alone. Find a team that can provide validation, feedback, support, and mentoring
  • Have a good time. If you enjoy it, you'll have fewer regrets even when you fail.

See also

Favorite site

author Zer0 sitemap