MCPcopy
hub / github.com/tdewolff/minify / pickColor

Function pickColor

_benchmarks/sample_echarts.js:69074–69090  ·  view source on GitHub ↗
(node, seriesModel, treeHeight)

Source from the content-addressed store, hash-verified

69072 var paletteScope = {}; // Default color strategy
69073
69074 function pickColor(node, seriesModel, treeHeight) {
69075 // Choose color from palette based on the first level.
69076 var current = node;
69077
69078 while (current && current.depth > 1) {
69079 current = current.parentNode;
69080 }
69081
69082 var color = seriesModel.getColorFromPalette(current.name || current.dataIndex + '', paletteScope);
69083
69084 if (node.depth > 1 && typeof color === 'string') {
69085 // Lighter on the deeper level.
69086 color = lift(color, (node.depth - 1) / (treeHeight - 1) * 0.5);
69087 }
69088
69089 return color;
69090 }
69091
69092 ecModel.eachSeriesByType('sunburst', function (seriesModel) {
69093 var data = seriesModel.getData();

Callers 1

sunburstVisualFunction · 0.85

Calls 1

liftFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…