node --> Cy.NodeSingular a collection of a single node

interface NodeSingular {
    -: CollectionBuildingDifferenceFunc;
    !: CollectionBuildingDifferenceFunc;
    .: CollectionBuildingIntersectionFunc;
    (-): CollectionSymmetricDifferenceFunc;
    (+): CollectionSymmetricDifferenceFunc;
    \: CollectionBuildingDifferenceFunc;
    &: CollectionBuildingIntersectionFunc;
    ^: CollectionSymmetricDifferenceFunc;
    +: CollectionBuildingUnionFunc;
    |: CollectionBuildingUnionFunc;
    add: CollectionBuildingUnionFunc;
    and: CollectionBuildingIntersectionFunc;
    difference: CollectionBuildingDifferenceFunc;
    intersect: CollectionBuildingIntersectionFunc;
    intersection: CollectionBuildingIntersectionFunc;
    length: number;
    n: CollectionBuildingIntersectionFunc;
    not: CollectionBuildingDifferenceFunc;
    or: CollectionBuildingUnionFunc;
    relativeComplement: CollectionBuildingDifferenceFunc;
    subtract: CollectionBuildingDifferenceFunc;
    symdiff: CollectionSymmetricDifferenceFunc;
    symmetricDifference: CollectionSymmetricDifferenceFunc;
    u: CollectionBuildingUnionFunc;
    union: CollectionBuildingUnionFunc;
    xor: CollectionSymmetricDifferenceFunc;
    [iterator](): Iterator<NodeSingular, any, any>;
    $id(id: string): NodeSingular;
    abscomp(): CollectionReturnValue;
    absoluteComplement(): CollectionReturnValue;
    active(): boolean;
    addClass(classes: ClassNames): this;
    addListener(events: string, selector: string, handler: EventHandler): this;
    addListener(events: string, handler: EventHandler): this;
    allAre(selector: string): boolean;
    allAreNeighbors(eles: CollectionArgument): boolean;
    allAreNeighbours(eles: CollectionArgument): boolean;
    ancestors(selector?: string): cytoscape.NodeCollection;
    animate(options: ElementAnimateOptionPos | ElementAnimateOptionRen, params?: ElementAnimateOptionsBase): this;
    animated(): boolean;
    animation(options: SingularAnimationOptionsPos | SingularAnimationOptionsRen): AnimationManipulation;
    anySame(eles: CollectionArgument): boolean;
    aStar(options: SearchAStarOptions): SearchAStarResult;
    attr(name?: string): any;
    attr(name: string, value: any): this;
    attr(obj: any): this;
    bellmanFord(options: SearchBellmanFordOptions): SearchBellmanFordResult;
    betweennessCentrality(options: SearchBetweennessOptions): SearchBetweennessResult;
    bfs(options: SearchFirstOptions): SearchFirstResult;
    bind(events: string, selector: string, handler: EventHandler): this;
    bind(events: string, handler: EventHandler): this;
    boundingbox(options?: BoundingBoxOptions): BoundingBox12 & BoundingBoxWH;
    boundingBox(options?: BoundingBoxOptions): BoundingBox12 & BoundingBoxWH;
    breadthFirstSearch(options: SearchFirstOptions): SearchFirstResult;
    children(selector?: string): cytoscape.NodeCollection;
    classes(classes: ClassNames): this;
    classes(classes: undefined | ClassNames): string[] | NodeSingular;
    classes(): string[];
    clearQueue(): this;
    clone(): CollectionReturnValue;
    closedNeighborhood(selector?: string): CollectionReturnValue;
    closenessCentrality(options: SearchClosenessCentralityOptions): number;
    closenessCentralityNormalized(options: SearchClosenessCentralityNormalizedOptions): SearchDegreeCentralityNormalizedResultUndirected | SearchDegreeCentralityNormalizedResultDirected;
    commonAncestors(selector?: string): cytoscape.NodeCollection;
    complement(): CollectionReturnValue;
    components(): CollectionReturnValue[];
    connectedEdges(selector?: string): cytoscape.EdgeCollection;
    contains(eles: CollectionArgument): boolean;
    copy(): CollectionReturnValue;
    createLayout(options: LayoutOptions): Layouts;
    css(name: string, value: any): this;
    css(name: string): any;
    css(obj: object): this;
    css(): {
        [index: string]: any;
    };
    cy(): cytoscape.Core;
    data(name?: string): any;
    data(name: string, value: any): this;
    data(obj: any): this;
    degree(includeLoops: boolean): number;
    degreeCentrality(options: SearchDegreeCentralityOptions): SearchDegreeCentralityResultUndirected | SearchDegreeCentralityResultDirected;
    degreeCentralityNormalized(options: SearchDegreeCentralityNormalizedOptions): SearchDegreeCentralityNormalizedResultUndirected | SearchDegreeCentralityNormalizedResultDirected;
    delay(duration: number, complete?: (() => void)): this;
    delayAnimation(duration: number): AnimationManipulation;
    depthFirstSearch(options: SearchFirstOptions): SearchFirstResult;
    descendants(selector?: string): cytoscape.NodeCollection;
    deselect(): this;
    dfs(options: SearchFirstOptions): SearchFirstResult;
    diff(selector: string | CollectionArgument): {
        both: CollectionReturnValue;
        left: CollectionReturnValue;
        right: CollectionReturnValue;
    };
    dijkstra(options: SearchDijkstraOptions): SearchDijkstraResult;
    each(each: ((ele: NodeSingular, i: number, eles: this) => boolean | void), thisArg?: any): this;
    edges(selector?: string): cytoscape.EdgeCollection;
    edgesTo(eles: string | CollectionArgument): cytoscape.EdgeCollection;
    edgesWith(eles: string | CollectionArgument): cytoscape.EdgeCollection;
    effectiveOpacity(): number;
    emit(events: string, extra?: unknown[]): this;
    empty(): boolean;
    eq(index: number): NodeSingular;
    every(test: ((ele: CollectionArgument, i: number, eles: CollectionArgument) => boolean), thisArg?: any): boolean;
    filter(selector: string | ((ele: NodeSingular, i: number, eles: CollectionArgument) => boolean)): CollectionReturnValue;
    first(): NodeSingular;
    flashClass(classes: ClassNames, duration?: number): this;
    floydWarshall(options: SearchFloydWarshallOptions): SearchFloydWarshallResult;
    forEach(each: ((ele: NodeSingular, i: number, eles: this) => boolean | void), thisArg?: any): this;
    getElementById(id: string): NodeSingular;
    grabbable(): boolean;
    grabbed(): boolean;
    grabify(): this;
    group(): ElementGroup;
    has(eles: CollectionArgument): boolean;
    hasClass(className: string): boolean;
    height(): number;
    hidden(): boolean;
    hopcroftTarjanBiconnected(): {
        components: CollectionReturnValue;
        cut: cytoscape.NodeCollection;
    };
    hopcroftTarjanBiconnectedComponents(): {
        components: CollectionReturnValue;
        cut: cytoscape.NodeCollection;
    };
    htb(): {
        components: CollectionReturnValue;
        cut: cytoscape.NodeCollection;
    };
    htbc(): {
        components: CollectionReturnValue;
        cut: cytoscape.NodeCollection;
    };
    id(): string;
    incomers(selector?: string): CollectionReturnValue;
    indegree(includeLoops: boolean): number;
    inside(): boolean;
    is(selector: string): boolean;
    isChild(): boolean;
    isChildless(): boolean;
    isEdge(): this is EdgeSingular;
    isNode(): this is NodeSingular;
    isOrphan(): boolean;
    isParent(): boolean;
    json(): string;
    jsons(): string[];
    kargerStein(): {
        components: CollectionReturnValue;
        cut: cytoscape.EdgeCollection;
        partitionFirst: cytoscape.NodeCollection;
        partitionSecond: cytoscape.NodeCollection;
    };
    kruskal(handler: ((edge: cytoscape.EdgeCollection) => number)): CollectionReturnValue;
    last(): NodeSingular;
    layout(options: LayoutOptions): Layouts;
    layoutDimensions(options: LayoutDimensionOptions): {
        h: number;
        w: number;
    };
    layoutPositions(layout: string, options: LayoutPositionOptions, handler: ElementPositionFunction): void;
    leaves(selector?: string): cytoscape.NodeCollection;
    listen(events: string, selector: string, handler: EventHandler): this;
    listen(events: string, handler: EventHandler): this;
    lock(): this;
    locked(): boolean;
    makeLayout(options: LayoutOptions): Layouts;
    map<T>(fn: ((ele: NodeSingular, i: number, eles: CollectionArgument) => T), thisArg?: any): T[];
    max<T>(fn: ((ele: NodeSingular, i: number, eles: CollectionArgument) => T), thisArg?: any): {
        ele: SingularElementReturnValue;
        value: T;
    };
    maxDegree(includeLoops: boolean): number;
    maxIndegree(includeLoops: boolean): number;
    maxOutdegree(includeLoops: boolean): number;
    merge(eles: string | CollectionArgument): this;
    min<T>(fn: ((ele: NodeSingular, i: number, eles: CollectionArgument) => T), thisArg?: any): {
        ele: SingularElementReturnValue;
        value: T;
    };
    minDegree(includeLoops: boolean): number;
    minIndegree(includeLoops: boolean): number;
    minOutdegree(includeLoops: boolean): number;
    modelPosition(): Position;
    modelPosition(dimension: PositionDimension): number;
    modelPosition(dimension: PositionDimension, value: number): this;
    modelPosition(pos: Position): this;
    modelPositions(handler: Position | ElementPositionFunction): this;
    move(location: {
        source?: string;
        target?: string;
    }): cytoscape.EdgeCollection;
    move(location: {
        parent: null | string;
    }): cytoscape.NodeCollection;
    neighborhood(selector?: string): CollectionReturnValue;
    nodes(selector?: string): cytoscape.NodeCollection;
    nonempty(): boolean;
    nonorphans(selector?: string): cytoscape.NodeCollection;
    numericStyle(name: string): any;
    numericStyleUnits(name: string): any;
    off(events: string, selector?: string, handler?: EventHandler): this;
    on(events: string, selector: string, handler: EventHandler): this;
    on(events: string, handler: EventHandler): this;
    once(events: string, selector: string, data: any, handler: EventHandler): this;
    once(events: string, selector: string, handler: EventHandler): this;
    once(events: string, handler: EventHandler): this;
    one(events: string, selector: string, data: any, handler: EventHandler): this;
    one(events: string, selector: string, handler: EventHandler): this;
    one(events: string, handler: EventHandler): this;
    openNeighborhood(selector?: string): CollectionReturnValue;
    orphans(selector?: string): cytoscape.NodeCollection;
    outdegree(includeLoops: boolean): number;
    outerHeight(): number;
    outerWidth(): number;
    outgoers(selector?: string): CollectionReturnValue;
    pageRank(options: SearchPageRankOptions): SearchPageRankResult;
    parent(selector?: string): cytoscape.NodeCollection;
    parents(selector?: string): cytoscape.NodeCollection;
    point(): Position;
    point(dimension: PositionDimension): number;
    point(dimension: PositionDimension, value: number): this;
    point(pos: Position): this;
    points(handler: Position | ElementPositionFunction): this;
    pon(events: string, selector?: string): Promise<EventHandler>;
    position(): Position;
    position(dimension: PositionDimension): number;
    position(dimension: PositionDimension, value: number): this;
    position(pos: Position): this;
    positions(handler: Position | ElementPositionFunction): this;
    predecessors(selector?: string): CollectionReturnValue;
    promiseOn(events: string, selector?: string): Promise<EventHandler>;
    reduce<T>(fn: ((prevVal: T, ele: NodeSingular, i: number, eles: CollectionArgument) => T), initialValue: T): T;
    relativePoint(dimension?: PositionDimension): Position;
    relativePoint(dimension: PositionDimension, value: Position): this;
    relativePoint(pos: {
        [name: string]: number;
    }): this;
    relativePosition(dimension?: PositionDimension): Position;
    relativePosition(dimension: PositionDimension, value: Position): this;
    relativePosition(pos: {
        [name: string]: number;
    }): this;
    remove(): CollectionReturnValue;
    removeAllListeners(): this;
    removeAttr(names?: string): CollectionReturnValue;
    removeClass(classes: ClassNames): this;
    removed(): boolean;
    removeData(names?: string): CollectionReturnValue;
    removeListener(events: string, selector?: string, handler?: EventHandler): this;
    removeScratch(namespace: string): this;
    removeStyle(names?: string): this;
    renderedBoundingbox(options?: BoundingBoxOptions): BoundingBox12 & BoundingBoxWH;
    renderedBoundingBox(options?: BoundingBoxOptions): BoundingBox12 & BoundingBoxWH;
    renderedCss(): {
        [name: string]: any;
    };
    renderedCss(name: string): any;
    renderedHeight(): number;
    renderedOuterHeight(): number;
    renderedOuterWidth(): number;
    renderedPoint(dimension?: PositionDimension): Position;
    renderedPoint(dimension: PositionDimension, value: Position): this;
    renderedPoint(pos: {
        [name: string]: number;
    }): this;
    renderedPosition(dimension?: PositionDimension): Position;
    renderedPosition(dimension: PositionDimension, value: Position): this;
    renderedPosition(pos: {
        [name: string]: number;
    }): this;
    renderedStyle(): {
        [name: string]: any;
    };
    renderedStyle(name: string): any;
    renderedWidth(): number;
    restore(): CollectionReturnValue;
    roots(selector?: string): cytoscape.NodeCollection;
    same(eles: CollectionArgument): boolean;
    scratch(namespace?: string): any;
    scratch(namespace: string, value: any): this;
    select(): this;
    selectable(): boolean;
    selected(): boolean;
    selectify(): this;
    shift(dimension: PositionDimension, value?: number): this;
    shift(pos: Position): this;
    siblings(selector?: string): cytoscape.NodeCollection;
    size(): number;
    slice(start?: number, end?: number): this;
    some(test: ((ele: CollectionArgument, i: number, eles: CollectionArgument) => boolean), thisArg?: any): boolean;
    sort(sort: ((ele1: NodeSingular, ele2: NodeSingular) => number)): CollectionReturnValue;
    stop(clearQueue?: boolean, jumpToEnd?: boolean): this;
    style(name: string, value: any): this;
    style(name: string): any;
    style(obj: object): this;
    style(): {
        [index: string]: any;
    };
    successors(selector?: string): CollectionReturnValue;
    tarjanStronglyConnected(): {
        components: CollectionReturnValue;
        cut: cytoscape.EdgeCollection;
    };
    tarjanStronglyConnectedComponents(): {
        components: CollectionReturnValue;
        cut: cytoscape.EdgeCollection;
    };
    toArray(): NodeSingular[];
    toggleClass(classes: ClassNames, toggle?: boolean): this;
    totalDegree(includeLoops: boolean): number;
    transparent(): number;
    trigger(events: string, extra?: unknown[]): this;
    tsc(): {
        components: CollectionReturnValue;
        cut: cytoscape.EdgeCollection;
    };
    tscc(): {
        components: CollectionReturnValue;
        cut: cytoscape.EdgeCollection;
    };
    unbind(events: string, selector?: string, handler?: EventHandler): this;
    ungrabify(): this;
    unlisten(events: string, selector?: string, handler?: EventHandler): this;
    unlock(): this;
    unmerge(eles: string | CollectionArgument): this;
    unselect(): this;
    unselectify(): this;
    visible(): boolean;
    width(): number;
}

