contentType = 'application/octet-stream';
if ( type == 'png' ){
var png = vis.png();
var binary = fixBinary(atob(png));
blob = new Blob([binary], {type: 'image/png'});
}
else if ( type == "pdf" ) {
var pdf = vis.pdf();
blob = new Blob([window.atob(pdf)], {'type':contentType, });
}
else{
var FileContent = "";
if ( type == "svg" ){
FileContent = vis.svg();
}
else if ( type == "xgmml" ){
FileContent = vis.xgmml();
}
else if ( type == "sif" ){
FileContent = vis.sif();
}
else{
FileContent = vis.graphml();
}
blob = new Blob([FileContent], {'type':contentType, });
}
a.href = window.URL.createObjectURL(blob);
a.download = 'network.'+type;
a.click();
});
Marek Mutwil於 2014年11月29日星期六 UTC+8上午5時29分59秒寫道: