Skip to content

Documentation / @finchart/dom / PointerInteractionsOptions

Interface: PointerInteractionsOptions ​

Defined in: dom/src/pointer.ts:10

Properties ​

crosshair? ​

optional crosshair?: boolean

Defined in: dom/src/pointer.ts:13


doubleClickReset? ​

optional doubleClickReset?: boolean

Defined in: dom/src/pointer.ts:15

Double-click resets to the full view. Default true.


keyboard? ​

optional keyboard?: boolean

Defined in: dom/src/pointer.ts:36

Basic keyboard gestures — ←→ pans by 5% of the screen width each, +/− zooms about the center. Default true. Doesn't remove the focus ring — that's accessibility.

Only these two are what this turns off. The tabIndex and keydown listener attach regardless of this option, so even with it off the element still takes focus, and keys that go to the input stack (Delete, Esc, ], [ for drawing tools) still work.

To take the chart out of tab order, set tabindex="-1" on the element directly — an existing tabindex attribute is left alone whatever its value. This option isn't the place for that.


kineticScroll? ​

optional kineticScroll?: boolean

Defined in: dom/src/pointer.ts:21

Releasing a drag lets it flow with inertia. Off by default — it gets in the way of precise manipulation (lining up a backtest range), so this is opt-in.


pan? ​

optional pan?: boolean

Defined in: dom/src/pointer.ts:11


wheel? ​

optional wheel?: "always" | "modifier"

Defined in: dom/src/pointer.ts:67

When the wheel zooms. "always" (the default) takes every wheel event over the chart — a trackpad's two-finger scroll zooms, and the page behind does not scroll. "modifier" zooms only with Ctrl or ⌘ held — which is also what a trackpad pinch sends — and lets a plain wheel or two-finger vertical scroll reach the page; a sideways swipe still pans. A chart that is one block of a scrolling page wants the second.


zoom? ​

optional zoom?: boolean

Defined in: dom/src/pointer.ts:12


zoomSpeed? ​

optional zoomSpeed?: number

Defined in: dom/src/pointer.ts:58

Zoom factor per wheel notch (100 px of wheel travel; a trackpad scroll zooms in proportion to its distance). 1.1 means 10% at a time. Default 1.1.

The domain is finite positive numbers, and three ranges behave differently:

  • > 1 — the zoom step
  • = 1 — nothing happens (×1 either direction). No error, no log
  • < 1 — direction flips (wheel up zooms out). Not a defect — this could be a natural-scroll preference, so the guard is deliberately left out
  • 0, negative, NaN, Infinity — not blocked here. Setting it succeeds silently, and the core rejects with ContractError on the first wheel event. Because the throw site is inside a DOM listener, it goes to window.onerror, not the consumer's try/catch

The usual source is a settings panel's valueAsNumber (NaN if blank) or Number(localStorage.getItem(...)).