D3 Scale - Sqrt
✓ Published1🌍 Public
This example compares linear and square-root scales for encoding data as circle radii. Two rows of circles, one red and one green, map the same dataset from 0 to 100 using D3's `d3.scaleLinear` and `d3.scaleSqrt`. The linear scale positions circles along the x-axis, while its radius is scaled for visual clarity. The square-root scale directly maps the data to the radius, ensuring that the circle's area, rather than its diameter, is proportional to the value. The SVG output includes an annotation recommending square-root scaling for area-based encodings.
AI-generated descriptionD3 Scales
MIT Licensed