MCPcopy Index your code
hub / github.com/apache/echarts / getColorVisual

Function getColorVisual

src/component/visualMap/visualEncoding.ts:86–115  ·  view source on GitHub ↗
(
    seriesModel: SeriesModel,
    visualMapModel: VisualMapModel,
    value: ParsedValue,
    valueState: VisualMapModel['stateList'][number]
)

Source from the content-addressed store, hash-verified

84// performance and export for heatmap?
85// value can be Infinity or -Infinity
86function getColorVisual(
87 seriesModel: SeriesModel,
88 visualMapModel: VisualMapModel,
89 value: ParsedValue,
90 valueState: VisualMapModel['stateList'][number]
91) {
92 const mappings = visualMapModel.targetVisuals[valueState];
93 const visualTypes = VisualMapping.prepareVisualTypes(mappings);
94 const resultVisual: Partial<Record<BuiltinVisualProperty, any>> = {
95 color: getVisualFromData(seriesModel.getData(), 'color') // default color.
96 };
97
98 for (let i = 0, len = visualTypes.length; i < len; i++) {
99 const type = visualTypes[i];
100 const mapping = mappings[
101 (type === 'opacity' ? '__alphaForOpacity' : type) as BuiltinVisualProperty
102 ];
103 mapping && mapping.applyVisual(value, getVisual, setVisual);
104 }
105
106 return resultVisual.color;
107
108 function getVisual(key: BuiltinVisualProperty) {
109 return resultVisual[key];
110 }
111
112 function setVisual(key: BuiltinVisualProperty, value: any) {
113 resultVisual[key] = value;
114 }
115}

Callers 2

setStopMethod · 0.85
setStopMethod · 0.85

Calls 4

getVisualFromDataFunction · 0.90
prepareVisualTypesMethod · 0.80
applyVisualMethod · 0.80
getDataMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…