remove
Removes the given element from the group
Parameters
element Object
The element to remove.
Example
<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
shapes: [
{ id: "1", type: "rectangle", x: 100, y: 100 },
{ id: "2", type: "rectangle", x: 200, y: 100 },
{ id: "3", type: "circle", x: 150, y: 200 }
]
});
var diagram = $("#diagram").getKendoDiagram();
var shape1 = diagram.getShapeById("1");
var shape2 = diagram.getShapeById("2");
var shape3 = diagram.getShapeById("3");
// Create a group and add elements
var group = new kendo.dataviz.diagram.Group();
group.append(shape1.visual);
group.append(shape2.visual);
group.append(shape3.visual);
console.log("Before remove - children count:", group.children.length);
// Remove a specific element from the group
group.remove(shape2.visual);
console.log("After remove - children count:", group.children.length);
</script>
In this article