<div id="myDiagramDiv" style="border: solid 1px black; width:600px; height:700px"></div>
  The &quot;TreeExpanderButton&quot;, which changes the <a>Node.isTreeExpanded</a> property, really only works with tree structures.
  When you want to hide/show the &quot;downstream&quot; nodes from a given node, using the &quot;TreeExpanderButton&quot; might not do what you like,
  especially when there are cycles in the graph structure.
  Instead, this sample implements a &quot;Button&quot; with custom behavior to modify the visibility of each Node.
  If this behavior is still not quite right for your app, you can adapt the behavior implemented in the
  </p><pre>collapseFrom</pre> and <pre>expandFrom</pre> functions to use different criteria for when to stop recursion.
加入 GoJS 交流群
GoJS 交流群 (769862113)