Links and two-way data binding


I have some nodes with links between them, and i want people to be able to reshape the lines. However when i store the diagram, and retrieves it again, the custom line adjustments are gone, and default placing comes back. Therefore I need to implement a two-way databinding.
I can not find any examples on how to do this. Can anyone here help me with this?

I have seen examples, and implemented this behavior for node locations, and this works find. But how can i do this with link paths?

I have tried the following without success:
new go.Binding(“geometry”, “geo”, go.Geometry.parse).makeTwoWay(go.Geometry.stringify)
But maybe this is incorrect? What would be the correct approach here?

Here is all the relevant code:

window.myDiagram.linkTemplate =
$(go.Link, // the whole link panel
routing: go.Link.Orthogonal,
corner: 2,
toShortLength: 4,
relinkableFrom: true,
relinkableTo: true,
reshapable: true,
selectable: true
$(go.Shape, // the link path shape
isPanelMain: true,
stroke: “black”,
strokeWidth: 1
new go.Binding(“geometry”, “geo”, go.Geometry.parse).makeTwoWay(go.Geometry.stringify) // Does not work…
$(go.Shape, // the arrowhead
toArrow: “standard”,
stroke: null,
fill: “black”
$(go.TextBlock, // the label
name: “LABELTEXT”,
text: “”
new go.Binding(“text”, “lblText”).makeTwoWay()

window.myDiagram.toolManager.linkingTool.temporaryLink.routing = go.Link.Orthogonal;
window.myDiagram.toolManager.relinkingTool.temporaryLink.routing = go.Link.Orthogonal;

Just do a TwoWay Binding of the Link.points property.
The sample demostrates this, as does the State Chart sample.

Furthermore Models have special support for JSON serializing a “points” property that is a List of Points to/from an Array of numbers. This permits the results that you can see in the text area showing the points for each link data.

When loading a Model, if there is a Binding to a data property that does not exist on a particular object, the target property is not assigned. In this case that means that the Link.points property would not be assigned, so the Link’s route will be calculated normally.

Further explanation: the Link’s geometry is derived from the route, i.e., from the Link.points array. So setting/binding the link’s Shape.geometry is ineffective because the Geometry is thrown away as the Link automatically recomputes its Geometry based on the route and the other Link properties such as Link.curve.

I finally found the examples showing this, and now i have made it working here in my code as well.