搜索特定节点并定位到此节点位置

怎么实现这个功能

If you want to do this when initializing the Diagram, you’ll need to do it in an “InitialLayoutCompleted” DiagramEvent listener, because until the nodes and links all exist and they have been laid out, it doesn’t make sense to scroll yet.

我的意思是搜索框搜索标题,可以定位到该标题的位置

  1. Loop your diagram.model.nodeDataArray, look for nodeData with your conditions.
  2. When you find it, use diagram.findNodeForData to get the Node it belongs to.
  3. Center the Node by diagram.commandHandler.scrollToPart.