Hi All,
I currently have a model with group names set for all nodes and would like to create the nodes with the layerName set to the node values except for one group where the layerName is ‘Foreground’. This is to prevent nodes from overlapping when they are in different groups when the diagram is first rendered.
In the go.GraphObject.make() call, I tried adding a binding:
new go.Binding("layerName", "groupName", function (groupName) {
if (groupName === 'xyz') {
return 'Foreground';
} else {
return groupName;
}
})
However this does not work and the nodes in different groups continue to overlap. If I replace the layerName with for example width and return different width values, it renders the widths perfectly. This layerName manipulation also works
inside the selection listener to bring groups to the foreground. Any idea what I’m doing wrong here? Is there an alternate or better way to prevent overlapping?
Thanks!