我正在使用 go.js 制作组织结构图。
我无法弄清楚的一件事是,如何过滤特定节点?是否有可能在 go.js 中有一个用于搜索节点的 UI?
组织结构图静态示例中有一个搜索框,其中提供了过滤节点的示例。
// 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的文档。