Superscript Format II
✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Sep 28, 2013
A log-scaled axis spans from 10⁻⁴ to 10⁴, with tick labels that display only the number 10 for each power of ten. The code uses d3.svg.axis for the axis, then post-selects tick text elements, filters for powers of ten, and appends a tspan for the superscript exponent. The exponent is computed from the tick value using Math.log and rendered with a smaller font size via CSS. This approach creates a clean, typographically precise axis label alternative to Unicode superscripts.
AI-generated descriptionAn alternative to Unicode superscripts, using axis post-selection to add tspan elements.
gpl-3.0 Licensed