You should be able to set (either directly or via a Binding) the Link.points property to that Array. Link | GoJS API
So you don’t need to call Array.flatMap.
I don’t understand the title for this topic: “Binding error: undefined target property: size”. What does “size” have to do with this?
That warning about a change happening outside of a transaction just tells you that something is being changed between transactions and will be included in the next transaction. I don’t know what you are doing when you get that warning, but maybe you are setting some link routes without conducting a transaction.
Sorry for the title, I have copied the wrong line … I have changed the title.
Ok so it’s juste a transaction error. I was thinking that as long the old / new are differently written, something was wrong
Have you an example on how to do it in a transaction ?
I get Link.points from a db call
On init of the diagram I pass the data and bind them
If the diagram needs to pass in the auto layout then the schema.layout is assigned
After if the user wants to run it by hand he can, and it runs the same code
OK, so you have a data Binding of the Link.points property that looks like: new go.Binding("points"), and your model includes Arrays of x,y data.
That should not cause those warnings. Perhaps you are receiving the points data asynchronously? Remember that all changes should be made during a single transaction.
No because the actual thing is that we have metadata from the template stored in database (sometime)
In this case the user might want to re-run the layout
But changing template(s) will automatically cause a layout to happen. Again, in your case.
Do your new templates show Pictures that do not have a desiredSize (width and height) set to real numbers, so that nodes change size? I’m wondering if the asynchronous loading of images might cause those recomputation of link routes.
Can you specify their width and height? Basically fixing their size ahead of time. It’s the same problem with the loading of images in HTML – the recommendation is to set the width and height to avoid frequent page layouts.