LabelOverlayOptions
Options for a label overlay
| Name | Type | Description |
|---|---|---|
| attributes? | Record<string,string> | Optional custom attributes to write to the overlay's element. |
| backgroundStyle? | LabelBackgroundStyle | Optional style for the label's background. |
| cssClass? | string | Optional CSS class(es) to add to the overlay's element. |
| direction? | number | 1 to point forwards (the default), -1 to point backwards. Only taken into consideration in some overlay types. |
| events? | Record<OverlayEvents,(value:any, event:any) => any> | Optional event handlers to attach to the overlay. |
| font? | FontSpec | Optional spec for the font to use on this label. |
| id? | string | Optional ID for the overlay. Can be used to retrieve the overlay from a connection. |
| label | string | Function | String, or a function returning a string, for the label. |
| labelLocationAttribute? | string | Optional name of the attribute that identifies this overlay's location on the path. Defaults to . |
| location? | number | Defaults to 0.5. See docs. |
| rotatable? | 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? | boolean | Whether or not to use an HTML element. Defaults to false (uses an SVG element) |
| visibility? | OverlayVisibility | Whether the overlay is always visible, or only on hover. Defaults to OVERLAY_VISIBILITY_ALWAYS. |