@tiepna wrote:
Hi,
I'm following this code below:
diagram.nodeTemplate = $(go.Node, "Auto", $(go.Shape, "Rectangle", { fill: "lightgray" }), $(go.TextBlock, { margin: 5}, new go.Binding("text", "key")) ); diagram.linkTemplate = $(go.Link, // get the link spots from the link data new go.Binding("fromSpot", "fromSpot", go.Spot.parse), new go.Binding("toSpot", "toSpot", go.Spot.parse), $(go.Shape), $(go.Shape, { toArrow: "Standard" }) ); var nodeDataArray = [ { key: "Alpha" }, { key: "Beta" }, { key: "Gamma" }, { key: "Delta" } ]; var linkDataArray = [ { from: "Alpha", to: "Beta", fromSpot: "TopRight", toSpot: "Left" }, { from: "Alpha", to: "Gamma", fromSpot: "Left", toSpot: "Left" }, { from: "Alpha", to: "Delta", fromSpot: "None", toSpot: "Top" } ]; diagram.model = new go.GraphLinksModel(nodeDataArray, linkDataArray);
And by this way I calculated fromSpot and toSpot from beginning. But Issue here is: When i move node, the link not dynamic by location of nodes.
Is there anyway to make link dynamic in this case?Sorry if the question not clear!
Thank you,
Posts: 9
Participants: 2