Migrating to Version 4 of D3, part 1

Kristin Henry
8 min readAug 14, 2016

At a recent Bay Area D3 User Group meetup, I gave a short talk on migrating to the new version of D3. I highlighted some of the changes in the version of D3 and shared a simple case study, with the hopes of helping others get started out.

This article is a slightly modified and expanded version of my talk.

There are so many changes in the new version of D3 that it’s just not possible to cover them all in a short discussion. So I’ll cover a few things that stood out to me as particularly useful.

The new version is full of big changes, and it’s not backward compatible. For a full list of changes, go to the source! There is extensive documentation on the changes in D3.

You could group the changes into three main types:

  • Changes to names → “the great namespace flattening”
  • Modular Library + NPM
  • Lots of Minor and Major restructuring, and additions

“The great namespace flattening”

Renaming (flattening) methods → Bunch of little changes, that you can’t ignore.

d3.random.normal --> d3.randomNormald3.random.logNormal --> d3.randomLogNormald3.scale.linear --> d3.scaleLinear

Modular Library + NPM

Big change. Can ignore this… for now.

--

--

Kristin Henry
Kristin Henry

Written by Kristin Henry

Generative and Data Artist. Creative Coder. Data Visualization Consultant. Founder of GalaxyGoo. http://kristinhenry.github.io/ Admin on vis.social

No responses yet