Skip to content
Snippets Groups Projects
Commit 20311864 authored by Matthias Konitzny's avatar Matthias Konitzny :fire:
Browse files

Moved js source files to src folder

parent b83c67b3
No related branches found
No related tags found
No related merge requests found
Showing
with 12 additions and 8 deletions
File moved
File moved
import { State } from "./state";
import * as Graph from "./graph";
import { loadGraphJson } from "../../datasets/datasets";
import { loadGraphJson } from "../../../datasets/datasets";
import ForceGraph from "force-graph";
import * as Interactions from "./interactions";
import { setSpace, SPACE } from "../../config";
......@@ -57,7 +57,9 @@ function load() {
.linkColor((link) => state.linkColor(link))
.nodeColor((node) => state.nodeColor(node))
.onNodeClick((node) => state.onNodeClick(node))
.onNodeDragEnd((node, translate) => state.onNodeDragEnd(node, translate))
.onNodeDragEnd((node, translate) =>
state.onNodeDragEnd(node, translate)
)
.autoPauseRedraw(false) // keep redrawing after engine has stopped
.linkWidth((link) => state.linkWidth(link))
.linkDirectionalParticles(state.linkDirectionalParticles())
......
......@@ -56,7 +56,6 @@ export class Graph extends ManagedData {
clearTimeout(this.physicsStopTimeoutId);
}
this.data = Graph.addIdentifiers(this.getCleanData(this.data, false));
this.triggerOnChange();
......@@ -143,7 +142,9 @@ export class Graph extends ManagedData {
this.enableStoring();
}
this.storeCurrentData("Deleted nodes with ids [" + nodeIds.join(",") + "]");
this.storeCurrentData(
"Deleted nodes with ids [" + nodeIds.join(",") + "]"
);
}
stopPhysics() {
......
import jQuery from "jquery";
import { state } from "./editor";
import { listAllSpaces, saveGraphJson } from "../../datasets/datasets";
import { listAllSpaces, saveGraphJson } from "../../../datasets/datasets";
import { SPACE } from "../../config";
/**
......
File moved
......@@ -95,11 +95,12 @@ export class State extends Tool {
onNodeDragEnd(node, translate) {
// Handle as click event, if drag distance under a certain threshold
var distanceDragged = Math.sqrt(Math.pow(translate.x, 2) + Math.pow(translate.y, 2));
var distanceDragged = Math.sqrt(
Math.pow(translate.x, 2) + Math.pow(translate.y, 2)
);
if (distanceDragged < DRAG_THRESHOLD_2D) {
this.onNodeClick(node);
return;
} else {
this.tool.onNodeDragEnd(node, translate);
}
......
File moved
File moved
File moved
File moved
File moved
File moved
import Tool from "./tool";
import { saveGraphJson } from "../../../datasets/datasets";
import { saveGraphJson } from "../../../../datasets/datasets";
import { state, graph } from "../editor";
import { SPACE } from "../../../config";
......
File moved
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