@neo4j-nvl/interaction-handlers 2.0.0-d21c8bbe → 2.0.0-ec6fdba7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/lib/constants.d.ts +1 -1
  3. package/lib/constants.js +4 -2
  4. package/lib/index.d.ts +10 -20
  5. package/lib/index.js +10 -10
  6. package/lib/interaction-handlers/base.d.ts +67 -67
  7. package/lib/interaction-handlers/base.js +98 -104
  8. package/lib/interaction-handlers/box-select-interaction.d.ts +44 -44
  9. package/lib/interaction-handlers/box-select-interaction.js +133 -127
  10. package/lib/interaction-handlers/click-interaction.d.ts +111 -111
  11. package/lib/interaction-handlers/click-interaction.js +116 -131
  12. package/lib/interaction-handlers/drag-node-interaction.d.ts +40 -40
  13. package/lib/interaction-handlers/drag-node-interaction.js +102 -111
  14. package/lib/interaction-handlers/draw-interaction.d.ts +37 -37
  15. package/lib/interaction-handlers/draw-interaction.js +245 -278
  16. package/lib/interaction-handlers/hover-interaction.d.ts +30 -30
  17. package/lib/interaction-handlers/hover-interaction.js +79 -89
  18. package/lib/interaction-handlers/keyboard-interaction.d.ts +146 -146
  19. package/lib/interaction-handlers/keyboard-interaction.js +254 -271
  20. package/lib/interaction-handlers/lasso-interaction.d.ts +45 -45
  21. package/lib/interaction-handlers/lasso-interaction.js +174 -196
  22. package/lib/interaction-handlers/pan-interaction.d.ts +61 -61
  23. package/lib/interaction-handlers/pan-interaction.js +110 -100
  24. package/lib/interaction-handlers/utils.d.ts +2 -2
  25. package/lib/interaction-handlers/utils.js +39 -38
  26. package/lib/interaction-handlers/zoom-interaction.d.ts +48 -48
  27. package/lib/interaction-handlers/zoom-interaction.js +69 -71
  28. package/lib/overlay-renderer/overlay-renderer.d.ts +13 -13
  29. package/lib/overlay-renderer/overlay-renderer.js +96 -111
  30. package/package.json +16 -6
  31. package/lib/__tests__/box-select-interaction.test.d.ts +0 -1
  32. package/lib/__tests__/box-select-interaction.test.js +0 -149
  33. package/lib/__tests__/click-interaction.test.d.ts +0 -1
  34. package/lib/__tests__/click-interaction.test.js +0 -505
  35. package/lib/__tests__/drag-node-interaction.test.d.ts +0 -1
  36. package/lib/__tests__/drag-node-interaction.test.js +0 -247
  37. package/lib/__tests__/hover-interaction.test.d.ts +0 -1
  38. package/lib/__tests__/hover-interaction.test.js +0 -374
  39. package/lib/__tests__/keyboard-interaction.test.d.ts +0 -1
  40. package/lib/__tests__/keyboard-interaction.test.js +0 -436
  41. package/lib/__tests__/lasso-interaction.test.d.ts +0 -1
  42. package/lib/__tests__/lasso-interaction.test.js +0 -219
  43. package/lib/__tests__/pan-interaction.test.d.ts +0 -1
  44. package/lib/__tests__/pan-interaction.test.js +0 -223
  45. package/lib/__tests__/utils.test.d.ts +0 -1
  46. package/lib/__tests__/utils.test.js +0 -19
  47. package/lib/__tests__/zoom-interaction.test.d.ts +0 -1
  48. package/lib/__tests__/zoom-interaction.test.js +0 -185
package/CHANGELOG.md CHANGED
@@ -2,6 +2,29 @@
2
2
 
3
3
  All notable changes to NVL will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
4
4
 
