C

RectangleNodeStyle

Node style that uses a rectangular shape as a basis and supports configurable round or diagonal corners.
ImplementsInheritance Hierarchy

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

Parameters

Properties

Gets or sets which corners are drawn with the chosen cornerStyle.
The default value is ALL.
conversionfinal

See Also

Developer's Guide
Gets or sets the size of the corners.
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.
The default value is ROUND.
conversionfinal

See Also

Developer's Guide
Gets or sets a CSS class that will be applied to the visualization.

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 or sets the Fill for filling the interior of the shape.
The default value is WHITE.
conversionfinal

See Also

Developer's Guide
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
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
Gets or sets the Stroke used for drawing the outline of the shape.
The default value is BLACK.
conversionfinal

See Also

Developer's Guide

Methods

Create a clone of this object.
final

Return Value

Object
A clone of this object.