Selectable Filtering, Movable Filtering
Movable Filtering
If the control element is movable - isMovable(item) → {Boolean}
default to obtain the movable property of element, and user can have custom edition:
isMovable : function(item) {
return item.movable !== false;
}
For example, judge if the element can be moved via the name of element
var canMove = graph.createNode("Q-Node", -100, -50);
var cannotMove = graph.createNode("Node", 100, 50);
var edge = graph.createEdge("Hello\nQunee", canMove, cannotMove);
graph.isMovable = function(item){
return item.name && item.name.indexOf('Q') === 0;
}
Selectable Filtering
What is similar includes whether the control function is selectable isSelectable(item)
- isSelectable(item) → {Boolean} - whether it is selectable
- isSelected(element) → {Boolean} - whether the element is selected