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
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
Get an element in the collection from its ID in a very performant way.
The ID of the element to get.
Get all elements in the graph that are not in the calling collection. http://js.cytoscape.org/#eles.absoluteComplement
Gets whether the element is active (e.g. on user tap, grab, etc). http://js.cytoscape.org/#ele.active
Add classes to elements. http://js.cytoscape.org/#eles.addClass
A space-separated list of class names to add to the elements.
Determine whether all elements in the specified collection are in the neighbourhood of the calling collection.
The other elements to compare to.
Animate the elements.
An object containing the details of the animation. http://js.cytoscape.org/#eles.animate
Optional
params: ElementAnimateOptionsBaseGet an animation for the element.
An object containing the details of the animation.
Determine whether this collection contains any of the same elements as another collection.
The other elements to compare to.
Perform the A* search algorithm on the elements in the collection. This finds the shortest path from the root node to the goal node. http://js.cytoscape.org/#eles.aStar
Get a particular data field for the element.
Optional
name: stringThe name of the field to get.
Set a particular data field for the element.
The name of the field to set.
The value to set for the field.
Update multiple data fields at once via an object.
The object containing name- value pairs to update data fields.
Perform the Bellman-Ford search algorithm on the elements in the collection. This finds the shortest path from the starting node to all other nodes in the collection. http://js.cytoscape.org/#eles.bellmanFord
Considering only the elements in the calling collection, calculate the betweenness centrality of the nodes. http://js.cytoscape.org/#eles.betweennessCentrality
Optional
options: BoundingBoxOptionsGet the bounding box of the elements in model coordinates.
Optional
options: BoundingBoxOptionsAn object containing options for the function. http://js.cytoscape.org/#eles.boundingBox
Perform a breadth-first search within the elements in the collection.
Replace the current list of classes on the elements with the specified list.
A space-separated list or array of class names that replaces the current class list. http://js.cytoscape.org/#eles.classes Note: can be used to clear all classes (empty string or array).
Remove all queued animations for the elements. http://js.cytoscape.org/#eles.clearQueue
Get a new collection containing clones (i.e. copies) of the elements in the calling collection. http://js.cytoscape.org/#eles.clone
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.
Optional
selector: string[optional] An optional selector that is used to filter the resultant collection.
Considering only the elements in the calling collection, calculate the closeness centrality of the specified root node. http://js.cytoscape.org/#eles.closenessCentrality
Considering only the elements in the calling collection, calculate the closeness centrality of the nodes. http://js.cytoscape.org/#eles.closenessCentralityNormalized
Get edges codirected to those in the collection.
Two edges are said to be codirected if they connect the same two nodes in the same direction: The edges have the same source and target. That is:
Optional
selector: string[optional] An optional selector that is used to filter the resultant collection.
Get the connected components, considering only the elements in the calling collection. An array of collections is returned, with each collection representing a component.
Get the nodes connected to the edges in the collection
Optional
selector: string[optional] An optional selector that is used to filter the resultant collection.
Determine whether this collection contains all of the elements of another collection.
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.
Get a new collection containing clones (i.e. copies) of the elements in the calling collection. http://js.cytoscape.org/#eles.clone
Set a particular style property value.
The name of the visual style property to set.
The value to which the property is set.
Get a particular style property value.
The name of the visual style property to get.
Set several particular style property values.
An object of style property name-value pairs to set.
Get a name-value pair object containing visual style properties and their values for the element.
Get a particular data field for the element.
Optional
name: stringThe name of the field to get.
Set a particular data field for the element.
The name of the field to set.
The value to set for the field.
Update multiple data fields at once via an object.
The object containing name- value pairs to update data fields.
Considering only the elements in the calling collection, calculate the degree centrality of the specified root node. http://js.cytoscape.org/#eles.degreeCentrality
Considering only the elements in the calling collection, calculate the normalised degree centrality of the nodes. http://js.cytoscape.org/#eles.degreeCentralityNormalized
Add a delay between animations for the elements.
How long the delay should be in milliseconds.
Optional
complete: (() => void)A function to call when the delay is complete. http://js.cytoscape.org/#eles.delay
Get a delay animation for the element.
How long the delay should be in milliseconds. http://js.cytoscape.org/#ele.delayAnimation
Perform a depth-first search within the elements in the collection. http://js.cytoscape.org/#eles.depthFirstSearch
Perform a traditional left/right diff on the two collections.
A selector representing the elements on the right side of the diff. All elements in the graph matching the selector are used as the passed collection. The elements on the right side of the diff.
This function returns a plain object of the form { left, right, both } where left - is the set of elements only in the calling (i.e. left) collection, right - is the set of elements only in the passed (i.e. right) collection, and both - is the set of elements in both collections. http://js.cytoscape.org/#eles.diff
Perform Dijkstra's algorithm on the elements in the collection. This finds the shortest paths to all other nodes in the collection from the root node. http://js.cytoscape.org/#eles.dijkstra
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.
The function executed each iteration. ele - The current element. i - The index of the current element. eles - The collection of elements being iterated.
Optional
thisArg: any[optional] The value for this within the iterating function.
Get the edges that match the specified selector.
Optional
selector: stringThe selector to match against. http://js.cytoscape.org/#eles.filter
Get the effective opacity of the element (i.e. on-screen opacity), which takes into consideration parent node opacity. http://js.cytoscape.org/#ele.effectiveOpacity
Get an element at a particular index in the collection.
You may use eles[i] in place of eles.eq(i) as a more performant alternative.
The index of the element to get.
Determine whether all elements in this collection satisfy the specified test function.
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.
Optional
thisArg: any[optional] The value for this within the test function.
Get a new collection containing elements that are accepted by the specified filter.
The selector to match against.
Get the first element in the collection.
Add classes to the elements, and then remove the classes after a specified duration.
A space-separated list of class names to flash on the elements.
Optional
duration: number[optional] The duration in milliseconds that the classes should be added on the elements. After the duration, the classes are removed. http://js.cytoscape.org/#eles.flashClass
Perform the Floyd Warshall search algorithm on the elements in the collection. This finds the shortest path between all pairs of nodes. http://js.cytoscape.org/#eles.floydWarshall
Optional
thisArg: anyGet an element in the collection from its ID in a very performant way.
The ID of the element to get.
Get the group string that defines the type of the element.
The group strings are 'nodes' for nodes and 'edges' for edges. In general, you should be using ele.isEdge() and ele.isNode() instead of ele.group(). http://js.cytoscape.org/#ele.group
Get whether an element has a particular class.
The name of the class to test for. http://js.cytoscape.org/#ele.hasClass
Get whether the element is hidden. http://js.cytoscape.org/#ele.visible
finds the biconnected components in an undirected graph, as well as their respective cut vertices, using an algorithm due to Hopcroft and Tarjan. http://js.cytoscape.org/#eles.hopcroftTarjanBiconnected
Finds the biconnected components in an undirected graph, as well as their respective cut vertices, using an algorithm due to Hopcroft and Tarjan. http://js.cytoscape.org/#eles.hopcroftTarjanBiconnected
Finds the biconnected components in an undirected graph, as well as their respective cut vertices, using an algorithm due to Hopcroft and Tarjan. http://js.cytoscape.org/#eles.hopcroftTarjanBiconnected
Finds the biconnected components in an undirected graph, as well as their respective cut vertices, using an algorithm due to Hopcroft and Tarjan. http://js.cytoscape.org/#eles.hopcroftTarjanBiconnected
A shortcut to get the ID of an element. http://js.cytoscape.org/#ele.id
Get whether the element is inside the graph (i.e. not removed). http://js.cytoscape.org/#ele.inside
Get whether the element is an edge. http://js.cytoscape.org/#ele.isEdge
Get whether the edge is a loop (i.e. source same as target). http://js.cytoscape.org/#edge.isLoop
Get whether the element is a node. http://js.cytoscape.org/#ele.isNode
Get whether the edge is simple (i.e. source different than target). http://js.cytoscape.org/#edge.isSimple
Get the element's plain JavaScript object representation. http://js.cytoscape.org/#ele.json
Finds the minimum cut in a graph using the Karger-Stein algorithm. The optimal result is found with a high probability, but without guarantee. http://js.cytoscape.org/#eles.kargerStein
Perform Kruskal's algorithm on the elements in the collection, returning the minimum spanning tree, assuming undirected edges. http://js.cytoscape.org/#eles.kruskal
Get the last element in the collection.
Get a new layout, which can be used to algorithmically position the nodes in the collection. This function is useful for running a layout on a subset of the elements in the graph, perhaps in parallel to other layouts.
You must specify options.name with the name of the layout you wish to use.
Note: that you must call layout.run() in order for it to affect the graph.
The layout options.
Get an array containing values mapped from the collection.
The function that returns the mapped value for each element. ele - The current element. i - The index of the current element. eles - The collection of elements being mapped.
Optional
thisArg: any[optional] The value for this within the iterating function.
Find a maximum value and the corresponding element.
The function that returns the value to compare for each element. ele - The current element. i - The index of the current element. eles - The collection of elements being mapped.
Optional
thisArg: any[optional] The value for this within the iterating function.
The element that corresponds to the minimum value.
The minimum value found.
Perform a in-place merge of the given elements into the calling collection.
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:
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).
Find a minimum value in a collection.
The function that returns the value to compare for each element. ele - The current element. i - The index of the current element. eles - The collection of elements being mapped.
Optional
thisArg: any[optional] The value for this within the iterating function.
The element that corresponds to the minimum value.
The minimum value found.
Effectively move edges to different nodes. The modified (actually new) elements are returned. http://js.cytoscape.org/#eles.move
Optional
source?: stringOptional
target?: stringEffectively move nodes to different parent node. The modified (actually new) elements are returned. http://js.cytoscape.org/#eles.move
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.
Optional
selector: string[optional] An optional selector that is used to filter the resultant collection.
Get the nodes that match the specified selector.
Optional
selector: stringThe selector to match against. http://js.cytoscape.org/#eles.filter
Get the numeric value of a style property in preferred units that can be used for calculations.
The name of the style property to get. http://js.cytoscape.org/#ele.numericStyle
Get the units that ele.numericStyle() is expressed in, for a particular property.
The name of the style property to get. http://js.cytoscape.org/#ele.numericStyleUnits
Optional
selector: stringOptional
handler: EventHandlerA space separated list of event names.
[optional] A delegate selector to specify child elements for which the handler runs.
The handler function called when one of the specified events occurs. Takes the event object as a parameter.
A space separated list of event names.
[optional] A delegate selector to specify child elements for which the handler is triggered.
[optional] A plain object which is passed to the handler in the event object argument.
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.
Optional
selector: string[optional] An optional selector that is used to filter the resultant collection.
Rank the nodes in the collection using the Page Rank algorithm. http://js.cytoscape.org/#eles.pageRank
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:
Optional
selector: string[optional] An optional selector that is used to filter the resultant collection.
Optional
selector: stringOptional
selector: stringReduce a single value by applying a function against an accumulator and each value of the collection.
The function that returns the accumulated value given the previous value and the current element. prevVal The value accumulated from previous elements. ele The current element. i The index of the current element. eles The collection of elements being reduced.
The initial value for reducing It is used also for type inference of output, but the type can be also stated explicitly as generic http://js.cytoscape.org/#eles.reduce
Remove the elements from the graph. http://js.cytoscape.org/#eles.remove
Optional
names: stringRemove classes from elements.
A space-separated list of class names to remove from the elements. http://js.cytoscape.org/#eles.removeClass
Get whether the element has been removed from the graph. http://js.cytoscape.org/#ele.removed
Remove developer-defined data associated with the elements. http://js.cytoscape.org/#eles.removeData
Optional
names: stringA space-separated list of fields to delete.
Optional
selector: stringOptional
handler: EventHandlerRemove scratchpad data. You should remove scratchpad data only at your own namespaces. http://js.cytoscape.org/#ele.removeScratch
A namespace string.
Optional
options: BoundingBoxOptionsGet the bounding box of the elements in rendered coordinates.
Optional
options: BoundingBoxOptionsAn object containing options for the function.
Put removed elements back into the graph. http://js.cytoscape.org/#eles.restore
Determine whether this collection contains exactly the same elements as another collection.
The other elements to compare to.
Get or set the scratchpad at a particular namespace, where temporary or non-JSON data can be stored. Get scratchpad if one or no parameter provided. App-level scratchpad data should use namespaces prefixed with underscore, like '_foo'. http://js.cytoscape.org/#ele.scratch
Optional
namespace: stringA namespace string.
Get an array of segment point model positions (i.e. bend points) for a {@code curve-style: segments} edge.
While the segment points may be specified relatively in the stylesheet, this function returns the absolute model positions of the segment points. The points are specified in the order of source-to-target direction.
Make the elements selected (NB other elements outside the collection are not affected). http://js.cytoscape.org/#eles.select
Get whether the element's selection state is mutable. http://js.cytoscape.org/#ele.selectable
Get whether the element is selected. http://js.cytoscape.org/#ele.selected
Make the selection states of the elements mutable. http://js.cytoscape.org/#eles.selectify
Get a subset of the elements in the collection based on specified indices.
Optional
start: 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.
Optional
end: 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.
Determine whether any element in this collection satisfies the specified test function.
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.
Optional
thisArg: any[optional] The value for this within the test function.
Get a new collection containing the elements sorted by the specified comparison function.
The sorting comparison function that returns a negative number for ele1 before ele2, 0 for ele1 same as ele2, or a positive number for ele1 after ele2.
Get source node of this edge.
Optional
selector: stringAn optional selector that is used to filter the resultant collection. http://js.cytoscape.org/#edge.source
Get source nodes connected to the edges in the collection.
Optional
selector: string[optional] An optional selector that is used to filter the resultant collection.
Stop all animations that are currently running.
Optional
clearQueue: booleanA boolean, indicating whether the queue of animations should be emptied.
Optional
jumpToEnd: booleanA boolean, indicating whether the currently-running animations should jump to their ends rather than just stopping midway. http://js.cytoscape.org/#eles.stop
Set a particular style property value.
The name of the visual style property to set.
The value to which the property is set.
Get a particular style property value.
The name of the visual style property to get.
Set several particular style property values.
An object of style property name-value pairs to set.
Get a name-value pair object containing visual style properties and their values for the element.
Get target node of this edge.
Optional
selector: stringAn optional selector that is used to filter the resultant collection. http://js.cytoscape.org/#edge.target
Get target nodes connected to the edges in the collection.
Optional
selector: string[optional] An optional selector that is used to filter the resultant collection.
Finds the strongly connected components of a directed graph using Tarjan's algorithm. http://js.cytoscape.org/#eles.tarjanStronglyConnected
Finds the strongly connected components of a directed graph using Tarjan's algorithm. http://js.cytoscape.org/#eles.tarjanStronglyConnected
Get the collection as an array, maintaining the order of the elements.
Toggle whether the elements have the specified classes.
A space-separated list of class names to toggle on the elements.
Optional
toggle: boolean[optional] Instead of automatically toggling, adds the classes on truthy values or removes them on falsey values. http://js.cytoscape.org/#eles.toggleClass
Get whether the element's effective opacity is completely transparent, which takes into consideration parent node opacity. http://js.cytoscape.org/#ele.transparent
Finds the strongly connected components of a directed graph using Tarjan's algorithm. http://js.cytoscape.org/#eles.tarjanStronglyConnected
Finds the strongly connected components of a directed graph using Tarjan's algorithm. http://js.cytoscape.org/#eles.tarjanStronglyConnected
Optional
selector: stringOptional
handler: EventHandlerOptional
selector: stringOptional
handler: EventHandlerPerform an in-place operation on the calling collection to remove the given elements.
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:
Make the elements not selected (NB other elements outside the collection are not affected). http://js.cytoscape.org/#eles.unselect
Make the selection states of the elements immutable. http://js.cytoscape.org/#eles.unselectify
Get whether the element is visible. http://js.cytoscape.org/#ele.visible
edge --> Cy.EdgeSingular a collection of a single edge