Hi!
I have found that “Linking” transaction is duplicated for nodes which are part of some group.
Here is an example, just drag a link from the first node to the second one:
const $ = go.GraphObject.make;
const myDiagram = $(go.Diagram, "diagram", {
"undoManager.isEnabled": true,
"ModelChanged": (e) => {
if (e.isTransactionFinished && e.object && e.object.changes) {
console.log(`Transaction is finished: ${e.object.name}`);
}
}
});
myDiagram.nodeTemplate = $(go.Node, "Auto", { fromLinkable: true, toLinkable: true },
$(go.Shape, "Circle", { width: 40, height: 40, cursor: "pointer" }),
new go.Binding("location", "loc", go.Point.parse)
);
const myModel = $(go.GraphLinksModel, {
nodeDataArray: [
{ key: "group1", loc: "0 0", isGroup: true },
{ key: "node1", loc: "100 0", group: "group1" },
{ key: "node2", loc: "200 0", group: "group1" }
]
});
myDiagram.model = myModel;
This doesn’t happen for groups without a layer.
Am I to understand it’s a bug? If so, do you have any plans on fixing it?
Thanks.