math3d-react
math3d-react copied to clipboard
Saving and/or exporting the code for a graphic
This is actually two different, but related, feature requests.
-
Is there a straightforward way to to add a save/load feature? The "share" feature does already allow users to link to a premade graphic. But "permanent" is a risky concept on the internet - a server might be rebooted, or the temp files could be cleared out. For users spending hours creating graphics for teaching, it would be great if there was a way to download the "code" for a graphic that could be saved/loaded if anything happened to the server.
-
Is there a simple way to export code for a graphic that could be embedded into the text of another website? One great use of math3d could be in writing OER (open educational resources) textbooks. But such a textbook should be able to generate its graphics internally without referring to an external website. Said another way, it would be great to be able to use math3d.org to easily create and then export graphics like the one at https://davidmathlogic.com/amit/sphericalcoordinates.html
Either way, thanks for creating such a great tool.
Re 1: I understand your waryness—no one wants to spend time creating stuff only to have it disappear. That said, please feel confident using "Share":
The visualizations are stored in a database, not temporary files. The database is backed up weekly, and backups are kept for 8 weeks. So, if there ever was a problem with the database, I'd have some time to fix it and not too much would be lost. (Of course any loss is bad.)
Adding an option to export some sort of textual representation of the visualizations, then re-import it, would not be easy. Moreover, it would make maintenance much harder... Right now, if there's a need to change how how data is represented internally, I can migrate the database schema and users never need to know about it. If users can export the internal representation, then there's backward compatibility issues.
Re 2 If I understand correctly, you're suggesting a sort of "stand-alone" export: create a visualization, then download an html file (with js/css included) that you can open locally. No support for re-import. That's an interesting idea—I have not thought about it before. Will think more on it.
Of course, if you just want to embed math3d in another webpage, there's always iframes. A bit clunky. To really use that well, we'd probably want to add some option on math3d urls to collapse the drawers, to give authors a bit more control.
Disclaimer: I've had less time to work on math3d since I moved from teaching math to software development as my full-time job. I am dedicated to keeping the site working and useful, but for now am prioritizing bug fixes and keeping dependencies up-to-date (which I need to work on).
Re 1 Thanks, this description of the file storage helps a lot.
Re 2 In principle, there might be a fairly straightforward was implement this. You might just be able to generate a .zip file containing the html file containing the graphic, and a copy of each stylesheet, javascript, .json, .js, (etc) file that is linked to by the html file. That way, a user could just upload the .zip file to their page, and they'd be hosting their graphic. Of course, there may issues with this (either technical or copyright/license related) that I'm not thinking of.
Either way, thanks for creating such a great tool.
When looking at you suggestion I found a kludge that might work. You can share the graph and on that link open source. I think you could copy the code from there and make a standalone local copy of your graph. I think but I haven't gotten round to doing that yet.
Something like this that references a local copy of mathbox, not the online bundle, so as not to rely on something that can go down. https://kaosarchives.hashbase.io/mods/interferencia23.html