Specifies custom data for the TreeMapLayout.
Type Details
- yfiles module
- view-layout-bridge
- yfiles-umd modules
- view-layout-bridge
- Legacy UMD name
- yfiles.tree.TreeMapLayoutData
See Also
Constructors
Creates a new instance of TreeMapLayoutData which helps configuring TreeMapLayout.
Parameters
A map of options to pass to the method.
- nodeWeights - ItemMapping<INode,number>
The mapping from nodes to the weight value used for the tree map layout. This option sets the nodeWeights property on the created object.
- abortHandler - AbortHandler
The AbortHandler used during the layout. This option sets the abortHandler property on the created object.
Properties
Gets or sets the AbortHandler used during the layout.
Remarks
An AbortHandler can be used to gracefully stop or cancel a running layout and offers options for automatically doing so after a predetermined time.
An AbortHandler configured or set here overrides the one on LayoutExecutor.
Examples
The most common use case would be to just configure the AbortHandler here, e.g. to set timeouts for a graceful stop or canceling the running layout:
layoutData.abortHandler.stopDuration = TimeSpan.fromSeconds(10) layoutData.abortHandler.cancelDuration = TimeSpan.fromSeconds(30)
layoutData.abortHandler!.stopDuration = TimeSpan.fromSeconds(10) layoutData.abortHandler!.cancelDuration = TimeSpan.fromSeconds(30)
If there's already an AbortHandler instance that's pre-configured or will be used in a different place to, e.g., cancel the layout when the user presses a button, you can also set one explicitly:
layoutData.abortHandler = abortHandler
See Also
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 a 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
Combines this instance with the given layout data.
Remarks
Parameters
A map of options to pass to the method.
- data - LayoutData
- The LayoutData to combine this instance with.
Returns
- ↪LayoutData
- The combined layout data.