I am dealing with a situation where there are multiple vertex cells in a graph and I am utilizing the JavaScript library mxGraph. The issue arises when I drag a cell from the edge of the canvas, causing it to extend beyond the canvas boundaries. I am seeking a way to prevent this cell drag from occurring outside of the canvas limits. Is there a specific function available that can restrict the dragging of cells to stay within the canvas boundaries?
I have come across a function named: graph.setCellsMovable(false);
However, this function completely disables cell movement, whereas my requirement is to only disable the cell movement if it is dragged outside of the canvas boundary.