Browse Source

simulation prerendering is now a config var

filtering
Ruben van de Ven 1 year ago
parent
commit
f9dec8a947
  1. 7
      graph.js

7
graph.js

@ -3,6 +3,7 @@ const CONFIG = { @@ -3,6 +3,7 @@ const CONFIG = {
'nodeSize': 16,
'baseUrl': 'https://www.securityvision.io/wiki/index.php/',
'dataUrl': 'semantic_data.json',
'preSimulate': true, // run simulation before starting, so we don't start with lines jumping around
'labels': {
'rotate': true,
},
@ -302,8 +303,10 @@ function buildGraph(data) { @@ -302,8 +303,10 @@ function buildGraph(data) {
// simulate the first bit without drawing, so we don't have the 'jumping' graph in the beginning
for (var i = 0, n = Math.ceil(Math.log(simulation.alphaMin()) / Math.log(1 - simulation.alphaDecay())); i < n; ++i) {
simulation.tick();
if (CONFIG.preSimulate) {
for (var i = 0, n = Math.ceil(Math.log(simulation.alphaMin()) / Math.log(1 - simulation.alphaDecay())); i < n; ++i) {
simulation.tick();
}
}

Loading…
Cancel
Save