我想使用 jquery 根据某些条件突出显示 GOJS 图表节点。假设有一个变量状态,其值为B
、d
或p
。因为B
它应该是红色的,因为d
它应该是绿色的。因为p
它应该是黄色的。我该如何做到这一点?
1469 次
1 回答
0
突出显示节点很容易,这里有几个例子。
否则这只是过滤节点的问题。您很可能希望使用Diagram.findNodesByExample来查询节点。
组织结构图静态示例中有一个搜索框,它提供了使用以下过滤节点的示例findNodesByExample
:
// create a case insensitive RegExp from what the user typed
var regex = new RegExp(input.value, "i");
...
// search four different data properties for the string, any of which may match for success
var results = myDiagram.findNodesByExample({ name: regex },
{ nation: regex },
{ title: regex },
{ headOf: regex });
有关更多信息,请参阅findNodesByExample的文档。
于 2015-08-07T13:59:04.480 回答