From the course: D3.js Essential Training

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Using color scales

Using color scales

- [Narrator] Imagine this map without color. We often use color to express data. Now we're going to explore D3's vast offering of color scales, including predefined arrays of color. Here the data are randomly generated. You select whether the data are sequential, diverging or qualitative, and you can click this info button to see what each means. And the site suggests different color palettes for you depending on which of the three selections you've made. Now this map is incredibly influential because Cynthia Brewer and colleagues came up with the map and the coloring, and it is what lies behind D3's selection of color scales. Okay, so it's worth investing some time in understanding this site. Let's just go through it quickly. Sequential color schemes are suitable when the data can be ordered and where darker colors represent higher values or values of interest. So typically low values are of less interest and the high values are of more interest. So we are drawing the user's…

Contents