This video discusses why colors are scales, including D3 built-in color scales.
- [Instructor] In D3, we often use color to express data.…For example, a darker color might mean a higher value…or red might mean one thing and green another.…In cases where color is a range,…it's appropriate to use a scale,…since a scale just translates values from one range…into values in another.…We're just going to look quickly at some of the color ranges…that D3 provides for us automatically.…There are eight here: interpolate warm, interpolate cool,…interpolate rainbow, that's the one…we're going to be using shortly.…
You can see there's a few of them.…Now actually, you can generate…your own custom ranges as you see fit,…but for now we're going to use interpolate rainbow…because it's got the greatest number of quite bright colors.…So what we're going to do, back in our shapes file,…is color our rectangles using one of those color ranges.…The first thing to do is to declare a new color scale.…And we're going to say…var rainbow equals d3.scaleSequential().domain().…
Color scales, sequential scales, work a bit differently…
- Making a simple bar chart with D3
- Understanding SVG graphics
- Drawing basic shapes
- Adding text
- Using generators and the path element
- Creating a scale and axes
- Importing data into D3
- Creating trees and Voronoi tessellations
- Preparing your data for advanced graphics
- Adding interactivity and transitions
- Choosing the right graphic
- Finding D3.js plugins
Skill Level Intermediate
2. Making a Simple Bar Chart with D3
3. Basic Shapes, Courtesy of SVG
4. Advanced Shapes, with D3 and Path
5. Scales and Axes
6. Importing Data into D3
7. Additional Graphics with D3 Layout
8. Preparing Your Data for Advanced Graphics
10. Picking the Right Graphic
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.