<script>
$("#mapOptions{{prefix}}").click(function(){
    {%include resModule + ":chartOptions.dialog" %}
});
$("#downloadSVG{{prefix}}").click(function(){
    // debugger;
    var svg = $("#wrapperHTML{{prefix}} svg.mpld3-figure")[0].outerHTML;
    var URL = (window.webkitURL || window.URL);
    var url = URL.createObjectURL(new Blob([svg], {type : "image/svg+xml"}));
    var a = document.createElement('a');
    $("#wrapperHTML{{prefix}}")[0].appendChild(a);
    a.innerHTML = "graphic.svg";
    a.href = url;
    a.setAttribute("type", "hidden");
    a.download = "graphic.svg";
    a.click();
});
</script>
<button id="mapOptions{{prefix}}">Options</button>
{% if this.options.get('staticFigure') != 'true' %}
    <button id="downloadSVG{{prefix}}">Download SVG</button>
{% endif %}