(
dataByCoordSys: DataByCoordSysCollection,
point: number[],
payload: AxisTriggerPayload,
dispatchAction: ExtensionAPI['dispatchAction']
)
| 416 | } |
| 417 | |
| 418 | function dispatchTooltipActually( |
| 419 | dataByCoordSys: DataByCoordSysCollection, |
| 420 | point: number[], |
| 421 | payload: AxisTriggerPayload, |
| 422 | dispatchAction: ExtensionAPI['dispatchAction'] |
| 423 | ) { |
| 424 | // Basic logic: If no showTip required, hideTip will be dispatched. |
| 425 | if (illegalPoint(point) || !dataByCoordSys.list.length) { |
| 426 | dispatchAction({type: 'hideTip'}); |
| 427 | return; |
| 428 | } |
| 429 | |
| 430 | // In most case only one axis (or event one series is used). It is |
| 431 | // convenient to fetch payload.seriesIndex and payload.dataIndex |
| 432 | // directly. So put the first seriesIndex and dataIndex of the first |
| 433 | // axis on the payload. |
| 434 | const sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {} as DataIndex; |
| 435 | |
| 436 | dispatchAction({ |
| 437 | type: 'showTip', |
| 438 | escapeConnect: true, |
| 439 | x: point[0], |
| 440 | y: point[1], |
| 441 | tooltipOption: payload.tooltipOption, |
| 442 | position: payload.position, |
| 443 | dataIndexInside: sampleItem.dataIndexInside, |
| 444 | dataIndex: sampleItem.dataIndex, |
| 445 | seriesIndex: sampleItem.seriesIndex, |
| 446 | dataByCoordSys: dataByCoordSys.list |
| 447 | }); |
| 448 | } |
| 449 | |
| 450 | function dispatchHighDownActually( |
| 451 | axesInfo: Dictionary<CollectedAxisInfo>, |
no test coverage detected
searching dependent graphs…