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

Add ability to have "canned" Formula sequences. #430

Open gwhitney opened 2 months ago

gwhitney commented 2 months ago

This will be much like the specific OEIS sequence cards in the switcher. We should have the ability to have cards in the sequence switcher that correspond to pre-filled Formulas, as well as a "New Formula" one for entering an arbitrary formula. When this is implemented, the Naturals sequence should be dropped altogether, and one of the canned formulas should be formula n producing the naturals.

Some questions that need to be nailed down:

  1. Should we automagically save the last couple of sequences used?
  2. Should the site visitor have the ability to add new canned formulas, maybe (re)name them, etc? Like the saved specimens, but just formulas?
  3. Are there other canned formulas we want there by default, other than the natural numbers?
gwhitney commented 3 weeks ago

Resolved on October 29 meeting:

The frontscope will keep a list of all sequences visited (since the last browser cache clear). The most recent N will be displayed visually in the sequence switcher (along with the mandatory "stock" ones, which I think should include a couple of OEIS and a couple of Formula and a Random). At the bottom of the switcher will be "History" dropdown, which will show all of the rest in a text-only format, but with hyperlinks to go back to them. There will still be a trashcan on the user ones, which will eliminate it from the visual list and relegate it only to the text History section.

Note that this feature will be uniform for all classes of Sequences. A Sequence is considered visited when (a) a new URL with it as the sequence specification is loaded, (b) a Specimen is saved with that Sequence, or (c) when it is the current sequence and a new URL is loaded with a different sequence. This eliminates saving all the little intermediate versions as you play with the parameters of a sequence or the details of a formula.

Remaining questions @katestange @Vectornaut:

  1. Any suggestions for the other "always there" Formula besides n (to show an example of how you can do something more complicated)? The Beatty sequence in Formula form??
  2. Should the start index/ end index/ length be considered part of the identity of the Sequence, so that you might have a couple of entries that are exactly the same sequence, just with different extents? Or should the start/end/length be stripped to avoid that redundancy? The latter would mean when you re-select a previous sequence from the history, it would go back to the default of the entire sequence. So if you had focused on a particular region of the sequence, say indices 8192 to 16383, that information would be lost. Is that an OK price to pay for avoiding cluttering up the history list with different sections of the VF numbers? I guess there is a third option: save the indices/length, but do not save additional new sequences in the history if they differ from one there only in the index information. Or a fourth option, which upon reflection is my favorite: Only one saved instance of a sequence, and the extents are saved, but if you would be saving another copy of the same sequence but with different extents, the saved extents are updated to the one you are now saving. That way you get all of the individual sequences you have visited, and for each you get the most recent index range you used it with.

Thanks for letting me know your thoughts.

katestange commented 3 weeks ago

I like the beatty sequence formula! in your bullet 1.

I like the fourth option in your bullet 2.

gwhitney commented 1 week ago

OK, I will be getting to this soon after the docsite overhaul lands, so @Vectornaut if you would like to weigh in befoer then please do, or if either of you think this should wait until after our next in-person meeting please add the "meeting" label back. Otherwise the beatty sequence formula will become the other canned sequence and I will go with the "fourth option" on sequence identity, which is that the extents of a sequence are not considered part of sequence's identity, but the most recent ones used are saved.