Maintenance - Mise à jour mensuelle Lundi 7 Décembre 2021 entre 7h00 et 9h00

Commit c8b4a4f6 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

export SVG presque ok

parent e330eaf3
...@@ -2013,6 +2013,10 @@ ...@@ -2013,6 +2013,10 @@
} }
} }
function addSVGText(text, x, y) {
return '<text fill="#000" stroke="none" font-family="Arial" font-size="8pt" font-style="normal" font-weight="normal" text-decoration="none" x="'+x+'" y="'+y+'" text-anchor="middle" dominant-baseline="alphabetic">'+text+'</text>';
}
function addExportModule(div, extraheight, type){ function addExportModule(div, extraheight, type){
$t = div; $t = div;
...@@ -2086,7 +2090,18 @@ ...@@ -2086,7 +2090,18 @@
$(this).css('border-color', "white"); $(this).css('border-color', "white");
}); });
select_form.hide(); select_form.hide();
var svgContent = "data:image/svg+xml;base64," + window.btoa(__context.getSerializedSvg(true)),
var $expDiv = $("<div></div>");
$expDiv.append(__context.getSerializedSvg(true));
$("[id^=resultC]").each(function(){
$expDiv.children("svg").children("g").append(addSVGText($(this).html(), $(this).css("left"), $(this).css("top")));
});
$("[id^=label]").each(function(){
$expDiv.children("svg").children("g").append(addSVGText($(this).html(), $(this).css("left"), $(this).css("top")));
});
var svgContent = "data:image/svg+xml;base64," + window.btoa($expDiv.html()),
encodedUri = encodeURI(svgContent); encodedUri = encodeURI(svgContent);
$('#data-export').attr("href", encodedUri); $('#data-export').attr("href", encodedUri);
$('#data-export').attr("download", "jVenn_chart.svg"); $('#data-export').attr("download", "jVenn_chart.svg");
......
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