function init() {
var $ = go.GraphObject.make;
myDiagram =
$(go.Diagram, “myDiagramDiv”,
{
initialContentAlignment: go.Spot.Center, // for v1.*
layout: $(go.GridLayout, { wrappingColumn: 1, spacing: new go.Size(60, 60) })
});
myDiagram.nodeTemplate =
$(go.Node, “Auto”,
{ width: 80, height: 50, fromSpot: new go.Spot(0, 1, 6, 0), toSpot: new go.Spot(0, 0, 6, 0) },
$(go.Shape,
{ fill: “white” },
new go.Binding(“fill”, “color”)),
$(go.TextBlock,
new go.Binding(“text”))
);
myDiagram.linkTemplate =
$(go.Link,
{ routing: go.Link.Orthogonal },
new go.Binding(“curviness”),
$(go.Shape),
$(go.Shape, { toArrow: “Standard” }),
$(go.TextBlock, { stroke: “red”, background: “white” },
new go.Binding(“text”, “curviness”))
);
myDiagram.model = new go.GraphLinksModel(
[
{ key: 1, text: “Alpha”, color: “lightblue” },
{ key: 2, text: “Beta”, color: “orange” },
{ key: 3, text: “Gamma”, color: “lightgreen” },
{ key: 4, text: “Delta”, color: “pink” },
{ key: 5, text: “Epsilon”, color: “coral” }
],
[
{ from: 1, to: 2, curviness: 0 },
{ from: 2, to: 3, curviness: 10 },
{ from: 3, to: 4, curviness: -20 },
{ from: 4, to: 5, curviness: 20 }
]);
}
I tried it … its slanting the first and last part of the link, but the breaks are good. Why does the slant occur ?