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

Function getLinkGroupIndex

src/component/axisPointer/modelHelper.ts:332–344  ·  view source on GitHub ↗

* For example: * { * axisPointer: { * links: [{ * xAxisIndex: [2, 4], * yAxisIndex: 'all' * }, { * xAxisId: ['a5', 'a7'], * xAxisName: 'xxx' * }] * } * }

(linksOption: AxisPointerOption['link'], axis: Axis)

Source from the content-addressed store, hash-verified

330 * }
331 */
332function getLinkGroupIndex(linksOption: AxisPointerOption['link'], axis: Axis): number {
333 const axisModel = axis.model;
334 const dim = axis.dim;
335 for (let i = 0; i < linksOption.length; i++) {
336 const linkOption = linksOption[i] || {};
337 if (checkPropInLink(linkOption[dim + 'AxisId' as 'xAxisId'], axisModel.id)
338 || checkPropInLink(linkOption[dim + 'AxisIndex' as 'xAxisIndex'], axisModel.componentIndex)
339 || checkPropInLink(linkOption[dim + 'AxisName' as 'xAxisName'], axisModel.name)
340 ) {
341 return i;
342 }
343 }
344}
345
346function checkPropInLink(linkPropValue: number[] | number | string | string[] | 'all', axisPropValue: number | string) {
347 return linkPropValue === 'all'

Callers 1

saveTooltipAxisInfoFunction · 0.85

Calls 1

checkPropInLinkFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…