edge --> Cy.EdgeSingular a collection of a single edge

interface EdgeSingular {
    -: 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<EdgeSingular, any, any>;
    $id(id: string): EdgeSingular;
    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;
    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;
    classes(classes: ClassNames): this;
    classes(classes: undefined | ClassNames): string[] | EdgeSingular;
    classes(): string[];
    clearQueue(): this;
    clone(): CollectionReturnValue;
    closedNeighborhood(selector?: string): CollectionReturnValue;
    closenessCentrality(options: SearchClosenessCentralityOptions): number;
    closenessCentralityNormalized(options: SearchClosenessCentralityNormalizedOptions): SearchDegreeCentralityNormalizedResultUndirected | SearchDegreeCentralityNormalizedResultDirected;
    codirectedEdges(selector?: string): cytoscape.EdgeCollection;
    complement(): CollectionReturnValue;
    components(): CollectionReturnValue[];
    connectedNodes(selector?: string): cytoscape.NodeCollection;
    contains(eles: CollectionArgument): boolean;
    controlPoints(): Position[];
    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;
    degreeCentrality(options: SearchDegreeCentralityOptions): SearchDegreeCentralityResultUndirected | SearchDegreeCentralityResultDirected;
    degreeCentralityNormalized(options: SearchDegreeCentralityNormalizedOptions): SearchDegreeCentralityNormalizedResultUndirected | SearchDegreeCentralityNormalizedResultDirected;
    delay(duration: number, complete?: (() => void)): this;
    delayAnimation(duration: number): AnimationManipulation;
    depthFirstSearch(options: SearchFirstOptions): SearchFirstResult;
    deselect(): this;
    dfs(options: SearchFirstOptions): SearchFirstResult;
    diff(selector: string | CollectionArgument): {
        both: CollectionReturnValue;
        left: CollectionReturnValue;
        right: CollectionReturnValue;
    };
    dijkstra(options: SearchDijkstraOptions): SearchDijkstraResult;
    each(each: ((ele: EdgeSingular, i: number, eles: this) => boolean | void), thisArg?: any): this;
    edges(selector?: string): cytoscape.EdgeCollection;
    effectiveOpacity(): number;
    emit(events: string, extra?: unknown[]): this;
    empty(): boolean;
    eq(index: number): EdgeSingular;
    every(test: ((ele: CollectionArgument, i: number, eles: CollectionArgument) => boolean), thisArg?: any): boolean;
    filter(selector: string | ((ele: EdgeSingular, i: number, eles: CollectionArgument) => boolean)): CollectionReturnValue;
    first(): EdgeSingular;
    flashClass(classes: ClassNames, duration?: number): this;
    floydWarshall(options: SearchFloydWarshallOptions): SearchFloydWarshallResult;
    forEach(each: ((ele: EdgeSingular, i: number, eles: this) => boolean | void), thisArg?: any): this;
    getElementById(id: string): EdgeSingular;
    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;
    inside(): boolean;
    is(selector: string): boolean;
    isEdge(): this is EdgeSingular;
    isLoop(): boolean;
    isNode(): this is NodeSingular;
    isSimple(): 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(): EdgeSingular;
    layout(options: LayoutOptions): Layouts;
    listen(events: string, selector: string, handler: EventHandler): this;
    listen(events: string, handler: EventHandler): this;
    makeLayout(options: LayoutOptions): Layouts;
    map<T>(fn: ((ele: EdgeSingular, i: number, eles: CollectionArgument) => T), thisArg?: any): T[];
    max<T>(fn: ((ele: EdgeSingular, i: number, eles: CollectionArgument) => T), thisArg?: any): {
        ele: SingularElementReturnValue;
        value: T;
    };
    merge(eles: string | CollectionArgument): this;
    midpoint(): Position;
    min<T>(fn: ((ele: EdgeSingular, i: number, eles: CollectionArgument) => T), thisArg?: any): {
        ele: SingularElementReturnValue;
        value: T;
    };
    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;
    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;
    outerHeight(): number;
    outerWidth(): number;
    pageRank(options: SearchPageRankOptions): SearchPageRankResult;
    parallelEdges(selector?: string): cytoscape.EdgeCollection;
    pon(events: string, selector?: string): Promise<EventHandler>;
    promiseOn(events: string, selector?: string): Promise<EventHandler>;
    reduce<T>(fn: ((prevVal: T, ele: EdgeSingular, i: number, eles: CollectionArgument) => T), initialValue: T): T;
    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;
    renderedStyle(): {
        [name: string]: any;
    };
    renderedStyle(name: string): any;
    renderedWidth(): number;
    restore(): CollectionReturnValue;
    same(eles: CollectionArgument): boolean;
    scratch(namespace?: string): any;
    scratch(namespace: string, value: any): this;
    segmentPoints(): Position[];
    select(): this;
    selectable(): boolean;
    selected(): boolean;
    selectify(): this;
    size(): number;
    slice(start?: number, end?: number): this;
    some(test: ((ele: CollectionArgument, i: number, eles: CollectionArgument) => boolean), thisArg?: any): boolean;
    sort(sort: ((ele1: EdgeSingular, ele2: EdgeSingular) => number)): CollectionReturnValue;
    source(selector?: string): NodeSingular;
    sourceEndpoint(): Position;
    sources(selector?: string): cytoscape.NodeCollection;
    stop(clearQueue?: boolean, jumpToEnd?: boolean): this;
    style(name: string, value: any): this;
    style(name: string): any;
    style(obj: object): this;
    style(): {
        [index: string]: any;
    };
    target(selector?: string): NodeSingular;
    targetEndpoint(): Position;
    targets(selector?: string): cytoscape.NodeCollection;
    tarjanStronglyConnected(): {
        components: CollectionReturnValue;
        cut: cytoscape.EdgeCollection;
    };
    tarjanStronglyConnectedComponents(): {
        components: CollectionReturnValue;
        cut: cytoscape.EdgeCollection;
    };
    toArray(): EdgeSingular[];
    toggleClass(classes: ClassNames, toggle?: boolean): this;
    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;
    unlisten(events: string, selector?: string, handler?: EventHandler): 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 animate animated animation anySame aStar attr bellmanFord betweennessCentrality bfs bind boundingbox boundingBox breadthFirstSearch classes clearQueue clone closedNeighborhood closenessCentrality closenessCentralityNormalized codirectedEdges complement components connectedNodes contains controlPoints copy createLayout css cy data degreeCentrality degreeCentralityNormalized delay delayAnimation depthFirstSearch deselect dfs diff dijkstra each edges effectiveOpacity emit empty eq every filter first flashClass floydWarshall forEach getElementById group has hasClass height hidden hopcroftTarjanBiconnected hopcroftTarjanBiconnectedComponents htb htbc id inside is isEdge isLoop isNode isSimple json jsons kargerStein kruskal last layout listen makeLayout map max merge midpoint min move neighborhood nodes nonempty numericStyle numericStyleUnits off on once one openNeighborhood outerHeight outerWidth pageRank parallelEdges pon promiseOn reduce remove removeAllListeners removeAttr removeClass removed removeData removeListener removeScratch removeStyle renderedBoundingbox renderedBoundingBox renderedCss renderedHeight renderedOuterHeight renderedOuterWidth renderedStyle renderedWidth restore same scratch segmentPoints select selectable selected selectify size slice some sort source sourceEndpoint sources stop style target targetEndpoint targets tarjanStronglyConnected tarjanStronglyConnectedComponents toArray toggleClass transparent trigger tsc tscc unbind unlisten 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

