-
Notifications
You must be signed in to change notification settings - Fork 60
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
Allow users to configure filters and set them at runtime via a editable dialog #4393
Conversation
note: this was motivated originally by this issue (transcription factor track from UCSC called JASPAR) #2624 which is very feat dense and on the UCSC website, they only display features with score>400 by default. this PR allows us to recapitulate a similar behavior in jbrowse |
4f16921
to
95d9fe0
Compare
|
thanks for checking out. the textbox had readonly mistakenly from copying to another part of the codebase and the submit button is disabled and checks if empty and checks basic jexl syntax and reports an error if there is any e.g. syntax error now |
|
not sure what this means, you can edit the textbox?
good catch, i recommended this fix upstream to typos-cli also
onhover where? |
i see regarding clear filters. I will just allow it to submit now with an empty textbox then |
The problem with allowing to submit it with an empty textbox is it errors out because you are "submitting jexl to filter by" |
Could add a filter icon beside the track name and have the onhover show the filter applied ;; clicking on icon could open the modal? Hidden when no filters applied |
error with this fixed now
i think the design of the user interface for this is a little tricky. that is not a bad idea. there is also the concept of a "DispayBlurb" that displays in the lower left corner. I might say that this could go into a follow up PR. it would be valuable, but designing the right UI might take some extra work. I would also say the idea for fetching all the available fields could also be a follow up PR. it is a good idea, but it is a bit on the tricky side to implement and delive correctly. |
This allows users to configure a filter in their config.json as an array of jexl strings, or set an array of jexl filters
Fixes #1988
Screenshot showing the runtime dialog
The filters are stored on the LinearBasicDisplay model as a prop named jexlFilters, and the state model is used if no config filters are supplied (otherwise config filters are used, which is an empty array by default)
As the UI is currently designed, the user actually types out jexl: when they are hand-editing the UI. this is a small code simplification, but we could remove it and make it automatically prepend this string. Random note regarding that: i am somewhat just discouraged by the limitations of jexl, so we could consider looking at escape routes e.g. trying to create a javascript eval if security concerns can be addressed