I’m trying to have my node’s links to wrap around the side they’re connected to. According to API spot go.Spot.LeftRightSides
should do the trick (not perfect but close), but what I noticed is no matter what type of spot I choose it always connects to the same place (all links in one point). Even when I set the ports to go.Spot.Bottom
nothing changes. The same when I delete the ports. Only thing that causes a change is moving ports to another object in the template - it changes accordingly.
So I guess for some reason my ports just won’t change. I think I’m missing something here.
Here’s my code:
diagram.nodeTemplate =
$(go.Node, "Vertical", go.Panel.Auto, {
selectionObjectName: "TEXT"
},
new go.Binding("deletable", "deletable"),
$(go.Shape, {
figure: "RoundedRectangle",
fill: "rgb(255,0,0)",
portId: "",
fromSpot: go.Spot.LeftRightSides,
toSpot: go.Spot.LeftRightSides,
strokeWidth: 0,
},
new go.Binding("stroke", "stroke"),
new go.Binding("fill", "color"),
new go.Binding("opacity", "depth", function (d) {
return (d > 1) ? 0 : 1;
}),
new go.Binding("fill", "color")),
new go.Binding("layerName", "stroke"),
$(go.TextBlock, {
name: "TEXT",
minSize: new go.Size(30, 15),
margin: new go.Margin(8, 15, 8, 15),
stroke: "white",
editable: true,
isMultiline: false
},
new go.Binding("stroke", "stroke"),
new go.Binding("margin", "depth", function (d) {
return (d > 1) ? new go.Margin(8, 3, 8, 3) : new go.Margin(8, 15, 8, 15);
}),
new go.Binding("text", "text").makeTwoWay(),
new go.Binding("scale", "scale").makeTwoWay(),
new go.Binding("font", "font").makeTwoWay()),
new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
new go.Binding("locationSpot", "dir", function (d) {
return spotConverter(d, false);
}),
);
Im using the Double Tree Layout.
Thanks for any help.