visible

Gets or sets the visibility of the current element.

Parameters

visible Boolean

The new visibility state.

Returns

Boolean True if the element is visible, false otherwise.

Example

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
        id: "rect1",
        type: "rectangle",
        x: 50,
        y: 50,
        height: 100,
        width: 150
    }]
});

var diagram = $("#diagram").getKendoDiagram();
var shape = diagram.getShapeById("rect1");
var rect = diagram.shapes[0];

// Get current visibility state
var isVisible = rect.visible();
console.log("Current visibility:", isVisible);

// Hide the rectangle
rect.visible(false);
console.log("Rectangle hidden");

// Show the rectangle again
rect.visible(true);
console.log("Rectangle visible again");
</script>
In this article
visible
Not finding the help you need?
Contact Support