5
+ ## [Unreleased]
6
+
7
+ This release adds keyboard actions for moving nodes, ships an agent skill for NVL, and makes all packages loadable as ESM in Node.js without a bundler.
8
+
9
+ ### Added
10
+
11
+ * Keyboard interaction handler actions for moving nodes with the arrow keys, with a new `onNodeMove` callback.
12
+ * Agent skill files for NVL, shipped with `@neo4j-nvl/base`.
13
+
14
+ ### Changed
15
+
16
+ * `@neo4j-nvl/react` and `@neo4j-nvl/interaction-handlers` are now spec-compliant ESM with `"type": "module"` and an `exports` map. Note that deep imports into `lib/` will no longer work.
17
+ * Replaced `lodash` with `lodash-es` in `@neo4j-nvl/react` and `@neo4j-nvl/interaction-handlers` (Jest users transforming `@neo4j-nvl/*` also need to transform `lodash-es`).
18
+ * Type declarations of `@neo4j-nvl/base` now resolve correctly with `moduleResolution: "nodenext"`.
19
+ * Container resizing uses the native `ResizeObserver` instead of the `resizelistener` dependency.
20
+ * Default `height` and `outline` styles of NVL containers can now be overridden by stylesheets.
21
+
22
+ ### Fixed
23
+
24
+ * `fit()` zooms out beyond `minZoom` when `allowDynamicMinZoom` is `true` and the graph does not fit the viewport.
25
+ * `onHover` callback's `element` parameter is now typed as possibly `undefined`, matching the runtime behaviour.
26
+ * Added missing caret for the React 18 peer dependency range in `@neo4j-nvl/react`.
27
+
5
28
  ## [2.0.0] - 2026-09-15
6
29
 
7
30
  This 2.0.0 major release upgrades NVL to WebGL2 for both the renderer and physics engine, unlocking major performance improvements. It also adds new clustering capabilities with visual decorations to the force directed and hierarchical layouts.
@@ -1,2 +1,2 @@
1
1
  export declare const NODE_EDGE_WIDTH = 10;
