Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import mermaid from 'mermaid';
import * as svgPng from 'save-svg-as-png';
console.log( 'mermaid', mermaid.version() );
// TODO This is very ugly, but for now it renders. This SVG creation should be
// done in the build step.
let ss = document.getElementById( 'js-stage' );
let btn = document.getElementById( 'save-png-button' );
btn.addEventListener('click', function() {
let svgList = ss.getElementsByTagName('svg');
let options = {
scale: 2,
backgroundColor: '#ffffff',
};
if (svgList.length) {
svgPng.saveSvgAsPng(svgList[0], document.title+'.png', options);
}
});
/**
* Created by knut on 14-12-02.
*/
mermaid = require('mermaid')
console.log('Test page! mermaid version' + mermaid.version())