LabelOverlayOptions
Options for a label overlay
Extends
Properties
attributes?
optionalattributes:Record<string,string>
Optional custom attributes to write to the overlay's element.
Inherited from
backgroundStyle?
optionalbackgroundStyle:LabelBackgroundStyle
Optional style for the label's background.
cssClass?
optionalcssClass:string
Optional CSS class(es) to add to the overlay's element.
Inherited from
direction?
optionaldirection:number
1 to point forwards (the default), -1 to point backwards. Only taken into consideration in some overlay types.
Inherited from
events?
optionalevents:Record<OverlayEvents, (value,event?) =>any>
Optional event handlers to attach to the overlay.
Inherited from
font?
optionalfont:FontSpec
Optional spec for the font to use on this label.
id?
optionalid:string
Optional ID for the overlay. Can be used to retrieve the overlay from a connection.
Inherited from
label
label:
string|Function
String, or a function returning a string, for the label.
labelLocationAttribute?
optionallabelLocationAttribute:string
Optional name of the attribute that identifies this overlay's location on the path. Defaults to location.
location?
optionallocation:number
Defaults to 0.5. See docs.
Inherited from
rotatable?
optionalrotatable:boolean|"strict"|"legible"
Sets whether the label 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 label will be made rotatable, in "legible" mode - in which VisuallyJs ensures that the label is legible by avoiding rotating the text so that it is upside down or otherwise awkward to read. You can set "strict" mode, which will rotate the label to the appropriate angle regardless of whether or not it will make the label difficult to read. If you supply boolean false, the label will not be rotatable in any situation.
useHTMLElement?
optionaluseHTMLElement:boolean
Whether or not to use an HTML element. Defaults to false (uses an SVG element)
visibility?
optionalvisibility:OverlayVisibility
Whether the overlay is always visible, or only on hover. Defaults to OVERLAY_VISIBILITY_ALWAYS.