2
- export declare const DRAG_THRESHOLD = 10;
2
+ export declare const DRAG_THRESHOLD = 10;
package/lib/constants.js CHANGED
@@ -1,2 +1,4 @@
1
- export const NODE_EDGE_WIDTH = 10;
2
- export const DRAG_THRESHOLD = 10;
1
+ // src/constants.ts
2
+ const NODE_EDGE_WIDTH = 10;
3
+ const DRAG_THRESHOLD = 10;
4
+ export { DRAG_THRESHOLD, NODE_EDGE_WIDTH };
package/lib/index.d.ts CHANGED
@@ -1,20 +1,10 @@
1
- import type { BoxSelectInteractionCallbacks, BoxSelectInteractionOptions } from './interaction-handlers/box-select-interaction';
2
- import { BoxSelectInteraction } from './interaction-handlers/box-select-interaction';
3
- import type { ClickInteractionCallbacks, ClickInteractionOptions } from './interaction-handlers/click-interaction';
4
- import { ClickInteraction } from './interaction-handlers/click-interaction';
5
- import { DragNodeInteraction } from './interaction-handlers/drag-node-interaction';
6
- import type { DragNodeInteractionCallbacks } from './interaction-handlers/drag-node-interaction';
7
- import { DrawInteraction } from './interaction-handlers/draw-interaction';
8
- import type { DrawInteractionCallbacks, DrawInteractionOptions } from './interaction-handlers/draw-interaction';
9
- import type { HoverInteractionCallbacks, HoverInteractionOptions } from './interaction-handlers/hover-interaction';
10
- import { HoverInteraction } from './interaction-handlers/hover-interaction';
11
- import type { KeyboardInteractionCallbacks, KeyboardInteractionOptions } from './interaction-handlers/keyboard-interaction';
12
- import { KeyboardInteraction } from './interaction-handlers/keyboard-interaction';
13
- import { LassoInteraction } from './interaction-handlers/lasso-interaction';
14
- import type { LassoInteractionCallbacks, LassoInteractionOptions } from './interaction-handlers/lasso-interaction';
15
- import type { PanInteractionCallbacks, PanInteractionOptions } from './interaction-handlers/pan-interaction';
16
- import { PanInteraction } from './interaction-handlers/pan-interaction';
17
- import type { ZoomInteractionCallbacks, ZoomInteractionOptions } from './interaction-handlers/zoom-interaction';
18
- import { ZoomInteraction } from './interaction-handlers/zoom-interaction';
19
- export type { BoxSelectInteractionOptions, BoxSelectInteractionCallbacks, ClickInteractionOptions, HoverInteractionOptions, HoverInteractionCallbacks, DragNodeInteractionCallbacks, ClickInteractionCallbacks, KeyboardInteractionCallbacks, KeyboardInteractionOptions, PanInteractionCallbacks, DrawInteractionCallbacks, PanInteractionOptions, ZoomInteractionCallbacks, ZoomInteractionOptions, LassoInteractionOptions, LassoInteractionCallbacks, DrawInteractionOptions };
20
- export { ZoomInteraction, PanInteraction, BoxSelectInteraction, ClickInteraction, HoverInteraction, DragNodeInteraction, DrawInteraction, LassoInteraction, KeyboardInteraction };
1
+ import { BoxSelectInteraction, BoxSelectInteractionCallbacks, BoxSelectInteractionOptions } from "./interaction-handlers/box-select-interaction.js";
2
+ import { ClickInteraction, ClickInteractionCallbacks, ClickInteractionOptions } from "./interaction-handlers/click-interaction.js";
3
+ import { DragNodeInteraction, DragNodeInteractionCallbacks } from "./interaction-handlers/drag-node-interaction.js";
4
+ import { DrawInteraction, DrawInteractionCallbacks, DrawInteractionOptions } from "./interaction-handlers/draw-interaction.js";
5
+ import { HoverInteraction, HoverInteractionCallbacks, HoverInteractionOptions } from "./interaction-handlers/hover-interaction.js";
6
+ import { KeyboardInteraction, KeyboardInteractionCallbacks, KeyboardInteractionOptions } from "./interaction-handlers/keyboard-interaction.js";
7
+ import { LassoInteraction, LassoInteractionCallbacks, LassoInteractionOptions } from "./interaction-handlers/lasso-interaction.js";
8
+ import { PanInteraction, PanInteractionCallbacks, PanInteractionOptions } from "./interaction-handlers/pan-interaction.js";
9
+ import { ZoomInteraction, ZoomInteractionCallbacks, ZoomInteractionOptions } from "./interaction-handlers/zoom-interaction.js";
10
+ export { BoxSelectInteraction, type BoxSelectInteractionCallbacks, type BoxSelectInteractionOptions, ClickInteraction, type ClickInteractionCallbacks, type ClickInteractionOptions, DragNodeInteraction, type DragNodeInteractionCallbacks, DrawInteraction, type DrawInteractionCallbacks, type DrawInteractionOptions, HoverInteraction, type HoverInteractionCallbacks, type HoverInteractionOptions, KeyboardInteraction, type KeyboardInteractionCallbacks, type KeyboardInteractionOptions, LassoInteraction, type LassoInteractionCallbacks, type LassoInteractionOptions, PanInteraction, type PanInteractionCallbacks, type PanInteractionOptions, ZoomInteraction, type ZoomInteractionCallbacks, type ZoomInteractionOptions };
package/lib/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import { BoxSelectInteraction } from './interaction-handlers/box-select-interaction';
2
- import { ClickInteraction } from './interaction-handlers/click-interaction';
3
- import { DragNodeInteraction } from './interaction-handlers/drag-node-interaction';
4
- import { DrawInteraction } from './interaction-handlers/draw-interaction';
5
- import { HoverInteraction } from './interaction-handlers/hover-interaction';
6
- import { KeyboardInteraction } from './interaction-handlers/keyboard-interaction';
7
- import { LassoInteraction } from './interaction-handlers/lasso-interaction';
8
- import { PanInteraction } from './interaction-handlers/pan-interaction';
9
- import { ZoomInteraction } from './interaction-handlers/zoom-interaction';
10
- export { ZoomInteraction, PanInteraction, BoxSelectInteraction, ClickInteraction, HoverInteraction, DragNodeInteraction, DrawInteraction, LassoInteraction, KeyboardInteraction };
1
+ import { BoxSelectInteraction } from "./interaction-handlers/box-select-interaction.js";
2
+ import { ClickInteraction } from "./interaction-handlers/click-interaction.js";
3
+ import { DragNodeInteraction } from "./interaction-handlers/drag-node-interaction.js";
4
+ import { DrawInteraction } from "./interaction-handlers/draw-interaction.js";
5
+ import { HoverInteraction } from "./interaction-handlers/hover-interaction.js";
6
+ import { KeyboardInteraction } from "./interaction-handlers/keyboard-interaction.js";
7
+ import { LassoInteraction } from "./interaction-handlers/lasso-interaction.js";
8
+ import { PanInteraction } from "./interaction-handlers/pan-interaction.js";
9
+ import { ZoomInteraction } from "./interaction-handlers/zoom-interaction.js";
10
+ export { BoxSelectInteraction, ClickInteraction, DragNodeInteraction, DrawInteraction, HoverInteraction, KeyboardInteraction, LassoInteraction, PanInteraction, ZoomInteraction };
@@ -1,4 +1,4 @@
1
- import type { NVL } from '@neo4j-nvl/base';
1
+ import { NVL } from "@neo4j-nvl/base";
2
2
  /**
3
3
  * Base class for all interactions.
4
4
  * @abstract
@@ -6,70 +6,70 @@ import type { NVL } from '@neo4j-nvl/base';
6
6
  * @hidden
7
7
  */