Hierarchy (view full)

Properties

Methods

[iterator] $id abscomp absoluteComplement active addClass addListener allAre allAreNeighbors allAreNeighbours ancestors animate animated animation anySame aStar attr bellmanFord betweennessCentrality bfs bind boundingbox boundingBox breadthFirstSearch children classes clearQueue clone closedNeighborhood closenessCentrality closenessCentralityNormalized commonAncestors complement components connectedEdges contains copy createLayout css cy data degree degreeCentrality degreeCentralityNormalized delay delayAnimation depthFirstSearch descendants deselect dfs diff dijkstra each edges edgesTo edgesWith effectiveOpacity emit empty eq every filter first flashClass floydWarshall forEach getElementById grabbable grabbed grabify group has hasClass height hidden hopcroftTarjanBiconnected hopcroftTarjanBiconnectedComponents htb htbc id incomers indegree inside is isChild isChildless isEdge isNode isOrphan isParent json jsons kargerStein kruskal last layout layoutDimensions layoutPositions leaves listen lock locked makeLayout map max maxDegree maxIndegree maxOutdegree merge min minDegree minIndegree minOutdegree modelPosition modelPositions move neighborhood nodes nonempty nonorphans numericStyle numericStyleUnits off on once one openNeighborhood orphans outdegree outerHeight outerWidth outgoers pageRank parent parents point points pon position positions predecessors promiseOn reduce relativePoint relativePosition remove removeAllListeners removeAttr removeClass removed removeData removeListener removeScratch removeStyle renderedBoundingbox renderedBoundingBox renderedCss renderedHeight renderedOuterHeight renderedOuterWidth renderedPoint renderedPosition renderedStyle renderedWidth restore roots same scratch select selectable selected selectify shift siblings size slice some sort stop style successors tarjanStronglyConnected tarjanStronglyConnectedComponents toArray toggleClass totalDegree transparent trigger tsc tscc unbind ungrabify unlisten unlock unmerge unselect unselectify visible width

