src/app/graphs/automatic-layout.ts
This class is an abstract representation of a node in a graph
Properties |
|
Methods |
|
constructor(id: string | number, positionX: number, positionY: number, nodeType: NodeType)
|
Defined in src/app/graphs/automatic-layout.ts:175
|
Private connectedTo |
Type : Set<LayoutNode>
|
Default value : new Set<LayoutNode>()
|
Defined in src/app/graphs/automatic-layout.ts:172
|
Set of edges this node is connected to |
Public fixed |
Default value : false
|
Defined in src/app/graphs/automatic-layout.ts:169
|
If true, this node will not move under any circumstance |
Readonly id |
Type : string | number
|
Defined in src/app/graphs/automatic-layout.ts:163
|
Node id |
Static Readonly MAX_DISTANCE_CONNECTED |
Type : number
|
Default value : 80
|
Defined in src/app/graphs/automatic-layout.ts:148
|
The maximum spacing between two nodes if they are connected by an edge |
Static Readonly MIN_DISTANCE_CONNECTED |
Type : number
|
Default value : 20
|
Defined in src/app/graphs/automatic-layout.ts:151
|
The minimum spacing between two nodes if they are connected by an edge |
Static Readonly MIN_DISTANCE_EDGE |
Type : number
|
Default value : 60
|
Defined in src/app/graphs/automatic-layout.ts:154
|
The minimum spacing between a node and an edge |
Static Readonly MIN_DISTANCE_NOT_CONNECTED |
Type : number
|
Default value : 80
|
Defined in src/app/graphs/automatic-layout.ts:145
|
The minimum spacing between two nodes if they are not connected by an edge |
Readonly padding |
Type : number
|
Defined in src/app/graphs/automatic-layout.ts:175
|
Padding to be added to this node |
Static Readonly PADDING_COMPONENT |
Type : number
|
Default value : 50
|
Defined in src/app/graphs/automatic-layout.ts:157
|
The padding around a component node |
Static Readonly PADDING_INTERFACE |
Type : number
|
Default value : 5
|
Defined in src/app/graphs/automatic-layout.ts:160
|
The padding around an interface node |
Public position |
Type : Vector
|
Defined in src/app/graphs/automatic-layout.ts:166
|
Position of this node |
Public calculateMovement | ||||||||
calculateMovement(allNodes: Array<LayoutNode>)
|
||||||||
Defined in src/app/graphs/automatic-layout.ts:274
|
||||||||
Calculate the movement direction that this node should move in, based on all other nodes around it
Parameters :
Returns :
Vector
The direction in which this node wants to travel |
Public connectTo | ||||||||
connectTo(other: LayoutNode)
|
||||||||
Defined in src/app/graphs/automatic-layout.ts:188
|
||||||||
Create an edge between this node and another node. Does not create a connection from the other node to this node!
Parameters :
Returns :
void
|
Private repelFromEdges | ||||||||||||
repelFromEdges(otherNode: LayoutNode, ignoredEdges: Set
|
||||||||||||
Defined in src/app/graphs/automatic-layout.ts:198
|
||||||||||||
Calculate the force pointing away from all edges that are connected to the other node
Parameters :
Returns :
Vector
The total force pointing away from all edges |
Private repelOrAttractToOtherNode | ||||||||
repelOrAttractToOtherNode(otherNode: LayoutNode)
|
||||||||
Defined in src/app/graphs/automatic-layout.ts:244
|
||||||||
Calculate the direction this node has to move to be closer to connected nodes and to be further away from non-connected nodes
Parameters :
Returns :
Vector
The force on this node |