bibiji
bibiji

Reputation: 167

Select elements in cytoscape.js using "or" operator

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

Answers (1)

canbax
canbax

Reputation: 3856

Below should work. Give attention to the COMMA. Comma is used for logical OR

cy.nodes("[weight >= 50],[height < 180]");

Upvotes: 3

Related Questions