visible

Gets or sets the shape visible state.

Parameters

visible Boolean optionalIndicates whether the shape should be visible in the Diagram. If skipped, the method will return the current visible state of the shape.

Example

<button id="hideBtn">Hide Shape 2</button>
<div id="diagram"></div>
<script>
  $("#hideBtn").on("click", function(e){
    var diagram = $("#diagram").getKendoDiagram();
    var shape = diagram.shapes[1];
    shape.visible(false);
  });
  $("#diagram").kendoDiagram({
    shapes:[
      {
        id:"1",
        content:{
          text: "State 1"
        },
        x: 20,
        y: 20
      },
      {
        id:"2",
        content: {
          text: "State 2"
        },
        x: 160,
        y: 20
      }
    ],
    connections:[
      {
        from: "1",
        to: "2"
      }
    ]
  });
</script>
In this article