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

Function createKeyGetter

src/animation/universalTransition.ts:299–314  ·  view source on GitHub ↗
(isOld: boolean, onlyGetId: boolean)

Source from the content-addressed store, hash-verified

297 }
298
299 function createKeyGetter(isOld: boolean, onlyGetId: boolean) {
300 return function (diffItem: DiffItem): string {
301 const data = diffItem.data;
302 const dataIndex = diffItem.dataIndex;
303 // TODO if specified dim
304 if (onlyGetId) {
305 return data.getId(dataIndex);
306 }
307 if (isOld) {
308 return direction === TRANSITION_P2C ? diffItem.childGroupId : diffItem.groupId;
309 }
310 else {
311 return direction === TRANSITION_C2P ? diffItem.childGroupId : diffItem.groupId;
312 }
313 };
314 }
315
316 // Use id if it's very likely to be an one to one animation
317 // It's more robust than groupId

Callers 1

transitionBetweenFunction · 0.85

Calls 1

getIdMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…