dag-builder-js
Advanced tools
Comparing version 0.0.14 to 0.0.15
{ | ||
"name": "dag-builder-js", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "dag-builder-js is a simple-to-use Javascript DAG library with support to N:N vertices/edges. It supports validating that no cycle can be created in real-time, import/export states and it's built on SVG so you can render graphs pretty much anywhere.", | ||
@@ -5,0 +5,0 @@ "main": "dist/dag.js", |
@@ -153,3 +153,3 @@ Directed-Acyclic-Graph-Builder-js (dag-builder-js) | ||
function onEdgeAdded(type, graph, vertex){ | ||
function onEdgeAdded(type, graph, edge){ | ||
// When edge is added to graph | ||
@@ -169,3 +169,3 @@ } | ||
function onEdgeRemoved(type, graph, vertex){ | ||
function onEdgeRemoved(type, graph, edge){ | ||
// When edge is removed from graph | ||
@@ -172,0 +172,0 @@ } |
@@ -54,8 +54,12 @@ /* SPDX-License-Identifier: GPL-3.0-only */ | ||
// add support for selecting invididual edges | ||
this.setupClickEvents(); | ||
this.setupClickEvents(graph); | ||
} | ||
setupClickEvents() { | ||
this.drawingContext.on('click', (event) => { | ||
setupClickEvents(graph) { | ||
this.drawingContext.on('click', (event) => { | ||
event.stopPropagation(); | ||
/* ignore event if graph is in readOnly mode */ | ||
if(graph.readOnly) return; | ||
this.setSelected(!this.isSelected()); | ||
@@ -62,0 +66,0 @@ }); |
@@ -24,2 +24,3 @@ /* SPDX-License-Identifier: GPL-3.0-only */ | ||
this.edges = new EdgeContainer(); | ||
this.readOnly = false; | ||
@@ -140,2 +141,5 @@ /* internal-only listeners */ | ||
d3.select(window).on("keydown", (event) => { | ||
/* ignore event if graph is in readOnly mode */ | ||
if(this.readOnly) return; | ||
if ([46 /* delete */, 8 /* backspace */].includes(event.keyCode)) { | ||
@@ -231,2 +235,5 @@ // delete dependent edges on doomed vertices | ||
edgeConnectorGenericDragHandler(type, that, event) { | ||
/* ignore event if graph is in readOnly mode */ | ||
if(that.readOnly) return; | ||
let vertex = null; | ||
@@ -267,3 +274,3 @@ let connector = null; | ||
that.update(); | ||
} | ||
} | ||
} |
@@ -148,3 +148,3 @@ /* SPDX-License-Identifier: GPL-3.0-only */ | ||
// add support for selecting invididual vertices | ||
this.setupClickEvents(); | ||
this.setupClickEvents(graph); | ||
} | ||
@@ -201,5 +201,9 @@ | ||
setupClickEvents() { | ||
setupClickEvents(graph) { | ||
this.drawingContext.on('click', (event) => { | ||
event.stopPropagation(); | ||
/* ignore event if graph is in readOnly mode */ | ||
if(graph.readOnly) return; | ||
this.setSelected(!this.isSelected()); | ||
@@ -206,0 +210,0 @@ }); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2100154
15977