Viewing a saved revision (read-only)
d5f4792a44384f55b8d35048bec8cb28
Bivariate Color Schemes
This example demonstrates bivariate color schemes for choropleth maps through a grid of color swatches. The visualization generates two color ramps using the `d3.cubehelix` function, each defined by a hue angle with varying luminance values, then interpolates between the two ramps with `d3.interpolateRgb` and `d3.interpolateCubehelix` to build a matrix of 25 colors. The resulting matrix is rendered as SVG rectangles, with the color of each cell reflecting the combined weight of two independent data dimensions. The code includes adjustable constants for color count, hue range, saturation, and luminance values.
AI-generated descriptionAn attempt at a generic definition for bivariate color schemes. Inspired by Bivariate Choropleth Maps: A How-to Guide.