Decorates an arbitrary node styles with an additional collapse/expand handle.
Remarks
This style uses the CollapsibleNodeStyleDecoratorRenderer to adorn an existing INodeStyle with a Button
that can then be used to trigger the TOGGLE_EXPANSION_STATE.
By default, this handle is rendered as a plus ("+") sign when in collapsed state, and a minus ("-") sign when in expanded state.
The collapse button can be styled using the CSS class selectors 'yfiles-collapsebutton', 'yfiles-collapsebutton-checked' and 'yfiles-collapsebutton-unchecked'.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.styles.CollapsibleNodeStyleDecorator
See Also
Constructors
CollapsibleNodeStyleDecorator
(wrapped?: INodeStyle, renderer?: CollapsibleNodeStyleDecoratorRenderer)Initializes a new instance of the CollapsibleNodeStyleDecorator class using the provided style for the wrapped property and the provided CollapsibleNodeStyleDecoratorRenderer as renderer.
Parameters
A map of options to pass to the method.
- wrapped - INodeStyle
- The decorated style. If none is provided, the wrapped property will be initialized with a ShapeNodeStyle.
- renderer - CollapsibleNodeStyleDecoratorRenderer
- An instance of CollapsibleNodeStyleDecoratorRenderer to render this style. If none is provided, a new instance of CollapsibleNodeStyleDecoratorRenderer will be set as renderer.
- buttonPlacement - ILabelModelParameter
An ILabelModelParameter that determines the placement of the button for toggling the expanded state. This option sets the buttonPlacement property on the created object.
- insets - Insets
The insets to use for the INodeInsetsProvider that will be reported by the CollapsibleNodeStyleDecoratorRenderer's ILookup. This option sets the insets property on the created object.
Properties
Gets or sets an ILabelModelParameter that determines the placement of the button for toggling the expanded state.
Remarks
See Also
Gets or sets the insets to use for the INodeInsetsProvider that will be reported by the CollapsibleNodeStyleDecoratorRenderer's ILookup.
Remarks
This effectively influences the way the bounds of a group node are being calculated. The default IGroupBoundsCalculator implementation will use these insets to determine the minimum size of a group node given a set of contained nodes.
The default is (5,16,5,5)
See Also
Gets the renderer implementation that can be queried for implementations that provide details about the visual appearance and visual behavior for a given node and this style instance.
Remarks
const creator = style.renderer.getVisualCreator(node, style)
const visual = creator.createVisual(context)
See Also
Implements
Gets or sets the wrapped node style that will be used to perform the actual rendering of the node.
Methods
Create a clone of this object.