-
Notifications
You must be signed in to change notification settings - Fork 110
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
395 Control date filters via text input #411
395 Control date filters via text input #411
Conversation
… JS Dates. Create a slider element for filtering dates. The slider element sets the state to a new minimum and maximum date, with dates given as JS Date objects.
filter components.
Looking over #395 again, I've noticed that the last few commits neglect some implementation details. I hadn't given the issue a second look before making the commits, and can make the changes this weekend if you'd prefer.
Edit I've also forgot to set the 'cursor' CSS of the toggle switch to 'pointer'. |
@ptgott Sorry it took me a couple days to get to this. Looks like good progress and getting close. I agree, though, that we should go ahead and make the changes you note. You should not use the dataChoices object for any user interactions - we should put everything that can be changed by the user onto the State object. a) this makes it cleaner to separate configuration from user changes and b) we'll definitely need this for #387 - URL State Encoding. The 'min' and 'max' values in dataChoices were originally used to determine the outer bounds of the sliders. As it appears you've done for the date slider this should actually be set by checking the data itself to find the min and max values. Note that the continuous number sliders have not yet implemented this functionality and still use dataChoices.max and dataChoices.min for their slider configuration. The best place to put this is on the state object with they keyword Currently the filter pillboxes are not working in this branch - clearing the filter doesn't clear the pillbox, and clicking the x on the pillbox doesn't reset the filter. That fix may be part of the setState issue. Final couple issues you note should be easy -submit button, null value text, and pointer cursor in css. Thanks Paul! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment. We should make the 'dataChoices' object immutable, and store everything in the State object so that we can recreate it from the URL when needed and so triggering pillboxes and such works correctly.
…min and max values for continuous filter inputs from dataCollection.filterData where available, and from dataChoices as a provisional measure in case this is not available. The date filter control stores the min and max values of newly formatted dates as local variables, not in dataChoices.
@NealHumphrey I've opted to use a separate key within the state object to store the values of nullsShown, rather than make nullsShown a third element within a given state array, as there are a number of moments throughout the code that assume that an empty filterValues state array indicates a cleared filter. |
Great, thanks @ptgott! I'll wait to get the cosmetic stuff before doing a final review/merge, let me know when that's ready. |
…' and 'max' filter control text inputs into the same constructor. Format the date and continuous filter control components.
@NealHumphrey The newly formatted date/continuous filter controls should be ready now! |
@ptgott this is great! It's almost ready, there's just a couple things I'd still like to adjust before it gets merged in.
|
Also - do merge in the current dev branch to resolve your merge conflicts so it's ready to get into dev |
…ndividually with pillboxes. Clear multiple 'nulls shown' filter values with the Clear All button.
@ptgott it looks like you've checked off all the checklist - is there anything left that you were planning to do on this? All the changes look good. I did find a little bit of UI bug, though, related to the syncing of the UI and the actual filter state. I made a separate ticket for it. #442 Let me know if there's anything else you expect still needs changing. I think that I will probably merge this in as-is, and let you/someone pick up the issue #442 in a separate PR so that we can use this new ui in a few integration related tasks. |
@NealHumphrey Thanks for taking a look at this! |
Addresses #395.
This subsumes #385