Save and restore entities coordinates and links points in a diagram

Yes, the state chart sample is similar.

For your function, lda.points.n is a minified property name, and I think you probably mean to refer to lda.points.iterator or maybe lda.points.toArray(). Since you want to save the points as a flattened array, you probably want to use conversion functions in your points binding. One will convert the array of strings to a list of points, and one will convert the list to an array of strings.

Maybe something like this:

// convert a stringified array of points to a list
function parsePoints(pts) {
  var ptarr = JSON.parse(pts);
  var list = new go.List();
  for (var i = 0; i < ptarr.length; i += 2) {
    var x = parseFloat(ptarr[i]);
    var y = parseFloat(ptarr[i + 1]);
    var pt = new go.Point(x, y);
    list.add(pt);
  }
  return list;
}

// convert a list of points to a stringified array
function stringifyPoints(pts) {
  var it = pts.iterator;
  var arr = [];
  while (it.next()) {
    var pt = it.value;
    arr.push(pt.x);
    arr.push(pt.y);
  }
  return JSON.stringify(arr);
}
...
new go.Binding("points", "points", parsePoints).makeTwoWay(stringifyPoints)
...