Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serializing SVG #29

Open
bstro opened this issue Nov 21, 2018 · 1 comment
Open

Serializing SVG #29

bstro opened this issue Nov 21, 2018 · 1 comment

Comments

@bstro
Copy link

bstro commented Nov 21, 2018

I'm looking for a way to serialize SVG. Related to elm/file#1

The app I’m using this for is pretty niche, so a lot of this might not make sense, but I’ll give it a go:

You can take a look at an early, in progress version at http://hexagra.ms/678978

Its an app for working with the ancient Chinese book of philosophy called the I Ching. The UI allows users to enter specific numbers that correlate with shapes that may be looked up in the book. I dynamically generate these shapes as SVG for display in the browser. However, I also want to allow users to download the SVG shapes to do whatever they’d like with (I use this feature myself for journaling purposes.) I currently use ports to accomplish this, but it’d be nice if I could keep everything in Elm by using elm/file's download function. The only missing piece of the puzzle appears to be the lack of ability to serialize SVG nodes.

This is admittedly a pretty niche use case, although it isn’t too much of a stretch to imagine someone building some sort of vector image editor/creator, and wanting to allow users to download the SVG content they’ve created in the browser, which is what I thought the example from the elm/file documentation was describing, at least until I looked harder at the type signatures.

@bstro bstro changed the title Serializing SVG? Serializing SVG Nov 21, 2018
@evancz
Copy link
Member

evancz commented Nov 21, 2018

Thank you for the excellent explanation! I cannot promise a feature like this will get added, but it is really helpful to have your story!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants