Module: EdgeRouting

Handles the edge routing between nodes and supernodes
Source:

Methods

(inner) addCircularDrawLines(supernodePosition, startAngle, stopAngle, radius, stopAngleOffsets, prevVec, vec, renderedEdge) → {int}

adds the circular part of one supernode of an edge to the lines array
Parameters:
Name Type Description
supernodePosition vec3 center of the circle
startAngle float where the circle will begin in the range [0-2*PI]
stopAngle float where the circle will stop in the range [0-2*PI]
radius float of the circle
stopAngleOffsets float an offset to the stop angle for each of the two directions in the range [0-2*PI]
prevVec THREE.Vector2 used for intermediate calculations
vec THREE.Vector2 used for intermediate calculations
renderedEdge renderedEdge to which the cirlce lines belong
Source:
Returns:
0 or 1, determining the direction in which the cirlce was drawn
Type
int

(inner) addDrawLine(prevVec, vec, renderedEdge, zPriority)

adds a line defined by prevVec and vec to the lines array
Parameters:
Name Type Description
prevVec THREE.Vector2 defining the start position of the edge
vec THREE.Vector2 defining the end position of the edge
renderedEdge renderedEdge to which the drawn line belongs
zPriority float of the edge [0-1], higher number is drawn on top
Source:

(inner) addNodeOutDrawLine(supernodePosition, angle, radius, prevVec, vec, renderedEdge)

adds the one line going out from the supernode and connects with the circle lines to the lines array
Parameters:
Name Type Description
supernodePosition vec3 of the supernode
angle float at which the node from which the drawn line exits is located within the supernode in the range [0-2*PI]
radius float to which the line extends
prevVec THREE.Vector2 used for intermediate calculations
vec THREE.Vector2 used for intermediate calculations
renderedEdge renderedEdge to which the drawn line belongs
Source:

(inner) addSupernodeConnectionDrawLine(supernode1ExitPosition, supernode2ExitPosition, prevVec, vec, renderedEdge)

adds the one line of the edge which connects the two supernodes to the lines array
Parameters:
Name Type Description
supernode1ExitPosition vec2 from where the line should stat
supernode2ExitPosition vec2 where the line should end
prevVec THREE.Vector2 used for intermediate calculations
vec THREE.Vector2 used for intermediate calculations
renderedEdge renderedEdge to which the line belongs
Source:

(inner) atan3(b, a) → {float}

computes the atan function in the range [0-2*PI]
Parameters:
Name Type Description
b float
a *
Source:
Returns:
the calculated function value
Type
float

(inner) computeDetailLODLinesRenderingObject(supernodeRenderedEdgeMatrix)

adds the required lines for all edges of the currently selected supernodes to the lines array
Parameters:
Name Type Description
supernodeRenderedEdgeMatrix supernodeRenderedEdgeMatrix describing the edges
Source:

(inner) computeEdgeZPosition(priority) → {float}

computes the z coordinate of an edge for rendering
Parameters:
Name Type Description
priority float [0-1], where higher number is drawn on top
Source:
Returns:
the edge z position
Type
float

(inner) computeInsideLinesForRendering(supernodeRenderedEdgeMatrix, vec, prevVec)

adds the required lines for all internal edges of the currently selected supernodes to the lines array
Parameters:
Name Type Description
supernodeRenderedEdgeMatrix supernodeRenderedEdgeMatrix describing the edges
vec THREE.Vector2 used for intermediate calculations
prevVec THREE.Vector2 used for intermediate calculations
Source:

(inner) computeNodeAngle(supernodeIndex, nodeIndex) → {float}

computes the angle at which a node is positioned within a supernode
Parameters:
Name Type Description
supernodeIndex * withing the selected supernodes
nodeIndex * withing the supernode
Source:
Returns:
the node angle in the range [0-2*PI]
Type
float

(inner) computeNodeExitAngle(nodeAngle, nodeId, directionAttribute)

computes the exit angle for the next edge of the specified node the exit angle is updated automatically within this function for the next call
Parameters:
Name Type Description
nodeAngle float at which the node is placed within the supernode in the range [0-2*PI]
nodeId int id of the node
directionAttribute int either 0 or 1 defining intra or inter supernode edges
Source:
Returns:
the exit angle of the node edge

(inner) computeOutsideLinesForRendering(supernodeRenderedEdgeMatrix, vec, prevVec)

adds the required lines for all external (connecting) edges of the currently selected supernodes to the lines array
Parameters:
Name Type Description
supernodeRenderedEdgeMatrix supernodeRenderedEdgeMatrix describing the edges
vec THREE.Vector2 used for intermediate calculations
prevVec THREE.Vector2 used for intermediate calculations
Source:

(inner) computeSupernodeRenderedEdgeMatrix(supernodeEdgeMatrix, minEdgeWeight, maxEdgeWeight) → {supernodeRenderedEdgeMatrix}

calculates the supernodeRenderedEdgeMatrix from the renderedEdgeMatrix which covers additional information for the edges
Parameters:
Name Type Description
supernodeEdgeMatrix supernodeEdgeMatrix used for the calculations
minEdgeWeight float of all edges within the supernodeEdgeMatrix
maxEdgeWeight float of all edges within the supernodeEdgeMatrix
Source:
Returns:
the supernode rendered edge matrix
Type
supernodeRenderedEdgeMatrix

(inner) getAngleDifference(angle1, angle2) → {float}

calculates the positive difference between two angles in the range [0,2*PI]
Parameters:
Name Type Description
angle1 float [0-2*PI]
angle2 float [0-2*PI]
Source:
Returns:
difference between the angles
Type
float

(inner) getCircleLayoutDirection(startAngle, stopAngle) → {int}

returns the direciton which connects the two angles with the shorter path
Parameters:
Name Type Description
startAngle float of the circle in the range [0-2*PI]
stopAngle float of the circle in the range [0-2*PI]
Source:
Returns:
-1: clockwise, 1: counterclockwise
Type
int

(inner) getDirectionIndex(routingDirection) → {int}

maps the routing direction for circular lines to the dedicaded array index
Parameters:
Name Type Description
routingDirection int either -1 or 1
Source:
Returns:
0 or 1
Type
int

(inner) getSmallerConnectingAngleInCircle(angle1, angle2)

calculates the shortes angle distance connecting two angles in the range [0,PI]
Parameters:
Name Type Description
angle1 float [0-2*PI]
angle2 float [0-2*PI]
Source:
Returns:
the connection angle

(inner) setVecToDirectionWithOffset(vec, offset, radius, direction)

sets the passed vector to the position defined by an offset o, a direction d and radius r (o + d * r)
Parameters:
Name Type Description
vec THREE.Vector2 whose value is modified by this function
offset THREE.Vector2 origin from which to go into the direction
radius float how far to step in the direction
direction float in form of an angle in the range [0-2*PI]
Source:

(inner) sortEdgesForInsideLayouting(renderedEdges)

sorts the renderedEdges of one supernode based on their weight and then their angular distance between the two nodes of the edge
Parameters:
Name Type Description
renderedEdges Array.<renderedEdge> an array of internal edges of one supernodeode
Source:

(inner) sortEdgesForOutsideLayouting(renderedEdges, supernodeExitAngle)

sorts the renderedEdges of one supernode based on their weight and then their angular distance to the supernode exit angle
Parameters:
Name Type Description
renderedEdges Array.<renderedEdge> an array of edges of one supernode to another one
supernodeExitAngle float angle at which the edges exit the node in the range [0-2*PI]
Source: