Skip to content

desktop/src/lib/chart.ts

Comment 1, line 1

desktop/src/lib/chart.ts:1

/**
* Hide chart tooltips on exit; browser behavior checked on 2026-09-27.
* ECharts 6 manual hideTip also calls hideLater(hideDelay), so use hideDelay: 0.
* The old 999999 value delayed every hide path. ECharts handles ordinary exits;
* this wrapper handles missed events:
* - globalout when the pointer leaves the canvas;
* - document mousemove outside this chart, including its tooltip children,
* when selecting a point expands a summary and moves the canvas without mouseout,
* or WebView2 misses mouseout;
* - document mouseout with no relatedTarget when leaving the application window;
* - window blur when changing apps or clicking the title bar.
* Returns cleanup for component unmount.
*/

Comment 2, line 16

desktop/src/lib/chart.ts:16

/** Source names are data, including inside ECharts' HTML tooltips. */

Comment 3, line 25

desktop/src/lib/chart.ts:25

/** ECharts axes/legends have independent defaults. Apply theme colors to each;
* global textStyle alone does not ensure readability on a dark canvas. */

Comment 4, line 60

desktop/src/lib/chart.ts:60

// A target inside this chart or its tooltip means the pointer is still browsing it.

Comment 5, line 81

desktop/src/lib/chart.ts:81

/**
* For item-triggered pies/heatmaps, hide when zr mousemove has no target,
* indicating blank canvas. Do not apply to axis-triggered charts, whose
* grid areas intentionally retain tooltips.
*/

Comment 6, line 96

desktop/src/lib/chart.ts:96

/** Select periods on release; dragging does not pan or replace the full chart. */

Comment 7, line 115

desktop/src/lib/chart.ts:115

/** Point/axis selection, horizontal brushing and zoom share period labels. */