Skip to content
Snippets Groups Projects
Commit d4403211 authored by Rafael László's avatar Rafael László :speech_balloon:
Browse files

Add graph manipulation

parent ead3e521
No related branches found
No related tags found
No related merge requests found
...@@ -39,6 +39,27 @@ ...@@ -39,6 +39,27 @@
}, },
shadow: true shadow: true
}, },
manipulation: {
addNode: function(nodeData,callback) {
const type = prompt("Type? (server, powerstrip, uplink, ups, switch)", "server");
const name = prompt("Name?", "node69")
const power = prompt("Power usage?", "420")
nodeData.label = name;
callback(nodeData);
},
deleteNode: function (nodeData, callback) {
callback(nodeData);
},
deleteEdge: function (edgeData, callback) {
callback(edgeData);
},
addEdge: function(edgeData,callback) {
if (edgeData.from !== edgeData.to) {
callback(edgeData);
}
},
editEdge: false
},
physics: { physics: {
forceAtlas2Based: { forceAtlas2Based: {
gravitationalConstant: -26, gravitationalConstant: -26,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment