{"version":"1.0","type":"rich","title":"d3js Exercice 2 - Scales","description":"This example demonstrates how D3.js scale functions map input domain values to output range values, printing results directly to the page. It uses `d3.scaleLinear()` to transform numbers between 0 and 20 into a range of 0 to 1, showing outputs for boundary and mid-point inputs. The code then applies the `.clamp(true)` method to restrict output values beyond the specified domain, so inputs like -10 and 200 return clamped results. Written in French comments, it also suggests experimenting with `invert`, `power`, `log` scales, and color ranges. The visualization is purely text-based, using `document.writeln` to display results in a `<pre>` element.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-d3ccea51ac8cc279a29a0ff4aa0391df?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}