D3: .scaleBand, .rangeRound: Ordinal Scale with Range Bands

Forked script below was converted from D3.js v3 to v4.

nick3499
1 min readMar 2, 2017

Comparing the two gists embedded below:

  • v4’s .scaleBand() replaced .scale.ordinal().
  • v4’s .rangeRound() replaced v3’s .rangeRoundBands().
  • v4’s console.log(bands.bandwidth()) replaced v3’s console.log(bands.rangeBand()).

Forked script above was based on v4. Original script below was based on v3.

D3.js 3.5.17 seems to have a similar existence to Python 2.7.13. Maintained to avoid alienating v3 users.

--

--

nick3499
nick3499

Written by nick3499

coder of JavaScript and Python

No responses yet