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

svg export from python #71

Closed
jotech opened this issue Nov 10, 2014 · 2 comments
Closed

svg export from python #71

jotech opened this issue Nov 10, 2014 · 2 comments

Comments

@jotech
Copy link

jotech commented Nov 10, 2014

Is it possible to export the map made by escher directly from python?
I mean something like this:

b = escher.Builder (...)
b.export_svg (...)

It would be usefull to integrate escher in other web apps.

@zakandrewking
Copy link
Owner

This isn't currently possible from Python or without a web browser in general. The Escher rendering all happens in the browser DOM, so the only way to run Escher from the command line would be to use 'headless' node.js, as described here. I haven't tried this, but we can put it on the development roadmap.

Alternatively, if the web app is running in a browser, you could generate an Escher map in a hidden div, and save the SVG file with a JavaScript function, like this:

var b = escher.Builder(map_data, null, embedded_css, { selection: d3.select('#my_hidden_div') };
b.map.save_svg();

@jotech
Copy link
Author

jotech commented Nov 11, 2014

This headless node.js sounds interesting!
I'm now using b.save_html() as a workaround.
The html file can be parsed and integrated well.

thank you @zakandrewking for your nice and usefull work and for helping!

@jotech jotech closed this as completed Nov 11, 2014
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