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

Function getGroupId

src/animation/universalTransition.ts:96–116  ·  view source on GitHub ↗
(data: SeriesData, dataIndex: number, dataGroupId: string, isChild: boolean)

Source from the content-addressed store, hash-verified

94}
95
96function getGroupId(data: SeriesData, dataIndex: number, dataGroupId: string, isChild: boolean) {
97 // try to get groupId from encode
98 const visualDimension = isChild ? 'itemChildGroupId' : 'itemGroupId';
99 const groupIdDim = getDimension(data, visualDimension);
100 if (groupIdDim) {
101 const groupId = getValueByDimension(data, dataIndex, groupIdDim);
102 return groupId;
103 }
104 // try to get groupId from raw data item
105 const rawDataItem = data.getRawDataItem(dataIndex) as OptionDataItemObject<unknown>;
106 const property = isChild ? 'childGroupId' : 'groupId';
107 if (rawDataItem && rawDataItem[property]) {
108 return rawDataItem[property] + '';
109 }
110 // fallback
111 if (isChild) {
112 return;
113 }
114 // try to use series.dataGroupId as groupId, otherwise use dataItem's id as groupId
115 return (dataGroupId || data.getId(dataIndex));
116}
117
118// flatten all data items from different serieses into one arrary
119function flattenDataDiffItems(list: TransitionSeries[]) {

Callers 1

flattenDataDiffItemsFunction · 0.85

Calls 4

getDimensionFunction · 0.85
getValueByDimensionFunction · 0.85
getRawDataItemMethod · 0.45
getIdMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…