MCPcopy
hub / github.com/apache/echarts / setItemVisualFromData

Function setItemVisualFromData

src/visual/helper.ts:66–88  ·  view source on GitHub ↗
(data: SeriesData, dataIndex: number, key: string, value: any)

Source from the content-addressed store, hash-verified

64}
65
66export function setItemVisualFromData(data: SeriesData, dataIndex: number, key: string, value: any) {
67 switch (key) {
68 case 'color':
69 // Make sure not sharing style object.
70 const style = data.ensureUniqueItemVisual(dataIndex, 'style');
71 style[data.getVisual('drawType')] = value;
72 // Mark the color has been changed, not from palette anymore
73 data.setItemVisual(dataIndex, 'colorFromPalette', false);
74 break;
75 case 'opacity':
76 data.ensureUniqueItemVisual(dataIndex, 'style').opacity = value;
77 break;
78 case 'symbol':
79 case 'symbolSize':
80 case 'liftZ':
81 data.setItemVisual(dataIndex, key, value);
82 break;
83 default:
84 if (__DEV__) {
85 console.warn(`Unknown visual type ${key}`);
86 }
87 }
88}

Callers 1

setVisualFunction · 0.90

Calls 3

setItemVisualMethod · 0.80
getVisualMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…