Documentation / @finchart/core / index / InteractionTarget
Interface: InteractionTarget
Defined in: packages/core/src/interaction/types.ts:13
The side that actually applies an interaction. The chart implements this.
Input arrives in pixels, but the domain works in data units, so a conversion is needed. The chart is the only thing that knows the scale used for that conversion, so the pixel entry points live here too — if the handler knew the scale, the input layer would take on the coordinate system as well.
Methods
click()
click(
position):void
Defined in: packages/core/src/interaction/types.ts:40
A set of input echoes — the same character as crosshair: they never change state, only pass through to subscribers. The material behind drawing tools and app integrations (marker clicks).
Parameters
position
Returns
void
contextMenu()
contextMenu(
position):void
Defined in: packages/core/src/interaction/types.ts:42
Parameters
position
Returns
void
crosshair()
crosshair(
position):void
Defined in: packages/core/src/interaction/types.ts:33
The cursor's position, or null when it has left the chart.
Parameters
position
Point | null
Returns
void
doubleClick()
doubleClick(
position):void
Defined in: packages/core/src/interaction/types.ts:41
Parameters
position
Returns
void
fitDomains()
fitDomains():
void
Defined in: packages/core/src/interaction/types.ts:49
Resets both axes so the whole dataset is visible — the destination of the double-click reset. This just lifts a public method that already existed on Plot onto the contract.
Returns
void
pan()
pan(
offset):void
Defined in: packages/core/src/interaction/types.ts:23
Shifts the x domain by offset data units.
Parameters
offset
number
Returns
void
panByPixels()
panByPixels(
dx):void
Defined in: packages/core/src/interaction/types.ts:25
For a drag of dx screen pixels. Dragging right shows the earlier range.
Parameters
dx
number
Returns
void
routeInput()
routeInput(
event):boolean
Defined in: packages/core/src/interaction/types.ts:20
Offers the normalized input to the stack (registered consumers) first. true means it was consumed — the caller (the handler) must not then apply the gesture vocabulary below. pan/zoom/crosshair remain simply the translation of input the stack didn't consume.
Parameters
event
Returns
boolean
zoom()
zoom(
factor,center):void
Defined in: packages/core/src/interaction/types.ts:28
Zooms by factor, holding center (data coordinates) fixed.
Parameters
factor
number
center
number
Returns
void
zoomAtPixel()
zoomAtPixel(
factor,screenX):void
Defined in: packages/core/src/interaction/types.ts:30
Zooms holding a screen x fixed (for a wheel event, at the cursor).
Parameters
factor
number
screenX
number
Returns
void