Scale
A visualization scale maps data values to visual values such as positions, colors, or sizes.
D3.js in Action, Third Edition
A scale maps data values to visual values such as size, color, or screen position.
- How it is used
- Translates prepared data into visual attributes while constructing D3 charts.
- How deep it goes
- Defines domains, ranges, continuous values, and discrete values, then demonstrates scaleLinear without covering every scale family.
- Examples
- Uses bar charts, TV-series ratings, gendered salary box plots, scatterplots, and a scaleLinear mapping from 0–200 to 0–20.
- What you can do after
- Apply it via D3 by configuring a domain and range, evaluating the scale, and assigning outputs to chart attributes.
Data Storytelling with Altair and AI
A visualization scale maps data values to visual values such as positions, colors, or sizes.
- How it is used
- Maps data values to visual outputs, especially colors, while constructing readable Altair charts.
- How deep it goes
- Defines domains, ranges, and schemes with examples, but stops short of explaining scale internals.
- Examples
- Uses category-colored bars, quantitative blue-to-red mappings, and country lines colored with the set2 scheme.
- What you can do after
- Apply it via Altair to configure color palettes, domains, and ranges for encoded chart values.
Read how Data Storytelling with Altair and AI explains scale →
Related concepts
- range()configured by · range() is a visualization-scale method or parameter that sets or specifies the scale’s output values.
- axis generatorused by · An axis generator is a D3 function that constructs SVG elements representing a chart axis from a scale.
- ordinal scaleincludes · An ordinal scale maps discrete domain values to discrete range values while preserving their categorical association.
- scaleLinear()includes · scaleLinear() is a D3 scale function that maps continuous numeric input values to continuous numeric output values.
- linear scaleincludes · A linear scale maps continuous input values to output values through a linear relationship between its domain and range.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

