🌍 Public
Viewing a saved revision (read-only)
44186a9ac8ad45df8a3f80ee99c931f6
scaleOrdinal() other variations
This example demonstrates the use of `d3.scaleOrdinal()` to map categorical month names to colors from the `d3.schemePaired` palette, with each month rendered as an `SVG` text element. The x-positions are determined by a `d3.scaleLinear()` scale mapping indices 0–11 to a 600-pixel range. The visualization shows how ordinal scales assign discrete colors to categories, while the linear scale controls spatial layout. The code uses D3's selection and `.join()` operation to create the text elements within the SVG wrapper. The data is a hardcoded array of month abbreviations.
AI-generated description