You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 29, 2019. It is now read-only.
// create an array with nodes
var nodes = new vis.DataSet([
{ id: 0, label: '0' },
{ id: 1, label: '1' },
{ id: 2, label: '2' },
{ id: 3, label: '3' },
{ id: 4, label: '4' }
]);
// create an array with edges
var edges = [];
// create a network
var container = document.getElementById('mynetwork');
// provide the data in the vis format:
var data = {
nodes: nodes,
edges: edges
};
var options = {
manipulation: {
enabled: true,
initiallyActive: true,
deleteNode: function(deleteData, callback) {
callback(deleteData)
}
}
};
// initialize your network!
var network = new vis.Network(container, data, options);
As @danieldiekmeiersuggested, this is most likely because Vis checks for truthy-ness in the ids (because if you use a string as the id, it works, and you can remove the node):