src/charts/helpers/export.js
function convertSvgToHtml (d3svg, title) {
        if (!d3svg) {
            return;
        }

        d3svg.attr('version', 1.1)
            .attr('xmlns', 'http://www.w3.org/2000/svg');
        let serializer = serializeWithStyles.initializeSerializer();
        let html = serializer(d3svg.node());

        html = formatHtmlByBrowser(html);
        html = prependTitle.call(this, html, title, parseInt(d3svg.attr('width'), 10));
        html = addBackground(html);

        return html;
    }
function convertSvgToHtml (d3svg, title) {
        if (!d3svg) {
            return;
        }

        d3svg.attr('version', 1.1)
            .attr('xmlns', 'http://www.w3.org/2000/svg');
        let serializer = serializeWithStyles.initializeSerializer();
        let html = serializer(d3svg.node());

        html = formatHtmlByBrowser(html);
        html = prependTitle.call(this, html, title, parseInt(d3svg.attr('width'), 10));
        html = addBackground(html);

        return html;
    }
function convertSvgToHtml ( d3svg , title ) { if ( ! d3svg ) { return ; } d3svg . attr ( 'version' , 1.1 ) . attr ( 'xmlns' , 'http://www.w3.org/2000/svg' ) ; let serializer = serializeWithStyles . initializeSerializer ( ) ; let html = serializer ( d3svg . node ( ) ) ; html = formatHtmlByBrowser ( html ) ; html = prependTitle . call ( this , html , title , parseInt ( d3svg . attr ( 'width' ) , 10 ) ) ; html = addBackground ( html ) ; return html ; }
Takes the D3 SVG element, adds proper SVG tags, adds inline styles
from stylesheets, adds white background and returns string
@param  {SVGElement} d3svg   TYPE d3 svg element
@return {String}             String of passed d3
Takes the D3 SVG element adds proper SVG tags adds inline styles from stylesheets adds white background and returns string