Skip to main content

CustomOverlayOptions

Options for a custom overlay. You need to supply the create method, which is passed the current connection as an argument, and return a DOM element.

Extends

Type Parameters

EL

EL

Properties

attributes?

optional attributes: Record<string, string>

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

Inherited from

OverlayOptions.attributes


cssClass?

optional cssClass: string

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

Inherited from

OverlayOptions.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

OverlayOptions.direction


events?

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

Optional event handlers to attach to the overlay.

Inherited from

OverlayOptions.events


id?

optional id: string

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

Inherited from

OverlayOptions.id


location?

optional location: number

Defaults to 0.5. See docs.

Inherited from

OverlayOptions.location


rotatable?

optional rotatable: boolean | "strict" | "legible"

Sets whether the overlay can be rotated to match the gradient of the connector at that location at which it is positioned. If you supply boolean true here, the overlay will be made rotatable in "legible" mode, in which VisuallyJs ensures that the overlay is always mostly 'upright, by avoiding rotating it so that it is upside down or other awkward to read. You can set "strict" mode, which will rotate the overlay to the appropriate angle regardless of whether or not it will make any text on it difficult to read.


visibility?

optional visibility: OverlayVisibility

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

Inherited from

OverlayOptions.visibility