Skip to content
Snippets Groups Projects
Commit ce9ba9f7 authored by Harm Kube's avatar Harm Kube
Browse files

First Handler-function

parent cd57ce6d
No related branches found
No related tags found
No related merge requests found
Pipeline #52638 passed
......@@ -69,6 +69,7 @@ export default class Graph {
this.onNodeHover(node);
this.updateHighlight();
})
.onNodeDragEnd((node, translate) => this.onNodeDragEnd(node, translate))
.onLinkHover((link) => this.onLinkHover(link))
//.linkColor((link) => this.getLinkColor(link))
.linkPositionUpdate((line, { start, end }) =>
......@@ -80,6 +81,7 @@ export default class Graph {
.onEngineTick(() => this.initializeModel())
.width(Helpers.getWidth())
.height(Helpers.getHeight());
}
/**
......@@ -194,6 +196,18 @@ export default class Graph {
this.updateHighlight();
}
onNodeDragEnd(node, translate) {
// NodeDrag is handled like NodeClick if distance is very short
if(Math.sqrt(Math.pow(translate.x, 2)+ Math.pow(translate.y, 2)+ Math.pow(translate.z, 2)) < 10) {
this.focusOnNode(node);
if (MODE === "default") {
this.infoOverlay.updateInfoOverlay(node);
}
console.log("Hello Inside");
}
console.log("Hello Outside");
}
focusOnNode(node) {
if (typeof node == "string") {
node = this.idToNode[node];
......@@ -500,4 +514,6 @@ export default class Graph {
return group;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment