resize

Adjusts the diagram viewport to match the size of the container.

Example - resize Diagram on window resize

<style>
  html,
  body,
  .diagram-wrapper,
  &#35;diagram {
    height: 100%;
  }
</style>
<div class="diagram-wrapper">
  <div id="diagram"></div>
</div>
<script>
  $(window).on("resize", function() {
    kendo.resize($(".diagram-wrapper"));
  });
  $("#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