Shape flickering if using 2-way binding along with function

I am using gojs pallet and diagram, while dropping objects into diagram I need to check its scale so the I can resize object as follows:

new go.Binding(“strokeWidth”, “”, function () {
return 1 / mydiagram.scale;
}).makeTwoWay(),
new go.Binding(“height”, “height”, function (s) {
return s / mydiagram.scale;
}).makeTwoWay(),
new go.Binding(“width”, “width”, function (s) {
return s / mydiagram.scale;
}).makeTwoWay(),

but when I am zooming to scale level 5 or above object is flickering on resize and working fine in I using 1-way binding. I need 2-binding with smooth resizing/reshaping because I am saving object for future use.

That’s an improper Binding, so you should be getting errors, which might be causing the problems that you see. Specify some property name as the second argument to the Binding constructor.

Since you specify the source property to be an empty string, how is the Binding supposed to save a modified “strokeWidth” value?

For “width” and “height”, you also need to provide back-converters so that the saved value can be converted again later to the original width or height value.

For “width” and “height”, you also need to provide back-converters so that the saved value can be converted again later to the original width or height value.

How do we do that?

Read GoJS Data Binding -- Northwoods Software and Binding | GoJS API