Skip to main content

Interface: GraphStructure

Defined in: src/diagram/model.ts:60

Provides graph content: elements and connected links.

Extended by​

Accessors​

cellsVersion​

Get Signature​

get cellsVersion(): number

Defined in: src/diagram/model.ts:70

Graph content (elements and links) version number which changes on every cell change (when element or link added/removed/reordered, see DiagramModelEvents.changeCells).

Returns​

number


elements​

Get Signature​

get elements(): readonly Element[]

Defined in: src/diagram/model.ts:74

All elements (nodes) in the graph.

Returns​

readonly Element[]


factory​

Get Signature​

get factory(): DataFactory

Defined in: src/diagram/model.ts:65

Provides an RDF term factory to create RDF terms for identifiers and property values.

Returns​

DataFactory


Get Signature​

get links(): readonly Link[]

Defined in: src/diagram/model.ts:78

All links (edges) between elements in the graph.

Returns​

readonly Link[]

Methods​

findLink(linkTypeId, sourceId, targetId): undefined | Link

Defined in: src/diagram/model.ts:99

Searches for any link of the specified type between elements with specified IDs in the graph if exists.

If multiple links is found, any of them could be returned.

Parameters​

ParameterType

linkTypeId

LinkTypeIri

sourceId

string

targetId

string

Returns​

undefined | Link


getElement()​

getElement(elementId): undefined | Element

Defined in: src/diagram/model.ts:82

Gets an element by its Element.id in the graph if exists.

Parameters​

ParameterType

elementId

string

Returns​

undefined | Element


getElementLinks(element): readonly Link[]

Defined in: src/diagram/model.ts:88

Gets all links connected to the specified element in the graph.

If element is not in the graph, no links would be returned.

Parameters​

ParameterType

element

Element

Returns​

readonly Link[]


getLink(linkId): undefined | Link

Defined in: src/diagram/model.ts:92

Gets a link by its Link.id in the graph if exists.

Parameters​

ParameterType

linkId

string

Returns​

undefined | Link


getLinkVisibility()​

getLinkVisibility(linkTypeId): LinkTypeVisibility

Defined in: src/diagram/model.ts:115

Gets current visibility mode for the specified link type.

Parameters​

ParameterType

linkTypeId

LinkTypeIri

Returns​

LinkTypeVisibility


sourceOf()​

sourceOf(link): undefined | Element

Defined in: src/diagram/model.ts:105

Gets a source element for the specified link in the graph.

If link is not in the graph, undefined would be returned instead.

Parameters​

ParameterType

link

Link

Returns​

undefined | Element


targetOf()​

targetOf(link): undefined | Element

Defined in: src/diagram/model.ts:111

Gets a target element for the specified link in the graph.

If link is not in the graph, undefined would be returned instead.

Parameters​

ParameterType

link

Link

Returns​

undefined | Element