# Class Label

Represents a Label object.

#### Hierarchy

- ContentItem
  - Label

- Defined in flow.ts:3179

#####
Index

### Constructors

constructor

### Properties

drawShape
fillShape
fillStyle
flow
font
gradientFillStyle
image
imageMargin
imagePosition
isExcludedFromLayout
isHidden
isHitTestVisible
isSelectable
isShadowed
isXMoveable
isXSizeable
isYMoveable
isYSizeable
lineWidth
opacity
polygon
ptOnLink
shapeFamily
strokeStyle
tag
text
textFillStyle
textLineHeight
textMargin
textPosition

### Accessors

anchorPositionOnLink
bounds
dock
isSelected
labels
owner

### Methods

clone
refresh
setRect

## Constructors

### constructor

- new Label(flow, left, top, width, height, text, owner): Label

- 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

  Overrides ContentItem.constructor

  - Defined in flow.ts:3191

## Properties

### drawShape

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

Inherited from ContentItem.drawShape

- Defined in flow.ts:2390

### fillShape

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

Inherited from ContentItem.fillShape

- Defined in flow.ts:2394

### fillStyle

fillStyle: string

The color used to fill the item

Inherited from ContentItem.fillStyle

- Defined in flow.ts:2231

### flow

flow: Flow = null

A reference of the AddFlow component containing this item

Inherited from ContentItem.flow

- Defined in flow.ts:2210

### font

font: string

The font used to display the text of the item

Inherited from ContentItem.font

- Defined in flow.ts:2221

### gradientFillStyle

gradientFillStyle: string

The color used to create a gradient with the fillStyle color

Inherited from ContentItem.gradientFillStyle

- Defined in flow.ts:2234

### image

image: HTMLImageElement = null

The image displayed in the contentItem

Inherited from ContentItem.image

- Defined in flow.ts:2397

### imageMargin

imageMargin: Margin = ...

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

Inherited from ContentItem.imageMargin

- Defined in flow.ts:2418

### imagePosition

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

Inherited from ContentItem.imagePosition

- Defined in flow.ts:2409

### isExcludedFromLayout

isExcludedFromLayout: boolean

Determines whether the item is excluded by a layout algorithm

#### Default

    false

Inherited from ContentItem.isExcludedFromLayout

- Defined in flow.ts:2262

### isHidden

isHidden: boolean

Determines whether the item is hidden

#### Default

    false

Inherited from ContentItem.isHidden

- Defined in flow.ts:2258

### isHitTestVisible

isHitTestVisible: boolean

Determines whether the item can be hit tested

#### Default

    true

Inherited from ContentItem.isHitTestVisible

- Defined in flow.ts:2254

### isSelectable

isSelectable: boolean

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

#### Default

    true

Inherited from ContentItem.isSelectable

- Defined in flow.ts:2250

### isShadowed

isShadowed: boolean

Determines whether a shadow is displayed for the item

#### Default

    false

Inherited from ContentItem.isShadowed

- Defined in flow.ts:2225

### isXMoveable

isXMoveable: boolean = true

Determines whether the contentItem can be moved horizontally moved or not

#### Default

    true

Inherited from ContentItem.isXMoveable

- Defined in flow.ts:2363

### isXSizeable

isXSizeable: boolean = true

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

#### Default

    true

Inherited from ContentItem.isXSizeable

- Defined in flow.ts:2372

### isYMoveable

isYMoveable: boolean = true

Determines whether the contentItem can be moved vertically

#### Default

    true

Inherited from ContentItem.isYMoveable

- Defined in flow.ts:2367

### isYSizeable

isYSizeable: boolean = true

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

#### Default

    true

Inherited from ContentItem.isYSizeable

- Defined in flow.ts:2377

### lineWidth

lineWidth: number

The thickness of the lines used to draw the item

#### Default

    1

Inherited from ContentItem.lineWidth

