In case anyone is interested in an example:
myDiagram.nodeTemplate =
$(go.Node, "Auto",
{ width: 150, height: 50, isShadowed: true, locationSpot: go.Spot.Center },
new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
$(go.Shape,
{ fill: "#eee", stroke: "gray", portId: "" }),
$(go.TextBlock,
new go.Binding("text"))
);
myDiagram.nodeTemplateMap.add("app",
$(go.Node, "Spot",
{ locationSpot: go.Spot.Center },
new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
$(go.Shape, "Circle", { width: 70, height: 70, fill: "#ccc", stroke: "gray" }),
$(go.TextBlock,
new go.Binding("text"))
));
myDiagram.linkTemplate =
$(go.Link,
{
// routing: go.Link.Orthogonal, corner: 10,
// curviness: 10, //curve: go.Link.Bezier,
relinkableFrom: true, relinkableTo: true,
reshapable: true, resegmentable: true
},
$(go.Shape, { stroke: "#aaa", strokeWidth: 1.5 }),
$(go.Shape, { toArrow: "", fill: "#eee", stroke: "#aaa", scale: 1.5 },
new go.Binding("toArrow"))
);
myDiagram.model = new go.GraphLinksModel(
[
{ "key": 1, "text": "SALES", "loc": "0 100" },
{ "key": 2, "text": "INVENTORY", "loc": "400 0" },
{ "key": 3, "text": "BUDGET", "loc": "400 89" },
{ "key": 4, "text": "PRODUCTION", "loc": "327 157" },
{ "key": 11, "text": "APP1", "loc": "100 0", "category": "app" },
{ "key": 12, "text": "APP1", "loc": "230 0", "category": "app" },
{ "key": 13, "text": "APP3", "loc": "190 93", "category": "app" },
{ "key": 14, "text": "APP4", "loc": "92 187", "category": "app" }
],
[
{ "from": 11, "to": 1 },
{ "from": 14, "to": 1 },
{ "from": 2, "to": 12 },
{ "from": 12, "to": 11, "toArrow": "Diamond" },
{ "from": 13, "to": 11, "toArrow": "Diamond" },
{ "from": 4, "to": 13 }
]);