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.
Get all compound ancestor nodes (i.e. parents, parents' parents, etc.) of each node in the collection.
Optional
selector: stringA selector used to filter the resultant collection. http://js.cytoscape.org/#nodes.ancestors
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.
Get all compound child (i.e. direct descendant) nodes of each node in the collection.
Optional
selector: stringA selector used to filter the resultant collection. http://js.cytoscape.org/#nodes.children
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 all compound ancestors common to all the nodes in the collection, starting with the closest and getting progressively farther.
Optional
selector: stringA selector used to filter the resultant collection. http://js.cytoscape.org/#nodes.commonAncestors
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 edges connected to the nodes 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 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
Get all compound descendant (i.e. children, children's children, etc.) nodes of each node in the collection.
Optional
selector: stringA selector used to filter the resultant collection. http://js.cytoscape.org/#nodes.descendants
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 edges coming from the collection (i.e. the source) going to another collection (i.e. the target).
The other collection.
Get the edges connecting the collection to another collection. Direction of the edges does not matter.
The other collection.
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 whether the user can grab a node. http://js.cytoscape.org/#node.grabbable
Get whether a node is currently grabbed, meaning the user has hold of the node. http://js.cytoscape.org/#node.grabbed
Allow the user to grab the nodes. http://js.cytoscape.org/#nodes.grabify
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 edges (and their sources) coming into the nodes in the collection.
Optional
selector: string[optional] An optional selector that is used to filter the resultant collection.
Get whether the element is inside the graph (i.e. not removed). http://js.cytoscape.org/#ele.inside
Get whether the node is a compound child (i.e. contained within a node) http://js.cytoscape.org/#node.isChild
Get whether the node is childless (i.e. a node with no child nodes) http://js.cytoscape.org/#node.isChildless
Get whether the element is an edge. http://js.cytoscape.org/#ele.isEdge
Get whether the element is a node. http://js.cytoscape.org/#ele.isNode
Get whether the node is an orphan (i.e. a node with no parent) http://js.cytoscape.org/#node.isOrphan
Get whether the node is a compound parent (i.e. a node containing one or more child nodes) http://js.cytoscape.org/#node.isParent
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.
Returns the node width and height. Meant for use in layout positioning to do overlap detection.
The layout options object.
Position the nodes for a discrete/synchronous layout. http://js.cytoscape.org/#nodes.layoutPositions
The layout.
The layout options object.
From the set of calling nodes, get the nodes which are leaves (i.e. no outgoing edges, as in a directed acyclic graph).
Optional
selector: string[optional] An optional selector that is used to filter the resultant collection.
Lock the nodes such that their positions can not be changed. http://js.cytoscape.org/#nodes.lock
Get whether a node is locked, meaning that its position can not be changed. http://js.cytoscape.org/#node.locked
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:
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.
Get the (model) position of a node.
Get the value of a specified position dimension.
The position dimension to set.
Set the value of a specified position dimension.
The position dimension to set.
The value to set to the dimension.
Set the position using name-value pairs in the specified object.
An object specifying name-value pairs representing dimensions to set.
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 all nonorphan (i.e. has a compound parent) nodes in the calling collection.
Optional
selector: stringA selector used to filter the resultant collection. http://js.cytoscape.org/#nodes.nonorphans
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.
Get all orphan (i.e. has no compound parent) nodes in the calling collection.
Optional
selector: stringA selector used to filter the resultant collection. http://js.cytoscape.org/#nodes.orphans
Get edges (and their targets) coming out of the nodes in the collection.
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 the compound parent node of each node in the collection.
Optional
selector: stringA selector used to filter the resultant collection. http://js.cytoscape.org/#nodes.parent
Optional
selector: stringGet the (model) position of a node.
Get the value of a specified position dimension.
The position dimension to set.
Set the value of a specified position dimension.
The position dimension to set.
The value to set to the dimension.
Set the position using name-value pairs in the specified object.
An object specifying name-value pairs representing dimensions to set.
Optional
selector: stringGet the (model) position of a node.
Get the value of a specified position dimension.
The position dimension to set.
Set the value of a specified position dimension.
The position dimension to set.
The value to set to the dimension.
Set the position using name-value pairs in the specified object.
An object specifying name-value pairs representing dimensions to set.
Set the positions via a function.
A callback function that returns the position to set for each element.
Recursively get edges (and their sources) coming into the nodes in the collection (i.e. the incomers, the incomers' incomers, ...).
Optional
selector: string[optional] An optional selector that is used to filter the resultant collection.
Optional
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
Get the value of a specified relative position dimension.
Optional
dimension: PositionDimensionThe position dimension to get.
Get the value of a specified relative position dimension.
Optional
dimension: PositionDimensionThe position dimension to get.
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.
Set the value of a specified rendered position dimension.
Optional
dimension: PositionDimensionThe position dimension to set.
Get the value of a specified rendered position dimension.
Optional
dimension: PositionDimensionThe position dimension to get.
Put removed elements back into the graph. http://js.cytoscape.org/#eles.restore
From the set of calling nodes, get the nodes which are roots (i.e. no incoming edges, as in a directed acyclic graph).
Optional
selector: string[optional] An optional selector that is used to filter the resultant collection.
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.
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
Shift the positions of the nodes by a given model position vector.
The position dimension to shift.
Optional
value: numberThe value to shift the dimension.
Shift the positions of the nodes by a given model position vector.
An object specifying name-value pairs representing dimensions to shift.
Get all sibling (i.e. same compound parent) nodes of each node in the collection.
Optional
selector: stringA selector used to filter the resultant collection. http://js.cytoscape.org/#nodes.siblings
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.
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.
Recursively get edges (and their targets) coming out of the nodes in the collection (i.e. the outgoers, the outgoers' outgoers, ...).
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: EventHandlerDisallow the user to grab the nodes. http://js.cytoscape.org/#nodes.ungrabify
Optional
selector: stringOptional
handler: EventHandlerUnlock the nodes such that their positions can be changed. http://js.cytoscape.org/#nodes.unlock
Perform 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
node --> Cy.NodeSingular a collection of a single node