- Defined in flow.ts:2241

### opacity

opacity: number

The opacity of the item

#### Default

    1

Inherited from ContentItem.opacity

- Defined in flow.ts:2245

### polygon

polygon: Point[] = []

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

#### Default

    null

Inherited from ContentItem.polygon

- Defined in flow.ts:2385

### ptOnLink

ptOnLink: Point = ...

- Defined in flow.ts:3180

### shapeFamily

shapeFamily: ShapeFamily = ShapeFamily.Ellipse

ellipse, rectangle, polygon, other

Inherited from ContentItem.shapeFamily

- Defined in flow.ts:2380

### strokeStyle

strokeStyle: string

The color used to draw the item

Inherited from ContentItem.strokeStyle

- Defined in flow.ts:2228

### tag

tag: any

Sets or returns a tag associated with the item.

#### Default

    null

Inherited from ContentItem.tag

- Defined in flow.ts:2272

### text

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.

Inherited from ContentItem.text

- Defined in flow.ts:2268

### textFillStyle

textFillStyle: string

The color used to display the text of the item

Inherited from ContentItem.textFillStyle

- Defined in flow.ts:2237

### textLineHeight

textLineHeight: number = 8

The height of a line of the text of the contentItem

Inherited from ContentItem.textLineHeight

- Defined in flow.ts:2412

### textMargin

textMargin: Margin = ...

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

Inherited from ContentItem.textMargin

- Defined in flow.ts:2415

### textPosition

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

Inherited from ContentItem.textPosition

- Defined in flow.ts:2403

## Accessors

### anchorPositionOnLink

- get anchorPositionOnLink(): number

- 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

  - Defined in flow.ts:3275
- set anchorPositionOnLink(value): void

- #### Parameters

  - ##### value: number

  #### Returns void

  - Defined in flow.ts:3279

### bounds

- get bounds(): Rect

- The bounding rectangle of the moved item

  #### Returns Rect

  Inherited from ContentItem.bounds

  - Defined in flow.ts:2420
- set bounds(bounds): void

- The bounding rectangle of the moved item

  #### Parameters

  - ##### bounds: Rect

  #### Returns void

  Inherited from ContentItem.bounds

  - Defined in flow.ts:2424

### dock

- get dock(): DockStyle

- Returns/sets the dock style of the label

  #### Returns DockStyle

  #### Default

      None

  - Defined in flow.ts:3251
- set dock(dock): void

- #### Parameters

  - ##### dock: DockStyle

  #### Returns void

  - Defined in flow.ts:3255

### isSelected

- get isSelected(): boolean

- Returns/sets a flag indicating if the item is selected or not.

  #### Returns boolean

  Inherited from ContentItem.isSelected

  - Defined in flow.ts:2298
- set isSelected(value): void

- #### Parameters

  - ##### value: boolean

  #### Returns void

  Inherited from ContentItem.isSelected

  - Defined in flow.ts:2302

### labels

- get labels(): Label[]

- Returns the list of labels attached to this item.

  #### Returns Label[]

  Inherited from ContentItem.labels

  - Defined in flow.ts:2216

### owner

- get owner(): IHasLabels

- Returns/sets the reference of the owner item of this label

  #### Returns IHasLabels

  - Defined in flow.ts:3208
- set owner(owner): void

- #### Parameters

  - ##### owner: IHasLabels

  #### Returns void

  - Defined in flow.ts:3212

## Methods

### clone

- clone(): Label

- Clone the label

  #### Returns Label

  - Defined in flow.ts:3291

### refresh

- refresh(): void

- Cause the item to be updated.

  #### Returns void

  Inherited from ContentItem.refresh

  - Defined in flow.ts:2332

### setRect

- setRect(rect): void

- #### Parameters

  - ##### rect: Rect

  #### Returns void

  Overrides ContentItem.setRect

  - Defined in flow.ts:3297

Generated using TypeDoc