Hi! I came across problem, that link looks incorrect (as I think). How can I tune it? Nodes have immutable coordinates and I expect that Diagram draw correct link by portIds. Maybe I skip something into configs? Or can I indicate intermediate points?
Currently behavior: Monosnap
Example: Monosnap
red line - how line are going
yellow line - example of expected behavior
I have that configs:
Link:
export const linkTemplate = $(
go.Link,
{
curve: go.Link.Bezier,
fromEndSegmentLength: 50,
toEndSegmentLength: 50,
fromShortLength: 5,
toShortLength: 10,
selectable: false,
fromSpot: go.Spot.Right,
toSpot: go.Spot.Left,
},
$(
go.Shape,
{ stroke: referenceColors.inactive },
new go.Binding('stroke', 'isSelected', (isSelected) =>
isSelected ? referenceColors.highlighted : referenceColors.inactive,
),
),
$(
go.Shape,
{
toArrow: 'Standard',
stroke: referenceColors.inactive,
fill: referenceColors.inactive,
alignmentFocus: new go.Spot(1, 0.5, 5, 0),
},
new go.Binding('stroke', 'isSelected', (isSelected) =>
isSelected ? referenceColors.highlighted : referenceColors.inactive,
),
new go.Binding('fill', 'isSelected', (isSelected) =>
isSelected ? referenceColors.highlighted : referenceColors.inactive,
),
),
);
Diagram:
$(go.Diagram, {
isReadOnly: true,
model: $(go.GraphLinksModel, {
linkFromPortIdProperty: 'fromPort',
linkToPortIdProperty: 'toPort',
nodeKeyProperty: 'id',
linkKeyProperty: 'id',
}),
layout: $(go.TreeLayout, {
arrangementOrigin: new go.Point(0, 0),
angle: 0,
treeStyle: go.TreeLayout.StyleLayered,
layerStyle: go.TreeLayout.LayerSiblings,
alignment: go.TreeLayout.AlignmentCenterChildren,
nodeSpacing: 50,
layerSpacing: 50,
arrangement: go.TreeLayout.ArrangementVertical,
path: go.TreeLayout.PathDestination,
isInitial: false,
isOngoing: false,
}),
});