interface LabelOverlayOptions {
    attributes?: Record<string, string>;
    cssClass?: string;
    events?: Record<string, ((value, event?) => any)>;
    id?: string;
    label: string | Function;
    labelLocationAttribute?: string;
    location?: number;
    useHTMLElement?: boolean;
}

Hierarchy (view full)

Properties

attributes?: Record<string, string>

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

cssClass?: string

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

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

Optional event handlers to attach to the overlay.

Type declaration

    • (value, event?): any
    • Parameters

      • value: any
      • Optional event: any

      Returns any

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.

location?: number

Defaults to 0.5. See docs.

useHTMLElement?: boolean

Whether or not to use an HTML element. Defaults to false (uses an SVG element)