getDiagramBounds() returns different values when browser is resized/maximized/restored etc.

Hi Syncfusion team,

I'm using the latest version of the diagram component (19.4.48) in my app.

I'm observing that the getDiagramBounds() API returns different values when the browser is resized/maximized/restored etc (even though the diagram itself has not changed).

Stackblitz demo: https://stackblitz.com/edit/angular-zfkdz6-rurytc?file=app.component.ts

Please see attached video recording for full details.

Please let me know if any additional details are needed from my end.

Thanks,

-Mithun

PS: This issue can be reproduced even on older version of the diagram component (e.g. 19.3.55).




Attachment: video1245261251_9406204.zip


4 Replies

AM Arunkumar Manoharan Syncfusion Team February 7, 2022 11:31 AM UTC

Hi Mithun,


On further analysis, we found that you have set diagram width in percentage. So, the diagram will be updated based on the diagram parent width. The diagram bounds width is updated based on the browser resize. If you need a fixed width, then please set a diagram width in pixel. We have created a sample in which we have set the diagram width in pixel and now you will get the fixed diagram bounds width.



Sample Link: https://stackblitz.com/edit/angular-zfkdz6-hffq1z?file=app.component.html


Regards,
Arun Kumar.



MI Mithun February 11, 2022 07:29 AM UTC

Hi Arun,

Thanks for the detailed reply.

Looks like the diagramComponent's scroller.getPageBounds() method actually gives me exactly what I was looking for (i.e. the dimensions of the printable pages).

Any chance this method can be converted to a public API method (it is currently marked as "private" but is callable)?


Thanks,

-Mithun





AM Arunkumar Manoharan Syncfusion Team February 14, 2022 01:22 PM UTC

Hi Mithun,


We are validating your requirement and provide you with more details within two business days.


Regards,

Arun Kumar.



AM Arunkumar Manoharan Syncfusion Team February 18, 2022 04:36 PM UTC

Hi Mithun,


We have provided the getbounds() method in the sample itself. Kindly use this method to get the bounds values. For more info, please refer to the below sample link.

Sample link: https://stackblitz.com/edit/angular-zfkdz6-t2uto6?file=app.component.ts


Regards,

Arun Kumar.


Loader.
Up arrow icon