I am using GoJs with Vue.Js framework. I tried to download graph as image . But Graph is not downloading completely. I attached two screen shots I want to download graph (as shown in Expecteddownload.png) but graph is downloaded as shown in (Actutaldownaload.png)
I tried solution as mentioned in forum. but could not get success
downaloadImage(){
console.log('Downaload')
var d = this.myDiagram.documentBounds;
var fWidth = d.width;
var fHeight = d.height;
var blob = this.myDiagram.makeImageData({ background: "white", scale:.1, size: new go.Size(2000,2000), returnType: "blob", callback: this.myCallback });
}
What is the value of this.myDiagram.documentBounds? It might be that 0.1 times the width or height of the Diagram.documentBounds is greater than 2000. If so, you need to either decrease the scale or increase the maxSize property, as I suggested above.
What do you mean by “download graph as HTML page”?
That seems very unusual. Few people want to download an HTML file along with all of the files that it loads. Most people want to download a single file that is a rendering of the diagram.
As I saw your example … I noticed that on a button “Download the HTML and JS to use as a starting point” you implemented the functionality all graph is downloaded as html …
I see code for this functionality..
function goDownload() {
var sampleHTML = byId(“allSampleContent”); // or “sample” + “code”, but this contains both and more
var title = location.href.substring(location.href.lastIndexOf(‘/’)+1);
var sampleParent = byId(“sample”).parentElement;
sampleParent.removeChild(b1);
sampleParent.removeChild(b2);
var text = `
We have a requirement download graph and after loading when we click on any part of node that will hightlighted with parent and child nodes as showing in example…
We have requirement after loading … highlighting funcationlity will work as live
applicaiton. I attached screen shots.