@neo4j-nvl/interaction-handlers 0.2.28 → 0.2.29
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/lib/interaction-handlers/base.d.ts +1 -1
- package/lib/interaction-handlers/draw-interaction.d.ts +1 -1
- package/lib/interaction-handlers/draw-interaction.js +1 -2
- package/lib/interaction-handlers/pan-interaction.d.ts +2 -2
- package/lib/interaction-handlers/zoom-interaction.d.ts +1 -1
- package/lib/overlay-renderer/overlay-renderer.js +6 -4
- package/package.json +1 -1
|
@@ -107,8 +107,7 @@ export class DrawInteraction extends BaseInteraction {
|
|
|
107
107
|
to: targetNode ? targetNode.id : newTargetNodeId,
|
|
108
108
|
captions: [{ value: 'TEST' }]
|
|
109
109
|
};
|
|
110
|
-
let x = pos
|
|
111
|
-
let y = pos.y;
|
|
110
|
+
let { x, y } = pos;
|
|
112
111
|
let size = 25;
|
|
113
112
|
if (hitNode) {
|
|
114
113
|
x = hitNode.targetCoordinates.x;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NVL } from '@neo4j-nvl/core';
|
|
1
|
+
import type { NVL } from '@neo4j-nvl/core';
|
|
2
2
|
import { BaseInteraction } from './base';
|
|
3
3
|
/**
|
|
4
4
|
* Options for the click interaction handler to customize its behavior.
|
|
@@ -59,7 +59,7 @@ export declare class PanInteraction extends BaseInteraction<PanInteractionCallba
|
|
|
59
59
|
* panInteraction.updateTargets([], true)
|
|
60
60
|
* ```
|
|
61
61
|
*/
|
|
62
|
-
updateTargets: (targets:
|
|
62
|
+
updateTargets: (targets: ('node' | 'relationship')[], excludeNodeMargin: boolean) => void;
|
|
63
63
|
private handleMouseDown;
|
|
64
64
|
private handleMouseMove;
|
|
65
65
|
private handleMouseUp;
|
|
@@ -49,8 +49,8 @@ export class OverlayRenderer {
|
|
|
49
49
|
_fixCanvasSize(canvas) {
|
|
50
50
|
const parent = canvas.parentElement;
|
|
51
51
|
const rect = parent.getBoundingClientRect();
|
|
52
|
-
const width = rect
|
|
53
|
-
const height = rect
|
|
52
|
+
const { width } = rect;
|
|
53
|
+
const { height } = rect;
|
|
54
54
|
const devicePixelRatio = window.devicePixelRatio || 1;
|
|
55
55
|
canvas.width = width * devicePixelRatio;
|
|
56
56
|
canvas.height = height * devicePixelRatio;
|
|
@@ -75,8 +75,9 @@ export class OverlayRenderer {
|
|
|
75
75
|
const localStartY = (startY - rect.top) * devicePixelRatio;
|
|
76
76
|
const localEndX = (endX - rect.left) * devicePixelRatio;
|
|
77
77
|
const localEndY = (endY - rect.top) * devicePixelRatio;
|
|
78
|
-
if (!this._ctx)
|
|
78
|
+
if (!this._ctx) {
|
|
79
79
|
return;
|
|
80
|
+
}
|
|
80
81
|
this._ctx.beginPath();
|
|
81
82
|
this._ctx.rect(localStartX, localStartY, localEndX - localStartX, localEndY - localStartY);
|
|
82
83
|
this._ctx.closePath();
|
|
@@ -100,8 +101,9 @@ export class OverlayRenderer {
|
|
|
100
101
|
clear() {
|
|
101
102
|
const rect = this.canvas.getBoundingClientRect();
|
|
102
103
|
const devicePixelRatio = window.devicePixelRatio || 1;
|
|
103
|
-
if (!this._ctx)
|
|
104
|
+
if (!this._ctx) {
|
|
104
105
|
return;
|
|
106
|
+
}
|
|
105
107
|
this._ctx.clearRect(0, 0, rect.width * devicePixelRatio, rect.height * devicePixelRatio);
|
|
106
108
|
}
|
|
107
109
|
destroy() {
|