exploratoria / exploratoria.github.io

An online hommage to the Exploratorium
http://exploratoria.github.io
MIT License
5 stars 0 forks source link

Behavior of exhibts/mathematics/parametric-surfaces on refresh #4

Closed paulmasson closed 8 years ago

paulmasson commented 9 years ago

When this exhibit is refreshed, the current code loads a random parametric surface. This behavior is useful for first-time viewers to see what is available, but if a user edits the codes and refreshes with the "Update View" button then the current surface is replaced with another. Wouldn't it be better to have the exhibit keep current values of equation and texture on refreshes after the first load?

One way to achieve this is setting values in window.sessionStorage for equation and texture if the values don't currently exist. Is there a better way to achieve the desired behavior?

theo-armour commented 9 years ago

May use something like location.hash to inform care current state...

Session storage would be fun to do but elevated code to intermediate to advanced coder level.

theo-armour commented 9 years ago

The current particular parametric surfaces script is designed to be part of a series of scripts to enhance the viewing of equations. As such, it includes some techniques that new users might not feel comfortable with.

If we want people to be editing and creation equations then it might be better to have something much simpler.

Have a look at:

https://github.com/jaanga/algesurf/tree/gh-pages/parametric-equations/equation-files

Every equation is in its own simple file and folder. Being in its own file, each equation is much easier to edit.

All of these scripts should work well within the Code View Edit Script. It might be a lot easier for people to get going with individual scripts.