MCPcopy Create free account
hub / github.com/microsoft/SandDance / defaultColorScheme

Function defaultColorScheme

packages/chart-recommender/src/recommender.ts:21–30  ·  view source on GitHub ↗
(c: SandDance.types.Column)

Source from the content-addressed store, hash-verified

19}
20
21export function defaultColorScheme(c: SandDance.types.Column) {
22 if (c.quantitative) {
23 return 'redyellowgreen';
24 } else if (c.stats.distinctValueCount === 2) {
25 return 'dual_redgreen';
26 } else if (c.stats.distinctValueCount <= 10) {
27 return 'category10';
28 }
29 return 'category20';
30}

Callers 2

constructorMethod · 0.90
constructorMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected