 edges = [];

nodes = new vis.DataSet(nodesJson);
edges = new vis.DataSet(edgesJson);
var container = document.getElementById('mynetwork');
var data = {
nodes: nodes,
edges: edges
};
var options = {
nodes:{
shape: "box"
},
edges: {
smooth: true,
arrows: {
to: {
enabled: true
}
}
},
interaction: {
navigationButtons: true,
keyboard: true
},
layout: {
hierarchical:{
direction: directionInput.value
}
},
physics: {
hierarchicalRepulsion: {
centralGravity: 0.8,
springLength: 120,
springConstant: 1.2,
nodeDistance