@neo4j-nvl/interaction-handlers 0.2.57 → 0.2.59

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.
@@ -184,13 +184,22 @@ export class DrawInteraction extends BaseInteraction {
184
184
  this.mouseDownNode = hitNodeEdges[0];
185
185
  const canvasPos = getCanvasPosition(this.containerInstance, event);
186
186
  const pos = getWorldPosition(this.nvlInstance, canvasPos);
187
+ const color = this.currentOptions.ghostGraphStyling?.node?.color ?? DefaultGhostGraphStyling.node.color;
188
+ const html = document.createElement('div');
189
+ html.style.width = '110%';
190
+ html.style.height = '110%';
191
+ html.style.position = 'absolute';
192
+ html.style.left = '-5%';
193
+ html.style.top = '-5%';
194
+ html.style.borderRadius = '50%';
195
+ html.style.backgroundColor = color;
187
196
  this.newTempTargetNode = {
188
197
  id: generateUniqueId(13),
189
198
  size: this.currentOptions.ghostGraphStyling?.node?.size ?? DefaultGhostGraphStyling.node.size,
190
199
  selected: false,
191
200
  x: pos.x,
192
201
  y: pos.y,
193
- color: this.currentOptions.ghostGraphStyling?.node?.color ?? DefaultGhostGraphStyling.node.color
202
+ html
194
203
  };
195
204
  this.setNewRegularRelationshipToNewTempTargetNode();
196
205
  this.nvlInstance.addAndUpdateElementsInGraph([this.newTempTargetNode], this.newTempRegularRelationshipToNewTempTargetNode ? [this.newTempRegularRelationshipToNewTempTargetNode] : []);
@@ -49,7 +49,7 @@ export class PanInteraction extends BaseInteraction {
49
49
  };
50
50
  handleMouseDown = (event) => {
51
51
  const hits = this.nvlInstance.getHits(event, difference(['node', 'relationship'], this.targets), {
52
- hitNodeMarginWidth: this.currentOptions.excludeNodeMargin ? NODE_EDGE_WIDTH : 0
52
+ hitNodeMarginWidth: this.currentOptions.excludeNodeMargin === true ? NODE_EDGE_WIDTH : 0
53
53
  });
54
54
  if (hits.nvlTargets.nodes.length > 0 || hits.nvlTargets.relationships.length > 0) {
55
55
  this.shouldPan = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neo4j-nvl/interaction-handlers",
3
- "version": "0.2.57",
3
+ "version": "0.2.59",
4
4
  "license": "SEE LICENSE IN 'Neo4j Early Access Agreement - Visualization Library.pdf'",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",