Specifies custom data for the TreeMapLayout.
Type Parameters
- TNode
- TEdge
- TNodeLabel
- TEdgeLabel
Type Details
- yFiles module
- algorithms
Constructors
Parameters
A map of options to pass to the method.
- nodeWeights - ItemMapping<TNode,number>
- The mapping from nodes to the weight value used for the tree map layout. This option either sets the value directly or recursively sets properties to the instance of the nodeWeights property on the created object.
- childNodeComparator - function(TNode, TNode):number
- The comparison function that defines the order in which child nodes are placed inside their parent node. This option sets the childNodeComparator property on the created object.
Signature Details
function(x: TNode, y: TNode) : number
Encapsulates a method that compares two objects.Parameters
- x - TNode
- The first object to compare.
- y - TNode
- The second object to compare.
Returns
- number
- An integer value which is
<0
ifx
is less thany
,0
ifx
is equal toy
, or>0
ifx
is greater thany
Properties
Gets or sets the comparison function that defines the order in which child nodes are placed inside their parent node.
Remarks
Signature Details
function(x: TNode, y: TNode) : number
Parameters
- x - TNode
- The first object to compare.
- y - TNode
- The second object to compare.
Returns
- number
- An integer value which is
<0
ifx
is less thany
,0
ifx
is equal toy
, or>0
ifx
is greater thany
Gets or sets the mapping from nodes to the weight value used for the tree map layout.
Remarks
The weight of a node defines the area assigned to the node inside the available parent area with respect to the other child nodes, i.e., the area of the node rectangle in the resulting layout is proportional to the weight. Child nodes at the same hierarchy level with equal weight get the same area, they do not necessarily get equal width and height values.
All leaf nodes (nodes without further children) need to have a weight greater than 0
. Non-leaf nodes do not need to have a weight. They will get the sum of the weight of their children. If they have a weight on their own, some free space is generated inside the representative rectangle (i.e. the parent node is larger than the combined children).
See Also
Methods
combineWith
(data: LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>…) : LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>Combines this instance with the given layout data.
Remarks
Parameters
A map of options to pass to the method.
- data - LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>
- The LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> to combine this instance with.
Returns
- ↪LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>
- The combined layout data.