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.

        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) {
        var node = obj.part;
        var collapsed = !;  // toggle collapse state
        // remember collapse state on root data, with support for bindings and undo
        e.diagram.model.setDataProperty(, "isCollapsedRight", collapsed);
        // collapse/expand immediate children and toggle their visibility
        node.findLinksOutOf().each(function(n) {
            if ( === "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.