使用 "or" 运算符 cytoscape.js 中的 Select 个元素
Select elements in cytoscape.js using "or" operator
我想 select cytoscape 中的节点使用运算符“and”和“or”。
基于 [cytoscape.js][1] 文档
[1]: https://js.cytoscape.org/#selectors, 用户可以使用下面的“and”运算符语法,但我找不到任何“or”运算符的语法。
// get all nodes with weight more than 50 and height strictly less than 180
cy.elements("node[weight >= 50][height < 180]");
如何使用“或”运算符过滤节点?
下面应该可以。注意逗号。逗号用于逻辑或
cy.nodes("[weight >= 50],[height < 180]");
我想 select cytoscape 中的节点使用运算符“and”和“or”。
基于 [cytoscape.js][1] 文档
[1]: https://js.cytoscape.org/#selectors, 用户可以使用下面的“and”运算符语法,但我找不到任何“or”运算符的语法。
// get all nodes with weight more than 50 and height strictly less than 180
cy.elements("node[weight >= 50][height < 180]");
如何使用“或”运算符过滤节点?
下面应该可以。注意逗号。逗号用于逻辑或
cy.nodes("[weight >= 50],[height < 180]");