Thanks for the answer,I have one more problem regrading the linking of spots.when i make a diagram then save it and view it on another page(the page i made to show the saved diagrams) the links are not coming at the same position(there is a very small change in links position) and when I drag any shape of the diagram slightly,links connect to the spots as they were connected when i made the diagram(i.e. the position comes correctly).
changes happens during loading,when i drag the shapes in diagram slightly ,all the links retain their correct positions and connect to the spots automatically.
I have also set the twoway binding for points in my link template.
I said that it appeared that the triangle and cylinder node(s) had moved relative to the cube and hexagon node(s). This is in addition to the link routes being different from how they were when the model was saved.
So my question/suggestion was that you debug this by writing down the link routes and node positions before you save the model. Then save the model and look at that model data – does it hold the numbers that you recorded before saving? If they do, then you know the problem isn’t with the saving of the model.
Assuming it really is a problem with loading and not with saving, then load the model and examine the link routes and node positions again in the debugger – which values have changed, and how much?
yes, I wrote down the data of link routes and node positions before saving the model and matched it with the data i get after saving.Every thing is exactly same.
When i commented out the new go.Binding(“points”).makeTwoWay()
line in my linkTemplate (on the page where i am showing the saved diagrams),Links started to come connected to the spots very accurately. I don’t know why this happened,if I am not wrong the binding line I comment out is for remembering the link positions.
OK, so we know that it’s a problem that happens when loading. Yes, the Binding on Link.points is what saves and loads link routes.
But, again, I ask how much different are the positions of the nodes? Then we need to figure out why they are different. Clearly if the nodes have moved, any saved link routes, if faithfully restored, will not appear to connect the nodes correctly.
Also are the sizes of the nodes the same before saving as after loading. Just look at the Node.actualBounds.
And if in the debugger you look at the Link.points again, are they exactly the same numbers as what are in the saved model? That is just to confirm that loading the link routes worked correctly.