I am trying to create a custom link that consists of three stacked lines. I have seen the example that uses the pathPAttern approach, but it becomes very rough when used with orthogonal links. The corners are far from smooth. I have created an extension that offsets the original line, however Gojs only draws the last line.
function tripleLineLink() {
go.Link.call(this);
}
go.Diagram.inherit(tripleLineLink, go.Link);
tripleLineLink.prototype.makeGeometry = function () {
const originalGeomtry = go.Link.prototype.makeGeometry.call(this);
const upperLine = go.Link.prototype.makeGeometry.call(this).offset(10, -50);
const lowerLine = go.Link.prototype.makeGeometry.call(this).offset(-10, 50);
const combined = go.Geometry.parse(
`${go.Geometry.stringify(originalGeomtry)} ${go.Geometry.stringify(
upperLine
)} ${go.Geometry.stringify(lowerLine)}`
);
return combined;
};
this results in a svg path string that describes three different lines. Somehow Gojs only draws the path from the last M command.
As you can see in the image, only the lowerLine path is drawn
Is this expected behaviour and is there a way achieve a smooth three line link?
Best,
Niek