I'm a new in Gojs, and this question is about the node expandind control in tree model.
I just wonder can I control the root node in different way to the other node in tree model.
Take the Gojs official code for example:
$(go.Node, "Horizontal",
$(go.Panel, "Auto",
$(go.Shape, "Ellipse", { fill: null }),
$(go.TextBlock,
new go.Binding("text", "key"))
),
$("TreeExpanderButton")
);
diagram.layout = $(go.TreeLayout);
var nodeDataArray = [
{ key: "Alpha" }, { key: "Beta" }, { key: "Gamma" }, { key: "Delta" },
{ key: "Epsilon" }, { key: "Zeta" }, { key: "Eta" }, { key: "Theta" }
];
var linkDataArray = [
{ from: "Alpha", to: "Beta" },
{ from: "Beta", to: "Gamma" },
{ from: "Beta", to: "Delta" },
{ from: "Alpha", to: "Epsilon" },
{ from: "Epsilon", to: "Zeta" },
{ from: "Epsilon", to: "Eta" },
{ from: "Epsilon", to: "Theta" }
];
diagram.model = new go.GraphLinksModel(nodeDataArray, linkDataArray);
and we will get the tree like1
How can I remove the treeExpanderButton on the root node only, and keep the root node be expanded ?