8
8
  declare abstract class BaseInteraction<P extends Record<string, unknown>> {
9
- private readonly nvl;
10
- private readonly options;
11
- private readonly container;
12
- /**
13
- * @internal
14
- * @hidden
15
- */
16
- callbackMap: Map<string, ((...args: unknown[]) => void) | boolean>;
17
- /**
18
- * @internal
19
- * @hidden
20
- */
21
- constructor(nvl: NVL, options: P);
22
- /**
23
- * @internal
24
- * @hidden
25
- */
26
- get nvlInstance(): NVL;
27
- /**
28
- * Returns the current options of the interaction.
29
- * @returns The current options of the interaction.
30
- */
31
- get currentOptions(): P;
32
- /**
33
- * @internal
34
- * @hidden
35
- */
36
- get containerInstance(): HTMLElement;
37
- /**
38
- * @internal
39
- * @hidden
40
- */
41
- addEventListener: (type: keyof HTMLElementEventMap, listener: (event: Event) => void, options?: boolean | AddEventListenerOptions) => void;
42
- /**
43
- * @internal
44
- * @hidden
45
- */
46
- removeEventListener: (type: keyof HTMLElementEventMap, listener: (event: Event) => void, options?: boolean | EventListenerOptions) => void;
47
- /**
48
- * @internal
49
- * @hidden
50
- */
51
- callCallbackIfRegistered: (name: string, ...args: unknown[]) => void;
52
- /**
53
- * Add or update a callback for a given event of type.
54
- * @param name - The name of the event.
55
- * @param callback - The callback to be called when the event is triggered.
56
- */
57
- updateCallback: (name: string, callback: ((...args: unknown[]) => void) | boolean) => void;
58
- /**
59
- * Remove a callback for a given event of type.
60
- * @param name - The name of the event.
61
- */
62
- removeCallback: (name: string) => void;
63
- /**
64
- * Enables or disables global text selection during a drag or pan operation.
65
- * @param enable - Whether to enable or disable global text selection.
66
- * @param eventFunction - The event function to be added/removed when text selection is disabled/enabled.
67
- */
68
- toggleGlobalTextSelection: (enable: boolean, eventFunction?: (this: HTMLElement, ev: MouseEvent) => void) => void;
69
- /**
70
- * @internal
71
- * @hidden
72
- */
73
- abstract destroy(): void;
9
+ private readonly nvl;
10
+ private readonly options;
11
+ private readonly container;
12
+ /**
13
+ * @internal
14
+ * @hidden
15
+ */
16
+ callbackMap: Map<string, ((...args: unknown[]) => void) | boolean>;
17
+ /**
18
+ * @internal
19
+ * @hidden
20
+ */
21
+ constructor(nvl: NVL, options: P);
22
+ /**
23
+ * @internal
24
+ * @hidden
25
+ */
26
+ get nvlInstance(): NVL;
27
+ /**
28
+ * Returns the current options of the interaction.
29
+ * @returns The current options of the interaction.
30
+ */
31
+ get currentOptions(): P;
32
+ /**
33
+ * @internal
34
+ * @hidden
35
+ */
36
+ get containerInstance(): HTMLElement;
37
+ /**
38
+ * @internal
39
+ * @hidden
40
+ */
41
+ addEventListener: (type: keyof HTMLElementEventMap, listener: (event: Event) => void, options?: boolean | AddEventListenerOptions) => void;
42
+ /**
43
+ * @internal
44
+ * @hidden
45
+ */
46
+ removeEventListener: (type: keyof HTMLElementEventMap, listener: (event: Event) => void, options?: boolean | EventListenerOptions) => void;
47
+ /**
48
+ * @internal
49
+ * @hidden
50
+ */
51
+ callCallbackIfRegistered: (name: string, ...args: unknown[]) => void;
52
+ /**
53
+ * Add or update a callback for a given event of type.
54
+ * @param name - The name of the event.
55
+ * @param callback - The callback to be called when the event is triggered.
56
+ */
57
+ updateCallback: (name: string, callback: ((...args: unknown[]) => void) | boolean) => void;
58
+ /**
59
+ * Remove a callback for a given event of type.
60
+ * @param name - The name of the event.
61
+ */
62
+ removeCallback: (name: string) => void;
63
+ /**
64
+ * Enables or disables global text selection during a drag or pan operation.
65
+ * @param enable - Whether to enable or disable global text selection.
66
+ * @param eventFunction - The event function to be added/removed when text selection is disabled/enabled.
67
+ */
68
+ toggleGlobalTextSelection: (enable: boolean, eventFunction?: (this: HTMLElement, ev: MouseEvent) => void) => void;
69
+ /**
70
+ * @internal
71
+ * @hidden
72
+ */
73
+ abstract destroy(): void;
74
74
  }
