Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Graph

Graph containing nodes, connectors, edges and models

NOTICE: this class is used internally in the Project class, always use the Project class

Hierarchy

  • Graph

Implements

Index

Constructors

constructor

Properties

Private elements

elements: Dictionary<AbstractElement>

Methods

addConnector

  • addConnector(id: Guid, type: string, nodeId: Guid, properties: Dictionary<any>): void

addEdge

  • addEdge(id: Guid, type: string, modelId: Guid, startConnectorId: Guid, endConnectorId: Guid, properties?: Dictionary<any>): void
  • Adds an Edge to the Graph

    Parameters

    • id: Guid
    • type: string
    • modelId: Guid
    • startConnectorId: Guid
    • endConnectorId: Guid
    • Default value properties: Dictionary<any> = {}

    Returns void

addModel

  • addModel(id: Guid, type: string, properties: Dictionary<any>, parentId?: Guid): void
  • Adds a Model to the Graph

    Parameters

    • id: Guid
    • type: string
    • properties: Dictionary<any>
    • Optional parentId: Guid

    Returns void

addNode

  • addNode(id: Guid, type: string, modelId: Guid, properties: Dictionary<any>): void
  • Adds a Node to the Graph

    Parameters

    • id: Guid
    • type: string
    • modelId: Guid
    • properties: Dictionary<any>

    Returns void

deleteConnector

  • deleteConnector(id: Guid): void

deleteEdge

  • deleteEdge(id: Guid): void

deleteElement

  • Removes an element from the graph, WARNING: does not perform a cascading delete (i.e. no removal of orphan edges)

    Parameters

    • id: Guid

      Identifier of the element to remove

    • Optional ofType: ElementType

      Only delete the element if it is of the matching Type, if undefined, this check will be skipped

    Returns void

deleteModel

  • deleteModel(id: Guid): void

deleteNode

  • deleteNode(id: Guid): void

deleteProperty

  • deleteProperty(id: Guid, name: string): void

deserialize

  • Creates a new GraphInterface from a JSON Graph

    For the expected format, please read the documentation The expected format is the same as the format returned by serialize()

    Parameters

    • jsonObject: Object

    Returns GraphInterface

Private enqueueChildElement

  • enqueueChildElement(type: string, children: string[], queue: Queue<Object>, inQueue: Dictionary<Boolean>): void
  • Iterate over the child elements to add them

    Parameters

    • type: string

      Type of the child elements

    • children: string[]

      the Children to iterate over

    • queue: Queue<Object>

      The queue to add elements to

    • inQueue: Dictionary<Boolean>

      register which elements are processed

    Returns void

getElement

  • Returns an element given an GUID

    Parameters

    • id: Guid

      GUID representing an element identifier

    Returns AbstractElement

hasConnector

  • hasConnector(id: Guid): boolean

hasEdge

  • hasEdge(id: Guid): boolean

hasElement

  • hasElement(id: Guid): boolean

hasModel

  • hasModel(id: Guid): boolean

hasNode

  • hasNode(id: Guid): boolean

Private propertiesFromJSON

  • propertiesFromJSON(jsonProperties: Object): Dictionary<any>
  • Creates a Property dictionary from JSON

    Parameters

    • jsonProperties: Object

      JSON object that contains the properties

    Returns Dictionary<any>

serialize

  • serialize(): object
  • Transforms this Graph to a plain JSON graph

    Returns object

    • connectors: object
    • edges: object
    • models: object
    • nodes: object

setProperty

  • setProperty(id: Guid, name: string, value: any): void

Generated using TypeDoc