Link query between node


#1

I m working on a diagram that requires me to show the link between the nodes as the links between groups that the nodes are member of for reference the link between the store_id of staff and store_id of store should be shown between staff and store groups instead of the inner node
Screenshot%20from%202019-02-08%2015-04-19


#2

Yes, but what is your question? What do you want that is different from what you have?

One comment: you probably want to put some more work into defining the labels on the links. They now appear to be Shapes whose desiredSize has not been set, resulting in a default size of 100x100.


#3

my question is how to make them appear between outer groups rather than between the inner nodes
right now the link is connected the nodes inside the group


#4

i want the link data to be between the node but visually the link should be shown between the group that enclose them


#5

Your requirements are still very vague.

I will guess that you want to set Link.fromShortLength and toShortLength to a small number. I don’t know exactly how long it should be – maybe 4 or 6?
https://gojs.net/latest/api/symbols/Link.html#fromShortLength


#6

i found the functionality i was looking for in tree mapper
https://gojs.net/latest/samples/treeMapper.html
and the link you provided
https://gojs.net/latest/api/symbols/Link.html#fromShortLength
is not opening


#7

just to be clear this function is responsible for creating liks between groups instead of nodes?
MappingLink.prototype.getLinkPoint = function(node, port, spot, from, ortho, othernode, otherport) {
var r = port.getDocumentBounds();
var group = node.containingGroup;
var b = (group !== null) ? group.actualBounds : node.actualBounds;
var op = othernode.getDocumentPoint(go.Spot.Center);
var x = (op.x > r.centerX) ? b.right : b.left;
return new go.Point(x, r.centerY);
};


#8

The API link is working for me.

Did you try setting from/toShortLength? Unlike the Tree Mapper sample, the distance between the edge of the Node and the edge of its containing Group is constant in your app.


#9

in tree mapper is it just setting the length of link ?
it is not actually setting port on the outer group?


#10

i want the link between both last_update of each group look like thisScreenshot%20from%202019-02-08%2017-11-28

the link in data should be between last_update of both group but it should show it like it is between 2 outer groups

also i want those links to not over lap like this if other links are also made for “actoractor1” like


#11

Instead of having each item be implemented a separate Node, collected into Groups, it sounds as if you would have been better off doing what these samples do: https://gojs.net/latest/samples/entityRelationship.html and https://gojs.net/latest/samples/records.html. Note in the latter sample the links are connecting individual items/ports, but one could have links connect with the whole Node instead of individual ports.

But if you want to continue having separate Nodes in Groups, you could override Link.getLinkPoint to return calling getLinkPoint on the Node.containingGroup. Set fromSpot and toSpot to go.Spot.AllSides on the Group.


#12

yes i want to keep using nodes can u give an example of setting this Link point this is my link template right now
Screenshot%20from%202019-02-08%2018-07-20


#13

Sorry, I just tried what I suggested, and it didn’t do what you want.

I’m not sure there’s an easy solution to do it the way that you want, rather than the way I suggested before (not using Groups).


#14

appreciated anyways thanks


#15

What the MappingLink override of Link.getLinkPoint does is what you want. The problem is that you also want to spread out the link points along the sides of the Groups, and that’s not so easy to re-implement.


#16

yes exactly i am looking into it my self too and I m at the same point as you