Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@neo4j-nvl/interaction-handlers

Package Overview
Dependencies
Maintainers
3
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neo4j-nvl/interaction-handlers - npm Package Compare versions

Comparing version 0.2.14 to 0.2.15

12

lib/interaction-handlers/drag-node-interaction.js
import { NODE_EDGE_WIDTH } from '../constants';
import { BaseInteraction } from './base';
const DragThreshold = 10;
/**

@@ -75,3 +76,3 @@ * Interaction handler for dragging nodes.

this.selectedNodes = this.nvlInstance.getSelectedNodes();
if (this.mouseDownNode && this.selectedNodes.map((node) => node.id).includes(this.mouseDownNode.data.id)) {
if (this.mouseDownNode !== null && this.selectedNodes.map((node) => node.id).includes(this.mouseDownNode.data.id)) {
this.moveSelectedNodes = true;

@@ -90,4 +91,11 @@ }

// Avoid conflicts on moving node position in drawing process.
if (!this.mouseDownNode || event.buttons !== 1 || this.isDrawing)
if (this.mouseDownNode === null || event.buttons !== 1 || this.isDrawing) {
return;
}
const diffX = Math.abs(event.clientX - this.mousePosition.x);
const diffY = Math.abs(event.clientY - this.mousePosition.y);
const distanceSquared = Math.pow(diffX, 2) + Math.pow(diffY, 2);
if (distanceSquared < DragThreshold) {
return;
}
const zoom = this.nvlInstance.getScale();

@@ -94,0 +102,0 @@ const dx = ((event.clientX - this.mousePosition.x) / zoom) * window.devicePixelRatio;

2

package.json
{
"name": "@neo4j-nvl/interaction-handlers",
"version": "0.2.14",
"version": "0.2.15",
"license": "SEE LICENSE IN 'Neo4j Early Access Agreement - Visualization Library.pdf'",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc