A logarithmic scale maps a continuous domain through a logarithmic transformation. It is useful when values span large differences in magnitude, allowing multiplicative changes to occupy a readable visual range. section 7.5 section 7.4.1
Cetacean population scatterplot
A linear x-axis compresses species with smaller populations, making their values difficult to read. Replacing it with a logarithmic scale displays tenfold steps such as 1, 10, 100, 1k, 10k, 100k, 1M, and 10M, while preserving the full population range. section 7.4.1
const maxPopulation = d3.max(data, d => d.global_population_estimate); xScale = d3.scaleLog() .domain([1, maxPopulation]) .range([0, innerWidth]) .nice();
Configure the scale with the dataset’s maximum population, map the domain from 1 to that maximum, and spread it across the chart width. section 7.4.1


