D3 Ordinal Scales
  Duration: 13:01
Part of Course: Introductory D3 Course
This Lesson is for subscribers

D3-ordinal-scales_280x158
Unlock this lesson NOW!
  • Get expert advice on D3 Ordinal Scales
  • Enjoy access to the complete DashingD3js catalog
  • Start mastering D3.js right now!

Takeaways:

  • D3 provides three types of functions that map an input domain to an output range - D3 Quantitative Scales, D3 Ordinal Scales, and D3 Time Scales
  • The D3 Ordinal Scales are for discreet domains, such as sets of things or categories
  • The D3 Ordinal Scale, d3.scale.ordinal(), constructs a new ordinal scale with an empty domain and an empty range
  • The D3 Ordinal Scale is invalid until an output range is specified
  • The D3 Ordinal Scale comes with built in functionality to work with ranges, rangePoints, rangeBands, and RangeRoundBands which allow for very specific subdivision of the output interval of the scale
  • D3 comes with several Ordinal scales specifically constructed for colors - d3.scale.category10(), d3.scale.category20(), d3.scale.category20b(), and d3.scale.category20c
  • The D3 category10 scale comes with 10 categorical colors already chosen for you
  • The D3 category20 scales come with 20 categorical colors already chosen for you

This Transcript is for subscribers.

D3-ordinal-scales_280x158
Unlock this D3 Tutorial NOW!
  • Get expert advice on D3 Ordinal Scales
  • Enjoy access to the complete DashingD3js catalog
  • Start mastering D3.js right now!
<< Back To D3 Screencast and Written Tutorials Index