Cubehelix
✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Apr 29, 2014
This example displays a single horizontal strip of continuously varying colors, demonstrating the default cubehelix color scheme. The gradient runs from one color to another across the canvas width, showing the perceptual characteristics of the ramp. The code defines a custom d3.scale.cubehelix using d3.interpolateCubehelix and applies it via a canvas element. It generates pixel data with createImageData and writes the color values directly into the image buffer, which is then rendered with putImageData.
AI-generated descriptionThe d3.interpolateCubehelix plugin implements Dave Green’s cubehelix color scheme. The color ramp above is the default configuration of cubehelix, but the scheme is highly configurable; see the other examples.
gpl-3.0 Licensed