fix: now it's an array of arrays

This commit is contained in:
əlemi 2023-10-19 05:35:35 +02:00
parent f859314548
commit 6b4318f1cf

10
dist/index.html vendored
View file

@ -46,13 +46,13 @@
'#2E8757', '#2E8757',
'#05979A', '#05979A',
] ]
for (const i in graph.nodes) { for (const i in graph[0]) {
if (graph.nodes[i].label === domain) { graph.nodes[i].color = '#BF616A' } if (graph[0][i].title === domain) { graph[0][i].color = '#BF616A' }
else { graph.nodes[i].color = palette[Math.floor(Math.random() * palette.length)] } else { graph[0][i].color = palette[Math.floor(Math.random() * palette.length)] }
} }
const nodes = new vis.DataSet(graph.nodes); const nodes = new vis.DataSet(graph[0]);
const edges = new vis.DataSet(graph.vertices); const edges = new vis.DataSet(graph[1]);
// create a network // create a network
const container = document.getElementById("netgraph"); const container = document.getElementById("netgraph");