Classical Scales
This visualization showcases a comprehensive set of D3.js v2.10 scales through a series of horizontal axes, each paired with a descriptive label. Linear, logarithmic, power, square-root, quantile, quantize, threshold, and identity scales are demonstrated, with the log and power scales shown across different domain ranges to illustrate their behavior. The example also highlights tick subdivision options, including numeric, boolean, and string arguments, which is particularly notable because vanilla D3 v2.10 does not support function-based parameters for tick subdividing. The SVG renderer displays the axes with a glowing filter effect and the layout is fixed to 1500 pixels in height to accommodate the many examples.
AI-generated descriptionD3.js Axes …… <a href="http://bl.ocks.org/3605124" title="view this gist via bl.ocks.org">∆</a> <a href="http://bl.ocks.org/GerHobbelt" title="view a list of all my gists at bl.ocks.org">∞</a>
The same examples as in this gist, but now tweaked to provide the subticks where possible when using d3.js v2.10.0; this means that any functions passed in as arguments to provide a flexible subtick count, size, or otherwise, are reduced to explicit numbers as v2.10.0 vanilla D3 doesn't support functions as parameters to d3.axis methods.
Related gists
- gist 3605035: a series of linear axes with varying degress of sophistication, using the advanced d3.axis component
- gist 3605069: same code, with crash protection wrappers, for vanilla D3.js (use to see how many of these vanilla D3.js supports today)
- gist 3605124: reduced code suitable for use with vanilla D3.js v2.10 as is, with crash protection wrappers