(labels, scale)
| 69 | |
| 70 | /** "Other" keeps the neutral wherever the API folded a tail into it. */ |
| 71 | export 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 |
no test coverage detected