viewToModel
Transforms a point from View coordinates to Model coordinates. Model coordinates are independent coordinates to define Shape bounds.
Parameters
point kendo.dataviz.diagram.Point
The point in View coordinates.
Returns
kendo.dataviz.diagram.Point
the transformed point
Example - convert Point from View to Model coordinates
<button id="convertBtn">Convert point coordinates</button>
<div id="diagram"></div>
<script>
$("#convertBtn").on("click", function(){
var diagram = $("#diagram").getKendoDiagram();
var point = new kendo.dataviz.diagram.Point(200, 100);
var documentCoordinates = diagram.viewToModel(point);
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log("(200, 100) = > " + documentCoordinates);
});
$("#diagram").kendoDiagram({
zoom: 1.5,
shapes: [{
id: "1",
x: 100,
y: 20
}, {
id: "2",
x: 350,
y: 20
}, {
id: "3",
x: 250,
y: 200
}],
connections: [{
from: "1",
to: "2"
},{
from: "2",
to: "3"
}],
connectionDefaults: {
endCap: "ArrowEnd"
}
});
</script>