Use Case 1 - Group After Node
Model
"nodes": [
{ "key": 1, "name": "Start Node" },
{ "key": 4, "name": "After Test" },
{ "key": 20, "name": "Test", "isGroup": true },
{ "key": 21, "name": "Path 1.0", "group": 20 },
{ "key": 22, "name": "Path 2.0", "group": 20 },
{ "key": 23, "name": "Path 3.0", "group": 20 },
{ "key": 24, "name": "Path 1.1", "group": 20 },
{ "key": 26, "name": "Path 2.1", "group": 20 },
{ "key": 28, "name": "Path 2.2", "group": 20 }
],
"links": [
{ "from": 1, "to": 20 },
{ "from": 1, "to": 21, "transparent": true },
{ "from": 1, "to": 22, "transparent": true },
{ "from": 1, "to": 23, "transparent": true },
{ "from": 21, "to": 24 },
{ "from": 22, "to": 26 },
{ "from": 26, "to": 28 },
{ "from": 24, "to": 4, "transparent": true },
{ "from": 28, "to": 4, "transparent": true },
{ "from": 23, "to": 4, "transparent": true },
{ "from": 20, "to": 4 }
]
Expanded
Collapsed
Looks great except my band labels are no longer sequentially ordered. Where’s the “+3” labeled band?
Use Case 2 - Group After Another Group
Model
"nodes": [
{ "key": 1, "name": "Start Node" },
{ "key": 10, "name": "Branch", "isGroup": true },
{ "key": 11, "name": "Right Path", "group": 10 },
{ "key": 12, "name": "Left Path", "group": 10 },
{ "key": 2, "name": "After Left Path" },
{ "key": 4, "name": "After Test" },
{ "key": 20, "name": "Test", "isGroup": true },
{ "key": 21, "name": "Path 1.0", "group": 20 },
{ "key": 22, "name": "Path 2.0", "group": 20 },
{ "key": 23, "name": "Path 3.0", "group": 20 },
{ "key": 24, "name": "Path 1.1", "group": 20 },
{ "key": 26, "name": "Path 2.1", "group": 20 },
{ "key": 28, "name": "Path 2.2", "group": 20 }
],
"links": [
{ "from": 1, "to": 10 },
{ "from": 1, "to": 11, "transparent": true },
{ "from": 1, "to": 12, "transparent": true },
{ "from": 11, "to": 20 },
{ "from": 11, "to": 21, "transparent": true },
{ "from": 11, "to": 22, "transparent": true },
{ "from": 11, "to": 23, "transparent": true },
{ "from": 21, "to": 24 },
{ "from": 22, "to": 26 },
{ "from": 26, "to": 28 },
{ "from": 24, "to": 4, "transparent": true },
{ "from": 28, "to": 4, "transparent": true },
{ "from": 23, "to": 4, "transparent": true },
{ "from": 20, "to": 4 },
{ "from": 12, "to": 2 }
]
Expanded
Collapsed
Notice the “Test” collapsed group is in the wrong band. It should be in the “+2” labeled band. The band labels are not sequentially ordered. Where’s the “+4” labeled band?
To get this to work, I had to set my group.layout as follows.
new go.Binding("layout", "", function(data) {
var group = diagram.findPartForKey(data.key);
return group.isSubGraphExpanded ? null : $$(go.GridLayout);
}),
Any suggestions on getting my collapsed groups working properly?