Skip to main content

RectangleOverlayOptions

Options for a Rectangle overlay

Properties

align?

optional align: "center" | "flush"

When the overlay is at position 1 or 0 (or is being used a source/target marker), this determines how the rectangle intersects the vertex. A value of 'flush', which is the default, means a point on the boundary of the rectangle touches the vertex boundary. A value of 'center' means the rectangle's center is on the vertex boundary.


attributes?

optional attributes: Record<string, string>

Optional custom attributes to write to the overlay's element.

Inherited from

SimpleShapeOverlayOptions.attributes


cssClass?

optional cssClass: string

Optional CSS class(es) to add to the overlay's element.

Inherited from

SimpleShapeOverlayOptions.cssClass


direction?

optional direction: number

1 to point forwards (the default), -1 to point backwards. Only taken into consideration in some overlay types.

Inherited from

SimpleShapeOverlayOptions.direction


events?

optional events: Record<OverlayEvents, (value, event?) => any>

Optional event handlers to attach to the overlay.

Inherited from

SimpleShapeOverlayOptions.events


height?

optional height: number

Height of the rectangle. Defaults to 10.


hollow?

optional hollow: boolean

Defaults to false. When true, the arrow is stroked but not filled.

Inherited from

SimpleShapeOverlayOptions.hollow


id?

optional id: string

Optional ID for the overlay. Can be used to retrieve the overlay from a connection.

Inherited from

SimpleShapeOverlayOptions.id


location?

optional location: number

Defaults to 0.5. See docs.

Inherited from

SimpleShapeOverlayOptions.location


paintStyle?

optional paintStyle: PaintStyle

Optional paint style to use.

Inherited from

SimpleShapeOverlayOptions.paintStyle


rotate?

optional rotate: boolean

Whether or not to rotate the rectangle so that it is always perpendicular to the connector path. Defaults to false.


visibility?

optional visibility: OverlayVisibility

Whether the overlay is always visible, or only on hover. Defaults to OVERLAY_VISIBILITY_ALWAYS.

Inherited from

SimpleShapeOverlayOptions.visibility


width?

optional width: number

Width of the rectangle. Defaults to 10.