Converts SVG+CSS charts built with front-end technologies like D3 into SVG/PNG Node buffers for server-side use.
npm install export-svg-chart --save
To get SVG and PNG exports of your chart, you need to point the library towards a page that takes care of rendering it. This can be a dynamic rendering with UI elements, or an "export/print"-specific page with another skin for the chart.
const fs = ;const exportSvgChart = ;const options =url: ''selector: '.chart';;
What it does
- saveSvgAsPng doesn't support inlining of font face definitions (yet).
- If the chart is styled with ancestor selectors that are outside of it, the selectors need to be re-mapped when they are inlined. This isn't supported within this library at the moment.