Commit 549430ab authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Keep zoom on svg export

parent 6ff2f351
...@@ -30,16 +30,12 @@ dgenies.result.export.export_png = function() { ...@@ -30,16 +30,12 @@ dgenies.result.export.export_png = function() {
dgenies.result.export.export_svg = function () { dgenies.result.export.export_svg = function () {
dgenies.show_loading("Building picture...", 180); dgenies.show_loading("Building picture...", 180);
window.setTimeout(() => { window.setTimeout(() => {
let transform = d3.boxplot.container.attr("transform"); let svg = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" " +
let after = function () { "\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">";
let svg = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" " + svg += dgenies.result.export.get_svg("1000px");
"\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">"; let blob = new Blob([svg], {type: "image/svg+xml"});
svg += dgenies.result.export.get_svg("1000px"); //d3.boxplot.zoom.restore_scale(transform);
let blob = new Blob([svg], {type: "image/svg+xml"}); dgenies.result.export.save_file(blob, "svg");
d3.boxplot.zoom.restore_scale(transform);
dgenies.result.export.save_file(blob, "svg");
};
d3.boxplot.zoom.reset_scale(true, after);
}, 0); }, 0);
}; };
......
This diff is collapsed.
...@@ -403,6 +403,7 @@ def install(): ...@@ -403,6 +403,7 @@ def install():
toc = Markup(md.toc) toc = Markup(md.toc)
return render_template("documentation.html", menu="install", content=content, toc=toc) return render_template("documentation.html", menu="install", content=content, toc=toc)
@app.route("/contact", methods=['GET']) @app.route("/contact", methods=['GET'])
def contact(): def contact():
return render_template("contact.html", menu="contact") return render_template("contact.html", menu="contact")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment