Go JS Download Multiple Diagrams

We are creating Go JS diagram blob as below:
let d = myDiagram.documentBounds;
myBlob = myDiagram.makeImageData({ background: “white”, scale:1, returnType: “blob”, callback: createAllSectorsPlumbingBlobs, size: new go.Size(d.width, d.height), maxSize: new go.Size(999999999, 999999999) });

We have multiple diagrams and we are using navigation to display them < A B C D E F G H…>.
Requirement: I need to get blob array of all these diagrams.
Current Implementation: We are switching to each and every page in the navigantion and generating blob for that diagram.
What’s bad in Current Implementation: It is taking a lot of time to swich to each and every page in the navigation and getting it’s blob.

Expectation: I have separate node data array and link data array for all the pages in navigation.
How can we simply get blobs of all these pages without switching to each page?

I hope you realize that a raster image with your maximum size 999999999 * 999999999 will occupy approximately 3 999 999 992 000 000 000 bytes in memory. I don’t know of any machines that could produce such a large image.

Are you sure you have to produce a raster image? It might be much faster and smaller to render SVG by calling Diagram.makeSvg instead. You would just have to append the contents of the separate SVG renderings into a single SVG where each of the diagrams had an appropriate offset (horizontal or vertical or both).

1 Like