Looking at this further…
The “Horizontal” part in my simple codepen does not seem to allow for as many features as the more complex structure you use in your example, so the structure you are using is what I’m looking for.
The next question becomes: what is the best way of clicking on the “parent” and accessing all the properties of the “children”?
==============================
Completely changing the topic…
I wonder if part of the reasons grokking GoJS is challenging for me is due to the combination of all the “go” functions with object properties wrapped inside the functions, rather than a more JSON-like type of api?
Another way to put this: in chart libraries like Highcharts or AmCharts, you might have one library function that “makes” the chart, and then inside the function, you declare how you want things to look, etc., with a JSON structure. With GoJS, however, you have to keep calling $(go.Whatever
, and maybe all the ceremony becomes distracting.
So instead of…
$(go.Node, "Auto",
$(go.Shape, "Rectangle",
{ stroke: null }, // removed the name property
new go.Binding("fill", "color")),
$(go.TextBlock,
{ margin: 6, font: "18px sans-serif" },
new go.Binding("text", "key"))
);
…the syntax would be one “make a diagram” call with go, and inside you could use a (seemingly) simpler declarative syntax. Dummy example:
{
nodes: [{
type: "Auto",
shapes: [{
type: "Rectangle",
stroke: null,
bindings: [
{ "fill": "fillColor" },
{ "stroke": "strokeColor" }
]
}],
textBlocks: [{
margin: 4,
font: "13px sans-serif",
bindings: [{
"text": "key",
"twoWayBinding": true
}]
}]
}]
}