-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
checkParams() should run on defaults once sequence is chosen #401
Comments
Hmmm, I am confused. Scope.vue creates a visualization by calling Specimen.fromQuery. That calls validate() on first the sequence and then the visualizer. And validate() in turn calls checkParameters(). So I don't see how a validation can ever get on the screen without going through checkParameters(). Can you provide an explicit recipe for something to go wrong and an explanation of what exactly goes wrong? I tried Differences with all defaults (wants 20 terms) on A371958 (only has 15 terms) and all seemed to go fine. Admittedly, Differences tolerates its parameter called "n" being larger than the number of entries in the sequence and just deals with it in draw(), so it doesn't seem like anything can really go "wrong" there, but maybe the issue you are identifying can cause real problems in another context? |
Ok, well, I noticed this while working on the
My essential observation is that it doesn't auto-correct to 16 upon loading the sequence, only upon trying to update that box. I'll try to look into this more when I have time. |
Will try to debug when I get the chance, but sounds like it could possibly be a missing refreshParams() call in one of the places the number of terms is being changed. Basically any time a visualizer changes a parameter itself it should immediately call refreshParams(). |
I am thinking this will be fixed by the fix for #403; we shall have to see after that lands. |
@katestange same comments as for #403. Thanks for looking into the current status of this. |
So we can play with this issue in Chaos, which has a field for the number of terms.
So the behaviour has changed in ui2, but is still kind of weird. In many overhauled visualizers, they'll just use as many terms as available by default, so it won't even be in the url -- like for FactorFence. In some, we may want to limit the number of terms artificially, in which case this issue may (?) return/remain. Which brings up the question of the best way to handle such a situation (Turtle Enhance might want to limit the number of terms below the full number available, for example). |
With the current handling of sequence bounds in ui2, none of these things are reproducible. Closing. |
The default values for visualizer parameters may not be valid in the context of a particular sequence. This could be checked by
checkParams()
, but it appears that right nowcheckParams()
is not run until the user touches the parameters. For example, if a turtle visualizer or a difference visualizer wants to use the first N terms by defalut, but the sequence at hand has fewer than N terms (there are some sequences with very few terms in the OEIS!), such a check may fail. If it isn't checked, an error is thrown later on in the code when we try to fetch too many terms.The text was updated successfully, but these errors were encountered: