I want to return the value of P221_JSON_PROCESS item to the variable and then return the value to the new vis.DataSet. I tried as follows:
// P221_JSON_PROCESS contains - { id: 1, label: "Node 1" },
function returnNodes() {
var process = document.getElementById("P221_JSON_PROCESS").value;
return process;
}
var nodes = new vis.DataSet([
returnNodes();
]);
// create an array with edges
var edges = new vis.DataSet([
]);
// create a network
var container = document.getElementById("mynetwork");
var data = {
nodes: nodes,
edges: edges,
};
var options = {};
var network = new vis.Network(container, data, options);
Thanks in advance!
You can use add method like
or