Vertex Shapes

Vertices are rendered as circles by default. The shape style property allows using alternative geometries either by passing a shape keyword or by providing additional configuration for more control. This property is available anywhere vertex styles can be specified (for example in settings.baseStyles.vertex, settings.baseStyles['vertex:group'], or within settings.ruleBasedStyles).

Supported values are circle, ellipse square, rectangle, roundedRectangle, triangle, diamond, pentagon, hexagon, and octagon.

The following describes a few additional configurations:

The following shows an example of applying ellipse styling to vertices:

const settings = {
  baseStyles: {
    vertex: {
      shape: { type: 'ellipse', widthHeightRatio: 1.5 }
    }
  }
};

The preceding code produces the following output:

Figure: Applying Ellipse Styling to Vertices

Description of image follows

Description of the illustration vertex_shapes.png