Implements

  • IBaklavaEventEmitter
  • IBaklavaTapable

Constructors

Properties

_connections: Connection[] = []
_destroying: boolean = false
_loading: boolean = false
_nodes: AbstractNode[] = []
activeTransactions: number = 0
connectionEvents: {
    destruct: BaklavaEvent<void, Connection>;
} & ISubscribableProxy<{
    destruct: BaklavaEvent<void, Connection>;
}> = ...

Type declaration

editor: Editor
events: {
    addConnection: BaklavaEvent<IConnection, Graph>;
    addNode: BaklavaEvent<AbstractNode, Graph>;
    beforeAddConnection: PreventableBaklavaEvent<IAddConnectionEventData, Graph>;
    beforeAddNode: PreventableBaklavaEvent<AbstractNode, Graph>;
    beforeRemoveConnection: PreventableBaklavaEvent<IConnection, Graph>;
    beforeRemoveNode: PreventableBaklavaEvent<AbstractNode, Graph>;
    checkConnection: PreventableBaklavaEvent<IAddConnectionEventData, Graph>;
    removeConnection: BaklavaEvent<IConnection, Graph>;
    removeNode: BaklavaEvent<AbstractNode, Graph>;
} = ...

Type declaration

hooks: {
    checkConnection: ParallelHook<IAddConnectionEventData, CheckConnectionHookResult, Graph>;
    load: SequentialHook<IGraphState, Graph, IGraphState>;
    save: SequentialHook<IGraphState, Graph, IGraphState>;
} = ...

Type declaration

id: string = ...
nodeEvents: {
    addInput: BaklavaEvent<NodeInterface<any>, AbstractNode>;
    addOutput: BaklavaEvent<NodeInterface<any>, AbstractNode>;
    beforeAddInput: PreventableBaklavaEvent<NodeInterface<any>, AbstractNode>;
    beforeAddOutput: PreventableBaklavaEvent<NodeInterface<any>, AbstractNode>;
    beforeRemoveInput: PreventableBaklavaEvent<NodeInterface<any>, AbstractNode>;
    beforeRemoveOutput: PreventableBaklavaEvent<NodeInterface<any>, AbstractNode>;
    beforeTitleChanged: PreventableBaklavaEvent<string, AbstractNode>;
    loaded: BaklavaEvent<AbstractNode, AbstractNode>;
    removeInput: BaklavaEvent<NodeInterface<any>, AbstractNode>;
    removeOutput: BaklavaEvent<NodeInterface<any>, AbstractNode>;
    titleChanged: BaklavaEvent<string, AbstractNode>;
    update: BaklavaEvent<null | INodeUpdateEventData, AbstractNode>;
} & ISubscribableProxy<{
    addInput: BaklavaEvent<NodeInterface<any>, AbstractNode>;
    addOutput: BaklavaEvent<NodeInterface<any>, AbstractNode>;
    beforeAddInput: PreventableBaklavaEvent<NodeInterface<any>, AbstractNode>;
    beforeAddOutput: PreventableBaklavaEvent<NodeInterface<any>, AbstractNode>;
    beforeRemoveInput: PreventableBaklavaEvent<NodeInterface<any>, AbstractNode>;
    beforeRemoveOutput: PreventableBaklavaEvent<NodeInterface<any>, AbstractNode>;
    beforeTitleChanged: PreventableBaklavaEvent<string, AbstractNode>;
    loaded: BaklavaEvent<AbstractNode, AbstractNode>;
    removeInput: BaklavaEvent<NodeInterface<any>, AbstractNode>;
    removeOutput: BaklavaEvent<NodeInterface<any>, AbstractNode>;
    titleChanged: BaklavaEvent<string, AbstractNode>;
    update: BaklavaEvent<null | INodeUpdateEventData, AbstractNode>;
}> = ...

Type declaration

nodeHooks: {
    afterSave: SequentialHook<INodeState<any, any>, AbstractNode, INodeState<any, any>>;
    beforeLoad: SequentialHook<INodeState<any, any>, AbstractNode, INodeState<any, any>>;
} & ISubscribableProxy<{
    afterSave: SequentialHook<INodeState<any, any>, AbstractNode, INodeState<any, any>>;
    beforeLoad: SequentialHook<INodeState<any, any>, AbstractNode, INodeState<any, any>>;
}> = ...

Type declaration

template?: GraphTemplate

Accessors

  • get destroying(): boolean
  • Whether the graph is currently in the process of destroying itself

    Returns boolean

  • get loading(): boolean
  • Whether the graph is currently in the process of loading a saved graph

    Returns boolean

Methods

  • Add a connection to the list of connections.

    Parameters

    Returns undefined | Connection

    The created connection. If no connection could be created, returns undefined.

  • Add a node to the list of nodes.

    Type Parameters

    Parameters

    • node: T

      Instance of a node

    Returns undefined | T

    Instance of the node or undefined if the node was not added

  • Finds the Node with the provided id, as long as it exists in this graph

    Parameters

    • id: string

      id of the Node to find

    Returns undefined | AbstractNode

    The Node if found, otherwise undefined

  • Finds the NodeInterface with the provided id, as long as it exists in this graph

    Parameters

    • id: string

      id of the NodeInterface to find

    Returns undefined | NodeInterface<any>

    The NodeInterface if found, otherwise undefined

  • Load a state

    Parameters

    Returns string[]

    An array of warnings that occured during loading. If the array is empty, the state was successfully loaded.

  • Remove a connection from the list of connections.

    Parameters

    • connection: Connection

      Connection instance that should be removed.

    Returns void

  • Removes a node from the list. Will also remove all connections from and to the node.

    Parameters

    Returns void