-
Notifications
You must be signed in to change notification settings - Fork 666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing text and lines in a gif generated from svg #88
Comments
"Forbidden If you want control over how the SVG is rendered you could draw the SVG to a canvas yourself, and then pass the canvas to gif.js, and you could append the canvas to the DOM for debugging; the point being that it's not necessarily a gif.js problem; as far as gif.js is concerned it's just an image (or, if it's an |
Thank you for you patience, moreover i do not know why you could not see the sample page I made. The svg is genereted with d3.js library. Below the graph there is a button to export the data with the following code: function esportaGif() {
function saveData (data,fileName) {
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
var url = window.URL.createObjectURL(data);
a.href = url;
a.download = fileName;
a.click();
window.URL.revokeObjectURL(url);
};
var html = $("#grafico")[0];
var serialized = new XMLSerializer().serializeToString(html);
var svg = new Blob([serialized], {type: "image/svg+xml"});
var url = URL.createObjectURL(svg);
var gif = new GIF({
workers: 20,
quality: 1,
repeat:0,
debug: true,
background: '#fff',
transparent: 'rgba(0,0,0,0)',
dither: "FloydSteinberg-serpentine",
workerScript : "../ext/bower_components/gif.js/dist/gif.worker.js"
});
var img = new Image();
img.onload = function(){
gif.addFrame(img);
gif.on('finished',function(blob) {
saveData(blob, "grafico.gif");
});
gif.render();
};
img.src = url;
} |
I tried to put all on jsfiddle.net |
Ah, it was because I tried to switch to Looks like you're running into the same problem as #82 and #64, and which there's a pull request trying to fix #77 (described as hacky) If you're just trying to export a static image, you probably don't need to use gif.js; you can use |
Thank you, |
Missing text and lines in a gif generated from svg.
This is a sample page address.
https://45.76.94.162/pre-gea/test.html
If you click on "Esporta immagine" button the generated image is without line and text.
Thanks in advance
The text was updated successfully, but these errors were encountered: