Skip to content
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

Enable filtering for all available metadata #1743

Merged
merged 5 commits into from
Feb 4, 2024
Merged

Conversation

jameshadfield
Copy link
Member

See commit messages for more details, but here's the main change:

The sidebar filtering now surfaces all valid node-attrs defined across
the (terminal) nodes. URL queries (?f_${attrName}=value1,value2,...)
also work for all known attrs. Attributes which are known to be
continuous (via a colorings definition) are excluded, as the filtering
UI is not (yet) able to handle these; if a non-coloring continuous
attribute is set on the nodes then this will end up as a multitude of
numerical options in the sidebar.

As part of this implementation we have removed stateCountAttrs from
redux state and improved the validation of (filtering) URL queries.

The behaviour of filtering, and the restriction to collecting attributes
from terminal nodes only, is unchanged. See #1275 for more context.

Closes #1251

@nextstrain-bot nextstrain-bot temporarily deployed to auspice-james-search-al-xnd7bk January 30, 2024 20:28 Inactive
@nextstrain-bot nextstrain-bot temporarily deployed to auspice-james-search-al-xnd7bk January 30, 2024 20:40 Inactive
Copy link
Contributor

@joverlee521 joverlee521 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new filters work as expected in the test app! I tested filtering by accessions in the ncov and seasonal-flu builds.

+1 for removing a feature that has been broken for ~4 years 😅
I left some comments to change the order of the filter options, but overall looks good to me.

src/actions/recomputeReduxState.js Show resolved Hide resolved
src/components/controls/filter.js Outdated Show resolved Hide resolved
src/components/controls/filter.js Outdated Show resolved Hide resolved
This fixes a bug introduced in 8b1b9a2
(September 2019) where we moved the data structure from an Object to a
Map. The test summary appears at the top of the page, the download modal
and within a exported SVG.
This behaviour was restored by the previous commit but had been broken
for over 4 years. For early datasets, which used relatively few filters,
this text was mostly appropriate. For many of today's datasets it's
cumbersome, with phrases like "comprising 3 symptoms and 3 recencys".

The removal of `visibleStateCounts` should improve performance a little,
but we may wish to reinstate it in the future if we ever want to display
information about the number of visible tips per filter.
Deferring the value lookup will be slightly faster, especially for the
(common) terminal-nodes-only case. We have no use for counting invalid
values, so skip these.
The sidebar filtering now surfaces all valid node-attrs defined across
the (terminal) nodes. URL queries (`?f_${attrName}=value1,value2,...`)
also work for all known attrs. Attributes which are known to be
continuous (via a colorings definition) are excluded, as the filtering
UI is not (yet) able to handle these; if a non-coloring continuous
attribute is set on the nodes then this will end up as a multitude of
numerical options in the sidebar.

As part of this implementation we have removed `stateCountAttrs` from
redux state and improved the validation of (filtering) URL queries.

The behaviour of filtering, and the restriction to collecting attributes
from terminal nodes only, is unchanged. See #1275 for more context.

Closes #1251
@nextstrain-bot nextstrain-bot temporarily deployed to auspice-james-search-al-xnd7bk February 2, 2024 02:28 Inactive
@jameshadfield jameshadfield merged commit 62edb38 into master Feb 4, 2024
21 checks passed
@jameshadfield jameshadfield deleted the james/search-all branch February 4, 2024 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sidebar filtering options should include all node/branch attrs
3 participants