From the course: D3.js Essential Training for Data Scientists

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Introducing other scales

Introducing other scales - D3.js Tutorial

From the course: D3.js Essential Training for Data Scientists

Start my 1-month free trial

Introducing other scales

- [Instructor] I want to show you a few scales and axes that are available to you, even though we won't dwell on them in the course. We've looked at linear, time series, and ordinal scales, and these are by far the most commonly used. But D3 has several other scales that can save you a great deal of effort. It's easiest to demonstrate this with a block. This block uses version three, not version four, but it shows us the same principle by showing axes that are based on different scales. So this is a linear scale, where all the parts are evenly spaced, and this is a logarithmic scale, which defaults to base ten but can be changed. This is a natural logarithm. And then we have power scales, first square root and then squared. D3 supports all of these scales, saving you having to write your own functions. As well as plain linear scales, we have quantile, quantize and threshold scales. Quantile is probably the most familiar. If you have a distribution of data, you might divide your…

Contents