How can I change expand/collapse with Double tree?

Hello, I have a question.
How can I change expand/collapse with Double tree?

I would like expand / collapse to work when the ‘A’ or ‘B’ button is pressed.
In the example below, only the icon is changed.

$("Button",
    $(go.Shape,
      {
        name: "ButtonIcon",
        figure: "MinusLine",
        desiredSize: new go.Size(6, 6)
      },
      new go.Binding("figure", "isCollapsedRight",  // data.isCollapsedRight remembers whether "collapsed"
                     function(collapsed) { return collapsed ? "PlusLine" : "MinusLine"; })),
    {
      click: function(e, obj) {
        e.diagram.startTransaction();
        var node = obj.part;
        var collapsed = !node.data.isCollapsedRight;  // toggle collapse state
        // remember collapse state on root data, with support for bindings and undo
        e.diagram.model.setDataProperty(node.data, "isCollapsedRight", collapsed);
        // collapse/expand immediate children and toggle their visibility
        node.findLinksOutOf().each(function(n) {
            if (n.data.dir === "right") {  // just nodes on the right side of tree
                n.visible = !collapsed;
                n.isTreeExpanded = !collapsed;
            }
        });
        e.diagram.commitTransaction("toggled visibility of consequences");
      }
    })

How can I change expand/collapse with Double tree?

The direction of the arrows of the links indicates that your graph is not tree-structured. Note how the middle node appears to have two parents on its left side. In a tree, no node will have more than one parent.

The Double Tree sample is a simple tree that is split so that growth happens in two different directions.

So you need to reverse the direction of the links on the left side of your graph.