Hi there,
We have a question regarding the drawing of links.
The following situation occors:
The thing we want to change here is the drawing of the link at the place of the arrow. You can see the link is overlapping with the text, so what we want is move the overlapping links a bit down so it ‘makes a turn’ after te text.
We tried playing around with toEndSegmentLength, but it seems that value is kind of a minimal distance and not a maximum. Is there any way to do this?
Here is our link configuration:
const $ = go.GraphObject.make;
return $(go.Link,
{
routing: go.Link.AvoidsNodes,
curve: go.Link.JumpOver,
corner: 5,
toShortLength: 3,
relinkableFrom: false,
relinkableTo: false,
reshapable: false,
resegmentable: false,
fromEndSegmentLength: 40,
toEndSegmentLength: 20,
},
{
// mouse-overs subtly highlight links:
mouseEnter: (_e: any, link: any) => link.findObject(Highlight).stroke = 'rgba(30,144,255,0.2)',
mouseLeave: (_e: any, link: any) => link.findObject(Highlight).stroke = 'transparent',
selectionAdorned: false,
},
$(go.Shape, // the highlight shape, normally transparent
{ isPanelMain: true, strokeWidth: 8, stroke: 'transparent', name: Highlight }),
$(go.Shape, // the link path shape
{ isPanelMain: true, stroke: 'gray', strokeWidth: 2 },
new go.Binding('stroke', 'isSelected', (sel: any) => sel ? 'dodgerblue' : 'gray').ofObject()),
$(go.Shape, // the arrowhead
{ toArrow: 'standard', strokeWidth: 0, fill: 'gray' }),
$(go.TextBlock,
new TextStyle(),
{
stroke: Constants.ColorBlack,
wrap: go.TextBlock.WrapFit,
editable: false,
textAlign: 'left',
background: 'white',
minSize: new go.Size(100, 0),
maxSize: new go.Size(Constants.StepWidth - 15, Constants.StepHeight),
visible: false,
segmentIndex: 0,
overflow: go.TextBlock.OverflowEllipsis,
maxLines: 2,
},
new go.Binding('text', 'title', (val: any) => val[this.translate.currentLang]),
new go.Binding('visible', 'title', (title: any) => title ? true : false),
new go.Binding('segmentOrientation', 'fromPort', (val: any) => val === Constants.PortRight ? go.Link.OrientUpright : undefined),
new go.Binding('segmentOffset', 'fromPort', (val: any) => val === Constants.PortRight ? new go.Point(55, NaN) : new go.Point(15, 0)),
new go.Binding('textAlign', 'fromPort', (val: any) => val === Constants.PortRight ? 'left' : 'center')
)
);
I created a desired situation screenshot:
Thanks in advance!