Reputation: 167
I want to select nodes in cytoscape using operators "and" and "or".
Based on the [cytoscape.js][1] document
[1]: https://js.cytoscape.org/#selectors, the users can use the below syntax for "and" operator, but i couldn't find any syntax for "or" operator.
// get all nodes with weight more than 50 and height strictly less than 180
cy.elements("node[weight >= 50][height < 180]");
How to filter nodes with "or" operator?
Upvotes: 0
Views: 506
Reputation: 3856
Below should work. Give attention to the COMMA. Comma is used for logical OR
cy.nodes("[weight >= 50],[height < 180]");
Upvotes: 3