MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / onMouseMove

Function onMouseMove

src/core/createRenderCoordinator.ts:2474–2499  ·  view source on GitHub ↗
(payload: ChartGPUEventPayload)

Source from the content-addressed store, hash-verified

2472 };
2473
2474 const onMouseMove = (payload: ChartGPUEventPayload): void => {
2475 pointerState = {
2476 source: 'mouse',
2477 x: payload.x,
2478 y: payload.y,
2479 gridX: payload.gridX,
2480 gridY: payload.gridY,
2481 isInGrid: payload.isInGrid,
2482 hasPointer: true,
2483 };
2484
2485 // If we're over the plot and we have recent interaction scales, update interaction-x in domain units.
2486 // (Best-effort; render() refreshes scales and overlays.)
2487 if (payload.isInGrid && lastInteractionScales) {
2488 const xDomain = lastInteractionScales.xScale.invert(payload.gridX);
2489 setInteractionXInternal(Number.isFinite(xDomain) ? xDomain : null, 'mouse');
2490 } else if (!payload.isInGrid) {
2491 // Clear interaction-x when leaving the plot area (keeps synced charts from “sticking”).
2492 setInteractionXInternal(null, 'mouse');
2493 }
2494
2495 crosshairRenderer.setVisible(payload.isInGrid);
2496 emitCrosshairCallback(payload.isInGrid ? payload.x : null);
2497 emitHoverCallback(payload.isInGrid ? payload : null);
2498 requestRender();
2499 };
2500
2501 const onMouseLeave = (_payload: ChartGPUEventPayload): void => {
2502 // Only clear interaction overlays for real pointer interaction.

Callers

nothing calls this directly

Calls 6

setInteractionXInternalFunction · 0.85
emitCrosshairCallbackFunction · 0.85
emitHoverCallbackFunction · 0.85
invertMethod · 0.80
requestRenderFunction · 0.70
setVisibleMethod · 0.65

Tested by

no test coverage detected