Skip to main content
100%

D3 Scale Function PRactice

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

This example demonstrates D3 scale functions by mapping a small array of numeric values to positions along an SVG axis. It renders circles and labels on a horizontal line using a linear scale, then displays the corresponding axis with `d3.axisBottom`. The code imports a custom `getScale` utility from `utils.js` that switches between D3’s scale types—including `scaleLinear`, `scaleSqrt`, `scaleLog`, and others—although only the linear scale is actively applied. The visualization uses SVG rendering with a fixed 960×500 canvas and D3 v7 via `bundle.js`.

AI-generated description

D3 Scales

MIT Licensed

Similar vizzes