These are the principle functions used to interact with the graph model.

http://js.cytoscape.org/#core/graph-manipulation

interface CoreGraphManipulation {
    $(selector: string): CollectionReturnValue;
    $id(id: string): CollectionReturnValue;
    add(eles:
        | ElementDefinition
        | ElementsDefinition
        | ElementDefinition[]
        | CollectionArgument): CollectionReturnValue;
    batch(callback: (() => void)): void;
    collection(eles?: string | CollectionArgument[]): CollectionReturnValue;
    destroy(): void;
    destroyed(): boolean;
    edges(selector?: string): cytoscape.EdgeCollection;
    elements(selector?: string): CollectionReturnValue;
    endBatch(): void;
    filter(selector: string | ((ele: Singular<SingularElementReturnValue, SingularElementArgument>, i: number, eles: CollectionArgument) => boolean)): CollectionReturnValue;
    getElementById(id: string): CollectionReturnValue;
    hasElementWithId(id: string): boolean;
    mount(element: Element): void;
    nodes(selector?: string): cytoscape.NodeCollection;
    remove(eles: string | CollectionArgument): CollectionReturnValue;
    startBatch(): void;
    unmount(): void;
}

Hierarchy (view full)

Methods

  • Attaches the instance to the specified container for visualisation. http://js.cytoscape.org/#cy.mount

    If the core instance is headless prior to calling cy.mount(), then the instance will no longer be headless and the visualisation will be shown in the specified container. If the core instance is non-headless prior to calling cy.mount(), then the visualisation is swapped from the prior container to the specified container.

    Parameters

    • element: Element

    Returns void