Question: How to export piet-svg as File/dataUrl via the browser?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
Hello. Sorry if this is not the right place to ask for that, but I am currently using piet-web to draw on a canvas. I draw some elements I would like to export as PNG and SVG. I started with piet-svg but when you do:
`context.write(anybuff).unwrap();` we don't have access to the buffer anymore, right?
I suppose it would be nice to have some kind of callback which returns the SVG string or something to be able to have it as dataurl to force the download via the browser.
For a more real example, the app is currently deployed on https://beta.eukolia.design
For instance, if you select a smiley, I would like to be able to download it as SVG.
Thanks a lot for the help.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the piet-svg and piet-web APIs around context.write(anybuff), especially how the buffer is consumed. Determine whether the existing API can expose the generated SVG string or a data URL for browser downloads, and define the expected behavior using the smiley export example as the completion case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100