You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/storybook/src/Contexts.mdx
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
## Context
1
+
## VisCanvasContext
2
2
3
3
Children of `VisCanvas` have access to `VisCanvasContext`, which provides helpful utilities, notably to convert points between coordinate spaces (data, world, HTML).
4
4
It also exposes the size and ratio of the canvas and of the visualization, as well as the axis configs passed to `VisCanvas`.
|`r3fRoot`| React Three Fiber container rendered inside `canvasArea` that wraps the `canvas` element |
41
41
42
42
> These tables are not exhaustive. Please consider any undocumented property as experimental or meant for internal use only.
43
+
44
+
## InteractionsContext
45
+
46
+
Children of `VisCanvas` also have access to `InteractionsContext`, which provides low-level utilities for coordinating mouse interactivity on the canvas.
47
+
However, thanks to the `useInteraction` hook, which allows registering new interactions, there's little need to access `InteractionsContext` directly.
48
+
49
+
The only utility you may need is `getInteractions`, which allows accessing all registered interactions that are currently enabled. If you pass mouse button(s)
50
+
and/or modifier key(s) to it, it can filter the interactions and return only those that are compatible. Note that `getInteractions` only works
51
+
when called inside an event handler, not during render.
0 commit comments