about gojs, set the desiredSize property of part

99 Views Asked by At

The first step, I made a part and initialized the desiredSize to new go.Size(1000, 1000) and added it under the diagram object. There is no problem here;

The second step is to set the desiredSize property of part to new go.Size(NaN, NaN).

Two situations:

  1. Perform the first step, then the second step, part disappears.
  2. Perform the second step first, the part is infinite; then the first step, then the second step, the part disappears.

What I want to achieve is to set desiredSize to be infinitely large, and the size can be switched.

1

There are 1 best solutions below

0
On BEST ANSWER

Sorry, but GoJS does not support a width or a height of Infinity for any GraphObject.

Setting width or height to NaN, which is the default value for both properties, just allows the object to be naturally sized.