plebeiangraphlibrary 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A,I,Y,a,U,a,S,S,E,Y,E,G,E,W;I,S,Q,O;Q,O,mB,M,U,I,I,S,S;Y,U;Q;I;I,O,I,C,O,C,M,O,C,E,S,S,E,Q;Q,S,Y,O;Y,I;gB,O,Y,K;Y,E,O,K;gB,S;Y;Q;Q,S,W,O;Y,I;gB,O,W,C,Q,C;Y,E,O,K;gB,S;Y;Q;Q,S,O,Q;Y,S,O,U,S,S,Q,S,O,K,a;Q;Q,O,A,C,c,Y,M,W,gB,E,C,E;I;A;AASA;;;;;;;;;;CAUG,GACH,SAAe,oBACb,OAAY,EACZ,YAAkB,EAClB,oBAA0B,GAAG,EAC7B,kBAAwB,CAAC,EACzB,mBAAyB,CAAC;I,O,U,I,E,K,G,K,G;QAE1B,MAAM,YAAU,QAAM;QACtB,UAAU;QACV,MAAM,YAA+B,IAAI;QACzC,MAAM,YAA+B,IAAI;QACzC,IAAI,MAAI;QACR,KAAK,MAAM,UAAQ,UAAQ,OAAQ;YACjC,OAAK,KAAK,WAAW;YACrB,OAAK,KAAK,WAAW;YACrB,UAAQ,IAAI,QAAM;YAClB,UAAQ,IAAI,QAAM;QACnB;QACD,mBAAmB;QACnB,IAAK,IAAI,MAAI,GAAG,MAAI,cAAY,MAAK;YACnC,iCAAiC;YACjC,qDAAqD;YACrD,6CAA6C;YAC7C,IAAI;YACJ,IAAI;YACJ,yCAAyC;YACzC,IAAI;YACJ,IAAI;YACJ,+CAA+C;YAC/C,IAAI;YACJ,IAAI;YACJ,2DAA2D;YAC3D,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YAEJ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AAI,MAAM,uCAAuC;QACjD,IAAK,IAAI,IAAI,GAAG,IAAI,GAAG,IAAK;YAC1B,OAAO,IAAI,CAAA,GAAA,wCAAA,EAAM,CAAA;YACjB,gBAAgB;YAChB,MAAM,IAAI,GAAG;QACd;QACD,2CAA2C;QAC3C,8CAA8C;QAC9C,kBAAkB;QAClB,IAAI;QACJ,IAAI;QACJ,IAAI,QAAQ;QACZ,IAAK,IAAI,IAAI,GAAG,IAAI,GAAG,IAAK;YAC1B,IAAK,IAAI,KAAK,GAAG,KAAK,GAAG,KACvB,oDAAoD;YACpD,mCAAmC;YACnC,IAAI,KAAK,IAAI;gBACX,WAAW,KAAK;gBAChB,IAAI,IAAI,UAAU;oBAChB,8DAA8D;oBAC9D,OAAO,IAAI,CAAA,GAAA,cAAA,EAAK,GAAG,IAAI,CAAA;oBACvB,MAAM,IAAI,OAAO;oBACjB,SAAS;gBACV;YACF;QAEJ;QACD,8BAA8B;QAC9B,MAAM,IAAI,IAAI,CAAA,GAAA,cAAA,EAAM,OAAO;QAC3B,0BAA0B;QAC1B,OAAO;IACT;AAAC;IAED,2CAAe;4BAAE;AAAsB;","sources":["Src/Drawing/Drawing.ts","Src/HelperClasses/Utilities.ts","Src/HelperClasses/GeometryHelpers.ts","Src/HelperClasses/Point.ts","Src/HelperClasses/Line.ts","Src/GraphAlgorithms/GraphMethods.ts","Src/Core/Graph.ts","Src/Core/Edge.ts","Src/Drawing/ThreeJSDrawer.ts","Src/Shaders/vertexShader.glsl.ts","Src/Shaders/fragmentShader.glsl.ts","Src/index.ts","Src/SampleData/DataLoader.ts","Src/SampleData/ZKC.ts","Src/SampleData/ZKC_simulated.ts","Src/HelperClasses/GraphConstructors.ts","Src/Core/_Node.ts","Src/Drawing/GraphDrawer.ts","Src/Models/ErdosRenyiModel.ts"],"sourcesContent":["import Utilities from \"../HelperClasses/Utilities\";\r\nimport GeometryHelpers from \"../HelperClasses/GeometryHelpers\";\r\nimport Point from \"../HelperClasses/Point\";\r\nimport Line from \"../HelperClasses/Line\";\r\nimport Edge from \"../Core/Edge\";\r\nimport GraphMethods from \"../GraphAlgorithms/GraphMethods\";\r\nimport Graph from \"../Core/Graph\";\r\nimport _Node from \"../Core/_Node\";\r\n\r\n/**\r\n * Simulates Kamada kawai for a network in 2d. 3d is not supported yet\r\n * Note: This is an async function as it take time for some of the large graphs\r\n *\r\n * @param Graph - The first input number\r\n * @param iterations - The second input number\r\n * @param simulationBound - The bounds of simulation (Mostly a global number to scale the graph up or down)\r\n * @param cohesionValue - How sticky the nodes are i.r. how much they cluster together\r\n * @returns And node map of all the nodes and their simulated positions - Please note: position maps have to to be applied to the graph!\r\n *\r\n */\r\nasync function SimulateKamadaKawai(\r\n Graph: Graph,\r\n iterations: number,\r\n simulationBound: number = 100,\r\n cohesionValue: number = 1,\r\n repulsionValue: number = 1\r\n) {\r\n const adjList = Graph.get_adjacency();\r\n // pos map\r\n const PosMapX: Map<number, number> = new Map();\r\n const PosMapY: Map<number, number> = new Map();\r\n let rx, ry;\r\n for (const node of adjList.keys()) {\r\n rx = Math.random() * simulationBound;\r\n ry = Math.random() * simulationBound;\r\n PosMapX.set(node, rx);\r\n PosMapY.set(node, ry);\r\n }\r\n // start simulation\r\n for (let i = 0; i < iterations; i++) {\r\n // calculate the clustering force\r\n // these two keep track of the node being simulated's\r\n // position - redeclaring is sorta unncessary\r\n let nodeX: number;\r\n let nodeY: number;\r\n // also keep track of all the x_s and y_s\r\n let x_s: number[];\r\n let y_s: number[];\r\n // also the same thing for the clustering force\r\n let y_r: number[];\r\n let x_r: number[];\r\n // same thing for the cohesion values that get recalculated\r\n let new_c_xpos_dispacement: number;\r\n let new_c_ypos_dispacement: number;\r\n let new_x_r_pos: number;\r\n let new_y_r_pos: number;\r\n let new_c_xpos: number;\r\n let new_c_ypos: number;\r\n let new_g_xpos_displacement: number;\r\n let new_g_ypos_displacement: number;\r\n\r\n for (const node of adjList.keys()) {\r\n // this chunk is for the attraction force\r\n // get the node pos\r\n const neighbours = adjList.get(node)!;\r\n // remember always declare this nodes details\r\n nodeX = PosMapX.get(node)!;\r\n nodeY = PosMapY.get(node)!;\r\n // get the set of x's\r\n x_s = [];\r\n // get the set of y's\r\n y_s = [];\r\n // now iterate through the pos list and append\r\n neighbours.forEach((n_s) => {\r\n const n_pos_x = PosMapX.get(n_s)!;\r\n const n_pos_y = PosMapY.get(n_s)!;\r\n x_s.push(n_pos_x);\r\n y_s.push(n_pos_y);\r\n });\r\n // now average out the values\r\n new_c_xpos = Utilities.calculateAverage(x_s);\r\n new_c_ypos = Utilities.calculateAverage(y_s);\r\n\r\n // this chunk is for the repelling force\r\n y_r = [];\r\n x_r = [];\r\n let diffx: number;\r\n let diffy: number;\r\n let othernodeX: number;\r\n let othernodeY: number;\r\n\r\n // then find the element\r\n for (const otherNode of Graph.nodes.keys()) {\r\n // get the position of all the other nodes\r\n if (otherNode != node) {\r\n // calculate inverse distance\r\n othernodeX = PosMapX.get(otherNode)!;\r\n othernodeY = PosMapY.get(otherNode)!;\r\n diffx = othernodeX - nodeX;\r\n diffy = othernodeY - nodeY;\r\n // get the inverse square value\r\n // add that to the *_r arrays\r\n x_r.push(diffx);\r\n y_r.push(diffy);\r\n }\r\n }\r\n // this is the repulsion value\r\n new_x_r_pos =\r\n (repulsionValue * 1) /\r\n (Utilities.calculateAverage(x_r) * Utilities.calculateAverage(x_r));\r\n new_y_r_pos =\r\n (repulsionValue * 1) /\r\n (Utilities.calculateAverage(y_r) * Utilities.calculateAverage(y_r));\r\n\r\n // calculate the dispacement amount in c/y pos\r\n // this is the cohesion value\r\n new_c_xpos_dispacement = cohesionValue * (new_c_xpos - nodeX);\r\n new_c_ypos_dispacement = cohesionValue * (new_c_ypos - nodeY);\r\n\r\n // Also move all the points towards the center a little bit\r\n // so that the graph doesent explode out\r\n new_g_xpos_displacement = cohesionValue * (0 - nodeX);\r\n new_g_ypos_displacement = cohesionValue * (0 - nodeY);\r\n\r\n // then add the x and y components of the two vectors\r\n const new_xpos =\r\n new_x_r_pos + new_g_xpos_displacement + new_c_xpos_dispacement + nodeX;\r\n const new_ypos =\r\n new_y_r_pos + new_g_ypos_displacement + new_c_ypos_dispacement + nodeY;\r\n\r\n // now set these positions\r\n PosMapX.set(node, new_xpos);\r\n PosMapY.set(node, new_ypos);\r\n }\r\n }\r\n // return the position\r\n // keep in mind three JS works with Y upwards and not Z\r\n // in my head I work the other way round so Im swapping the Z and Y values here\r\n let PosMap: Map<number, Point> = new Map();\r\n for (const p of PosMapX.keys()) {\r\n PosMap.set(p, new Point(PosMapX.get(p)!, 0, PosMapY.get(p)!));\r\n }\r\n // get / set positions\r\n // move the points\r\n // Since this simulation might have moved the whole graph off screen\r\n // get the average pos\r\n const sim_x = [];\r\n const sim_y = [];\r\n const sim_z = [];\r\n let interimPoint;\r\n for (const p of PosMap.keys()) {\r\n interimPoint = PosMap.get(p)!;\r\n sim_x.push(interimPoint.x);\r\n sim_y.push(interimPoint.y);\r\n sim_z.push(interimPoint.z);\r\n }\r\n\r\n const x_displacement = Utilities.calculateAverage(sim_x);\r\n const y_displacement = Utilities.calculateAverage(sim_y);\r\n const z_displacement = Utilities.calculateAverage(sim_z);\r\n const dispacementVector = new Point(\r\n -x_displacement,\r\n -y_displacement,\r\n -z_displacement\r\n );\r\n\r\n PosMap = MovePmap(PosMap, dispacementVector);\r\n return PosMap;\r\n}\r\n\r\n/**\r\n *\r\n * Randomly sets all the positions for a graph\r\n * Not really very useful but I've used it in some cases and have kept it around\r\n *\r\n * @param Graph - The graph who's nodes you would want to reposition\r\n *\r\n * @return A position map of all the nodes and its corresponding positions\r\n */\r\nfunction InstanciateRandomPositions(Graph: Graph) {\r\n const adjList = Graph.get_adjacency();\r\n const PosMapX: Map<number, number> = new Map();\r\n const PosMapY: Map<number, number> = new Map();\r\n for (const node of adjList.keys()) {\r\n PosMapX.set(node, Math.random() * 200);\r\n PosMapY.set(node, Math.random() * 200);\r\n }\r\n const PosMap: Map<number, Point> = new Map();\r\n for (const p of PosMapX.keys()) {\r\n PosMap.set(p, new Point(PosMapX.get(p)!, 0, PosMapY.get(p)!));\r\n }\r\n return PosMap;\r\n}\r\n\r\n/**\r\n *\r\n * Constructs the edges as lines, Note: these are just a representation of the lines\r\n * they then have to be visulized using one of the Three JS Drawer functions like\r\n * draw a thick line or a thin line. This draws out the edges divided by some number of\r\n * divisions that you specify\r\n *\r\n * @param Graph - The graph whos edges are getting drawn\r\n * @param divDistance - How many divisions (distance) to make along the edge\r\n * @returns A line map - which holds a map of all the edge indices and the corresponding line representations\r\n */\r\nfunction DrawEdgeLines(Graph: Graph, divDistance: number) {\r\n // this is the return map\r\n const lineMap: Map<number, Line> = new Map();\r\n let edge: Edge;\r\n let start: Point;\r\n let end: Point;\r\n for (const key of Graph.edges.keys()) {\r\n edge = Graph.edges.get(key)!;\r\n // get the start pos\r\n start = Graph.nodes.get(edge.start)!.data.pos;\r\n end = Graph.nodes.get(edge.end)!.data.pos;\r\n const Line = GeometryHelpers.line_from_start_end_distance(\r\n start,\r\n end,\r\n divDistance\r\n );\r\n lineMap.set(key, Line);\r\n }\r\n return lineMap;\r\n}\r\n\r\n/**\r\n *\r\n * Constructs the edges as lines, Note: these are just a representation of the lines\r\n * they then have to be visulized using one of the Three JS Drawer functions like\r\n * draw a thick line or a thin line - this draws them based on the number of divisions\r\n * you would like them to have\r\n * @param Graph - The graph whos edges are getting drawn\r\n * @param numberOfDivs - How many divisions to make along the edge\r\n * @returns A line map - which holds a map of all the edge indices and the corresponding line representations\r\n */\r\nfunction DrawEdgeLinesDivisions(Graph: Graph, numberOfDivs: number) {\r\n // this is the return map\r\n const lineMap: Map<number, Line> = new Map();\r\n let edge: Edge;\r\n let start: Point;\r\n let end: Point;\r\n for (const key of Graph.edges.keys()) {\r\n edge = Graph.edges.get(key)!;\r\n // get the start pos\r\n start = Graph.nodes.get(edge.start)!.data.pos;\r\n end = Graph.nodes.get(edge.end)!.data.pos;\r\n const Line = GeometryHelpers.line_from_start_end_divisions(\r\n start,\r\n end,\r\n numberOfDivs\r\n );\r\n lineMap.set(key, Line);\r\n }\r\n return lineMap;\r\n}\r\n\r\n/**\r\n *\r\n * Edge bundling - this isnt as fast as the current KDE based methods - but it provides a basic method of\r\n * Visualizing large edge flows. Note: This is an aysnc function as it takes a while for the edge bundling to happen\r\n *\r\n * @param LineMap - The map of edges as a line map\r\n * @param iterations - The number of iterations to run edge bundling\r\n * @param distance - A shorthand for how close together the vertices need to be before they get influnced by each other\r\n * @returns A line map with all the updated positions of the line (Where they are bundled together) Again - this needs to be applied to the graph!\r\n */\r\nasync function DrawEdgeBundling(\r\n LineMap: Map<number, Line>,\r\n iterations: number,\r\n distance: number\r\n) {\r\n // first create a deep copy of the map\r\n const returnArray = new Map<number, Line>();\r\n for (let key of LineMap.keys()) {\r\n returnArray.set(key, structuredClone(LineMap.get(key)!));\r\n }\r\n // variables that are getting reused\r\n let line: Line;\r\n let otherLine: Line;\r\n let x_s: number[];\r\n let y_s: number[];\r\n let z_s: number[];\r\n let pnt: Point;\r\n let otherpoint: Point;\r\n let d: number;\r\n let x_d: number;\r\n let y_d: number;\r\n let z_d: number;\r\n let avgx: number;\r\n let avgy: number;\r\n let avgz: number;\r\n // run it for whatever number of iterations\r\n for (let i = 0; i < iterations; i++) {\r\n // then iterate through every line\r\n for (let key of returnArray.keys()) {\r\n // then get the line that we are working with\r\n line = returnArray.get(key)!;\r\n // then for each point in the line we have to move it closer to the other points\r\n for (let ii = 1; ii < line.points.length - 1; ii++) {\r\n // then get the point that we need to work with\r\n x_s = [];\r\n y_s = [];\r\n z_s = [];\r\n pnt = line.points[ii];\r\n // then run the point accumulation algoritm\r\n for (let otherKey of returnArray.keys()) {\r\n if (otherKey != key) {\r\n // then get the other line\r\n otherLine = returnArray.get(otherKey)!;\r\n for (let iii = 1; iii < otherLine.points.length - 1; iii++) {\r\n otherpoint = otherLine.points[iii];\r\n d = Utilities.calculateSquaredDistance(pnt, otherpoint);\r\n if (d <= Math.pow(distance, 2)) {\r\n x_d = otherpoint.x - pnt.x;\r\n y_d = otherpoint.y - pnt.y;\r\n z_d = otherpoint.z - pnt.z;\r\n x_s.push(x_d);\r\n y_s.push(y_d);\r\n z_s.push(z_d);\r\n }\r\n }\r\n }\r\n }\r\n // now create a new displacement amount\r\n avgx = pnt.x + 0.8 * (Utilities.calculateAverage(x_s) || 0);\r\n avgy = pnt.y + 0.8 * (Utilities.calculateAverage(y_s) || 0);\r\n avgz = pnt.z + 0.8 * (Utilities.calculateAverage(z_s) || 0);\r\n const newPoint = new Point(avgx, avgy, avgz);\r\n line.points[ii] = newPoint;\r\n }\r\n }\r\n }\r\n // now return that new map\r\n return returnArray;\r\n}\r\n\r\n/**\r\n *\r\n * Displace the edges vertically, almost akin to the Deck.gl arcs\r\n * The displacement is done in a sin curve with the ends still touching the nodes\r\n * Note: This is an inplace modification of the edges\r\n *\r\n * @param LineMap - The map of edges as a line map\r\n * @param displacement - the amount of vertical displacement\r\n */\r\nfunction DisplaceEdgeInY(LineMap: Map<number, Line>, displacement: number) {\r\n const returnArray = new Map<number, Line>();\r\n for (let key of LineMap.keys()) {\r\n returnArray.set(key, structuredClone(LineMap.get(key)!));\r\n }\r\n for (const key of returnArray.keys()) {\r\n const line = returnArray.get(key)!;\r\n // now for all the points in this\r\n let pnt, ydisval;\r\n for (let i = 0; i < line.points.length; i++) {\r\n pnt = line.points[i];\r\n ydisval =\r\n displacement * Math.sin((Math.PI * i) / (line.points.length - 1));\r\n pnt.y = pnt.y + ydisval;\r\n }\r\n }\r\n return returnArray;\r\n}\r\n\r\n/**\r\n *\r\n * Displace the vertices vertically based on some prameter (For example degree or modularity)\r\n *\r\n * @param Graph - the graph whos nodes have to be displaced\r\n * @param parameter - the prameter based on which you want to modify the\r\n * @param displacement - the maximum amunt of displacement, all the other values are rescaled linerly\r\n */\r\nfunction DisplaceVertices(\r\n Graph: Graph,\r\n parameter: string,\r\n displacement: number\r\n) {\r\n let max: number = 0;\r\n let value: number, ydisplacement: number;\r\n // go through the thing and set the min max values\r\n for (let node of Graph.nodes.values()) {\r\n value = eval(\"node.data.\" + parameter);\r\n if (value >= max) {\r\n max = value;\r\n }\r\n }\r\n // go through the nodes again and set the values\r\n for (const node of Graph.nodes.values()) {\r\n value = eval(\"node.data.\" + parameter);\r\n ydisplacement = (value / max) * displacement;\r\n // now filter the values so that we know that the values are between a max and a min\r\n ydisplacement = Math.max(0, ydisplacement); // this sets the lower bound to be something\r\n ydisplacement = Math.min(displacement, ydisplacement); // this sets the upper bound of the thing\r\n node.data.pos.y = ydisplacement;\r\n }\r\n}\r\n\r\n/**\r\n *\r\n * Generates a hive plot for a graph, this includes the option to displace the graph vertically based on degrees and how far away each node is\r\n *\r\n * @param Graph - The graph\r\n * @param selectedNode - the node around which the hive plot is generated\r\n * @param step - If the hive should step up or down if yes then by what increments\r\n * @param startPosition - Starting position\r\n * @returns\r\n */\r\nasync function HivePlot(\r\n Graph: Graph,\r\n selectedNode: number,\r\n step: number,\r\n startPosition: Point\r\n) {\r\n const adj = Graph.get_adjacency();\r\n const DijkstraDepth = await GraphMethods.Dijkstra(Graph, selectedNode);\r\n // calculate the number of steps that I am searching through\r\n const steps = Math.max(...[...DijkstraDepth.values()]);\r\n // step map\r\n const stepMap = new Map();\r\n // now create a stepped ring of stuff\r\n for (let i = 0; i <= steps; i++) {\r\n const ntier = [];\r\n for (const nkey of DijkstraDepth.keys()) {\r\n if (i == DijkstraDepth.get(nkey)) {\r\n ntier.push(nkey);\r\n }\r\n }\r\n stepMap.set(i, ntier);\r\n }\r\n // the returning pos map\r\n const Pmap = new Map();\r\n // now find the relevant node Positions\r\n // get the start positions\r\n const xoff = startPosition.x || 0;\r\n const yoff = startPosition.y || 0;\r\n const zoff = startPosition.z || 0;\r\n // set the positions\r\n for (const node of adj.keys()) {\r\n const yval = DijkstraDepth.get(node)! * step;\r\n const depthArr = stepMap.get(DijkstraDepth.get(node));\r\n const angle = 2 * Math.PI * (depthArr.indexOf(node) / depthArr.length);\r\n const xval = Math.sin(angle) * yval;\r\n const zval = Math.cos(angle) * yval;\r\n // construct a new point\r\n const pnt = new Point(xval + xoff, -yval + yoff, zval + zoff);\r\n Pmap.set(node, pnt);\r\n }\r\n // simulate the lines\r\n Graph.apply_position_map(Pmap);\r\n const lmap = DrawEdgeLines(Graph, 1);\r\n const newLmap = await DrawEdgeBundling(lmap, 12, 5);\r\n return { pmap: Pmap, emap: newLmap };\r\n}\r\n\r\n/**\r\n * Move a graph somewhere (like the physical location) - This is an inplace movement and overwrites existing values\r\n *\r\n * @param Graph - The graph that has to be moved\r\n * @param dispacement - This is a point and I end up using Point and Vector interchangably. So here the xyz values from the point are used to displace the nodes\r\n */\r\nfunction MoveGraph(Graph: Graph, dispacement: Point) {\r\n const Gmap = Graph.get_map();\r\n const NewPmap = MovePmap(Gmap.pmap, dispacement);\r\n const NewEmap = MoveEmap(Gmap.emap, dispacement);\r\n Graph.apply_drawing_maps({ pmap: NewPmap, emap: NewEmap });\r\n}\r\n\r\n/**\r\n *\r\n * Move the nodes somewhere (Or the nodemap corresponding to the graph) - This is not an overwrite rather returns a new position map for the nodes to moved\r\n *\r\n * @param NodeM\r\n * ap - The Current position map of the graph\r\n * @param displacement - The Displacement vector\r\n * @returns - A new position map\r\n */\r\nfunction MovePmap(NodeMap: Map<number, Point>, displacement: Point) {\r\n const newPmap: Map<number, Point> = new Map();\r\n for (let node of NodeMap.keys()) {\r\n const p = NodeMap.get(node)!;\r\n p.translate(displacement);\r\n newPmap.set(node, p);\r\n }\r\n return newPmap;\r\n}\r\n\r\n/**\r\n *\r\n * Move the edges somewhere (the edgemap corresponding to the graph) - This is not an overwrite and returns a new edge map for the edges to be moved too\r\n *\r\n * @param LineMap - The current line map, this is made up of lines\r\n * @param dispacement - The displacement vector\r\n * @returns - The new line map\r\n */\r\nfunction MoveEmap(LineMap: Map<number, Line>, dispacement: Point) {\r\n const newEmap: Map<number, Line> = new Map();\r\n // variables - instead of redeclaring\r\n let interimPoints: Point[];\r\n let interimLine: Line;\r\n let newLine: Line;\r\n for (let lineNumber of LineMap.keys()) {\r\n // reset the interim points\r\n interimPoints = [];\r\n // get the line\r\n interimLine = LineMap.get(lineNumber)!;\r\n // move all the points\r\n for (let pnt of interimLine.points) {\r\n pnt.translate(dispacement);\r\n // add this to the new stack of lines\r\n interimPoints.push(pnt);\r\n }\r\n // create a new line\r\n newLine = new Line(interimPoints);\r\n // add this to the new map\r\n newEmap.set(lineNumber, newLine);\r\n }\r\n return newEmap;\r\n}\r\n\r\n// THIS IS THE BIT THATS A BIT CONFUSING\r\n/*\r\nData for visualization is store in the graph under the elements data\r\nSo for example - the position data under a point in the graph is under \r\n- Graph.nodes.get(whatever node).data.pos \r\n*/\r\n// commenting out because appears to be redundant\r\n// update edge lines after moving points or something\r\n// this redraws the lines based on distance\r\n/**\r\n *\r\n * Draw new lines from edges, and draw them based on the distance of divisions (i.e. divide the line up every 10 units) Note: This is an in place update that takes place on the graph - it overwrites the existing data.\r\n *\r\n * @param Graph - The grapht who's edges have to be updated\r\n * @param divDistance - The distance by which the divisions are made\r\n */\r\nfunction UpdateEdgeLinesDist(Graph: Graph, divDistance: number) {\r\n let edge: Edge;\r\n let start: Point;\r\n let end: Point;\r\n let line: Line;\r\n for (const key of Graph.edges.keys()) {\r\n edge = Graph.edges.get(key)!;\r\n // get the start pos\r\n start = Graph.nodes.get(edge.start)!.data.pos;\r\n end = Graph.nodes.get(edge.end)!.data.pos;\r\n line = GeometryHelpers.line_from_start_end_distance(\r\n start,\r\n end,\r\n divDistance\r\n );\r\n edge.data.ldata = line;\r\n }\r\n}\r\n\r\n/**\r\n * \r\n * Draw new lines from edges, and draw them based on divisions (i.e. divide the line into 10 units) Note: This is an in place update that takes place on the graph - it overwrites the existing data.\r\n\r\n * @param Graph - The grapht who's edges have to be updated\r\n * @param Divs - The number of divisions to be made\r\n */\r\nfunction UpdateEdgeLinesDivs(Graph: Graph, Divs: number) {\r\n let edge: Edge;\r\n let start: Point;\r\n let end: Point;\r\n let line: Line;\r\n for (const key of Graph.edges.keys()) {\r\n edge = Graph.edges.get(key)!;\r\n // get the start pos\r\n start = Graph.nodes.get(edge.start)!.data.pos;\r\n end = Graph.nodes.get(edge.end)!.data.pos;\r\n line = GeometryHelpers.line_from_start_end_divisions(start, end, Divs);\r\n edge.data.ldata = line;\r\n }\r\n}\r\n\r\nexport default {\r\n SimulateKamadaKawai,\r\n DrawEdgeLines,\r\n DrawEdgeLinesDivisions,\r\n DrawEdgeBundling,\r\n HivePlot,\r\n DisplaceEdgeInY,\r\n MoveGraph,\r\n InstanciateRandomPositions,\r\n DisplaceVertices,\r\n // these two are special functions\r\n UpdateEdgeLinesDist,\r\n UpdateEdgeLinesDivs,\r\n};\r\n","import Point from \"./Point\";\r\n\r\n// Calculate average\r\n/**\r\n * calculate the average of an array of numberss\r\n * @param arr an array of number whose average has to be calculated\r\n * @returns the average\r\n */\r\nfunction calculateAverage(arr: number[]) {\r\n let runningSum = 0;\r\n for (let i = 0; i < arr.length; i++) {\r\n runningSum = runningSum + arr[i];\r\n }\r\n const avg = runningSum / arr.length;\r\n if (Number.isNaN(avg)) {\r\n return 0;\r\n }\r\n return avg;\r\n}\r\n\r\n// calculate distance between two points\r\n/**\r\n * Calculate the distance betweeen two points\r\n * @param p1 the first point\r\n * @param p2 the second point\r\n * @returns the distance between the points\r\n */\r\nfunction calculateDistance(p1: Point, p2: Point) {\r\n const d = Math.pow(\r\n Math.pow(p1.x - p2.x, 2) +\r\n Math.pow(p1.y - p2.y, 2) +\r\n Math.pow(p1.z - p2.z, 2),\r\n 0.5\r\n );\r\n return d;\r\n}\r\n\r\n// calculate squared distance sometimes we dont really need\r\n// the actual root but just a rough idea\r\n/**\r\n * Calculate the squared distance between two points\r\n * @param p1 the first point\r\n * @param p2 the second point\r\n * @returns the squared distance between the two points\r\n */\r\nfunction calculateSquaredDistance(p1: Point, p2: Point) {\r\n const d =\r\n Math.pow(p1.x - p2.x, 2) +\r\n Math.pow(p1.y - p2.y, 2) +\r\n Math.pow(p1.z - p2.z, 2);\r\n return d;\r\n}\r\n\r\n// get a random subset of something from a array of things\r\n// must provide the number of things we want from that array\r\n/**\r\n * get a random subset of something from a array of things must provide the number of things we want from that array\r\n * @param arr the array from which the subset has to be made\r\n * @param n number of items to select\r\n * @returns a new array made up of a random sample from the original array\r\n */\r\nfunction getRandomSubset(arr: any[], n: number) {\r\n var result = new Array(n),\r\n len = arr.length,\r\n taken = new Array(len);\r\n if (n > len)\r\n throw new RangeError(\"getRandom: more elements taken than available\");\r\n while (n--) {\r\n var x = Math.floor(Math.random() * len);\r\n result[n] = arr[x in taken ? taken[x] : x];\r\n taken[x] = --len in taken ? taken[len] : len;\r\n }\r\n return result;\r\n}\r\n\r\n/**\r\n * This is a super useful method to get a random number of edges or something that you would like to draw\r\n * this is primarily done because there are way too many edges sometimes and and the number of edges is really\r\n * What slows the whole rendering process down\r\n * @param map - the map that youd like to reduce\r\n * @param n - the fraction of items that youd like to return from this map\r\n * @returns A reduced map with a fractio of those many entries\r\n */\r\nfunction getRandomSubset_map(map: Map<number, any>, n: number) {\r\n const newMap = new Map();\r\n let prob;\r\n for (const item of map.keys()) {\r\n prob = Math.random();\r\n if (prob < n) {\r\n newMap.set(item, map.get(item));\r\n }\r\n }\r\n return newMap;\r\n}\r\n\r\nexport default {\r\n calculateAverage,\r\n calculateDistance,\r\n calculateSquaredDistance,\r\n getRandomSubset,\r\n getRandomSubset_map,\r\n};\r\n","import Point from \"./Point\";\r\nimport Line from \"./Line\";\r\nimport Utilities from \"./Utilities\";\r\n\r\n/**\r\n * Creates a line based on the number of divisons\r\n *\r\n * @param start the start point\r\n * @param end the end point\r\n * @param divisions the number of divisions\r\n * @returns the line object\r\n */\r\nfunction line_from_start_end_divisions(\r\n start: Point,\r\n end: Point,\r\n divisions: number\r\n) {\r\n // create a start and end time\r\n const Start = new Point(start.x, start.y, start.z);\r\n const End = new Point(end.x, end.y, end.z);\r\n // interpolated points\r\n const points: Point[] = [];\r\n // divisions\r\n for (let i = 0; i <= divisions; i++) {\r\n const interVar = i / divisions;\r\n const newx = interVar * Start.x + (1 - interVar) * End.x;\r\n const newy = interVar * Start.y + (1 - interVar) * End.y;\r\n const newz = interVar * Start.z + (1 - interVar) * End.z;\r\n const newPoint = new Point(newx, newy, newz);\r\n points.push(newPoint);\r\n }\r\n // create a new line\r\n const SubdividedLine = new Line(points);\r\n return SubdividedLine;\r\n}\r\n\r\n/**\r\n * Divides the line into a number of divisions based on distance\r\n * @param start - the start point\r\n * @param end - the end point\r\n * @param distance - the distance at which this line must be divided\r\n * @returns A line object with the right number of points\r\n */\r\nfunction line_from_start_end_distance(\r\n start: Point,\r\n end: Point,\r\n distance: number\r\n) {\r\n const dist = Utilities.calculateDistance(start, end);\r\n const divs = Math.round(dist / distance) + 2;\r\n const subdivline = line_from_start_end_divisions(start, end, divs);\r\n return subdivline;\r\n}\r\n\r\n/**\r\n * Calculates the centroid of an array of points\r\n * @param points An array of points\r\n * @returns the central point of the array of points\r\n */\r\nfunction centroid(points: Point[]) {\r\n let rx = 0;\r\n let ry = 0;\r\n let rz = 0;\r\n points.forEach((element) => {\r\n rx += element.x;\r\n ry += element.y;\r\n rz += element.z;\r\n });\r\n rx = rx / points.length;\r\n ry = ry / points.length;\r\n rz = rz / points.length;\r\n const centroid = new Point(rx, ry, rz);\r\n return centroid;\r\n}\r\n\r\nexport default {\r\n line_from_start_end_divisions,\r\n line_from_start_end_distance,\r\n centroid,\r\n};\r\n","interface Point {\r\n x: number;\r\n y: number;\r\n z: number;\r\n}\r\n\r\nclass Point {\r\n /**\r\n * Constructs a point based on the x y z values\r\n * @param x x value \r\n * @param y y value\r\n * @param z z value \r\n */\r\n constructor(x:number, y:number, z:number) {\r\n this.x = x;\r\n this.y = y;\r\n this.z = z;\r\n }\r\n\r\n // Points are somewhat the same thing as a vector \r\n // So im using the same type instead of redeclaring the \r\n // Type\r\n /**\r\n * Displaces a point - note this method moves the existing point\r\n * @param Point This is the displacement vactor, used as a point but the same idea holds\r\n */\r\n translate(Point:Point) {\r\n this.x = this.x + Point.x;\r\n this.y = this.y + Point.y;\r\n this.z = this.z + Point.z;\r\n }\r\n}\r\n\r\nexport default Point;\r\n","import Point from \"./Point\";\r\n\r\ninterface Line {\r\n points: Point[];\r\n}\r\n\r\nclass Line {\r\n /**\r\n * Constructs a line from an array of points\r\n * @param points an array of points\r\n */\r\n constructor(points: Point[]) {\r\n this.points = [];\r\n points.forEach((p) => {\r\n const point = new Point(p.x, p.y, p.z);\r\n this.points.push(point);\r\n });\r\n }\r\n}\r\n\r\nexport default Line;\r\n","import Edge from \"../Core/Edge\";\r\nimport Graph from \"../Core/Graph\";\r\nimport _Node from \"../Core/_Node\";\r\n\r\n// do a BFS Search Starting from some point\r\n// searches the whole graph and returns a map of which node\r\n// was searched from where\r\n// to speed this up all the nodes are actually numbers\r\n/**\r\n * \r\n * Performs a BFS search on a graph - Async because it takes a while on large graphs\r\n * \r\n * @param Graph - The graph which has to be searched using the BFS algorithm\r\n * @param node - The node form which to start \r\n * @returns - A map of which node was explored from which other node\r\n */\r\nasync function BFSSearch(Graph:Graph, node:number) {\r\n const adj = Graph.get_adjacency();\r\n const exploredFromMap:Map<number,number> = new Map();\r\n\r\n const explored:number[] = [];\r\n const stack:number[] = [];\r\n\r\n // queue the first node\r\n stack.push(node);\r\n exploredFromMap.set(node, -1);\r\n\r\n // search through the whole graph\r\n while (stack.length > 0) {\r\n const currentNode = stack.pop()!;\r\n // add this current node to the explored list\r\n explored.push(currentNode);\r\n const neighbours = adj.get(currentNode);\r\n for (let i = 0; i < neighbours!.length; i++) {\r\n const neighbour = neighbours![i];\r\n if (!explored.includes(neighbour)) {\r\n stack.push(neighbour);\r\n exploredFromMap.set(neighbour, currentNode);\r\n }\r\n }\r\n }\r\n // then return the explored from map\r\n return exploredFromMap;\r\n}\r\n\r\n// do a dijkstra Search Distance map\r\n/**\r\n * \r\n * Performs a dijkstra search on a graph\r\n * \r\n * @param Graph - The graph on which to perform the Dijkstra search \r\n * @param Node - The node from which to start\r\n * @returns - Map from which each one of the nodes was searched from\r\n */\r\nasync function Dijkstra(Graph:Graph, Node:number) {\r\n const adj = Graph.get_adjacency();\r\n const Dmap:Map<number, number> = new Map();\r\n // get the explored from map\r\n const exploredFromMap = await BFSSearch(Graph, Node);\r\n // then for each element in the map go through\r\n // contact trace where that element came from\r\n for (const n of adj.keys()) {\r\n let i = 0;\r\n let exploredFrom = exploredFromMap.get(n)!;\r\n while (exploredFrom != -1) {\r\n exploredFrom = exploredFromMap.get(exploredFrom)!;\r\n i += 1;\r\n }\r\n Dmap.set(n, i);\r\n }\r\n // now return this map\r\n return Dmap;\r\n}\r\n\r\n// This file contains basic things like\r\n// Graph searches and stuff\r\n// this only returns one of the diameters that is the longest \r\n// not all of them\r\n/**\r\n * \r\n * Finds the diameter of the graph\r\n * \r\n * @param Graph \r\n * @returns returns an object with a start, end - the two points of a graph and the diameter of the graph\r\n */\r\nasync function GraphDiameter(Graph:Graph) {\r\n // find the diameter of the graph\r\n // start Dijkstra from some random node\r\n let seed = Math.floor(Math.random() * Graph.nodes.size);\r\n let Dstart = await Dijkstra(Graph, seed);\r\n // iterate through all the values and then get\r\n // the value that is the highest amongst the others\r\n let currentDistance = -1;\r\n for (const n of Dstart.keys()) {\r\n const dval = Dstart.get(n)!;\r\n if (dval > currentDistance) {\r\n seed = n;\r\n currentDistance = dval;\r\n }\r\n }\r\n // then search from there to the furthest point again\r\n const newStart = seed;\r\n Dstart = await Dijkstra(Graph, seed);\r\n // repeat the thing\r\n currentDistance = -1;\r\n for (const n of Dstart.keys()) {\r\n const dval = Dstart.get(n)!;\r\n if (dval > currentDistance) {\r\n seed = n;\r\n currentDistance = dval;\r\n }\r\n }\r\n const returnObj = {\r\n start: newStart,\r\n end: seed,\r\n distance: currentDistance,\r\n };\r\n return returnObj;\r\n}\r\n\r\n// Select a subrgaph\r\n// you must specify a list of nodes that you passed in\r\n/**\r\n * \r\n * Select a subgraph\r\n * \r\n * @param graph - The main graph to select from\r\n * @param nodeList - The selection of nodes that we want to select from this graph\r\n * @returns A graph object that contains this subgraph\r\n */\r\nasync function SelectSubgraph(graph:Graph, nodeList:number[]) {\r\n const prunedNodes:Map<number,_Node> = new Map();\r\n const prunedEdges:Map<number, Edge> = new Map();\r\n // set the prunded vertices list\r\n nodeList.forEach((element) => {\r\n // get the element from the graph and set that\r\n // data element in the prunded vertices map\r\n const ndata = graph.nodes.get(element)!;\r\n prunedNodes.set(element, ndata);\r\n });\r\n\r\n // set the pruned edges list\r\n let i = 0;\r\n for (const edge of graph.edges.keys()) {\r\n const edgeData = graph.edges.get(edge)!;\r\n if (nodeList.includes(edgeData.start) && nodeList.includes(edgeData.end)) {\r\n prunedEdges.set(i, edgeData);\r\n i += 1;\r\n }\r\n }\r\n\r\n // construct a new graph that represents the new graph\r\n const newGraph = await Graph.create(prunedNodes, prunedEdges);\r\n return newGraph;\r\n}\r\n\r\n// this is where the exports happen\r\nexport default { GraphDiameter, Dijkstra, BFSSearch, SelectSubgraph };\r\n","import Line from \"../HelperClasses/Line\";\r\nimport Point from \"../HelperClasses/Point\";\r\nimport _Node from \"./_Node\";\r\nimport Edge from \"./Edge\";\r\n\r\ninterface Graph {\r\n nodes: Map<number, _Node>;\r\n edges: Map<number, Edge>;\r\n}\r\n\r\n/**\r\n * The main graph object - this contrains nodes and edges that get modified with different \r\n * Operations etc.\r\n */\r\nclass Graph {\r\n /**\r\n *\r\n * Construct a graph object (no initializing)\r\n *\r\n * @param nodes - Map of all the nodes associated with the graph\r\n * @param edges - Map of all the edges assocaiated with the graph\r\n */\r\n constructor(nodes: Map<number, _Node>, edges: Map<number, Edge>) {\r\n this.nodes = nodes;\r\n this.edges = edges;\r\n // execute Internal methods\r\n // this.printData();\r\n }\r\n\r\n // test function\r\n /**\r\n * Prints out a snapshot of data associated with this graph like how many nodes and how many edges\r\n */\r\n printData() {\r\n const message =\r\n \"This is a graph with \" +\r\n this.nodes.size +\r\n \" nodes and \" +\r\n this.edges.size +\r\n \" edges\";\r\n console.log(message);\r\n }\r\n\r\n // initialize\r\n /**\r\n * Initializes the graph and constructs a node adajaceny list list\r\n */\r\n async initialize() {\r\n await this.constructAdjacencyList();\r\n }\r\n\r\n // new create method\r\n /**\r\n *\r\n * This is the official create method to make a graph based on a set of nodes and edges\r\n * It also auto initializes the graph and sets all the adjaceny lists in the memory\r\n *\r\n * @param nodes - map of nodes\r\n * @param edges - map of edges\r\n * @returns\r\n */\r\n static async create(nodes: Map<number, _Node>, edges: Map<number, Edge>) {\r\n const g = new Graph(nodes, edges);\r\n await g.initialize();\r\n return g;\r\n }\r\n\r\n // construct the adjacency list represntation\r\n /**\r\n * Constructs the adjacency associated with the graph\r\n */\r\n async constructAdjacencyList() {\r\n // I'm constructing a Graph here so some of the stuff doesnt matter\r\n this.edges.forEach((edge) => {\r\n // get the start point\r\n const start = edge.start;\r\n const end = edge.end;\r\n // set the node property\r\n if (this.nodes.get(start)) {\r\n const relevantSNode = this.nodes.get(start);\r\n relevantSNode!.neighbours.push(end);\r\n } else if (this.nodes.get(end)) {\r\n const relevantENode = this.nodes.get(end);\r\n relevantENode!.neighbours.push(start);\r\n }\r\n });\r\n // then for each node then get the unique neighbours\r\n for (const key of this.nodes.keys()) {\r\n const neighs = this.nodes.get(key)!.neighbours;\r\n const new_neigh = [...new Set(neighs)];\r\n const selfIndex = new_neigh.indexOf(key);\r\n if (selfIndex > -1) {\r\n new_neigh.splice(selfIndex, 1); // 2nd parameter means remove one item only\r\n }\r\n this.nodes.get(key)!.neighbours = new_neigh;\r\n }\r\n }\r\n\r\n // add a node\r\n /**\r\n * Add a noce to the graph\r\n * @param nodeID - the node ID\r\n * @param data - data associated with the node\r\n */\r\n add_node(nodeID: number, data: _Node) {\r\n this.nodes.set(nodeID, data);\r\n }\r\n\r\n // add an edge\r\n /**\r\n * Add an edge to the graph\r\n * @param start - Starting index of the edge\r\n * @param end - The end index of the edge\r\n * @param data - data associated with the edge\r\n */\r\n add_edge(start: number, end: number, data: any) {\r\n const newEdge = new Edge(start, end, data);\r\n // this is a new edge that we add to the edges\r\n this.edges.set(this.edges.size, newEdge);\r\n // also add this to the node neighbours\r\n const relevantNode = this.nodes.get(start);\r\n relevantNode!.neighbours.push(end);\r\n }\r\n\r\n // get an adjacency list reprentation of the graph\r\n // this onlu has the indices and not the actual data\r\n // associated with the node to speed things up\r\n /**\r\n *\r\n * @returns Get the adjaceny (adjacency lists) associated with the graph\r\n */\r\n get_adjacency() {\r\n const SparseMap: Map<number, number[]> = new Map();\r\n // iterate through the node list\r\n for (const key of this.nodes.keys()) {\r\n SparseMap.set(key, this.nodes.get(key)!.neighbours);\r\n }\r\n return SparseMap;\r\n }\r\n\r\n // set position based on an array of positions\r\n // this could be anything (we use kamada kawai )\r\n /**\r\n * Apply a position map based on some data\r\n * @param data - the position map that has to be applied to the graph\r\n */\r\n apply_position_map(data: Map<number, Point>) {\r\n for (let n of data.keys()) {\r\n this.nodes.get(n)!.data = {\r\n ...this.nodes.get(n)!.data,\r\n pos: data.get(n),\r\n };\r\n }\r\n }\r\n\r\n // create new edge pos representation\r\n // same approach for applying the key data\r\n /**\r\n * Apply an line map to a graph\r\n * @param data Line data that has to be applied to the graph\r\n */\r\n apply_edge_pos_maps(data: Map<number, Line>) {\r\n for (let key of data.keys()) {\r\n this.edges.get(key)!.data = {\r\n ...this.edges.get(key)!.data,\r\n ldata: data.get(key),\r\n };\r\n }\r\n }\r\n\r\n // get the edge reps\r\n // this returns all the edge map readings\r\n /**\r\n * get the current edge map\r\n * @returns The current set of edges associated with the graph\r\n */\r\n get_edge_map() {\r\n const lines: Map<number, Line> = new Map();\r\n for (const key of this.edges.keys()) {\r\n const edge = this.edges.get(key)!.data.ldata;\r\n lines.set(key, edge);\r\n }\r\n return lines;\r\n }\r\n\r\n // graph apply pos and edge map\r\n /**\r\n * Applies all the maps to the graph\r\n * @param layout - Applies an object of maps associated with with a graph is made up of {pmap:(the position map), emap:{the edge map}}\r\n */\r\n apply_drawing_maps(layout: {\r\n pmap: Map<number, Point>;\r\n emap: Map<number, Line>;\r\n }) {\r\n if (layout.pmap) {\r\n this.apply_position_map(layout.pmap);\r\n }\r\n if (layout.emap) {\r\n this.apply_edge_pos_maps(layout.emap);\r\n }\r\n }\r\n\r\n // get the positon map of the graph\r\n /**\r\n * Gets the position map and the edge map respectively\r\n * @returns the positon map and the edge map as pmap and emap\r\n */\r\n get_map() {\r\n return {\r\n pmap: this.get_position_map(),\r\n emap: this.get_edge_map(),\r\n };\r\n }\r\n\r\n /**\r\n * get the postion of the nodes in the graph\r\n * @returns the position map\r\n */\r\n get_position_map() {\r\n const pmap: Map<number, Point> = new Map();\r\n for (const node of this.nodes.keys()) {\r\n pmap.set(node, this.nodes.get(node)!.data.pos);\r\n }\r\n return pmap;\r\n }\r\n}\r\n\r\n// Export the graph Library\r\nexport default Graph;\r\n","interface Edge {\r\n start: number;\r\n end: number;\r\n data: any;\r\n}\r\n\r\n/**\r\n * The edge class, edges have a start and end but they can also have data associated with that edge\r\n */\r\nclass Edge {\r\n /**\r\n * \r\n * Construct an edge\r\n * \r\n * @param start Start index of the edge based on the array of nodes\r\n * @param end End index of the edge based on the array of nodes\r\n * @param data Data associated, note that ldata is reserved for how to draw the lines associated with the edge\r\n */\r\n constructor(start:number, end:number, data:any) {\r\n this.start = start;\r\n this.end = end;\r\n this.data = { ...data };\r\n }\r\n}\r\n\r\nexport default Edge;\r\n","import * as THREE from \"three\";\r\nimport Point from \"../HelperClasses/Point\";\r\nimport Line from \"../HelperClasses/Line\";\r\nimport { hexToRgb } from \"../HelperClasses/ColorHelper\";\r\nimport { Line2 } from \"three/examples/jsm/lines/Line2.js\";\r\nimport { LineMaterial } from \"three/examples/jsm/lines/LineMaterial\";\r\nimport { LineGeometry } from \"three/examples/jsm/lines/LineGeometry\";\r\nimport { vertexShader } from \"../Shaders/vertexShader.glsl\";\r\nimport { fragmentShader } from \"../Shaders/fragmentShader.glsl\";\r\nimport GraphMethods from \"../GraphAlgorithms/GraphMethods\";\r\nimport Graph from \"../Core/Graph\";\r\nimport _Node from \"../Core/_Node\";\r\n\r\n// Draw the graph out as a bunch of vertices\r\n// As like tiny squares\r\n/**\r\n *\r\n * Draw the veritces of the graph out as a point cloud\r\n *\r\n * @param Graph - the graph that has to be drawn out\r\n * @param bounds - A global scaling parameter defaults to 1 but change to scale up a garph\r\n * @param size - The size of all the nodes - either input an array the same length of the number of nodes decribing how big each node is, or a global node value as a number or defaults to 1\r\n * @param color - the color of the node defaults to white\r\n * @param alpha - the alpha value of the node defaults to 1 (opaque)\r\n * @returns a three JS group that contains all the vertices as a point cloud or a three js points object that can be added to the scene\r\n */\r\nfunction DrawTHREEGraphVertices(\r\n Graph: Graph,\r\n bounds: number = 1,\r\n size: number | number[] = 1,\r\n color: number = 0xffffff,\r\n alpha: number = 1\r\n) {\r\n const positionAttribute: number[] = [];\r\n // get the corresponding points list\r\n const pmap = Graph.get_position_map();\r\n // declare the sizes and colors\r\n let sizes: number[];\r\n let colors: number[];\r\n if (typeof size == \"number\") {\r\n sizes = Array(Graph.nodes.size).fill(size);\r\n } else {\r\n sizes = size;\r\n }\r\n colors = Array(Graph.nodes.size).fill(color);\r\n const labels = [];\r\n const colorVal = new THREE.Color();\r\n colorVal.setRGB(255, 255, 255); // white as the default\r\n // process the data set\r\n let i = 0;\r\n let nodeData: Point;\r\n for (let node of Graph.nodes.keys()) {\r\n nodeData = pmap.get(node)!;\r\n positionAttribute.push(\r\n nodeData.x * bounds,\r\n nodeData.y * bounds,\r\n nodeData.z * bounds\r\n );\r\n\r\n colorVal.toArray(colors, i * 3);\r\n labels.push(node);\r\n i += 1;\r\n }\r\n\r\n const geometry = new THREE.BufferGeometry();\r\n // geometry attribute\r\n geometry.setAttribute(\r\n \"position\",\r\n new THREE.Float32BufferAttribute(positionAttribute, 3)\r\n );\r\n // color attribute\r\n geometry.setAttribute(\r\n \"customColor\",\r\n new THREE.Float32BufferAttribute(colors, 3)\r\n );\r\n // size attribute\r\n geometry.setAttribute(\"size\", new THREE.Float32BufferAttribute(sizes, 1));\r\n // label attribute\r\n geometry.setAttribute(\"label\", new THREE.Int32BufferAttribute(labels, 1));\r\n geometry.name = \"nodes\";\r\n\r\n // example material\r\n const PointMaterial = new THREE.ShaderMaterial({\r\n uniforms: {\r\n color: { value: new THREE.Color(0xffffff) }, // this is a base color dont mess with this\r\n pointTexture: {\r\n value: new THREE.TextureLoader().load(\"./Textures/Square.png\"),\r\n },\r\n alphaTest: { value: alpha },\r\n },\r\n vertexShader: vertexShader,\r\n fragmentShader: fragmentShader,\r\n });\r\n\r\n const vertices = new THREE.Group();\r\n vertices.add(new THREE.Points(geometry, PointMaterial));\r\n return vertices;\r\n}\r\n\r\n// then make a thing which draws out all the edges (THICK)\r\n/**\r\n *\r\n * Draws out all the edges (Thick edges of a graph)\r\n *\r\n * @param Graph - The graph whose edges have to be drawn\r\n * @param bounds - the global scale for all the edges to be drawn defaults to 1\r\n * @param color - color of the edges defaults to white\r\n * @param thickness - thickness of the edges (defaults to 0.2)\r\n * @returns a Three Js group of edges that can be added to the scene\r\n */\r\nfunction DrawTHREEGraphEdgesThick(\r\n Graph: Graph,\r\n bounds: number = 1,\r\n color = 0xffffff,\r\n thickness: number = 0.2\r\n) {\r\n // add the interpolation function\r\n const lineMap = Graph.get_edge_map();\r\n return DrawThickEdgesFromEdgeMap(lineMap, bounds, color, thickness);\r\n}\r\n\r\n// draw a thing to draw out all the edges from the edge map stuff\r\n/**\r\n *\r\n * Draw thick edges from an edge map\r\n *\r\n * @param EdgeMap - The edge map associated with the graph\r\n * @param bounds - The global scale of the graph - defaults to 1\r\n * @param color - The color of the edges - defaults to white\r\n * @param thickness - thickness of the edges - defaults to 0.2\r\n * @returns\r\n */\r\nfunction DrawThickEdgesFromEdgeMap(\r\n EdgeMap: Map<number, Line>,\r\n bounds: number,\r\n color: number = 0xffffff,\r\n thickness: number = 0.2\r\n) {\r\n // this is the line thing\r\n const mat = new LineMaterial({\r\n color: color,\r\n linewidth: thickness, // in world units with size attenuation, pixels otherwise\r\n vertexColors: true,\r\n\r\n //resolution: // to be set by renderer, eventually\r\n dashed: false,\r\n alphaToCoverage: true,\r\n });\r\n\r\n const meshes = new THREE.Group();\r\n for (let lval of EdgeMap.values()) {\r\n const mcolor = new THREE.Color();\r\n // convert the color that we shall be using\r\n mcolor.setHex(color);\r\n const pnts: number[] = [];\r\n const cols: number[] = [];\r\n\r\n lval.points.forEach((pnt) => {\r\n pnts.push(\r\n pnt.x * bounds - bounds / 2,\r\n pnt.y * bounds - bounds / 2,\r\n pnt.z * bounds - bounds / 2\r\n );\r\n cols.push(mcolor.r, mcolor.g, mcolor.b);\r\n });\r\n\r\n const geo = new LineGeometry();\r\n geo.setPositions(pnts);\r\n geo.setColors(cols);\r\n const line = new Line2(geo, mat);\r\n line.computeLineDistances();\r\n line.scale.set(1, 1, 1);\r\n meshes.add(line);\r\n }\r\n return meshes;\r\n}\r\n\r\n// make a thing that draws out all the lines (Thin)\r\n/**\r\n *\r\n * Draw thin lines for all the edges given a graph\r\n *\r\n * @param Graph - The graph that has to be drawn\r\n * @param bounds - The global scale factor for the the edges - defaults to 1\r\n * @param color - color of the lines - defaults to white\r\n * @returns\r\n */\r\nfunction DrawTHREEGraphEdgesThin(\r\n Graph: Graph,\r\n bounds: number = 1,\r\n color: number = 0xffffff\r\n) {\r\n // first get the edge map positions\r\n const emap = Graph.get_edge_map();\r\n return DrawThinEdgesFromEdgeMap(emap, bounds, color);\r\n}\r\n\r\n// function to draw edges from edge map\r\n/**\r\n *\r\n * Draw Line map as lines given the edge map assocaited with the graph\r\n *\r\n * @param LineMap - The edge map that has to be drawn out\r\n * @param bounds - Global scale for the edges to be drawn defaults to 1\r\n * @param color - Color of the edges defaults to 1\r\n * @returns\r\n */\r\nfunction DrawThinEdgesFromEdgeMap(\r\n LineMap: Map<number, Line>,\r\n bounds: number = 1,\r\n color: number = 0xffffff\r\n) {\r\n const material = new THREE.LineBasicMaterial({\r\n color: color,\r\n });\r\n const lines = new THREE.Group();\r\n let points: THREE.Vector3[];\r\n for (const edge of LineMap.values()) {\r\n points = [];\r\n // get the edge data\r\n const ldata = edge.points;\r\n ldata.forEach((element) => {\r\n points.push(\r\n new THREE.Vector3(\r\n element.x * bounds,\r\n element.y * bounds,\r\n element.z * bounds\r\n )\r\n );\r\n });\r\n // then make the line thing\r\n const geometry = new THREE.BufferGeometry().setFromPoints(points);\r\n const line = new THREE.Line(geometry, material);\r\n lines.add(line);\r\n }\r\n return lines;\r\n}\r\n\r\n// draw the cube box graph here\r\n/**\r\n *\r\n * Adde boxes where all the boxes are\r\n *\r\n * @param nodeMap - a map of all the nodes\r\n * @param bounds - global scale of the edges to be drawn, defaults to 1\r\n * @param color - default color of the edges, defaults to white\r\n * @param size - size of the nodes defaults to 10\r\n * @returns a group of vertices that contains all of the boxes associated with each one of the vertices\r\n */\r\nfunction AddBoxBasedImaging(\r\n nodeMap: Map<number, Point>,\r\n bounds: number = 1,\r\n color: number = 0xffffff,\r\n size: number | number[] = 10\r\n) {\r\n // precompute all the sizes\r\n let sizes: any;\r\n if (typeof size == \"number\") {\r\n sizes = Array(nodeMap.size).fill(size);\r\n } else {\r\n sizes = size;\r\n }\r\n // returns a group\r\n const group = new THREE.Group();\r\n const material = new THREE.MeshBasicMaterial({ color: color });\r\n let nodeData;\r\n let geometry: THREE.BoxGeometry;\r\n let nodeMesh: THREE.Mesh;\r\n for (let i = 0; i < nodeMap.size; i++) {\r\n nodeData = nodeMap.get(i)!;\r\n geometry = new THREE.BoxGeometry(sizes[i], sizes[i], sizes[i]);\r\n geometry.name = i.toString();\r\n nodeMesh = new THREE.Mesh(geometry, material);\r\n nodeMesh.position.set(\r\n nodeData.x * bounds,\r\n nodeData.y * bounds,\r\n nodeData.z * bounds\r\n );\r\n group.add(nodeMesh);\r\n }\r\n return group;\r\n}\r\n\r\n// Draw BoxBased imaging from a graph\r\n/**\r\n *\r\n * Draw box based verices given a graph\r\n *\r\n * @param Graph - The graph that needs its vertices drawn\r\n * @param bounds - A global scale for the graph, defaults to one\r\n * @param color - Default color of the boxes defaults to white\r\n * @param size - Default size of the nodes defaults to 10\r\n * @returns\r\n */\r\nfunction DrawTHREEBoxBasedVertices(\r\n Graph: Graph,\r\n bounds: number = 1,\r\n color: number = 0xffffff,\r\n size: number | number[] = 10\r\n) {\r\n const pmap = Graph.get_position_map();\r\n const Bgroup = AddBoxBasedImaging(pmap, bounds, color, size);\r\n return Bgroup;\r\n}\r\n\r\n// draw cylinders where required\r\n/**\r\n *\r\n * Draw cylinders where all the vertices are based on a node map\r\n *\r\n * @param nodeMap - the node map assiciate with the graph that has to be drawn out\r\n * @param divisonLength - the length of the divisions that are there in each one of the cylinder (this is a circumfurence amount), defaults to 16\r\n * @param color - the default color of the cylinder, defaults to white\r\n * @param size - the default size of the cylinder, defaults to 10\r\n * @returns\r\n */\r\nfunction AddCylinderBasedImaging(\r\n nodeMap: Map<number, Point>,\r\n divisonLength: number = 16,\r\n color: number = 0xffffff,\r\n size: number | number[] = 10\r\n) {\r\n // precompute all the sizes\r\n let sizes: any;\r\n if (typeof size == \"number\") {\r\n sizes.Array(nodeMap.size).fill(size);\r\n } else {\r\n sizes = size;\r\n }\r\n // returns a group\r\n const group = new THREE.Group();\r\n const material = new THREE.MeshBasicMaterial({ color: color });\r\n let radius, circumfurence, segments;\r\n let nodeData: Point;\r\n for (let i = 0; i < nodeMap.size; i++) {\r\n nodeData = nodeMap.get(i)!;\r\n radius = sizes[i];\r\n circumfurence = 2 * radius * Math.PI;\r\n segments = Math.ceil(circumfurence / divisonLength);\r\n const geometry = new THREE.CylinderGeometry(radius, radius, 10, segments);\r\n geometry.name = i.toString();\r\n const nodeMesh = new THREE.Mesh(geometry, material);\r\n nodeMesh.position.set(nodeData.x, nodeData.y, nodeData.z);\r\n group.add(nodeMesh);\r\n }\r\n return group;\r\n}\r\n\r\n// draw the sparse graph as groups\r\n// this seperates all the points based on some or the other group\r\n/**\r\n *\r\n * Split up a graph and return an boject containing a bunch of node groups and edge groups based on some parameterS\r\n *\r\n * @param Graph - the graph that you want to split up\r\n * @param propertyName - the property that you want to split them on\r\n * @returns - an object that hasa set of node vertices and a set of edge lines based on the splitting factor\r\n */\r\nasync function AddInModularityBasedPointGroups(\r\n Graph: Graph,\r\n propertyName: string\r\n) {\r\n // returns an array of groups\r\n const groups: Map<number, number[]> = new Map();\r\n let ndata: _Node;\r\n let modularity: number;\r\n for (let node of Graph.nodes.keys()) {\r\n ndata = Graph.nodes.get(node)!;\r\n modularity = eval(`ndata.data.${propertyName}}`);\r\n if (groups.has(modularity)) {\r\n groups.get(modularity)!.push(node);\r\n } else {\r\n groups.set(modularity, [node]);\r\n }\r\n }\r\n // then counstruct a bunch of subraphs\r\n const meshGraphVertices: Map<number, THREE.Group> = new Map();\r\n const meshGraphEdges: Map<number, THREE.Group> = new Map();\r\n let subgraphGroup: number[];\r\n let subgraph: Graph;\r\n let pointRep: THREE.Group;\r\n let edges: THREE.Group;\r\n for (let modularityGroup of groups.keys()) {\r\n subgraphGroup = groups.get(modularityGroup)!;\r\n // returns an array\r\n subgraph = await GraphMethods.SelectSubgraph(Graph, subgraphGroup);\r\n // then make the vertex thing\r\n pointRep = DrawTHREEGraphVertices(subgraph, 1);\r\n meshGraphVertices.set(modularityGroup, pointRep);\r\n // make the edges\r\n edges = DrawSimplifiedEdges(subgraph, 0.03);\r\n meshGraphEdges.set(modularityGroup, edges);\r\n }\r\n const ROBJ = {\r\n nodeGroups: meshGraphVertices,\r\n EdgeGroups: meshGraphEdges,\r\n };\r\n return ROBJ;\r\n}\r\n\r\n/**\r\n *\r\n * Draw simplified line edges (thin based) based on some number. This number is a fraction of the total number of edges (so if you specify 0.1 it would draw 10% of the edges)\r\n *\r\n * @param Graph - The graph that has to be drawn out\r\n * @param amount - The fraction of edges to be drawn\r\n * @param color - color of these edges - defaults to 0.1\r\n * @returns - a group of simple lines based on all the edges supplied to it\r\n */\r\nfunction DrawSimplifiedEdges(\r\n Graph: Graph,\r\n amount: number,\r\n color: number = 0xffffff\r\n) {\r\n const lineGroup = new THREE.Group();\r\n const material = new THREE.LineBasicMaterial({ color: color });\r\n let start: Point;\r\n let end: Point;\r\n let points: THREE.Vector3[];\r\n for (let edge of Graph.edges.values()) {\r\n if (Math.random() <= amount) {\r\n start = Graph.nodes.get(edge.start)!.data.pos;\r\n end = Graph.nodes.get(edge.end)!.data.pos;\r\n points = [];\r\n points.push(new THREE.Vector3(start.x, start.y, start.z));\r\n points.push(new THREE.Vector3(end.x, end.y, end.z));\r\n const geometry = new THREE.BufferGeometry().setFromPoints(points);\r\n const line = new THREE.Line(geometry, material);\r\n lineGroup.add(line);\r\n }\r\n }\r\n return lineGroup;\r\n}\r\n\r\n/**\r\n *\r\n * Change all the vertex colors based on some array of properties\r\n *\r\n * @param vertices - ThreeJS Points object, be sure to pass in the points object and not the group that the points belong too\r\n * @param indexArray - The array of the indices of all the nodes whose values that have to be changed\r\n * @param color - The color that they have to be changed too\r\n */\r\nfunction ChangeTheVertexColours(\r\n vertices: THREE.Points,\r\n indexArray: number[],\r\n color: number\r\n) {\r\n let Attrib = vertices.geometry.attributes;\r\n let k = 0;\r\n const col = new THREE.Color( color );\r\n indexArray.forEach((node) => {\r\n k = node * 3; // @ts-ignore\r\n Attrib.customColor.array[k] = col.r; // @ts-ignore\r\n Attrib.customColor.array[k + 1] = col.g; // @ts-ignore\r\n Attrib.customColor.array[k + 2] = col.b;\r\n });\r\n Attrib.customColor.needsUpdate = true;\r\n}\r\n\r\n/**\r\n *\r\n * This resets all the colors to white\r\n *\r\n * @param vertices - ThreeJS Points object, be sure to pass in the points object and not the group that the points belong too\r\n */\r\nfunction ResetVertexColors(vertices: THREE.Points) {\r\n let Attrib = vertices.geometry.attributes;\r\n let k = 0;\r\n for (let i = 0; i < Attrib.customColor.count; i++) {\r\n k = i * 3; // @ts-ignore\r\n Attrib.customColor.array[k] = 255; // @ts-ignore\r\n Attrib.customColor.array[k + 1] = 255; // @ts-ignore\r\n Attrib.customColor.array[k + 2] = 255;\r\n }\r\n Attrib.customColor.needsUpdate = true;\r\n}\r\n\r\nexport default {\r\n DrawTHREEGraphVertices,\r\n DrawTHREEGraphEdgesThick,\r\n DrawTHREEGraphEdgesThin,\r\n AddBoxBasedImaging,\r\n AddInModularityBasedPointGroups,\r\n DrawThinEdgesFromEdgeMap,\r\n DrawThickEdgesFromEdgeMap,\r\n AddCylinderBasedImaging,\r\n DrawSimplifiedEdges,\r\n ChangeTheVertexColours,\r\n ResetVertexColors,\r\n DrawTHREEBoxBasedVertices,\r\n};\r\n","const vertexShader = `\r\nattribute float size;\r\nattribute vec3 customColor;\r\n\r\nvarying vec3 vColor;\r\n\r\nvoid main() {\r\n vColor = customColor;\r\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\r\n gl_PointSize = size * ( 300.0 / -mvPosition.z );\r\n gl_Position = projectionMatrix * mvPosition;\r\n}\r\n`\r\n\r\nexport {vertexShader};","const fragmentShader = `\r\nuniform vec3 color;\r\nuniform sampler2D pointTexture;\r\nuniform float alphaTest;\r\n\r\nvarying vec3 vColor;\r\n\r\nvoid main() {\r\n gl_FragColor = vec4( color * vColor, 1.0 );\r\n gl_FragColor = gl_FragColor * texture2D( pointTexture, gl_PointCoord );\r\n if ( gl_FragColor.a < alphaTest ) discard;\r\n}\r\n`;\r\n\r\nexport { fragmentShader };\r\n","export { default as Graph } from \"./Core/Graph\";\r\nexport { default as GraphMethods } from \"./GraphAlgorithms/GraphMethods\";\r\nexport { default as SampleData } from \"./SampleData/DataLoader\";\r\nexport { default as Constructors } from \"./HelperClasses/GraphConstructors\";\r\nexport { default as Drawing } from \"./Drawing/Drawing\";\r\nexport { default as Geometry } from \"./HelperClasses/GeometryHelpers\";\r\nexport { default as Utilities } from \"./HelperClasses/Utilities\";\r\nexport { default as ThreeWrapper } from \"./Drawing/ThreeJSDrawer\";\r\nexport { default as GraphDrawer } from \"./Drawing/GraphDrawer\";\r\nexport { default as Models } from \"./Models/ErdosRenyiModel\";\r\n","// load up the ZKC dataset\r\nimport { zkc } from \"./ZKC\";\r\nimport { zkc_simulated } from \"./ZKC_simulated\";\r\nimport GraphConstructors from \"../HelperClasses/GraphConstructors\";\r\nimport Graph from \"../Core/Graph\";\r\nimport Point from \"../HelperClasses/Point\";\r\nimport _Node from \"../Core/_Node\";\r\nimport Edge from \"../Core/Edge\";\r\nimport Drawing from \"../Drawing/Drawing\";\r\n\r\n/**\r\n * \r\n * @returns the raw ZKC dataset\r\n */\r\nasync function LoadZKC() {\r\n // load up the dataset representation\r\n const data = zkc;\r\n const G = await GraphConstructors.ConstructGraphNodeEdgesList(data.nodes, data.edges);\r\n return G;\r\n}\r\n\r\n/**\r\n * \r\n * @returns the ZKC dataset with the positons simulated before hand\r\n */\r\nasync function LoadZKCSimulated() {\r\n // make a map\r\n const data = zkc_simulated;\r\n const nodes = new Map();\r\n const edges = new Map();\r\n // set the node map\r\n data.nodes.forEach((node) => {\r\n const id = node.id;\r\n const pos = new Point(node.px*50, 0, node.py*50);\r\n const modularity = node.member;\r\n const n = new _Node({ pos: pos, size:10, info:\"Node Info\", modularity:modularity });\r\n nodes.set(id, n);\r\n });\r\n // set the edge map\r\n for (let i = 0; i < data.edges.length; i++) {\r\n const edge = data.edges[i];\r\n const start = edge[0];\r\n const end = edge[1];\r\n const e = new Edge(start, end, {});\r\n edges.set(i, e);\r\n }\r\n // make a graph object\r\n const G = await Graph.create(nodes, edges);\r\n const lmap = Drawing.DrawEdgeLines(G, 20);\r\n G.apply_edge_pos_maps(lmap);\r\n return G;\r\n}\r\n\r\n// exports\r\nexport default { LoadZKC, LoadZKCSimulated };\r\n","const zkc = {\r\n nodes: [\r\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\r\n 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,\r\n ],\r\n edges: [\r\n [0, 1],\r\n [0, 2],\r\n [0, 3],\r\n [0, 4],\r\n [0, 5],\r\n [0, 6],\r\n [0, 7],\r\n [0, 8],\r\n [0, 10],\r\n [0, 11],\r\n [0, 12],\r\n [0, 13],\r\n [0, 17],\r\n [0, 19],\r\n [0, 21],\r\n [0, 31],\r\n [1, 2],\r\n [1, 3],\r\n [1, 7],\r\n [1, 13],\r\n [1, 17],\r\n [1, 19],\r\n [1, 21],\r\n [1, 30],\r\n [2, 3],\r\n [2, 7],\r\n [2, 8],\r\n [2, 9],\r\n [2, 13],\r\n [2, 27],\r\n [2, 28],\r\n [2, 32],\r\n [3, 7],\r\n [3, 12],\r\n [3, 13],\r\n [4, 6],\r\n [4, 10],\r\n [5, 6],\r\n [5, 10],\r\n [5, 16],\r\n [6, 16],\r\n [8, 30],\r\n [8, 32],\r\n [8, 33],\r\n [9, 33],\r\n [13, 33],\r\n [14, 32],\r\n [14, 33],\r\n [15, 32],\r\n [15, 33],\r\n [18, 32],\r\n [18, 33],\r\n [19, 33],\r\n [20, 32],\r\n [20, 33],\r\n [22, 32],\r\n [22, 33],\r\n [23, 25],\r\n [23, 27],\r\n [23, 29],\r\n [23, 32],\r\n [23, 33],\r\n [24, 25],\r\n [24, 27],\r\n [24, 31],\r\n [25, 31],\r\n [26, 29],\r\n [26, 33],\r\n [27, 33],\r\n [28, 31],\r\n [28, 33],\r\n [29, 32],\r\n [29, 33],\r\n [30, 32],\r\n [30, 33],\r\n [31, 32],\r\n [31, 33],\r\n [32, 33],\r\n ],\r\n};\r\n\r\nexport { zkc };\r\n","const zkc_simulated = {\r\n nodes: [\r\n { id: 0, px: 0.09083423378081436, py: 1.164162667707135, member: 0 },\r\n { id: 1, px: -0.5395391223661004, py: 0.8787097882002372, member: 0 },\r\n { id: 2, px: 0.25483951690897244, py: -0.011894166387290125, member: 0 },\r\n { id: 3, px: 0.5292273814873625, py: 0.8137715604013231, member: 0 },\r\n { id: 4, px: 0.6759740200024705, py: 2.010590015934319, member: 3 },\r\n { id: 5, px: 0.6648725961138767, py: 2.3765595730406712, member: 3 },\r\n { id: 6, px: -0.015476857282255526, py: 2.421851366492045, member: 3 },\r\n { id: 7, px: 0.9923183157183725, py: 0.7358251458599251, member: 0 },\r\n { id: 8, px: -0.6148021363450372, py: -0.03465499210385469, member: 1 },\r\n { id: 9, px: 0.24714516178546894, py: -1.012380550604274, member: 0 },\r\n { id: 10, px: 1.3293288757439443, py: 1.8641805845025743, member: 3 },\r\n { id: 11, px: -0.6571791278403557, py: 2.2163816367270526, member: 0 },\r\n { id: 12, px: 1.5181044222926994, py: 1.3282665066698078, member: 0 },\r\n { id: 13, px: -0.2979203330003603, py: 0.18438685313887027, member: 0 },\r\n { id: 14, px: -1.7502345807734376, py: -1.0935551887354324, member: 1 },\r\n { id: 15, px: -1.630224787934251, py: -1.5015879850995024, member: 1 },\r\n { id: 16, px: 0.5585243394360673, py: 3.5, member: 3 },\r\n { id: 17, px: -0.9776584881745712, py: 1.799718659872538, member: 0 },\r\n { id: 18, px: -1.385649185975611, py: -1.870388302312794, member: 1 },\r\n { id: 19, px: -0.9638464461397331, py: 0.24226946279518707, member: 0 },\r\n { id: 20, px: -1.0268125129631975, py: -2.1543990524894148, member: 1 },\r\n { id: 21, px: -1.3061680833745626, py: 1.527228276383933, member: 0 },\r\n { id: 22, px: -0.5552461198316926, py: -2.2498070887997685, member: 1 },\r\n { id: 23, px: 0.8262268914348979, py: -1.804253160744954, member: 2 },\r\n { id: 24, px: 1.9952840970427212, py: -1.0382885070400036, member: 2 },\r\n { id: 25, px: 1.9207660053211613, py: -0.5823795272244723, member: 2 },\r\n { id: 26, px: -0.1664715343791652, py: -2.6527209168204373, member: 1 },\r\n { id: 27, px: 0.9961959436268844, py: -1.0143754028553023, member: 2 },\r\n { id: 28, px: 0.6488880579857091, py: -1.024671500275854, member: 2 },\r\n { id: 29, px: 0.2398196340697841, py: -2.171491081802323, member: 1 },\r\n { id: 30, px: -1.3348117368940753, py: -0.31290471156377053, member: 1 },\r\n { id: 31, px: 0.6901260074375327, py: -0.2526601933356052, member: 2 },\r\n { id: 32, px: -0.6030949145287146, py: -1.0927507849665647, member: 1 },\r\n { id: 33, px: -0.3533395323856202, py: -1.1887389845640028, member: 1 },\r\n ],\r\n edges: [\r\n [0, 1],\r\n [0, 2],\r\n [0, 3],\r\n [0, 4],\r\n [0, 5],\r\n [0, 6],\r\n [0, 7],\r\n [0, 8],\r\n [0, 10],\r\n [0, 11],\r\n [0, 12],\r\n [0, 13],\r\n [0, 17],\r\n [0, 19],\r\n [0, 21],\r\n [0, 31],\r\n [1, 2],\r\n [1, 3],\r\n [1, 7],\r\n [1, 13],\r\n [1, 17],\r\n [1, 19],\r\n [1, 21],\r\n [1, 30],\r\n [2, 3],\r\n [2, 7],\r\n [2, 8],\r\n [2, 9],\r\n [2, 13],\r\n [2, 27],\r\n [2, 28],\r\n [2, 32],\r\n [3, 7],\r\n [3, 12],\r\n [3, 13],\r\n [4, 6],\r\n [4, 10],\r\n [5, 6],\r\n [5, 10],\r\n [5, 16],\r\n [6, 16],\r\n [8, 30],\r\n [8, 32],\r\n [8, 33],\r\n [9, 33],\r\n [13, 33],\r\n [14, 32],\r\n [14, 33],\r\n [15, 32],\r\n [15, 33],\r\n [18, 32],\r\n [18, 33],\r\n [19, 33],\r\n [20, 32],\r\n [20, 33],\r\n [22, 32],\r\n [22, 33],\r\n [23, 25],\r\n [23, 27],\r\n [23, 29],\r\n [23, 32],\r\n [23, 33],\r\n [24, 25],\r\n [24, 27],\r\n [24, 31],\r\n [25, 31],\r\n [26, 29],\r\n [26, 33],\r\n [27, 33],\r\n [28, 31],\r\n [28, 33],\r\n [29, 32],\r\n [29, 33],\r\n [30, 32],\r\n [30, 33],\r\n [31, 32],\r\n [31, 33],\r\n [32, 33],\r\n ],\r\n};\r\n\r\nexport { zkc_simulated };\r\n","import Graph from \"../Core/Graph\";\r\nimport _Node from \"../Core/_Node\";\r\nimport Edge from \"../Core/Edge\";\r\n\r\n// construct a graph based on an edge list etc\r\n/**\r\n * construct a graph based on an edge list and node list\r\n * @param nodes nodes as a list\r\n * @param edges edges as a list \r\n * @returns A graph that was construct from the list of nodes and edges\r\n */\r\nasync function ConstructGraphNodeEdgesList(nodes:any[], edges:any[]) {\r\n // make a node OBJ\r\n const nodeOBJ = new Map();\r\n for (let i = 0; i < nodes.length; i++) {\r\n const n = new _Node(nodes[i].data);\r\n nodeOBJ.set(nodes[i], n);\r\n }\r\n // make an edge object\r\n const edgeOBJ = new Map();\r\n for (let i = 0; i < edges.length; i++) {\r\n const e = new Edge(edges[i][0], edges[i][1], edges[i].data);\r\n edgeOBJ.set(i, e);\r\n }\r\n // make a graph object\r\n const G = await Graph.create(nodeOBJ, edgeOBJ);\r\n return G;\r\n}\r\n\r\nexport default { ConstructGraphNodeEdgesList };\r\n","// note this file is always reffered to as\r\n// _Node to not confuse with node (js) and\r\n// Vertices which are another 3d object that\r\n// can be changed in three js\r\ninterface _Node {\r\n data: any;\r\n neighbours: number[];\r\n}\r\n\r\n/**\r\n * This is the node class - they have an ID which is \r\n * essentially an index and some data associated with it \r\n * The data also contains the position of the \r\n */\r\nclass _Node {\r\n /**\r\n * \r\n * @param data Data associated with the node, be sure to be careful to pass in any \"pos\" data as they correspond to position of the nodes in the visuals of the graph\r\n */\r\n constructor(data:any) {\r\n // this data is an arbitrary thing with which I can create any object\r\n this.data = { ...data };\r\n // the neighbours bit is explicity set from the code outside\r\n this.neighbours = [];\r\n }\r\n}\r\n\r\nexport default _Node;\r\n","import * as THREE from \"three\";\r\nimport { OrbitControls } from \"three/examples/jsm/controls/OrbitControls\";\r\nimport Graph from \"../Core/Graph\";\r\n\r\n// interface for the graph drawing class\r\ninterface GraphDrawer3d {\r\n canvas: HTMLCanvasElement;\r\n width: number;\r\n height: number;\r\n geometryMap: Map<any, any>;\r\n materialMap: Map<any, any>;\r\n meshMap: Map<any, any>;\r\n controls: OrbitControls;\r\n renderer: THREE.WebGLRenderer;\r\n camera: THREE.PerspectiveCamera;\r\n scene: THREE.Scene;\r\n graphs: Map<number, Graph>;\r\n}\r\n\r\n/**\r\n * This is the main graph drawer class\r\n */\r\nclass GraphDrawer3d {\r\n /**\r\n * To initialize the graph drawer there are a set of graph drawing settings that have to be set.\r\n * Here are the details to do the same:\r\n * canvas - the html canvas element that you would like to render \r\n * height - the the height of the initialized canvas\r\n * width - the width of the initialized canvas\r\n * geometry map - a map that keeps track of all the geometry in the scene (Optional)\r\n * material map - a mapt that keeps track of all the materials in the scene (Optional)\r\n * controls - Controls that define how one can navigate this 3d space (Self initialized)\r\n * renderer - Renderer element form the three JS library\r\n * camera - A perspective camera from the threeJS library \r\n * scene - The three JS scene that gets define automatically\r\n * \r\n * @param GraphDrawerOptions3d - These above options are construdeted into a single object and passed into the Options elem\r\n */\r\n constructor(GraphDrawerOptions3d: {\r\n canvas: HTMLCanvasElement;\r\n width: number;\r\n height: number;\r\n geometryMap: Map<any, any>;\r\n materialMap: Map<any, any>;\r\n meshMap: Map<any, any>;\r\n controls: OrbitControls;\r\n renderer: THREE.WebGLRenderer;\r\n camera: THREE.PerspectiveCamera;\r\n scene: THREE.Scene;\r\n }) {\r\n this.canvas = GraphDrawerOptions3d.canvas;\r\n this.width = GraphDrawerOptions3d.width;\r\n this.height = GraphDrawerOptions3d.height;\r\n // these maps are optional\r\n // ive kepth them in as a way of managing all the\r\n // geometry in the scene\r\n this.geometryMap = new Map();\r\n this.materialMap = new Map();\r\n this.meshMap = new Map();\r\n this.controls;\r\n this.renderer;\r\n this.camera;\r\n this.scene;\r\n // graph map is the hash map that holds all the\r\n // graphs that we are working with together\r\n this.graphs = new Map();\r\n }\r\n\r\n /**\r\n * This essentially initializes the drawing element based on the settings\r\n * Remember to do this since if if its not done the scene will not render\r\n */\r\n async init() {\r\n const t1 = performance.now();\r\n\r\n this.camera = new THREE.PerspectiveCamera();\r\n\r\n // start up a new scene\r\n this.scene = new THREE.Scene();\r\n\r\n // set up a renderer\r\n this.renderer = new THREE.WebGLRenderer({\r\n canvas: this.canvas,\r\n antialias: true,\r\n });\r\n this.renderer.setSize(this.width, this.height);\r\n this.renderer.setClearColor(0xff00ff, 0);\r\n\r\n // add in a light\r\n this.scene.add(new THREE.AmbientLight(0xffffff));\r\n // add a spotlight\r\n const DirectionalLight = new THREE.DirectionalLight(0xffffff, 1);\r\n DirectionalLight.position.set(0, 10, 0);\r\n this.scene.add(DirectionalLight);\r\n\r\n // set up the control system\r\n this.controls = new OrbitControls(this.camera, this.renderer.domElement);\r\n this.camera.position.set(0, 100, 100);\r\n this.controls.autoRotate = true;\r\n this.controls.maxPolarAngle = Math.PI * 0.5;\r\n this.controls.maxDistance = 10000;\r\n this.controls.minDistance = 10;\r\n this.controls.update();\r\n\r\n // finally print out that the initialization has finished\r\n const t2 = performance.now();\r\n console.log(\"initialization has finished\");\r\n console.log(`Time to initialize ${t2 - t1} milliseconds`);\r\n }\r\n\r\n //add graph\r\n // this adds a graph to the current visualizer\r\n /**\r\n * \r\n * This is the main way to add elements to the viewer window that gets initialized\r\n * \r\n * @param element A geomerty element + material element to add to the scene as a group line or point cloud\r\n */\r\n addVisElement(element: THREE.Group | THREE.Line | THREE.Points) {\r\n this.scene.add(element);\r\n }\r\n\r\n // this stuff renders out one specific instances\r\n /**\r\n * This is the render call that is called every frame to update the rendering of the canvas\r\n * Remember to do this since this is a common are for bugs to occur\r\n */\r\n rendercall() {\r\n // this is the render draw call\r\n this.renderer.render(this.scene, this.camera);\r\n this.controls.update();\r\n }\r\n}\r\n\r\nexport default {\r\n GraphDrawer3d,\r\n};\r\n","// This essentially generates a erdos reyni graph\r\n// Super useful for juszt getting a random graph and studying\r\n// graph structure. Read more https://en.wikipedia.org/wiki/Erd%C5%91s%E2%80%93R%C3%A9nyi_model\r\n\r\nimport Edge from \"../Core/Edge\";\r\nimport Graph from \"../Core/Graph\";\r\nimport _Node from \"../Core/_Node\";\r\n\r\n/**\r\n * The G ( n , p ) G(n,p) model, a graph is constructed by connecting labeled nodes randomly. Each edge is included in the graph with probability p p, independently from every other edge.\r\n * https://en.wikipedia.org/wiki/Erd%C5%91s%E2%80%93R%C3%A9nyi_model\r\n * @param n Number of nodes\r\n * @param p Probability of two edges to eb connected\r\n * @returns A Erdos Reyni graph\r\n */\r\nasync function GenerateErdosReyni_n_p(n: number, p: number) {\r\n // first create a list of nodes\r\n const nodes = new Map();\r\n const edges = new Map();\r\n let node; // define once use many times basically\r\n for (let i = 0; i < n; i++) {\r\n node = new _Node({});\r\n // set this node\r\n nodes.set(i, node);\r\n }\r\n // now that all the nodes have been created\r\n // now loop all the node combinations and then\r\n // create the edge\r\n let interimP;\r\n let edge;\r\n let index = 0;\r\n for (let i = 0; i < n; i++) {\r\n for (let ii = 0; ii < n; ii++) {\r\n // im skipping self loops so just make sure there is\r\n // an if statement for the settings\r\n if (i != ii) {\r\n interimP = Math.random();\r\n if (p > interimP) {\r\n // then create and edge and add that edge to the list of edges\r\n edge = new Edge(i, ii, {});\r\n edges.set(index, edge);\r\n index += 1;\r\n }\r\n }\r\n }\r\n }\r\n // now create the actual graph\r\n const G = new Graph(nodes, edges);\r\n // lastly return the graph\r\n return G;\r\n}\r\n\r\nexport default { GenerateErdosReyni_n_p };\r\n"],"names":[],"version":3,"file":"pgl.js.map"}