Skip to main content
100%

D3 scale examples

✓ Published1🌍 Public
AAxVa 🐍 💪
Last edited Jan 24, 2024
Created on Jan 21, 2024

This example demonstrates D3 scale functions for mapping data values to visual ranges. It shows linear scales converting continuous domains to numeric and color outputs, ordinal scales for one-to-one mapping, and band scales for positioning categorical data with optional padding and rounded pixel ranges. The code uses `d3.scaleLinear`, `d3.scaleOrdinal`, `d3.scaleBand`, and `d3.interpolate` with data from `nobel-winners.json` containing country-level Nobel Prize counts. Console output illustrates scale outputs for specific inputs, including color interpolation and bandwidth calculations.

AI-generated description
MIT Licensed

Similar vizzes