@g.bartoli wrote:
Hi,
as I explained in another topic, I'm using dynamic layout switching and everything works fine (thanks Walter!).
I noticed that transitions between different layouts are smoothly animated and that's really nice. However, I tried to add"undoManager.isEnabled": true
to the diagram to manage undo/redo and suddenly transitions were gone, i.e. the layout switching still works, but it is instantaneous, which is visually worse than before.Here are my layout switching functions:
function setTreeLayout() { myDiagram.startTransaction("tree_layout"); myDiagram.layout = $(go.TreeLayout, { nodeSpacing: 20, layerSpacing: 200, }); myDiagram.commitTransaction("tree_layout"); } function setDynamicLayout() { myDiagram.startTransaction("dynamic_layout"); myDiagram.layout = $(go.ForceDirectedLayout, { defaultSpringLength: 30, defaultElectricalCharge: 200 }); myDiagram.commitTransaction("dynamic_layout"); }
And this is the simple HTML part for buttons:
<div id="layoutButtons"> <label><strong>Layout:</strong></label> <button onclick="setTreeLayout()">Tree</button> <button onclick="setDynamicLayout()">Dynamic</button> </div>
Everything else is working properly, just the transitions are disabled with undoManager. Is this a bug or an intended feature?
Thanks,
GuidoAs a side note, I wish Northwoods Software a Merry Christmas and Happy New Year! :)
Posts: 4
Participants: 2