Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

D3 Scale Function PRactice

Public visualization

Viewing a saved revision (read-only)

5f2953c0bcb946bb8871dc057174b74e

D3 Scale Function PRactice

0 stars1🌍 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