  • Get an array of control point model positions for a {@code curve-style: bezier) or {@code curve-style: unbundled-bezier} edge.

    While the control points may be specified relatively in the CSS, this function returns the absolute model positions of the control points. The points are specified in the order of source-to-target direction. This function works for bundled beziers, but it is not applicable to the middle, straight-line edge in the bundle.

    Returns Position[]

  • 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: EdgeSingular, 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 model position of the midpoint of the edge.

    The midpoint is, by default, where the edge’s label is centred. It is also the position towards which mid arrows point. For curve-style: unbundled-bezier edges, the midpoint is the middle extremum if the number of control points is odd. For an even number of control points, the midpoint is where the two middle-most control points meet. This is the middle inflection point for bilaterally symmetric or skew symmetric edges, for example. For curve-style: segments edges, the midpoint is the middle segment point if the number of segment points is odd. For an even number of segment points, the overall midpoint is the midpoint of the middle-most line segment (i.e. the mean of the middle two segment points).

    Returns Position

  • 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 edges parallel to those in the collection.

    Two edges are said to be parallel if they connect the same two nodes. Any two parallel edges may connect nodes in the same direction, in which case the edges share the same source and target. They may alternatively connect nodes in the opposite direction, in which case the source and target are reversed in the second edge. That is:

    • edge1.source().id() === edge2.source().id() && edge1.target().id() === edge2.target().id() OR
    • edge1.source().id() === edge2.target().id() && edge1.target().id() === edge2.source().id()

    Parameters

    • Optionalselector: string

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

    Returns cytoscape.EdgeCollection

  • 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');