Hardware-accelerated geospatial data plotting in the browser
autumnplot-gl • Docs
autumnplot-gl / makePaintballKey
makePaintballKey(
colors
,labels
,opts
?):SVGElement
Make an SVG containing a color key for a paintball plot. The key can be split over any number of columns.
• colors: (string
| Color
)[]
A list of colors
• labels: string
[]
The labels corresponding to each color
• opts?: PaintballKeyOptions
The options for creating the color key
SVGElement
An SVGElement containing the color bar image.
// Create the color key
const svg = makePaintballKey(colors, labels, {n_cols: 2, fontface: 'Trebuchet MS'});
// Add the color key to the page
document.getElementById('pb-key-container').appendChild(svg);