while reloading the diagram with different set of data (nodes and links), diagram keeps shifting towards right side of the screen every time. Also, i have observed that, viewport width is also getting increased every time.
I want to keep the “div” same all the time for all the data sets.
How can i prevent this shifting of diagram towards right?
First, please make sure when you have questions unrelated to other topics that you create new topics for them. This makes it easier for other to search for answers if they have a similar question.
I’m not entirely clear on what you want the behavior to be. Could you provide some screenshots of the behavior you’re seeing and what you’d like to happen?
myDiagram =
$(go.Diagram, "citopology_viewer_miniapp",
{
// start everything in the middle of the viewport
initialContentAlignment: go.Spot.Left,
// use a custom ResizingTool (along with a custom ResizeAdornment on each Group)
resizingTool: new LaneResizingTool(),
// don't allow dropping onto the diagram's background unless they are all Groups (lanes or pools)
mouseDragOver: function(e) {
if (!e.diagram.selection.all(function(n) { return n instanceof go.Group; })) {
e.diagram.currentCursor = 'not-allowed';
}
},
mouseDrop: function(e) {
if (!e.diagram.selection.all(function(n) { return n instanceof go.Group; })) {
e.diagram.currentTool.doCancel();
}
},
// a clipboard copied node is pasted into the original node's group (i.e. lane).
"commandHandler.copiesGroupKey": false,
// automatically re-layout the swim lanes after dragging the selection
"SelectionMoved": relayoutDiagram, // this DiagramEvent listener is
"SelectionCopied": relayoutDiagram, // defined above
"animationManager.isEnabled": false,
// disable undo & redo
"undoManager.isEnabled": false,
//toolTip duration: Infinity
"toolManager.toolTipDuration": NaN,
});
>>> Do the saved positions/locations of the nodes change?
– How can i verify this ?