DefaultLayoutGraph is a default implementation of LayoutGraph which holds the complete layout information about the graph and its elements.
Type Details
- yfiles module
- layout-core
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.layout.DefaultLayoutGraph
Constructors
Creates a new DefaultLayoutGraph instance with default settings.
Creates a new DefaultLayoutGraph instance which is a copy of the given graph.
Parameters
A map of options to pass to the method.
- argGraph - LayoutGraph
- the original graph
Creates a new DefaultLayoutGraph instance which is a copy of the given subgraph.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the original graph
- nodeSubset - ICursor
- the nodes that induce a subgraph of the original graph
Properties
Gets an array of all data provider look-up keys that are registered with this graph.
Defined in
Gets the number of edges in this graph.
Defined in
Gets a list of all edges in the graph.
Defined in
Yields a dynamic IEnumerable<T> for Edges that can be used to iterate over the edges that are contained in this instance.
Remarks
Defined in
Gets true
if this graph contains no nodes.
Defined in
Gets the number of nodes in this graph.
Defined in
Yields a dynamic IEnumerable<T> for YNodes that can be used to iterate over the nodes that are contained in this instance.
Remarks
Defined in
Gets all edge maps that have been created by this graph but have not yet been disposed.
Gets all node maps that have been created by this graph but have not yet been disposed.
Methods
Registers the given data provider using the given look-up key.
Remarks
Defined in
Redefines an edge's end points.
Remarks
Edge e
has source node v := e1.source()
and target node w := e2.target()
.
Edge e
is inserted in such a way that an iteration over the edges at v
returns e
- after
e1
, ifd1 == AFTER
- before
e1
, ifd1 == BEFORE
,
and an iteration over the edges at w
returns e
- after
e2
, ifd2 == AFTER
- before
e2
, ifd2 == BEFORE
.
Preconditions
- Edges
e
,e1
, ande2
must belong to this graph.
Parameters
A map of options to pass to the method.
- e - Edge
- The edge to be changed.
- e1 - Edge
- Reference edge for insertion at a new source node.
- e2 - Edge
- Reference edge for insertion at a new target node.
- d1 - GraphElementInsertion
- d2 - GraphElementInsertion
Defined in
changeEdge
(e: Edge, newSource: YNode, sourceReference: Edge, sourceD: GraphElementInsertion, newTarget: YNode, targetReference: Edge, targetD: GraphElementInsertion)Redefines an edge's end points.
Remarks
Edge e
has source node v := sourceReference.source()
or v := newSource
, if sourceReference == null
and target node w := targetReference.target()
or w := newTarget
, if targetReference == null
.
Edge e
is inserted in such a way that an iteration over the edges at v
returns e
- after
sourceReference
, ifsourceD == AFTER
- before
sourceReference
, ifsourceD == BEFORE
,
and an iteration over the edges at w
returns e
- after
targetReference
, iftargetD == AFTER
- before
targetReference
, iftargetD == BEFORE
.
Preconditions
- Edge
e
must belong to this graph. Also, eithersourceReference
ornewSource
must be non-null and belong to this graph, and eithertargetReference
ornewTarget
must be non-null and belong to this graph.
Parameters
A map of options to pass to the method.
- e - Edge
- The edge to be changed.
- newSource - YNode
- The new source node.
- sourceReference - Edge
- Reference edge for insertion at the new source node.
- sourceD - GraphElementInsertion
- newTarget - YNode
- The new target node.
- targetReference - Edge
- Reference edge for insertion at the new target node.
- targetD - GraphElementInsertion
Defined in
Redefines an edge's end points.
Remarks
Preconditions
newSource
andnewTarget
must belong to this graph.
Parameters
A map of options to pass to the method.
- e - Edge
- The edge to be changed.
- newSource - YNode
- The new source node of the given edge.
- newTarget - YNode
- The new target node of the given edge.
Defined in
Removes all nodes and edges from this graph.
Defined in
Returns whether or not this graph contains an edge that connects the given nodes.
Parameters
A map of options to pass to the method.
See Also
Defined in
Creates a new edge in this graph.
Remarks
The new edge has source node v
and target node w
, i.e., would be written as edge e = (v, w)
.
The edge is appended to the lists of incoming and outgoing edges at the source node and target node, respectively.
Parameters
A map of options to pass to the method.
Returns
- ↪Edge
- The newly created Edge object.
Defined in
createEdge
(v: YNode, e1: Edge, w: YNode, e2: Edge, d1: GraphElementInsertion, d2: GraphElementInsertion) : EdgeCreates a new edge in this graph to be ordered before or after a given edge.
Remarks
The new edge e
has source node v
and target node w
, i.e., would be written as edge e = (v, w)
.
Edge e
is inserted in such a way that an iteration over the edges at node v
returns e
- after
e1
, ifd1 == AFTER
- before
e1
, ifd1 == BEFORE
,
and an iteration over the edges at w
returns e
- after
e2
, ifd2 == AFTER
- before
e2
, ifd2 == BEFORE
.
Preconditions
- Edge
e1
must have source nodev
and edgee2
must have target nodew
.
Parameters
A map of options to pass to the method.
- v - YNode
- The source node of the edge.
- e1 - Edge
- An edge with source node
v
. - w - YNode
- The target node of the edge.
- e2 - Edge
- An edge with target node
w
. - d1 - GraphElementInsertion
- d2 - GraphElementInsertion
Returns
- ↪Edge
- The newly created Edge object.
Defined in
Creates a new implementation of IEdgeLayout.
Remarks
Returns
- ↪IEdgeLayout
- the layout of an edge
Returns a newly created edge map that is valid for the edges in this graph.
Remarks
The implementation returned by this method can be used for any edge that is part of this Graph instance at any point of time, i.e., it is safe to modify the graph structure (add and remove nodes and edges) freely.
The implementation returned uses O(m)
memory at all times and provides true O(1)
read and write access for each edge.
In order to release the resources held by this map, disposeEdgeMap has to be called.
Defined in
Creates a new ILabelLayoutFactory for this LayoutGraph that can be used for copying layout information of labels.
Creates a new implementation of INodeLayout.
Remarks
Returns
- ↪INodeLayout
- the layout of a node
Returns a newly created node map that is valid for the nodes in this graph.
Remarks
The implementation returned by this method can be used for any node that is part of this Graph instance at any point of time, i.e., it is safe to modify the graph structure (add and remove nodes and edges) freely.
The implementation returned uses O(n)
memory at all times and provides true O(1)
read and write access for each node.
In order to release the resources held by this map, disposeNodeMap has to be called.
Defined in
Informs the graph that the given edge map is no longer needed.
Remarks
This method is used for EdgeMap implementations that have been obtained using the createEdgeMap factory method.
Calling this method will destroy the edge map and associated resources can be freed. It is strongly recommended to dispose of all edge maps that are not needed anymore using this method.
Defined in
Informs the graph that the given node map is no longer needed.
Remarks
This method is used for NodeMap implementations that have been obtained using the createNodeMap factory method.
Calling this method will destroy the node map and associated resources can be freed. It is strongly recommended to dispose of all node maps that are not needed anymore using this method.
Defined in
Returns the rectangle describing the bounding box of the given node.
Parameters
A map of options to pass to the method.
- node - YNode
- the node
Returns
- ↪YRectangle
- the bounds of the node
See Also
Defined in
Returns the x-coordinate of the given node's center.
Parameters
A map of options to pass to the method.
- node - YNode
- the node
Returns
- ↪number
- the x-value of the node's center coordinate
See Also
Defined in
Returns the y-coordinate of the given node's center.
Parameters
A map of options to pass to the method.
- node - YNode
- the node
Returns
- ↪number
- the y-value of the node's center coordinate
See Also
Defined in
Returns the data provider that is registered with the graph using the given look-up key.
Remarks
Defined in
Provides access to the edges of the graph.
Returns the height of the given node.
Parameters
A map of options to pass to the method.
- node - YNode
- the node
Returns
- ↪number
- the height of the node
See Also
Defined in
Returns the layout information for all labels associated with the given node.
Remarks
Parameters
A map of options to pass to the method.
- node - YNode
- the node
Returns
- ↪INodeLabelLayout[]
- the layout information for the node's labels
Implements
Returns the layout information for all labels associated with the given edge.
Remarks
Parameters
A map of options to pass to the method.
- edge - Edge
- the edge
Returns
- ↪IEdgeLabelLayout[]
- the layout information for the edge's labels
Implements
Returns the layout information for the given node.
Remarks
Parameters
A map of options to pass to the method.
- node - YNode
- the node
Returns
- ↪INodeLayout
- the layout information for the node
Implements
Returns the layout information for the given edge.
Remarks
Parameters
A map of options to pass to the method.
- edge - Edge
- the edge
Returns
- ↪IEdgeLayout
- the layout information for the edge
Implements
Provides access to the nodes of the graph.
Returns the edge to which the given IEdgeLabelLayout belongs.
Parameters
A map of options to pass to the method.
- labelLayout - IEdgeLabelLayout
- the label's layout information
Returns
- ↪Edge
- the edge that owns the label
Implements
Returns the node to which the given INodeLabelLayout belongs.
Parameters
A map of options to pass to the method.
- labelLayout - INodeLabelLayout
- the label's layout information
Returns
- ↪YNode
- the node that owns the label
Implements
Returns the path of an edge, including the ports.
Remarks
Parameters
A map of options to pass to the method.
- edge - Edge
- the edge
Returns
- ↪YPointPath
- the path of the given edge
Defined in
Returns the path of an edge, including the ports.
Remarks
Parameters
A map of options to pass to the method.
- edge - Edge
- the edge
Returns
See Also
Defined in
Returns the control points of an edge.
Parameters
A map of options to pass to the method.
- edge - Edge
- the edge
Returns
See Also
Defined in
Returns the control points of an edge.
Parameters
A map of options to pass to the method.
- edge - Edge
- the edge
Returns
- ↪YPointPath
- a YPointPath representing the sequence of control points of the edge
See Also
Defined in
Returns the size of the given node.
Parameters
A map of options to pass to the method.
- node - YNode
- the node
Returns
- ↪YDimension
- the size of the node
See Also
Defined in
Returns the relative coordinates of the source point of the given edge.
Returns the relative coordinates of the target point of the given edge.
Returns the width of the given node.
Parameters
A map of options to pass to the method.
- node - YNode
- the node
Returns
- ↪number
- the width of the node
See Also
Defined in
Returns the x-coordinate of the given node's upper-left corner.
Parameters
A map of options to pass to the method.
- node - YNode
- the node
Returns
- ↪number
- the x-value of the node's upper-left corner
See Also
Defined in
Returns the y-coordinate of the given node's upper-left corner.
Parameters
A map of options to pass to the method.
- node - YNode
- the node
Returns
- ↪number
- the y-value of the node's upper-left corner
See Also
Defined in
Hides the given edge from this graph.
Remarks
Hiding an edge means to (temporarily) remove the edge from the graph.
Generally, hiding should only be used in the sense of temporarily removing an object that will be reinserted shortly after.
To reinsert a hidden edge use unhide.
See Also
Defined in
Hides the given node from this graph.
Remarks
Hiding a node means to (temporarily) remove the node from the graph.
Generally, hiding should only be used in the sense of temporarily removing an object that will be reinserted shortly after.
To reinsert a hidden node use unhide.
See Also
Defined in
Moves the upper-left corner of a node by a given vector.
Parameters
A map of options to pass to the method.
- node - YNode
- the node
- dx - number
- the x-component of the vector
- dy - number
- the y-component of the vector
Defined in
For internal debugging purposes only.
Defined in
Reinserts a formerly removed edge into this graph.
Remarks
The reinserted edge is appended to the sequence of edges in this graph, i.e., normally, its new position does not match the position before its removal. The same holds for the edge's positions in the list of incoming and outgoing edges at its source node and target node, respectively.
Note that reinserting an edge whose source/target is not in the graph (e.g., because it's currently hidden/removed) causes an exception. Hence, in such cases, you first have to unhide/reinsert the corresponding endpoints.
Parameters
A map of options to pass to the method.
- e - Edge
- The edge to be reinserted.
See Also
Defined in
Reinserts a formerly removed node into this graph.
Remarks
Parameters
A map of options to pass to the method.
- v - YNode
- The node to be reinserted.
See Also
Defined in
Removes the given node from this graph.
Specifies the center coordinates of the given node.
Parameters
A map of options to pass to the method.
See Also
Defined in
Specifies the center coordinates of the given node.
Parameters
A map of options to pass to the method.
- node - YNode
- the node
- x - number
- the new x-coordinate of the node's center
- y - number
- the new y-coordinate of the node's center
See Also
Defined in
Specifies the layout information for all associated labels of the given node in case there is only one label.
Remarks
Parameters
A map of options to pass to the method.
- node - YNode
- the node
- layout - INodeLabelLayout
- the layout information for the label of the node
Specifies the layout information for all associated labels of the given node.
Remarks
Parameters
A map of options to pass to the method.
- node - YNode
- the node
- layout - INodeLabelLayout[]
- the layout information for the labels of the node
Specifies the layout information for all associated labels of the given edge.
Remarks
Parameters
A map of options to pass to the method.
- edge - Edge
- the edge
- layout - IEdgeLabelLayout[]
- the layout information for the labels of the edge
Specifies the layout information for the given node.
Remarks
Parameters
A map of options to pass to the method.
- node - YNode
- the node
- layout - INodeLayout
- the layout information for the node
Specifies the layout information for the given edge.
Remarks
Parameters
A map of options to pass to the method.
- edge - Edge
- the edge
- layout - IEdgeLayout
- the layout information for the edge
Specifies the coordinates of the upper-left corner of the given node.
Parameters
A map of options to pass to the method.
- node - YNode
- the node
- x - number
- the new x-coordinate of the upper-left corner
- y - number
- the new y-coordinate of the upper-left corner
See Also
Defined in
Specifies the coordinates of the upper-left corner of the given node.
Parameters
A map of options to pass to the method.
See Also
Defined in
Sets the path of the given edge.
Remarks
The path of an edge is the position of the source port, followed by the positions of the bends, followed by the position of the target port.
Both source and target port are expected to be given in absolute coordinates.
Preconditions
- The length of the path must be at least
2
.
Parameters
A map of options to pass to the method.
- edge - Edge
- an edge in the graph
- path - YPointPath
- the new path sequence of the edge
Defined in
Sets the path of the given edge.
Remarks
The path of an edge is the position of the source port, followed by the positions of the bends, followed by the position of the target port.
Both source and target port are expected to be given in absolute coordinates.
Preconditions
- The length of the path must be at least
2
.
Parameters
A map of options to pass to the method.
- edge - Edge
- an edge in the graph
- path - YList
- the list of YPoints representing the new path sequence of the edge
See Also
Defined in
Sets the control points of the given edge.
Remarks
Parameters
A map of options to pass to the method.
- edge - Edge
- an edge in the graph
- points - YPointPath
- the new sequence of control points
Defined in
Sets the control points of the given edge.
Remarks
Parameters
A map of options to pass to the method.
- edge - Edge
- an edge in the graph
- points - YList
- the list of YPoints representing the new sequence of control points
See Also
Defined in
Specifies the width and height of the given node.
Parameters
A map of options to pass to the method.
- node - YNode
- the node
- width - number
- the new width of the node
- height - number
- the new height of the node
See Also
Defined in
Specifies the size of the given node.
Parameters
A map of options to pass to the method.
- node - YNode
- the node
- size - YDimension
- the new size of the node
See Also
Defined in
Specifies the absolute coordinates of the source point of the given edge.
Parameters
A map of options to pass to the method.
See Also
Defined in
Specifies the relative coordinates of the source point of the given edge.
Remarks
Parameters
A map of options to pass to the method.
See Also
Defined in
Specifies the absolute coordinates of the target point of the given edge.
Parameters
A map of options to pass to the method.
See Also
Defined in
Specifies the relative coordinates of the target point of the given edge.
Remarks
Parameters
A map of options to pass to the method.
See Also
Defined in
Sorts the internally held list of edges.
Remarks
null
, then the edges will not be sorted. This list determines the order of the edges as returned by getEdgeCursor.Parameters
A map of options to pass to the method.
- comparer - IComparer<Object>
- The comparator used for the edges.
Defined in
Sorts incoming and outgoing edges at each node of the graph.
Remarks
null
, then the corresponding edges (i.e., incoming/outgoing) will not be sorted. This sorts the order of the edges as returned by getOutEdgeCursor and getInEdgeCursor respectively.Parameters
A map of options to pass to the method.
- inComparer - IComparer<Object>
- The comparator used for the incoming edges at each node.
- outComparer - IComparer<Object>
- The comparator used for the outgoing edges at each node.
Defined in
Sorts the internally held list of nodes.
Remarks
null
, then the nodes will not be sorted. This list determines the order of the nodes as returned by getNodeCursor.Parameters
A map of options to pass to the method.
- comparer - IComparer<Object>
- The comparator used for the nodes.
Defined in
Returns a String representation of this graph.
Remarks
Defined in
Unhides the given edge in this graph.
Remarks
Unhiding an edge means to reinsert an edge that was formerly hidden from this graph by a call to hide.
Note that unhiding an edge whose source/target is not in the graph (e.g., because it's currently hidden/removed) causes an exception. Hence, in such cases, you first have to unhide/reinsert the corresponding endpoints.
See Also
Defined in
Fields
A IMap<T1,T2> associating the owner of an edge label with the edge label itself.
An IEdgeMap associating IEdgeLabelLayouts with the edges of this graph.
A IMap<T1,T2> associating the owner of a node label with the node label itself.
A INodeMap associating INodeLabelLayouts with the nodes of this graph.