* For example: * { * axisPointer: { * links: [{ * xAxisIndex: [2, 4], * yAxisIndex: 'all' * }, { * xAxisId: ['a5', 'a7'], * xAxisName: 'xxx' * }] * } * }
(linksOption: AxisPointerOption['link'], axis: Axis)
| 330 | * } |
| 331 | */ |
| 332 | function 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 | |
| 346 | function checkPropInLink(linkPropValue: number[] | number | string | string[] | 'all', axisPropValue: number | string) { |
| 347 | return linkPropValue === 'all' |
no test coverage detected
searching dependent graphs…