🌍 Public
Viewing a saved revision (read-only)
6aea73c5473c4dd6a6e041caa3c27532
scale
This example demonstrates the foundational concept of D3 scales by computing and logging values from linear, square root, and time scales, then calculating the extent of a small dataset and applying a linear scale with a nice domain. It uses the d3 v7 library, importing scaleLinear, scaleSqrt, and scaleTime from d3, and renders to a blank SVG canvas. The code defines explicit domains and ranges to show how input values map to output pixel positions, with a dataset of five numeric values and an extent-based domain.
AI-generated descriptionA demonstration of how to start using D3 version 6.