let width; let height; let margin; let no_of_nodes; let matrix_rows; let matrix_columns; let min; let max; let nodes_list = []; function preload() { edges_table = loadTable('3980.edges.csv','csv'); } function setup() { width = 1000; height = 1000; margin = 100; for(var j=0;j margin +matrix_cell_width*(nodes_list.indexOf(edges_table.getNum(i,1))) && mouseX < margin +matrix_cell_width*(nodes_list.indexOf(edges_table.getNum(i,1))) + matrix_cell_width && mouseY < margin +matrix_cell_height*(nodes_list.indexOf(edges_table.getNum(i,0))) + matrix_cell_height && mouseY > margin +matrix_cell_height*(nodes_list.indexOf(edges_table.getNum(i,0)))) { stroke(139,0,139); text("("+edges_table.getNum(i,1) +","+edges_table.getNum(i,0)+")",-6,0); } pop(); } pop(); push(); translate(margin,margin); for(var j=0;j margin +matrix_cell_width*j && mouseX < margin +matrix_cell_width*j + matrix_cell_width && mouseY < margin +matrix_cell_height*i + matrix_cell_height && mouseY > margin +matrix_cell_height*i) { push(); stroke(255,0,0); textSize(10); textStyle(BOLD); text(nodes_list[i],-matrix_cell_width*(j)-margin/2,matrix_cell_height/2); pop(); push(); stroke(255,0,0); textSize(10); textStyle(BOLD); textAlign(CENTER); rotate(-PI/2.0); text(nodes_list[j],margin/4 + matrix_cell_height*i,matrix_cell_width/2); pop(); } pop(); } } pop(); } function setPlotArea() { push(); textSize(25); textStyle(BOLD); textAlign(CENTER); text('Matrix Layout - Facebook data',(width)/2,margin/2); translate(margin, margin); line(0,0,0,(height-(2*margin))); translate(0,(height-(2*margin))); line(0,0,(width-(2*margin)),0); translate((width-(2*margin)),0); line(0,0,0,-(height-(2*margin))); translate(0,-(height-(2*margin))); line(0,0,-(width-(2*margin)),0); pop(); } function drawMatrixCells() { push(); translate(margin,margin); for(var i=1;i