Closed benwalch closed 4 years ago
use below function to decide which style can move and restrict
graph.isCellMovable = function (cell) { try {
if (cell.style.includes('style name 1')) {
return true;
} else if (cell.style.includes('style name 2')) {
return true;
} else {
return false;
}
} catch (e) {
}
};
Thank you for this project!
moveCells implementation of graph does move all given cells - even the ones with
style[mxConstants.STYLE_MOVABLE]
set tofalse
.Why is this important? Some Layout mechanisms use updateGroupBounds which in turn calls
moveCells
with all children. If there is a child vertex in the group which is defined to not be movable (by settingmxConstants.STYLE_MOVABLE
key in the cell style tofalse
) it gets moved regardless of that setting.