Hi there, i’m trying to drag different type of links from a jquery palette onto gojs diagram, much like this example: HTML Drag and Drop, but i need different type of links
my attempt was to add data to the jquery object, like so
Are you trying to add disconnected links to your diagram? Without any points, there won’t be any “link” to show, if its disconnected at both ends. So you need some data in model.addLinkData();
The link should have some points in order to be visible. Like:
myDiagram.model.addLinkData({ points: new go.List(go.Point).addAll([new go.Point(0, 0), new go.Point(30, 0), new go.Point(30, 40), new go.Point(60, 40)]) });
This also assumes there’s a binding in the link template on points:
That’s because link points are in document coordinates, not relative coordinates. The link’s points set the link’s location, you can’t set the location yourself.
So if you have a link going from (50,50) to (100,100), its location is going to be (about) (50,50).