Skip to main content
100%

Bivariate Color Schemes

✓ Published0🌍 Public
CCurran Kelleher
Last edited Oct 9, 2025
Created on Sep 1, 2024

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 description

An attempt at a generic definition for bivariate color schemes. Inspired by Bivariate Choropleth Maps: A How-to Guide.

MIT Licensed

Similar vizzes