Node style that uses a rectangular shape as a basis and supports configurable round or diagonal corners.
Implements
- I
- I
Remarks
The following properties define the final shape:
- 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)See Also
Developer's Guide
Members
No filters for this type
Constructors
Properties
Gets or sets which corners are drawn with the chosen cornerStyle.
Gets or sets which corners are drawn with the chosen cornerStyle.
The value is interpreted as absolute or scaled by the node size depending on the scaleCornerSize property. The default value is
10.final
See Also
Developer's Guide
Gets or sets the RectangleCornerStyle that defines how the affected corners are drawn.
Gets or sets the RectangleCornerStyle that defines how the affected corners are drawn.
The default value is an empty string, in which case no class is set for the visualization.
Multiple classes can be set by separating them with spaces, just like with the SVG class attribute.
final
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.
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.
The idiom for retrieving, e.g. an IVisualCreator implementation for a given style is:
const creator = style.renderer.getVisualCreator(node, style)
const visual = creator.createVisual(context)readonlyfinal
Implements
INodeStyle.rendererGets or sets whether the cornerSize property is interpreted as absolute or scaled by the node size.
Gets or sets whether the cornerSize property is interpreted as absolute or scaled by the node size.
The default value is
false.final
See Also
Developer's Guide
Methods
Create a clone of this object.
Create a clone of this object.