exportSVG

Exports the diagram content as an SVG document. The result can be saved using kendo.saveAs.

The full content of the diagram will be exported in 1:1 scale. If exporting the current view is desired then the kendo.drawing.drawDOM method should be called on a container element.

The export operation is asynchronous and returns a promise. The promise will be resolved with a SVG document encoded as a Data URI.

Parameters

options Object (optional)Export options.
options.raw Boolean (default: false)Resolves the promise with the raw SVG document without the Data URI prefix.

ReturnsPromise A promise that will be resolved with a SVG document encoded as a Data URI.

Example - Exporting a diagram to an SVG document

<button id="exportBtn">Export</button>
<div id="diagram"></div>
<script>
  $("#exportBtn").on("click", function(){
    var diagram = $("#diagram").getKendoDiagram();
    diagram.exportSVG().done(function(data) {
      kendo.saveAs({
        dataURI: data,
        fileName: "diagram.svg"
      });
    });
  });
  $("#diagram").kendoDiagram({
    dataSource: {
      data: [{ "items": [{ items: [{}] }] }],
      schema: { model: { children: "items" } }
    },
    layout: {
      type: "tree"
    }
  });
</script>
In this article