I was able to figure this out, and now the code looks like this:
// create a network var container = document.getElementById('mynetwork'); var data = { nodes: nodes, edges: edges }; var options = { nodes: { borderWidth:1, size:45, color: { border: '#222222', background: 'grey' }, font:{color:'black', size: 11, face :'arial', }, }, edges: { arrows: { to: {enabled: false, scaleFactor:1}, middle: {enabled: false, scaleFactor:1}, from: {enabled: false, scaleFactor:1} }, color: { color:'#848484', highlight:'#848484', hover: '#848484', }, font: { color: '#343434', size: 11, // px face: 'arial', background: 'none', strokeWidth: 5, // px strokeColor: '#ffffff', align:'vertical' }, smooth: { enabled: false, //setting to true enables curved lines //type: "dynamic", //roundness: 0.5 }, } }; network = new vis.Network(container, data, options); network.setOptions({ physics: {enabled:false} }); }
I had to move network.setOptions() , as shown in the new code, and now it works as desired.
Perry source share