9
Scales
A data visualization is a scaled representation of data. To encode data in visual artifacts, you map arbitrary values to graphical aspects, such as pixel dimensions, areas, colors, and other visual representations. This can be achieved with scales – functions that convert values from one dimension to another.
The d3-scale module, explored in this chapter, provides generators for reusable scaling functions. They can be used to expand or shrink a domain so that it fits in the output range of an SVG viewport, or convert values to dates and colors using interpolation, quantizing, or discrete mapping. These include continuous scales, such as linear, exponential, and logarithmic scales, interpolated scales frequently used for color schemes, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access