@neo4j-nvl/interaction-handlers 1.2.2 → 2.0.0
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.
- package/CHANGELOG.md +31 -1
- package/README.md +4 -4
- package/lib/__tests__/click-interaction.test.js +450 -264
- package/lib/__tests__/hover-interaction.test.js +83 -15
- package/lib/__tests__/zoom-interaction.test.js +20 -46
- package/lib/interaction-handlers/box-select-interaction.d.ts +1 -1
- package/lib/interaction-handlers/click-interaction.d.ts +46 -16
- package/lib/interaction-handlers/click-interaction.js +55 -34
- package/lib/interaction-handlers/hover-interaction.d.ts +5 -5
- package/lib/interaction-handlers/lasso-interaction.d.ts +1 -1
- package/lib/interaction-handlers/pan-interaction.d.ts +1 -1
- package/lib/interaction-handlers/zoom-interaction.d.ts +1 -8
- package/lib/interaction-handlers/zoom-interaction.js +0 -1
- package/package.json +2 -2
|
@@ -6,7 +6,7 @@ import { BaseInteraction } from './base';
|
|
|
6
6
|
export type ZoomInteractionOptions = {
|
|
7
7
|
/**
|
|
8
8
|
* If true, the interaction handler will not update the NVL instance directly.
|
|
9
|
-
* Instead, it will only call the
|
|
9
|
+
* Instead, it will only call the onZoomAndPan callback with the calculated values,
|
|
10
10
|
* allowing the parent application to control when and how to apply the zoom update.
|
|
11
11
|
* @defaultValue false
|
|
12
12
|
*/
|
|
@@ -16,13 +16,6 @@ export type ZoomInteractionOptions = {
|
|
|
16
16
|
* Callbacks for the zoom interaction handler.
|
|
17
17
|
*/
|
|
18
18
|
export type ZoomInteractionCallbacks = {
|
|
19
|
-
/**
|
|
20
|
-
* Called when the canvas is zoomed.
|
|
21
|
-
* @param zoomLevel - The zoom level.
|
|
22
|
-
* @param event - The original mouse wheel event.
|
|
23
|
-
* @deprecated Use {@link onZoomAndPan} instead.
|
|
24
|
-
*/
|
|
25
|
-
onZoom?: ((zoomLevel: number, event: WheelEvent) => void) | boolean;
|
|
26
19
|
/**
|
|
27
20
|
* Called when the canvas is zoomed and panned.
|
|
28
21
|
* @param zoomLevel - The zoom level.
|
|
@@ -61,7 +61,6 @@ export class ZoomInteraction extends BaseInteraction {
|
|
|
61
61
|
if (this.currentOptions.controlledZoom !== true) {
|
|
62
62
|
this.nvlInstance.setZoomAndPan(newZoomTarget, newPanX, newPanY);
|
|
63
63
|
}
|
|
64
|
-
this.callCallbackIfRegistered('onZoom', newZoomTarget, event);
|
|
65
64
|
this.callCallbackIfRegistered('onZoomAndPan', newZoomTarget, newPanX, newPanY, event);
|
|
66
65
|
}, 25, { leading: true });
|
|
67
66
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-nvl/interaction-handlers",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"license": "SEE LICENSE IN 'LICENSE.txt'",
|
|
5
5
|
"homepage": "https://neo4j.com/docs/nvl/current/",
|
|
6
6
|
"description": "Interaction handlers for the Neo4j Visualization Library",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"eslint": "yarn global:eslint ./src/"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@neo4j-nvl/base": "
|
|
30
|
+
"@neo4j-nvl/base": "2.0.0",
|
|
31
31
|
"concaveman": "1.2.1",
|
|
32
32
|
"lodash": "4.18.1"
|
|
33
33
|
},
|