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

Function ordinal

telemetry-dashboard/public/theme.js:60–68  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

58 * than inventing a step that would misstate the order.
59 */
60export function ordinal(n) {
61 if (n <= 0) return [];
62 if (n === 1) return [ORDINAL[2]];
63 const out = [];
64 for (let i = 0; i < n; i++) {
65 out.push(i < ORDINAL.length ? ORDINAL[Math.round((i * (ORDINAL.length - 1)) / (n - 1))] : NEUTRAL);
66 }
67 return out;
68}
69
70/** "Other" keeps the neutral wherever the API folded a tail into it. */
71export function paletteFor(labels, scale) {

Callers 1

paletteForFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected