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

Function dispatchTooltipActually

src/component/axisPointer/axisTrigger.ts:418–448  ·  view source on GitHub ↗
(
    dataByCoordSys: DataByCoordSysCollection,
    point: number[],
    payload: AxisTriggerPayload,
    dispatchAction: ExtensionAPI['dispatchAction']
)

Source from the content-addressed store, hash-verified

416}
417
418function 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
450function dispatchHighDownActually(
451 axesInfo: Dictionary<CollectedAxisInfo>,

Callers 1

axisTriggerFunction · 0.85

Calls 2

illegalPointFunction · 0.85
dispatchActionFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…