jamievicary / globular

Globular
37 stars 9 forks source link

Feature: Download graphics #21

Closed jamievicary closed 8 years ago

jamievicary commented 8 years ago

Globular needs a way to output results for inclusion in a research paper. Ultimately, the best solution would probably be auto-generating TikZ code. For now, a PNG-based solution will have to do.

So, the specification for this feature is:

This will be accomplished technically by creating an off-screen div of the correct size, rendering the diagram into it, converting SVG to canvas, then exporting. I think this is relatively easy with HTML5.

In the longer term, it would be nice to have Globular automatically spit out a sequence of images, corresponding perhaps to all the values of the rightmost slice control for the current diagram view.

In the even longer term, it would be nice to export TikZ code rather than PNGs, so that the colours etc can be modified in the document with macro commands.

In the super long term, maybe you could just reference one of your private proofs in your latex code by giving a URL, and the compiler will automatically contact globular.science and update your graphics for you.

jamievicary commented 8 years ago

You can now download a PNG graphic of the current image by pressing 'g', or clicking the Graphic option in the right-hand toolbar.

It works by creating an off-screen canvas of the right size, copying the SVG data across, then triggering the PNG export.