documentationfor yFiles for HTML 2.6

RectangleNodeStyle

Node style that uses a rectangular shape as 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.

This style can be used together with RectangleNodeStyleRenderer instances.

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-component
yfiles-umd modules
All view modules
Legacy UMD name
yfiles.styles.RectangleNodeStyle

See Also

Constructors

Properties

Methods