Skip to content
Snippets Groups Projects
Commit af6e0e23 authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Fix SVG for chromium

parent 43accb02
No related branches found
No related tags found
2 merge requests!2Ease the add of a new tool,!1Multitools
......@@ -4,8 +4,8 @@ if (!dgenies || !dgenies.result) {
dgenies.result.export = {};
dgenies.result.export.get_svg = function () {
return "<svg width='5000px' height='5000px' viewBox='0 0 100 100'>" + $("#draw-in").find(">svg").html() + "</svg>";
dgenies.result.export.get_svg = function (width="5000px") {
return `<svg version='1.1' xmlns='http://www.w3.org/2000/svg' width='${width}' height='${width}' viewBox='0 0 100 100'>${$("#draw-in").find(">svg").html()}</svg>`;
};
dgenies.result.export.save_file = function(blob, format) {
......@@ -34,7 +34,7 @@ dgenies.result.export.export_svg = function () {
let after = function () {
let svg = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" " +
"\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">";
svg += dgenies.result.export.get_svg();
svg += dgenies.result.export.get_svg("1000px");
let blob = new Blob([svg], {type: "image/svg+xml"});
d3.boxplot.zoom.restore_scale(transform);
dgenies.result.export.save_file(blob, "svg");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment