A NodeHalo specifies a rectangular area around a specific node.
Remarks
A layout algorithm that supports NodeHalos, keeps this area clear of graph elements, except the node labels of this specific node and the adjacent segments of its edges. All minimum distances to this node, which are used in the layout calculation, e.g., minimum first segment length, will be extended by the halo size.
This class defines a key used for registering a IDataProvider that provides NodeHalos for all nodes of the input graph. NodeHalo-aware layout algorithms like HierarchicLayout look for IDataProviders registered with this key to retrieve NodeHalo information.
The following layouters support NodeHalos with different restrictions:
- HierarchicLayout
- OrthogonalLayout
- CompactOrthogonalLayout
- TreeLayout
- ClassicTreeLayout
- TabularLayout
- OrganicLayout
- if the scope is set to SUBSET, MAINLY_SUBSET or MAINLY_SUBSET_GEOMETRIC, there might be some overlapping nodes and NodeHalos
- if node overlaps are allowed, NodeHalos may also overlap
- edges do not consider NodeHalos
- GenericLabeling
- if there is not enough space, labels may overlap with NodeHalos
- EdgeRouter
- other constraints (e.g. PortConstraints) with higher costs may cause edges to cross NodeHalos
- CircularLayout
- NodeHalo overlaps may occur if the internal BalloonLayout allows overlaps
- edges do not consider NodeHalos
- BalloonLayout
- NodeHalo overlaps may occur, if allowOverlaps is enabled
- edges do not consider NodeHalos
- SelfLoopRouter
- if there is not enough space, self-loops may overlap with NodeHalos
- RadialLayout
- non-tree edges do not consider NodeHalos
- RecursiveGroupLayout
- ComponentLayout
Type Details
- yfiles module
- layout-core
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.layout.NodeHalo
See Also
Methods
Returns a hash code for this object.
Remarks
The hash code is a numeric value that can be used to treat this object as a key in a hash table or similar data structure.
Two objects that are considered equal must have the same hash code. However, the reverse does not hold and two objects having the same hash code don't have to be equal. Ideally, the hash code should be roughly uniformly-distributed to prevent hash tables from performing poorly. Calculating the hash code is also a potentially frequent operation and should therefore be fast.
Returns
- ↪number
- the hash code for this object
Fields
The NodeHalo size at the bottom side of the node.
The NodeHalo size at the left side of the node.
The NodeHalo size at the right side of the node.
The NodeHalo size at the top side of the node.
Constants
Static Methods
Creates a NodeHalo with the specified values.
Remarks
Parameters
A map of options to pass to the method.
- top - number
- the NodeHalo size at the top side of the node
- left - number
- the NodeHalo size at the left side of the node
- bottom - number
- the NodeHalo size at the bottom side of the node
- right - number
- the NodeHalo size at the right side of the node
Returns
Throws
- Exception({ name: 'ArgumentError' })
- if one of the values is negative, Number.NaN or Number.POSITIVE_INFINITY
Creates a NodeHalo object with the specified value on each side of the node.
Remarks
Parameters
A map of options to pass to the method.
- value - number
- the halo size at each side of the node
Returns
Throws
- Exception({ name: 'ArgumentError' })
- if the value is negative, Number.NaN or Number.POSITIVE_INFINITY
Returns the NodeHalo associated with the given node.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the graph containing the given node
- node - YNode
- the node whose NodeHalo will be determined
Returns
Returns a YRectangle instance with the bounds of the given node including its NodeHalo.
Remarks
This YRectangle is located at the position of the node.
If the node does not have a NodeHalo assigned, this box has the same size as the node.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the graph containing the given node
- node - YNode
- the node whose NodeHalo will be determined
Returns
- ↪YRectangle
- a YRectangle instance with the bounds of the given node including its NodeHalo
Checks whether or not the given graph contains NodeHalo information.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
Returns
- ↪boolean