gpt4 book ai didi

gojs - 如何在 UI 中过滤 gojs 中的节点?

转载 作者:行者123 更新时间:2023-12-05 01:02:30 31 4
gpt4 key购买 nike

我正在使用 go.js 制作组织结构图。

我无法弄清楚的一件事是,如何过滤特定节点?是否可以在 go.js 中有一个用于搜索节点的 UI?

最佳答案

org chart static sample 中有一个搜索框这给出了过滤节点的示例。

// 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 的文档获取更多信息。

关于gojs - 如何在 UI 中过滤 gojs 中的节点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31771232/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com