Gojs arrowhead broken

Hi Team,

I have a saved json generated from gojs, i updated the text property of the node befor3 loading the page.

On loading page i bind this updated json to the model, the diagram is rendered but the arrow heads are misplaced, because the text of the node is bigger or smaller than the original.

How do i make sure the arrowheads are also resized?

Does the saved JSON text include the points for each link route? If so, then you haven’t updated the routes of the links connecting with the node(s) whose text you have updated.

Chances are that it would be easiest to simply remove such “points” property values, which will allow those links to compute their normal route.

Alternatively, you could implement an “InitialLayoutCompleted” DiagramEvent listener that examined each Link.points list of Points to see if there are any where the end points are not within half a pixel of the edge of their respectively connected ports. For such links, you can call Link.invalidateRoute.

Can you describe how this event listener is executed and what exactly Link.invalidateroute will do?
And yes you are right the points are also being saved, and on updating he names those points are not being updated as, i wont know the exact points after renaming

First, do you really need to save each link’s route? If you don’t save it, the diagram will recompute the route automatically taking the node’s new size and position into account.

Second, you can determine what the first or last point of a link route ought to be by calling https://gojs.net/latest/api/symbols/Link.html#getLinkPoint. If it isn’t close enough to the actual Link.getPoint value, then calling Link.invalidateRoute will recompute the route according to the various property values that the link has.