SNIK Graph - v26.11
    Preparing search index...

    Class Graph

    Cytoscape.js Graph Class with path operations and styling.

    Index
    • Creates a new cytoscape graph, assigns it to the #cy container and sets up basic event listeners.

      Parameters

      • container: HTMLElement

        parent element

      Returns Graph

    container: HTMLElement
    cy: Core
    instancesLoaded: boolean = false
    moveMatchNotified: boolean = false
    pathSource: NodeSingular = null
    selectedNode: NodeSingular = null
    starMode: boolean = false
    • Apply a function once per node an operation should act on, for functions that only support single nodes.

      Parameters

      • f: (node: NodeSingular) => void

        the function

      • Optionalele: NodeSingular

        the node the operation was triggered on

      • Optionalnodes: NodeCollection

        explicit collection, takes precedence over the selection

      Returns void

    • Inverts the screen colors in the canvas for day mode. Uses an inverted node js style file to keep node colors.

      Parameters

      • dayScheme: boolean

        whether the canvas colors should be inverted.

      • coloredEdges: boolean

        Give every edge-type a certain color.

      • showProperty: boolean

        Show the property as edge label even on all edges, else only show edge labels on unselected edges.

      Returns void

    • Apply a function once to all nodes an operation should act on, for functions that support node collections.

      Parameters

      • f: (nodes: NodeCollection) => void

        the function

      • Optionalele: NodeSingular

        the node the operation was triggered on

      • Optionalnodes: NodeCollection

        explicit collection, takes precedence over the selection

      Returns void

    • Get the equivalent elements in this graph of the given elements from another graph.

      Parameters

      • eles: Collection

        elements from another graph

      Returns Collection

      equivalent elements that exist in this graph

    • Get the equivalent nodes in this graph of the given nodes from another graph.

      Parameters

      • nodes: NodeCollection

        nodes from another graph

      Returns NodeCollection

      equivalent nodes that exist in this graph

    • Sets whether close matches are grouped in compound nodes.

      Parameters

      • enabled: boolean

        Whether to activate or deactivate combine match mode. *

      Returns Promise<void>

    • Returns, whether cumulative search is activated.

      Returns boolean

      whether cumulative search is activated.

    • Get a collection of nodes/edges using a list of their IDs. If not existent in this graph, then all others are scanned. If found, the node or edge is added to the current view and returned.

      Parameters

      • ids: Iterable<string>

        iterable of cytoscape ids

      Returns Collection

      cytoscape collection of elements with those ids

    • Get a collection of nodes/edges using a list of their IDs. Works only in this graph.

      Parameters

      • ids: Iterable<string>

        iterable of cytoscape ids

      Returns Collection

      cytoscape collection of elements with those ids

    • Returns the start node for all path operations

      Returns NodeSingular

      the start node for all path operations, or null if none exists.

    • Move all matching nodes together.

      Parameters

      • distance: number

        the distance between them

      Returns void

    • position in a circle around the first node

      Parameters

      • nodes: NodeCollection

        the nodes to position

      • distance: number

        the radius of the circle

      Returns void

    • Create and return a new graph if the option is set to create star operations in a new view.

      Parameters

      • alwaysNew: boolean = false

      Returns Promise<Graph>

      this iff the option to create stars in a new view is unset, a new view's graph if it is set

    • Center and highlight the given URI.

      Parameters

      • uri: string

        The URI of a class in the graph.

      Returns boolean

      whether presenting the URI succeeded

    • Center and highlight the given URIs.

      Parameters

      • uris: string[]

        the URIs to present

      • hideOthers: boolean = false

        whether to hide the other nodes

      Returns boolean

      whether presenting the URIs succeeded

    • Removes all highlighting (except selection) and shows all hidden nodes.

      Parameters

      • OptionalshowHidden: boolean

      Returns void

    • Set the given node as source for all path operations.

      Parameters

      • node: NodeSingular

        the new source

      Returns boolean

      whether node is not null

    • Show close matches of the given nodes.

      Parameters

      • nodes: NodeCollection

        the nodes whose close matches are shown

      Returns void

    • Highlight the given two nodes, directly connected nodes (in both directions) of both of them and a shortest path between the two. Hide all other nodes except when in star mode.

      Parameters

      • to: NodeSingular

        path target node

      Returns boolean

      whether a path could be found

    • Show all nodes and edges on a shortest path between "from" and "to". Hide all other nodes except when in star mode.

      Parameters

      • from: NodeSingular

        path source node

      • to: NodeSingular

        path target node

      • OptionalstarPath: boolean

        whether to show the star around all nodes on the path

      Returns boolean

      whether a path could be found

    • Highlight the give node and all its directly connected nodes (in both directions). Hide all other nodes except when in star mode.

      Parameters

      • center: NodeCollection

        node or collection of nodes. center of the star

      • changeLayout: boolean = false

        arrange the given node and it's close matches in the center and the connected nodes in a circle around them.

      • Optionaldirection: Direction

        only show edges that originate from node, not those that end in it. Optional and defaults to false.

      Returns void

    • Show a star around the given node and the selected nodes in another view.

      Parameters

      • node: NodeSingular

        the node the operation was triggered on

      • changeLayout: boolean = false

        arrange the given node and its close matches in the center and the connected nodes in a circle around them.

      • direction: Direction = Direction.BOTH

        only show edges that originate from node, not those that end in it.

      • alwaysNew: boolean = false

        whether to open a new view even if this graph is not the main view.

      Returns Promise<void>

    • Show a "spider worm" between two nodes, which combines a star around "to" with a shortest path from "from" to "to". Hide all other nodes except when in star mode.

      Parameters

      • from: NodeSingular

        path source node

      • to: NodeSingular

        path target node, gets a "star" around it as well

      Returns boolean

      whether a path could be found

    • Show (unhide) the given elements or hide them using visibility: hidden. Do not use this for filters as they use other classes to interact properly with shown and hidden elements. Does not unhide filtered elements on its own.

      Parameters

      • eles:
            | NodeSingular
            | NodeCollection
            | EdgeCollection
            | Collection<SingularElementReturnValue, SingularElementArgument>

        the elements to hide

      • visible: boolean = true

        Whether to show or hide the nodes. Defaults to the sometimes implied value of true.

      Returns void

    • Parameters

      • eles: Collection

        the elements to assign the star mode css class to

      Returns void