May 2019
Beginner to intermediate
650 pages
14h 50m
English
A symlog (symmetrical log) scale, which is created with d3.scaleSymlog(), is actually a mixture of three functions. In the middle is a linear function that includes zero inside a small interval, and a pair of symmetric logarithmics from the interval to infinity. The default linear interval is (-1,1), and the domain of the logarithmic functions is (-∞,-1] and [1,∞).
The following code creates a symlog scale with a symmetrical domain:
const data = d3.range(-32,33);const scale = d3.scaleSymlog() .domain([-32,32]) .range([0,1000]);
The result is as follows:

Read now
Unlock full access