Skip to main content

Class: AnnotationLink

Defined in: src/editor/annotationCells.ts:55

Diagram-only annotation link, exported and imported with the diagram.

Extends​

Constructors​

Constructor​

new AnnotationLink(props): AnnotationLink

Defined in: src/diagram/elements.ts:320

Parameters​

ParameterType

props

LinkProps

Returns​

AnnotationLink

Inherited from​

Link.constructor

Properties​

PropertyModifierTypeDefault valueDescriptionInherited from

events

readonly

Events<LinkEvents>

undefined

Events for the graph link.

Link.events

id

readonly

string

undefined

Unique and immutable link ID on the diagram.

Link.id

fromJSONType

readonly

"AnnotationLink"

'AnnotationLink'

‐

‐

typeId

readonly

LinkTypeIri

'urn:reactodia:annotates'

‐

‐

Accessors​

linkState​

Get Signature​

get linkState(): TemplateState

Defined in: src/diagram/elements.ts:398

Gets a serializable template-specific state for the link.

Returns​

TemplateState

Inherited from​

Link.linkState


sourceId​

Get Signature​

get sourceId(): string

Defined in: src/diagram/elements.ts:345

Gets an immutable link source element ID.

Returns​

string

Inherited from​

Link.sourceId


targetId​

Get Signature​

get targetId(): string

Defined in: src/diagram/elements.ts:352

Gets an immutable link target element ID.

Returns​

string

Inherited from​

Link.targetId


typeId​

Get Signature​

get typeId(): LinkTypeIri

Defined in: src/diagram/elements.ts:359

Gets the link type IRI.

Returns​

LinkTypeIri

Inherited from​

Link.typeId


vertices​

Get Signature​

get vertices(): readonly Vector[]

Defined in: src/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[]

Inherited from​

Link.vertices

Methods​

redraw()​

redraw(): void

Defined in: src/diagram/elements.ts:418

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

Returns​

void

Inherited from​

Link.redraw


setLinkState()​

setLinkState(value): void

Defined in: src/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

Inherited from​

Link.setLinkState


setVertices()​

setVertices(value): void

Defined in: src/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​

Inherited from​

Link.setVertices


toJSON()​

toJSON(): SerializedAnnotationLink

Defined in: src/editor/annotationCells.ts:80

Returns​

SerializedAnnotationLink


fromJSON()​

static fromJSON(state, options): undefined | AnnotationLink

Defined in: src/editor/annotationCells.ts:64

Parameters​

ParameterType

state

SerializedAnnotationLink

options

LinkFromJsonOptions

Returns​

undefined | AnnotationLink


generateId()​

static generateId(): string

Defined in: src/diagram/elements.ts:338

Generates a new unique ID for an link.

Returns​

string

Inherited from​

Link.generateId