Hi, I use points in my link template, I set
reshapable: true,
and use
new go.Binding('points').makeTwoWay(),
but in model i have not array of Points, i have such object
Hi, I use points in my link template, I set
reshapable: true,
and use
new go.Binding('points').makeTwoWay(),
but in model i have not array of Points, i have such object
The type of the Link.points property is List. So the data property will also be that type.
However the Model.toJson method will automatically render a property with that name and that type of value into an Array of numbers.
I use redux and store dont has same method. Are their any resolves to convert object to Array of Points during updating store?
If you want an Array of Points, you can just call List.toArray.
But I do not think you want an Array of Points. An Array of numbers is more efficient. And in some apps, it is advantageous to round those numbers so that the text is shorter, because full precision is not needed.
Okey, Array of numbers is more efficient. Are there resolve to convert Object points or array of points to array of numbers, no using Model.toJson? I want convert only points field
No, but it’s so easy to write, and you might want to customize it for your app anyway.