(data: SeriesData, dataIndex: number, dataGroupId: string, isChild: boolean)
| 94 | } |
| 95 | |
| 96 | function 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 |
| 119 | function flattenDataDiffItems(list: TransitionSeries[]) { |
no test coverage detected
searching dependent graphs…