Skip to main content
100%

D3 Scale - ScaleLog

✓ Published1🌍 Public
SSubhendu Karmakar
Last edited Dec 26, 2023
Created on Dec 26, 2023
Forked from D3 Scale - Sqrt

This example demonstrates how a logarithmic scale maps data values across an SVG canvas. It places six text labels at positions calculated by a `d3.scaleLog()` function, with a domain spanning from 10 to 100,000 and a range of 0 to 700 pixels. The visualization highlights how log scales compress large numerical ranges, showing labels for 0, 10, 100, 1,000, 10,000, and 100,000 at increasing intervals. The code uses D3 v7’s `scaleLog`, `scaleLinear`, and `scaleSqrt` definitions, rendering the output as SVG text elements.

AI-generated description

D3 Scales

MIT Licensed

Similar vizzes