D3: .scaleOrdinal(d3.schemeCategory10): Categorical Ordinal Scale

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

nick3499
1 min readMar 2, 2017
  • d3.scaleOrdinal(d3.schemeCategory10) is a v4 method which requires the d3.v4.min.js library. D3.js categorical scales map integers to colors, e.g. sequential zero-based integer keys with a color assigned to each key .Replacing v3’s d3.scale.category10().
  • .attrs({}) is a v4 method containing multiple attribute tuples which requires the d3-selection-multi.v1.min.js plugin, e.g. .attrs({width: 200, height: 20}). Replacing v3’s .attr({}) method containing multiple tuples.

Adapted v4 script above. Original v3 script below.

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

--

--

nick3499
nick3499

Written by nick3499

coder of JavaScript and Python

No responses yet