Selecting children/siblings/ancestors/descendants of a specific node #3080
rob-gordon
started this conversation in
General
Replies: 1 comment 1 reply
-
Topology is too expensive to be pragmatic for selectors. Cytoscape has a number of functions related to traversal that you can use: https://js.cytoscape.org/#collection/traversing |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Does anyone know if it is possible to use cytoscape selectors to select nodes which are children, siblings, ancestors, or descendants of a particular node?
Example 1
A selector which selects all nodes which are one edge away from a given node
![Screen Shot 2022-11-28 at 9 24 14 AM](https://user-images.githubusercontent.com/159949/204301649-098dd64e-0ebc-48f6-bea6-20d169561693.png)
An example selector,
![Screen Shot 2022-11-28 at 9 24 22 AM](https://user-images.githubusercontent.com/159949/204301696-bf6626b9-aaa9-41cb-b266-d3268f32900a.png)
#a:sibling { background-color: yellow; }
Example 2
A selector which selects all the descendants of a node in a directed acyclic graph
![Screen Shot 2022-11-28 at 9 21 34 AM](https://user-images.githubusercontent.com/159949/204301075-2d02b082-ec56-4134-83f0-e07429b85220.png)
An example selector,
![Screen Shot 2022-11-28 at 9 21 41 AM](https://user-images.githubusercontent.com/159949/204301098-2f44b6ef-e182-4dbb-b809-336b5874043c.png)
#d:descendants { background-color: yellow; }
I realize these could be expensive to compute and probably ambiguous in some contexts (I'm not a graph theory expert), but does anyone know if there has been an attempt to support selectors like these that I could try it out? Alternatively, is this functionality that could be added via a plugin?
Thanks for any advice or thoughts.
Beta Was this translation helpful? Give feedback.
All reactions