MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / paletteFor

Function paletteFor

telemetry-dashboard/public/theme.js:71–74  ·  view source on GitHub ↗
(labels, scale)

Source from the content-addressed store, hash-verified

69
70/** "Other" keeps the neutral wherever the API folded a tail into it. */
71export function paletteFor(labels, scale) {
72 const hues = scale === 'ordinal' ? ordinal(labels.length) : labels.map((_, i) => categorical(i));
73 return labels.map((label, i) => (label === 'Other' ? NEUTRAL : hues[i]));
74}
75
76// ---------------------------------------------------------------------------
77// Formatting

Callers 3

stackedAreaChartFunction · 0.90
barChartFunction · 0.90
pieChartFunction · 0.90

Calls 2

ordinalFunction · 0.85
categoricalFunction · 0.85

Tested by

no test coverage detected