Properties

Get a new collection, resulting from the collection without some specified elements. http://js.cytoscape.org/#eles.difference

Get the elements in both this collection and another specified collection. http://js.cytoscape.org/#eles.intersection

length: number

Get the number of elements in the collection.

Get the elements that are in the calling collection or the passed collection but not in both. http://js.cytoscape.org/#eles.symmetricDifference

Get a new collection, resulting from adding the collection with another one http://js.cytoscape.org/#eles.union

Methods

  • Get the closed neighbourhood of the elements.

    The neighbourhood returned by this function is a bit different than the traditional definition of a "neighbourhood": This returned neighbourhood includes the edges connecting the collection to the neighbourhood. This gives you more flexibility. A closed neighbourhood is one that does include the original set of elements.

    Parameters

    • Optionalselector: string

      [optional] An optional selector that is used to filter the resultant collection.

    Returns CollectionReturnValue

  • Iterate over the elements in the collection using an implementation like the native array function namesake.

    This function behaves like Array.prototype.forEach() with minor changes for convenience: You can exit the iteration early by returning false in the iterating function. The Array.prototype.forEach() implementation does not support this, but it is included anyway on account of its utility.

    Parameters

    • each: ((ele: NodeSingular, i: number, eles: this) => boolean | void)

      The function executed each iteration. ele - The current element. i - The index of the current element. eles - The collection of elements being iterated.

        • (ele, i, eles): boolean | void
        • Parameters

          Returns boolean | void

    • OptionalthisArg: any

      [optional] The value for this within the iterating function.

    Returns this

  • Determine whether all elements in this collection satisfy the specified test function.

    Parameters

    • test: ((ele: CollectionArgument, i: number, eles: CollectionArgument) => boolean)

      The test function that returns truthy values for elements that satisfy the test and falsey values for elements that do not satisfy the test. ele - The current element. i - The index of the current element. eles - The collection of elements being tested.

    • OptionalthisArg: any

      [optional] The value for this within the test function.

    Returns boolean

  • Perform a in-place merge of the given elements into the calling collection.

    Parameters

    • eles: string | CollectionArgument

      The elements to merge in-place or a selector representing the elements to merge. All elements in the graph matching the selector are used as the passed collection.

      This function modifies the calling collection instead of returning a new one. Use of this function should be considered for performance in some cases, but otherwise should be avoided. Consider using eles.union() instead. Use this function only on new collections that you create yourself, using cy.collection(). This ensures that you do not unintentionally modify another collection.

      Examples With a collection:

    Returns this

    var col = cy.collection(); // new, empty collection
    var j = cy.$('#j');
    var e = cy.$('#e');
    col.merge( j ).merge( e );

    With a selector:
    var col = cy.collection(); // new, empty collection
    col.merge('#j').merge('#e');
  • Get the open neighbourhood of the elements.

    The neighbourhood returned by this function is a bit different than the traditional definition of a "neighbourhood": This returned neighbourhood includes the edges connecting the collection to the neighbourhood. This gives you more flexibility. An open neighbourhood is one that does not include the original set of elements. If unspecified, a neighbourhood is open by default.

    Parameters

    • Optionalselector: string

      [optional] An optional selector that is used to filter the resultant collection.

    Returns CollectionReturnValue

  • Get the open neighbourhood of the elements.

    The neighbourhood returned by this function is a bit different than the traditional definition of a "neighbourhood": This returned neighbourhood includes the edges connecting the collection to the neighbourhood. This gives you more flexibility. An open neighbourhood is one that does not include the original set of elements. If unspecified, a neighbourhood is open by default.

    Parameters

    • Optionalselector: string

      [optional] An optional selector that is used to filter the resultant collection.

    Returns CollectionReturnValue

  • Get a subset of the elements in the collection based on specified indices.

    Parameters

    • Optionalstart: number

      [optional] An integer that specifies where to start the selection. The first element has an index of 0. Use negative numbers to select from the end of an array.

    • Optionalend: number

      [optional] An integer that specifies where to end the selection. If omitted, all elements from the start position and to the end of the array will be selected. Use negative numbers to select from the end of an array.

    Returns this

  • Determine whether any element in this collection satisfies the specified test function.

    Parameters

    • test: ((ele: CollectionArgument, i: number, eles: CollectionArgument) => boolean)

      The test function that returns truthy values for elements that satisfy the test and falsey values for elements that do not satisfy the test. ele - The current element. i - The index of the current element. eles - The collection of elements being tested.

    • OptionalthisArg: any

      [optional] The value for this within the test function.

    Returns boolean

  • Perform an in-place operation on the calling collection to remove the given elements.

    Parameters

    • eles: string | CollectionArgument

      The elements to remove in-place or a selector representing the elements to remove . All elements in the graph matching the selector are used as the passed collection.

      This function modifies the calling collection instead of returning a new one. Use of this function should be considered for performance in some cases, but otherwise should be avoided. Consider using eles.filter() or eles.remove() instead. Use this function only on new collections that you create yourself, using cy.collection(). This ensures that you do not unintentionally modify another collection.

      Examples With a collection:

    Returns this

    var col = cy.collection(); // new, empty collection
    var e = cy.$('#e');
    col.merge( cy.nodes() );
    col.unmerge( e );

    With a selector:
    var col = cy.collection(); // new, empty collection
    col.merge( cy.nodes() );
    col.unmerge('#e');