Show:

Overlays.Label Class

Provides a text label with which to decorate Connectors or Endpoints. For all different renderer types (SVG/Canvas/VML), jsPlumb draws a Label overlay as a styled DIV. You can style a Label using the cssClass parameter, or - if you need to programmatically generate the appearance - the labelStyle parameter.

Constructor

Overlays.Label

(
  • params
  • label
  • [cssClass]
  • [location=0.5]
  • [labelStyle]
)

Parameters:

  • params Object

    Constructor parameters

  • label String | Function
    • The text to display. You can provide a function here instead of plain text: it is passed the component as an argument, and it should return a String.
  • [cssClass] String optional

    Optional css class to use for the Label.

  • [location=0.5] Float optional

    Where, either as a proportional value from 0 to 1 inclusive, or as an absolute value (negative values mean distance from target; positive values greater than 1 mean distance from source) the Label should appear on the Connector

  • [labelStyle] Object optional

    Optional object containing properties for the label's style. Use this if you need to prgrammatically generate the label's appearance.

    • [cssClass] String optional

      css class for the label (you can also use the cssClass parameter on the label; this exists for historical reasons)

    • [font] String optional

      A string specifying a font to use, in valid CSS format.

    • [color] String optional

      A string specifying a font color to use, in valid CSS format.

    • [fillStyle] String optional

      A string specifying the background for the label, in valid CSS format.

    • [borderStyle] String optional

      A string specifying the border color for the label, in valid CSS format.

    • [borderWidth] Integer optional

      Width of the border's label

    • [padding] Integer optional

      Padding for the label.

Item Index