Class Label

Represents a Label object.

Hierarchy

Constructors

  • constructor

    Parameters

    • flow: Flow

      a reference to the flow component

    • left: number

      The horizontal position of the node to create.

    • top: number

      The vertical position of the node to create.

    • width: number

      The width of the node to create.

    • height: number

      The height of the node to create.

    • text: string

      A string to be displayed in the node to create.

    • owner: IHasLabels

      The item that will own this label

    Returns Label

Properties

drawShape: ((ctx, x, y, w, h) => void)

Type declaration

    • (ctx, x, y, w, h): void
    • The method used to draw the contentItem shape if the shapeFamily property is 'other'

      Parameters

      • ctx: CanvasRenderingContext2D
      • x: number
      • y: number
      • w: number
      • h: number

      Returns void

      Default

      null
      
fillShape: ((ctx, x, y, w, h) => void)

Type declaration

    • (ctx, x, y, w, h): void
    • The method used to fill the contentItem shape.

      Parameters

      • ctx: CanvasRenderingContext2D
      • x: number
      • y: number
      • w: number
      • h: number

      Returns void

      Default

      null
      
fillStyle: string

The color used to fill the item

flow: Flow = null

A reference of the AddFlow component containing this item

font: string

The font used to display the text of the item

gradientFillStyle: string

The color used to create a gradient with the fillStyle color

image: HTMLImageElement = null

The image displayed in the contentItem

imageMargin: Margin = ...

Returns/sets the margins of the image in the contentItem.

imagePosition: ImagePosition = ImagePosition.CenterMiddle

Used to specify the position of the image in the contentItem. leftTop leftMiddle leftBottom rightTop rightMiddle rightBottom centerTop centerMiddle centerBottom

Default

centerMiddle
isExcludedFromLayout: boolean

Determines whether the item is excluded by a layout algorithm

Default

false
isHidden: boolean

Determines whether the item is hidden

Default

false
isHitTestVisible: boolean

Determines whether the item can be hit tested

Default

true
isSelectable: boolean

Determines whether the item is selectable by clicking on it with the mouse or unselectable (readonly or inactive)

Default

true
isShadowed: boolean

Determines whether a shadow is displayed for the item

Default

false
isXMoveable: boolean = true

Determines whether the contentItem can be moved horizontally moved or not

Default

true
isXSizeable: boolean = true

Determines whether the node can be resized horizontally resized or not.

Default

true
isYMoveable: boolean = true

Determines whether the contentItem can be moved vertically

Default

true
isYSizeable: boolean = true

Determines whether the node can be resized vertically resized or not.

Default

true
lineWidth: number

The thickness of the lines used to draw the item

Default

1
opacity: number

The opacity of the item

Default

1
polygon: Point[] = []

The set of points defining the contentItem shape if if the shapeFamily property is 'polygon'.

Default

null
ptOnLink: Point = ...
shapeFamily: ShapeFamily = ShapeFamily.Ellipse

ellipse, rectangle, polygon, other

strokeStyle: string

The color used to draw the item

tag: any

Sets or returns a tag associated with the item.

Default

null
text: string

Sets or returns the text associated with the item. If the item is a node, the text is displayed inside the node. It is a multiline display. The text is wrapped automatically inside the node. Linefeed and carriage return characters are allowed.

textFillStyle: string

The color used to display the text of the item

textLineHeight: number = 8

The height of a line of the text of the contentItem

textMargin: Margin = ...

Returns/sets the margins of the text in the contentItem.

textPosition: TextPosition = TextPosition.CenterMiddle

Used to specify the position of the text in the contentItem. leftTop leftMiddle leftBottom rightTop rightMiddle rightBottom centerTop centerMiddle centerBottom

Default

centerMiddle

Accessors

  • Returns/sets a value which defines the position of the label near the link. It is a value between 0 and 1. If it is 0, then the label is placed near the origin node of the link. If it is 1, then the label is placed near the destination node of the link. If it is for instance 0.5, then the label is placed near the middle of the link.

    Returns number

  • Parameters

    • value: number

    Returns void

  • get bounds(): Rect
  • The bounding rectangle of the moved item

    Returns Rect

  • set bounds(bounds): void
  • The bounding rectangle of the moved item

    Parameters

    Returns void

  • get dock(): DockStyle
  • Returns/sets the dock style of the label

    Returns DockStyle

    Default

    None
    
  • set dock(dock): void
  • Parameters

    Returns void

  • get isSelected(): boolean
  • Returns/sets a flag indicating if the item is selected or not.

    Returns boolean

  • set isSelected(value): void
  • Parameters

    • value: boolean

    Returns void

  • get labels(): Label[]
  • Returns the list of labels attached to this item.

    Returns Label[]

  • get owner(): IHasLabels
  • Returns/sets the reference of the owner item of this label

    Returns IHasLabels

  • set owner(owner): void
  • Parameters

    Returns void

Methods

  • Clone the label

    Returns Label

  • Cause the item to be updated.

    Returns void

Generated using TypeDoc