var rows; var nodes; var area; var edges; var k; var myMap = new Map(); function V(x,y){ this.x=x; this.y=y; this.dx=0; this.dy=0; } function preload(){ table = loadTable('3980.csv', 'csv'); } function setup(){ createCanvas(900, 900); print("Hello world!"); print(table.getRowCount() + ' total rows in table'); print(table.getColumnCount() + ' total columns in table'); //cycle through the table nodes=[]; edges=[]; rows = table.getRowCount(); for (var r = 0; r < table.getRowCount(); r++){ edges.push([table.getString(r,0),table.getString(r,1)]); for (var c = 0; c < table.getColumnCount(); c++) { // print(table.getString(r,c)); var temp = table.getString(r,c); if(!nodes.includes(temp)){ nodes.push(temp); node = new V(50+Math.random()*800,50+Math.random()*800); // print(node.x); myMap.set(temp,node); } } } print(nodes.length); print(Math.random()*50); print("map",myMap.size); for(i=0; i