|
//Initializes diagram control
var diagram = new ej.diagrams.Diagram({
width: '100%',
height: '700px',
snapSettings: {
horizontalGridlines: gridlines,
verticalGridlines: gridlines,
},
//Trigger drop event
drop: drop,
});
diagram.appendTo('#diagram');
function drop(args) {
var node = args.element;
if (node.shape.shape === 'Terminator') {
node.shape = { type: 'Basic', shape: 'Ellipse' };
} else if (node.shape.shape === 'Process') {
node.shape = { type: 'Basic', shape: 'Star' };
} else if (node.shape.shape === 'Decision') {
node.shape = { type: 'Flow', shape: 'Or' };
} else {
node.shape = { type: 'Flow', shape: 'Extract' };
}
} |