Thanks for your proposal.
I think I can avoid the link routing-“problem” if I drag the “Component1” onto the “Condition”-Panel (LinkLabel) . The ‘mouseDragEnter’ event works successful onto the LinkLabel. My problem is only how can I get the “Link” of the LinkLabel ? The function findObject(“LINK”) return ‘null’. I need the link to get the source- and target-state (State1 and State2);
Thanks in advance!
![image](https://forum.nwoods.com/uploads/db3963/original/2X/9/95f9fcdf34285c35e79cd356bc9ed2ba3c9d1d43.png)
myWorkspace.linkTemplate =
$(go.Link,
{ name : "LINK" },
go.Link.AvoidsNodes,
{
relinkableFrom: true, relinkableTo: true,
toShortLength: 2,
corner: 5,
curve: go.Link.JumpOver,
selectable: true
},
$(go.Shape,
{ strokeWidth: 2, stroke: "#FFFFFF" }
),
$(go.Shape,
{ toArrow: "Standard", stroke: "#FFFFFF" }
),
$(go.Panel, "Vertical", // panel condition main
{ background: "#FFFFFF",
name : "CONDITION" ,
mouseDragEnter: (e, conditionPanel ) => {
if( conditionPanel == null )
{
console.log("conditionPanel = null");
return;
}
// successfull
console.log("conditionPanel name = : " + conditionPanel.name);
// !!! ERROR : 'link' == null !!!
var link = conditionPanel.findObject("LINK");
if( link == null )
{
console.log("link = null");
return;
}
console.log("link name = : " + link);
...
},
$(go.Panel, "Horizontal",
{ background: "#ffffff", },
$(go.TextBlock, "condition",
{ alignment: go.Spot.Left,
margin: new go.Margin(5, 5, 5, 5), // top, right, bottom, left
font: "12px Roboto, sans-serif",
//background: "lightgreen",
stroke: "rgba(0, 0, 0, .87)",
}
),
),
$(go.Shape, "LineH",
{
stroke: "rgba(0, 0, 0, .60)", strokeWidth: 1,
height: 1, stretch: go.GraphObject.Horizontal
},
),
$(go.Panel, "Horizontal",
$(go.TextBlock , "mappedComponent",
{ margin: mt8,
font: "10px Roboto, sans-serif",
stroke: "rgba(0, 0, 0, .87)",
}
)
)
)
);