makeImage with scale 1 not working for Circular and Heirarchical Layout

Hi,

I have a digram with around 100 nodes and I have used circular layout.
But when we try to makeImage with scale:1, the png downloaded does not include all the nodes. I see only partial diagram in the downloaded image.

Here’s what I am using:

var goJsDiagram = this.mapPanel.goJsDiagram;
        var imgData = goJsDiagram.makeImage({scale:1});
        var download = document.createElement('a');
        download.href = imgData.src;
        download.download = 'map.png';
        download.click();

Please let me know if I m missing anything.
Thanks in advance.

What is the value of your diagram’s documentBounds? What are the width and height of the image that you get?

Walter, your doubt seem to be correct. My Document boundaries are [3093,3014]. But the downloaded image has 2000px and 2000px max.

How can I tackle this?

I just figured there is maxSize: go.Size(Infinity, Infinity) property. Let me try using it.

Diagram.makeImage(data): Diagram width or height is larger than the default max size. (2286x2446 vs 2000x2000) Consider increasing the max size.

I am getting this warning when not using maxSize.

So, I thought I will use this :
var imgData = goJsDiagram.makeImage({scale:1,maxSize: go.Size(Infinity, Infinity)});

This also didnt work.

The reason for the maxSize option is to protect apps running in a limited memory environment (such as phones) from accidentally crashing due to running out of memory. (Not that it couldn’t happen in other manners.)

We don’t allow Infinity for the maxSize width or height, just to force you to think about what values really would be appropriate. Think of memory usage!

Ok,

I tried to change the maxSize to 4000, 4000. This also doesnt seem to work.
I am still getting the warning saying maxSize is 2000,2000.
[Diagram.makeImage(data): Diagram width or height is larger than the default max size. (2286x2446 vs 2000x2000) Consider increasing the max size.]

Not sure, what I am missing. I am using this

var imgData = goJsDiagram.makeImage({
							scale:1,
							maxSize: go.Size(4000, 4000)
						});
						var download = document.createElement('a');
						download.href = imgData.src;
						download.download = `map_${Date.now()}.png`;
						download.click();

Sorry my bad.
I was missing the ‘new’ keyword.