Node style that uses a rectangular shape as a basis and supports configurable round or diagonal corners.
Remarks
- cornerStyle – Whether corners should be ROUND or CUT by a diagonal line.
- scaleCornerSize – Whether the corner size should be used as absolute value (
false
) or be scaled with the node size (true
). This especially affects the resizing behavior of the node. - cornerSize – The (absolute or relative) corner size.
- corners – Which corners will be rounded or cut.
Examples
The following example shows a RectangleNodeStyle with scalable round corners, similar to a ShapeNodeStyle with shape PILL
const style = new RectangleNodeStyle({
scaleCornerSize: true,
cornerSize: 0.5,
})
graph.setStyle(node, style)
The following example shows a RectangleNodeStyle with straight cut corners
const style = new RectangleNodeStyle({
cornerStyle: 'cut',
})
graph.setStyle(node, style)
Type Details
- yFiles module
- view
Constructors
Parameters
A map of options to pass to the method.
- cornerStyle - RectangleCornerStyle
- The RectangleCornerStyle that defines how the affected corners are drawn. This option sets the cornerStyle property on the created object.
- cornerSize - number
- The size of the corners. This option sets the cornerSize property on the created object.
- scaleCornerSize - boolean
- Whether the cornerSize property is interpreted as absolute or scaled by the node size. This option sets the scaleCornerSize property on the created object.
- corners - RectangleCorners
- Which corners are drawn with the chosen cornerStyle. This option sets the corners property on the created object.
- stroke - Stroke
- fill - Fill
- cssClass - string
- A CSS class that will be applied to the visualization. This option sets the cssClass property on the created object.
Properties
Gets or sets which corners are drawn with the chosen cornerStyle.
Remarks
Gets or sets the size of the corners.
Remarks
10
.Gets or sets the RectangleCornerStyle that defines how the affected corners are drawn.
Remarks
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)
Implements
Gets or sets whether the cornerSize property is interpreted as absolute or scaled by the node size.
Remarks
false
.Methods
Create a clone of this object.