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

Export canvas as SVG? #87

Open
scruss opened this issue Aug 8, 2016 · 7 comments
Open

Export canvas as SVG? #87

scruss opened this issue Aug 8, 2016 · 7 comments

Comments

@scruss
Copy link

scruss commented Aug 8, 2016

SVG Crowbar doesn't seem able to export the canvas as SVG, so an export option would be welcome as an enhancement

@inexorabletash
Copy link
Owner

This would require rewriting the turtle graphics layer to render via SVG instead of Canvas (or maintain both code paths, and either always do both or have a flag, etc). Right now the history is not maintained (it's just pixels) so this would also incur memory overhead.

Big project; not impossible but not a high priority.

@scruss
Copy link
Author

scruss commented Aug 9, 2016

Unless you're explicitly rendering as a bitmap, SVG Crowbar can export a canvas as vectors. For some reason, though, it doesn't work on your site

@inexorabletash
Copy link
Owner

We're talking about http://nytimes.github.io/svg-crowbar/ ?

If so, I'm confused... how do you imagine that it's generating vectors? The source deals only with SVG elements. Do you have an example page where it is generating SVG from a canvas, or documentation about how that is expected to work?

(I could imagine that it hooks the canvas API entry points to record the drawing operations, but that's not what the tool does.)

@inexorabletash
Copy link
Owner

Closing due to lack of feedback.

@ethanpil
Copy link

ethanpil commented Nov 20, 2017

@inexorabletash I'm hoping to reopen this issue by suggesting incorporating this library?

https://github.com/gliffy/canvas2svg

@aleray
Copy link

aleray commented Feb 6, 2019

Hello,
I'm interested by the exact same feature. What do you think about @ethanpil proposal?
Thanks

@inexorabletash inexorabletash reopened this Feb 6, 2019
@inexorabletash
Copy link
Owner

Ah, sorry, missed or lost track of it.

I'd be willing to look at pull requests that pass existing tests. I think any such change is going to need to maintain the canvas as the primary display but record the command stream to produce an SVG. Ideally it would also cap the number of elements to preserve memory, and flush when the display was cleared.

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

No branches or pull requests

4 participants