You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
eles.components() gives all components of the elements in the calling collection. It would be nice to have ele.component() that gives the component of a node or an edge.
ele.component() would have to take into account all the elements in the graph --- i.e. you can't specify a subset of elements to consider. For those cases, it's better to use eles.components().
The text was updated successfully, but these errors were encountered:
More or less. You'd use a new cy.collection() and merge() for internal functions for performance. It's basically the existing ele.components() function implementation but only using one node as input rather than all nodes.
- Repurpose `eles.components()` to be more general by allowing setting of the `root` collection -- components that `root` nodes belong to will be returned. The signature is now `eles.components(root)`, where `root` is `eles.nodes()` by default.
- The repurposing of `eles.components()` makes it so `ele.component()` is basically a one-liner.
- Improve performance a bit by avoiding intermediary collections.
- Add `eles.componentsOf()` alias.
Ref #1878
eles.components()
gives all components of the elements in the calling collection. It would be nice to haveele.component()
that gives the component of a node or an edge.ele.component()
would have to take into account all the elements in the graph --- i.e. you can't specify a subset of elements to consider. For those cases, it's better to useeles.components()
.The text was updated successfully, but these errors were encountered: