It's weird, that autoresize property is disabled. Because in .aspx I have AutoResize="AllDirections". As I understand setting AutoResize="AllDirections" is enough for AutoResize to work. However, AutoResize="AllDirections" is not working for me, I'm dragging node off the left edge and diagram is not resizing.
So, I had to write special code for nodeModified event handler. Console shows no errors.
function diagramView_OnNodeMove(sender, args) {
var nodePosition = args.node.getBounds();
var margin = nodePosition.width;
var diagramView = sender._element;
const increment = 25;
var bounds = getDiagramBounds();
var left = bounds.left()
var right = bounds.right();
var top = bounds.top();
var bottom = bounds.bottom();
if (nodePosition.x <= left) {
left -= increment;
setDiagramBounds(left, top, right, bottom);
}
else if (nodePosition.x >= right - margin) {
right += increment;
setDiagramBounds(left, top, right, bottom);
sender.setScrollX(sender.getScrollX() + increment);
}
else if (nodePosition.y <= top) {
top -= increment;
setDiagramBounds(left, top, right, bottom);
}
else if (nodePosition.y >= bottom - margin) {
bottom += increment;
setDiagramBounds(left, top, right, bottom);
sender.setScrollY(sender.getScrollY() + increment);
}
}