75
- export { BaseInteraction };
75
+ export { BaseInteraction };
@@ -1,106 +1,100 @@
1
+ // src/interaction-handlers/base.ts
1
2
  /**
2
- * Base class for all interactions.
3
- * @abstract
4
- * @internal
5
- * @hidden
6
- */
7
- class BaseInteraction {
8
- nvl;
9
- options;
10
- container;
11
- /**
12
- * @internal
13
- * @hidden
14
- */
15
- callbackMap;
16
- /**
17
- * @internal
18
- * @hidden
19
- */
20
- constructor(nvl, options) {
21
- this.nvl = nvl;
22
- this.options = options;
23
- this.container = this.nvl.getContainer();
24
- this.callbackMap = new Map();
25
- }
26
- /**
27
- * @internal
28
- * @hidden
29
- */
30
- get nvlInstance() {
31
- return this.nvl;
32
- }
33
- /**
34
- * Returns the current options of the interaction.
35
- * @returns The current options of the interaction.
36
- */
37
- get currentOptions() {
38
- return this.options;
39
- }
40
- /**
41
- * @internal
42
- * @hidden
43
- */
44
- get containerInstance() {
45
- return this.container;
46
- }
47
- /**
48
- * @internal
49
- * @hidden
50
- */
51
- addEventListener = (type, listener, options) => {
52
- this.container?.addEventListener(type, listener, options);
53
- };
54
- /**
55
- * @internal
56
- * @hidden
57
- */
58
- removeEventListener = (type, listener, options) => {
59
- this.container?.removeEventListener(type, listener, options);
60
- };
61
- /**
62
- * @internal
63
- * @hidden
64
- */
65
- callCallbackIfRegistered = (name, ...args) => {
66
- const callback = this.callbackMap.get(name);
67
- if (typeof callback === 'function') {
68
- callback(...args);
69
- }
70
- };
71
- /**
72
- * Add or update a callback for a given event of type.
73
- * @param name - The name of the event.
74
- * @param callback - The callback to be called when the event is triggered.
75
- */
76
- updateCallback = (name, callback) => {
77
- this.callbackMap.set(name, callback);
78
- };
79
- /**
80
- * Remove a callback for a given event of type.
81
- * @param name - The name of the event.
82
- */
83
- removeCallback = (name) => {
84
- this.callbackMap.delete(name);
85
- };
86
- /**
87
- * Enables or disables global text selection during a drag or pan operation.
88
- * @param enable - Whether to enable or disable global text selection.
89
- * @param eventFunction - The event function to be added/removed when text selection is disabled/enabled.
90
- */
91
- toggleGlobalTextSelection = (enable, eventFunction) => {
92
- if (enable) {
93
- document.body.style.removeProperty('user-select');
94
- if (eventFunction) {
95
- document.body.removeEventListener('mouseup', eventFunction);
96
- }
97
- }
98
- else {
99
- document.body.style.setProperty('user-select', 'none', 'important');
100
- if (eventFunction) {
101
- document.body.addEventListener('mouseup', eventFunction);
102
- }
103
- }
104
- };
105
- }
3
+ * Base class for all interactions.
4
+ * @abstract
5
+ * @internal
6
+ * @hidden
7
+ */
8
+ var BaseInteraction = class {
9
+ nvl;
10
+ options;
11
+ container;
12
+ /**
13
+ * @internal
14
+ * @hidden
15
+ */
16
+ callbackMap;
17
+ /**
18
+ * @internal
19
+ * @hidden
20
+ */
21
+ constructor(nvl, options) {
22
+ this.nvl = nvl;
23
+ this.options = options;
24
+ this.container = this.nvl.getContainer();
25
+ this.callbackMap = /* @__PURE__ */ new Map();
26
+ }
27
+ /**
28
+ * @internal
29
+ * @hidden
30
+ */
31
+ get nvlInstance() {
32
+ return this.nvl;
33
+ }
34
+ /**
35
+ * Returns the current options of the interaction.
36
+ * @returns The current options of the interaction.
37
+ */
38
+ get currentOptions() {
39
+ return this.options;
40
+ }
41
+ /**
42
+ * @internal
43
+ * @hidden
44
+ */
45
+ get containerInstance() {
46
+ return this.container;
47
+ }
48
+ /**
49
+ * @internal
50
+ * @hidden
51
+ */
52
+ addEventListener = (type, listener, options) => {
53
+ this.container?.addEventListener(type, listener, options);
54
+ };
55
+ /**
56
+ * @internal
57
+ * @hidden
58
+ */
59
+ removeEventListener = (type, listener, options) => {
60
+ this.container?.removeEventListener(type, listener, options);
61
+ };
62
+ /**
63
+ * @internal
64
+ * @hidden
65
+ */
66
+ callCallbackIfRegistered = (name, ...args) => {
67
+ const callback = this.callbackMap.get(name);
68
+ if (typeof callback === "function") callback(...args);
69
+ };
70
+ /**
71
+ * Add or update a callback for a given event of type.
72
+ * @param name - The name of the event.
73
+ * @param callback - The callback to be called when the event is triggered.
74
+ */
75
+ updateCallback = (name, callback) => {
76
+ this.callbackMap.set(name, callback);
77
+ };
78
+ /**
79
+ * Remove a callback for a given event of type.
80
+ * @param name - The name of the event.
81
+ */
82
+ removeCallback = (name) => {
83
+ this.callbackMap.delete(name);
84
+ };
85
+ /**
86
+ * Enables or disables global text selection during a drag or pan operation.
87
+ * @param enable - Whether to enable or disable global text selection.
88
+ * @param eventFunction - The event function to be added/removed when text selection is disabled/enabled.
89
+ */
90
+ toggleGlobalTextSelection = (enable, eventFunction) => {
91
+ if (enable) {
92
+ document.body.style.removeProperty("user-select");
93
+ if (eventFunction) document.body.removeEventListener("mouseup", eventFunction);
94
+ } else {
95
+ document.body.style.setProperty("user-select", "none", "important");
96
+ if (eventFunction) document.body.addEventListener("mouseup", eventFunction);
97
+ }
98
+ };
99
+ };
106
100
  export { BaseInteraction };
