Skip to content

Serializing SVG #29

@bstro

Description

@bstro

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions