numberscope / frontscope

Numberscope's front end and user interface: responsible for specifying sequences and defining and displaying visualizers
MIT License
7 stars 15 forks source link

Better control of (re)-randomization #461

Open gwhitney opened 1 month ago

gwhitney commented 1 month ago

Currently, you can set the random seed of a visualization by adding a randomSeed=foo (or whatever in place of foo) parameter to the query part of a Numberscope URL. That produces precisely deterministic results. However, there are some idiosyncrasies of its behavior. For example, if you delete some other parameter value of the visualization and restore it with its same value, it re-runs from the beginning with the same seed (actually it is using cached values) even though the randomSeed parameter no longer appears in the URL; whereas if you change the parameter value and change it back to its initial value, it re-runs with different random numbers. This all seems inconsistent.

In particular, Kate would like a way to force re-randomization of the visualization without changing any of the parameters, even if a seed was initially specified. And then a way to capture and reproduce the current randomization.

One possibility would be to make the random seed a parameter of the visualization and always include it in the URL when it is set. There are two (somewhat connected) issues relating to that:

  1. It's basically a shared global parameter, not specifically attached to either a specific visualizer or sequence. So where would it "live" in the user interface (UI)?
  2. It's sort of an "advanced" point, so how can we avoid it "cluttering up" the UI, while still remaining discoverable/available for those who would like control over the random numbers?

I suppose one possibility would be to have a separate seed for each Sequence and/or Visualizer that uses randomness, so such seeds would just be parameters of their respective Sequence and/or Visualizer object, and then typically hide them behind a "more" or "advanced" checkbox in the parameter editor for those items.