I want to avoid overlapping of link labels, as the label size is too large. Please suggest a way to make the link labels clearly visible and readable. Refer to the details below for your reference.
Link Template Code: -
const linkTemplate =
$(go.Link, {
routing: go.Link.Orthogonal,
corner: 5,
selectionAdorned: false
},
new go.Binding("fromSpot", "category", (data) => data === "SelfLink" ? go.Spot.BottomSide : go.Spot.BottomSide),
new go.Binding("toSpot", "category", (data) => data === "SelfLink" ? go.Spot.Left : go.Spot.TopSide),
new go.Binding("zOrder", "isSelected", (sel) => sel ? 1 : 0).ofObject(), //After select link come in front
new go.Binding("layerName", "isSelected", (sel) => sel ? "Foreground" : "Background").ofObject(), // Bring link to front when selected
$(go.Shape,
{
isPanelMain: true, strokeWidth: 1.5,
fromLinkable: true,
toLinkable: true,
pickable: true,
},
new go.Binding("fill", "isSelected",
(sel, shp) => sel ? "#6c1448" : shp.part.data.edgedetails.color).ofObject(),
new go.Binding("stroke", "isSelected",
(sel, shp) => sel ? "#6c1448" : shp.part.data.edgedetails.color).ofObject(),
new go.Binding("strokeWidth", "isSelected", s => s ? 3 : 1.5).ofObject(),
),
$(go.Shape, //to arrowhead
{
toArrow: "standard", strokeWidth: 1
},
new go.Binding("fill", "isSelected",
(sel, shp) => sel ? "#6c1448" : shp.part.data.edgedetails.color).ofObject(),
new go.Binding("stroke", "isSelected",
(sel, shp) => sel ? "#6c1448" : shp.part.data.edgedetails.color).ofObject(),
new go.Binding("scale", "isSelected", s => s ? 1.60 : 1).ofObject(),
),
$(go.Panel, "Auto",
{
name: "LABEL"
},
$(go.Shape, "RoundedRectangle",
{
strokeWidth: 2,
visible: false,
pickable: true,
background: "transparent",
},
new go.Binding("fill", "isSelected",
(sel, shp) => sel ? "#6c1448" : "#ffffff").ofObject(),
new go.Binding("layerName", "isSelected", (sel) => sel ? "Foreground" : "Background").ofObject(),
),
$(go.TextBlock, // the label
{
background: "#ffffff",
height: 18,
textAlign: "center",
font: "bold 10pt serif",
stroke: "#000000",
editable: false,
margin: 2
},
new go.Binding("font", "isSelected",
(sel, shp) => sel ? "bold 11pt serif" : "bold 10pt serif").ofObject(),
new go.Binding("stroke", "isSelected",
(sel, shp) => sel ? "#6c1448" : "#000000").ofObject(),
new go.Binding("text", "constraintname").makeTwoWay()
)
)
);

