Skip to main content

Class: abstract Link

Defined in: diagram/elements.ts:298

Diagram link (graph edge)

Extended by

Constructors

Constructor

new Link(props): Link

Defined in: diagram/elements.ts:320

Parameters

ParameterType

props

LinkProps

Returns

Link

Properties

PropertyModifierTypeDescription

events

readonly

Events<LinkEvents>

Events for the graph link.

id

readonly

string

Unique and immutable link ID on the diagram.

Accessors

linkState

Get Signature

get linkState(): TemplateState

Defined in: diagram/elements.ts:398

Gets a serializable template-specific state for the link.

Returns

TemplateState


sourceId

Get Signature

get sourceId(): string

Defined in: diagram/elements.ts:345

Gets an immutable link source element ID.

Returns

string


targetId

Get Signature

get targetId(): string

Defined in: diagram/elements.ts:352

Gets an immutable link target element ID.

Returns

string


typeId

Get Signature

get typeId(): LinkTypeIri

Defined in: diagram/elements.ts:359

Gets the link type IRI.

Returns

LinkTypeIri


vertices

Get Signature

get vertices(): readonly Vector[]

Defined in: diagram/elements.ts:375

Gets the link geometry (intermediate points in paper coordinates in order from the link source to the target).

Returns

readonly Vector[]

Methods

redraw()

redraw(): void

Defined in: diagram/elements.ts:418

Forces a re-render of the link displayed by a template on a canvas.

Returns

void


setLinkState()

setLinkState(value): void

Defined in: diagram/elements.ts:408

Sets a new value for linkState property.

Triggers LinkEvents.changeLinkState event if new value does not equal to the previous one.

Parameters

ParameterType

value

TemplateState

Returns

void


setVertices()

setVertices(value): void

Defined in: diagram/elements.ts:388

Sets a new value for vertices property.

Triggers LinkEvents.changeVertices event if new geometry does not equal to the previous one.

Parameters

ParameterType

value

readonly Vector[]

Returns

void

See


generateId()

static generateId(): string

Defined in: diagram/elements.ts:338

Generates a new unique ID for an link.

Returns

string