@@ -1,33 +1,33 @@
1
- import type { NVL, Node, Relationship } from '@neo4j-nvl/base';
2
- import { BaseInteraction } from './base';
1
+ import { BaseInteraction } from "./base.js";
2
+ import { NVL, Node, Relationship } from "@neo4j-nvl/base";
3
3
  /**
4
4
  * Options for the multi-select interaction handler to customize its behavior.
5
5
  */
6
6
  export type BoxSelectInteractionOptions = {
7
- /**
8
- * If true, the selection will be applied when the mouse is released.
9
- * @default false
10
- */
11
- selectOnRelease?: boolean;
7
+ /**
8
+ * If true, the selection will be applied when the mouse is released.
9
+ * @default false
10
+ */
11
+ selectOnRelease?: boolean;
12
12
  };
13
13
  /**
14
14
  * Callbacks for the box select interaction handler.
15
15
  */
16
16
  export type BoxSelectInteractionCallbacks = {
17
- /**
18
- * Called once when the user presses the mouse on the canvas, starting the box selection.
19
- * @param event - The original mouse event.
20
- */
21
- onBoxStarted?: ((event: MouseEvent) => void) | boolean;
22
- /**
23
- * Called once the user releases the mouse after multi-selecting.
24
- * @param selectionObject - The selected nodes and relationships.
25
- * @param event - The original mouse event.
26
- */
27
- onBoxSelect?: (({ nodes, rels }: {
28
- nodes: Node[];
29
- rels: Relationship[];
30
- }, event: MouseEvent) => void) | boolean;
17
+ /**
18
+ * Called once when the user presses the mouse on the canvas, starting the box selection.
19
+ * @param event - The original mouse event.
20
+ */
21
+ onBoxStarted?: ((event: MouseEvent) => void) | boolean;
22
+ /**
23
+ * Called once the user releases the mouse after multi-selecting.
24
+ * @param selectionObject - The selected nodes and relationships.
25
+ * @param event - The original mouse event.
26
+ */
27
+ onBoxSelect?: (({ nodes, rels }: {
28
+ nodes: Node[];
29
+ rels: Relationship[];
30
+ }, event: MouseEvent) => void) | boolean;
31
31
  };
