@neo4j-nvl/interaction-handlers 0.2.33 → 0.2.35
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.
|
@@ -270,7 +270,6 @@ export class DrawInteraction extends BaseInteraction {
|
|
|
270
270
|
id: generateUniqueId(13),
|
|
271
271
|
from: this.mouseDownNode.data.id,
|
|
272
272
|
to: targetId,
|
|
273
|
-
captions: [{ value: 'TEST' }],
|
|
274
273
|
color: 'red'
|
|
275
274
|
};
|
|
276
275
|
}
|
|
@@ -294,7 +293,6 @@ export class DrawInteraction extends BaseInteraction {
|
|
|
294
293
|
id: generateUniqueId(13),
|
|
295
294
|
from: this.mouseDownNode.data.id,
|
|
296
295
|
to: this.mouseDownNode.data.id,
|
|
297
|
-
captions: [{ value: 'TEST' }],
|
|
298
296
|
color: 'red'
|
|
299
297
|
};
|
|
300
298
|
}
|
|
@@ -40,13 +40,13 @@ export type PanInteractionCallbacks = {
|
|
|
40
40
|
export declare class PanInteraction extends BaseInteraction<PanInteractionCallbacks> {
|
|
41
41
|
private mousePosition;
|
|
42
42
|
private targets;
|
|
43
|
-
private
|
|
43
|
+
private readonly options;
|
|
44
44
|
private shouldPan;
|
|
45
45
|
/**
|
|
46
46
|
* Creates a new instance of the pan interaction handler.
|
|
47
47
|
* @param nvl - The NVL instance to attach the interaction handler to
|
|
48
48
|
*/
|
|
49
|
-
constructor(nvl: NVL);
|
|
49
|
+
constructor(nvl: NVL, options?: PanInteractionOptions);
|
|
50
50
|
/**
|
|
51
51
|
* Updates which type of graph elements should hinder panning.
|
|
52
52
|
* @param targets - The graph elements that should hinder panning
|
|
@@ -19,7 +19,7 @@ export class PanInteraction extends BaseInteraction {
|
|
|
19
19
|
* Creates a new instance of the pan interaction handler.
|
|
20
20
|
* @param nvl - The NVL instance to attach the interaction handler to
|
|
21
21
|
*/
|
|
22
|
-
constructor(nvl) {
|
|
22
|
+
constructor(nvl, options = { excludeNodeMargin: false }) {
|
|
23
23
|
super(nvl);
|
|
24
24
|
Object.defineProperty(this, "mousePosition", {
|
|
25
25
|
enumerable: true,
|
|
@@ -33,7 +33,7 @@ export class PanInteraction extends BaseInteraction {
|
|
|
33
33
|
writable: true,
|
|
34
34
|
value: void 0
|
|
35
35
|
});
|
|
36
|
-
Object.defineProperty(this, "
|
|
36
|
+
Object.defineProperty(this, "options", {
|
|
37
37
|
enumerable: true,
|
|
38
38
|
configurable: true,
|
|
39
39
|
writable: true,
|
|
@@ -63,7 +63,7 @@ export class PanInteraction extends BaseInteraction {
|
|
|
63
63
|
writable: true,
|
|
64
64
|
value: (targets, excludeNodeMargin) => {
|
|
65
65
|
this.targets = targets;
|
|
66
|
-
this.excludeNodeMargin = excludeNodeMargin;
|
|
66
|
+
this.options.excludeNodeMargin = excludeNodeMargin;
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
69
|
Object.defineProperty(this, "handleMouseDown", {
|
|
@@ -72,7 +72,7 @@ export class PanInteraction extends BaseInteraction {
|
|
|
72
72
|
writable: true,
|
|
73
73
|
value: (event) => {
|
|
74
74
|
const hits = this.nvlInstance.getHits(event, difference(['node', 'relationship'], this.targets), {
|
|
75
|
-
hitNodeMarginWidth: this.excludeNodeMargin ? NODE_EDGE_WIDTH : 0
|
|
75
|
+
hitNodeMarginWidth: this.options.excludeNodeMargin ? NODE_EDGE_WIDTH : 0
|
|
76
76
|
});
|
|
77
77
|
if (hits.nvlTargets.nodes.length > 0 || hits.nvlTargets.relationships.length > 0) {
|
|
78
78
|
this.shouldPan = false;
|
|
@@ -110,7 +110,7 @@ export class PanInteraction extends BaseInteraction {
|
|
|
110
110
|
});
|
|
111
111
|
this.mousePosition = { x: 0, y: 0 };
|
|
112
112
|
this.targets = [];
|
|
113
|
-
this.
|
|
113
|
+
this.options = options;
|
|
114
114
|
this.shouldPan = false;
|
|
115
115
|
this.addEventListener('mousedown', this.handleMouseDown, true);
|
|
116
116
|
this.addEventListener('mousemove', this.handleMouseMove, true);
|