documentationfor yFiles for HTML 3.0.0.3

RectangleNodeStyle

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

Inheritance Hierarchy
RectangleNodeStyle
Implemented Interfaces

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)

Type Details

yFiles module
view

Constructors

Properties

Methods