reasons icon indicating copy to clipboard operation
reasons copied to clipboard

SVG export

Open eyssette opened this issue 3 years ago • 2 comments

Hi @davekinkead ! Do you think it's possible to include in your code a function to save the argument map as SVG (maybe with canvas2svg) ? Thanks again for your wonderful app!

eyssette avatar Nov 28 '21 10:11 eyssette

Canvas should automatically export to PNG in most browsers and in the hosted version, I made an embed script for interactive webpages ... <script async id="86d9086" src="http://reasons.io/maps/86d9086.js"></script> ... see https://reasons.io/learn/06

But SVG would be cool tool. Looking at canvas2svg, I think it would be best used as an additional, optional library to limit dependencies. Reasons could export a ctx context or something that could be consumed by the wrapper around canvas2svg.

Wanna send me a PR?

davekinkead avatar Nov 28 '21 10:11 davekinkead

I've added the function to save the map as PNG in my fork of your software, and also the possibility to create a custom URL that can be used with an iframe for interactive webpages, but yes SVG would be cool ! For example, with SVG you can hide a part of the map, and gradually reveal the rest.

eyssette avatar Nov 28 '21 11:11 eyssette