Static export

The current view, exactly as styled, leaves the page as a file. Zoom or pan first: the export is what you see, not a reset view. SVG stays vector and transparent; PNG rasterizes at 2× density against the page background, so a dark theme exports dark. The legend is HTML alongside the plot, so the export is the map itself.

The whole API

map.exportSVG({ filename: 'sales-by-country' })      // vector, transparent
await map.exportPNG({ scale: 2 })                    // raster, page background
const { imgURI } = await map.dataURI()               // embed instead of download
const markup = map.getSvgString()                    // the raw standalone SVG