32
32
  /**
33
33
  * An interaction handler for multi-selecting nodes and relationships.
@@ -36,26 +36,26 @@ export type BoxSelectInteractionCallbacks = {
36
36
  * For examples, head to the {@link https://neo4j.com/docs/nvl/current/interaction-handlers/#_boxselectinteraction Box Select Interaction documentation page}.
37
37
  */
38
38
  export declare class BoxSelectInteraction extends BaseInteraction<BoxSelectInteractionOptions> {
39
- private mousePosition;
40
- private startWorldPosition;
41
- private startClientPosition;
42
- private overlayRenderer;
43
- private isBoxSelecting;
44
- private boxSelectPending;
45
- /**
46
- * Creates a new instance of the multi-select interaction handler.
47
- * @param nvl - The NVL instance to attach the interaction handler to.
48
- * @param options - Options for the multi-select interaction handler to customize its behavior.
49
- */
50
- constructor(nvl: NVL, options?: BoxSelectInteractionOptions);
51
- private handleMouseDown;
52
- private handleDrag;
53
- private getHitsInBox;
54
- private endBoxSelect;
55
- /**
56
- * Removes all related event listeners and the overlay renderer for the box.
57
- */
58
- destroy(): void;
59
- private activateBoxSelect;
60
- private turnOnBoxSelect;
61
- }
39
+ private mousePosition;
40
+ private startWorldPosition;
41
+ private startClientPosition;
42
+ private overlayRenderer;
43
+ private isBoxSelecting;
44
+ private boxSelectPending;
45
+ /**
46
+ * Creates a new instance of the multi-select interaction handler.
47
+ * @param nvl - The NVL instance to attach the interaction handler to.
48
+ * @param options - Options for the multi-select interaction handler to customize its behavior.
49
+ */
50
+ constructor(nvl: NVL, options?: BoxSelectInteractionOptions);
51
+ private handleMouseDown;
52
+ private handleDrag;
53
+ private getHitsInBox;
54
+ private endBoxSelect;
55
+ /**
56
+ * Removes all related event listeners and the overlay renderer for the box.
57
+ */
58
+ destroy(): void;
59
+ private activateBoxSelect;
60
+ private turnOnBoxSelect;
61
+ }