Skip to main content
100%

d3js Exercice 2 - Scales

✓ Published0🌍 Public
AAlainRo
Last edited Feb 28, 2018
Created on Oct 10, 2017

This example demonstrates the behavior of D3.js linear scales, specifically how they map input domain values to output range values. It shows the default scaling for values within the domain, then highlights what happens outside the interval, and finally illustrates the effect of the clamp method. The code uses `d3.scaleLinear()` with a domain of `[0, 20]` and range `[0, 1]`, logging results for various inputs including negative and oversized values. A second scale with `.clamp(true)` restricts outputs to the range. The visualization is purely text-based, using `document.writeln` to display computed values in the browser.

AI-generated description

d3js Exercice 2 - Scales

mit Licensed

Similar vizzes