Allows to scale the visualization of an ILabelStyle depending on the zoom level.
Remarks
Especially, this decorator is intended to be used in combination with an existing label style as zoom-invariant visualization for selection, focus or highlight indication.
The zoomPolicy property defines how the zoom level affects the rendering of the wrapped style. It can either scale according to the zoom level, similar to regular chart elements, or it can simulate a zoom level of one so that, for example, the pen thickness does not scale up or down, similar to the default yFiles indicators.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.styles.IndicatorLabelStyleDecorator
See Also
Constructors
Creates a new instance wrapping the provided style.
Parameters
A map of options to pass to the method.
- wrapped - ILabelStyle
- The label style to wrap. If no wrapped style is provided, style is used instead
- zoomPolicy - StyleDecorationZoomPolicy
How the style is affected by the current zoom level. This option sets the zoomPolicy property on the created object.
- padding - Insets
The padding the label layout is increased by. This option sets the padding property on the created object.
Properties
Gets or sets the padding the label layout is increased by.
Remarks
Actually, the bounds rendered by the style is the original label layout enlarged by this padding.
Depending on the zoomPolicy property, the padding is interpreted in world or view coordinates.
The default padding has a value of 0
for all four sides.
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 label and this style instance.
Remarks
const creator = style.renderer.getVisualCreator(label, style)
const visual = creator.createVisual(context)
Implements
Gets the wrapped label style.
Remarks
Gets or sets how the style is affected by the current zoom level.
Remarks
It can either scale according to the zoom level, similar to regular chart elements, or it can simulate a zoom level of one so that, for example, the pen thickness does not scale up or down, similar to the default yFiles indicators.
The default value is VIEW_COORDINATES.
See Also
Methods
Returns a memberwise clone of this instance.