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

Sidebar filtering options should include all node/branch attrs #1251

Closed
jameshadfield opened this issue Dec 20, 2020 · 2 comments · Fixed by #1743
Closed

Sidebar filtering options should include all node/branch attrs #1251

jameshadfield opened this issue Dec 20, 2020 · 2 comments · Fixed by #1743
Assignees
Labels
enhancement New feature or request

Comments

@jameshadfield
Copy link
Member

The original intent of the sidebar filtering was to allow filtering by all traits which are defined via metadata.filters as well as those defined via metadata.colorings. The latter has not yet been implemented.

Note that the filters which appear in the footer of Auspice should still only reflect those defined in metadata.filters.

@joverlee521
Copy link
Contributor

joverlee521 commented Jan 8, 2024

With the work to export metadata fields without defining them as coloring options (nextstrain/augur#1384), we should extend filtering options to include all available metadata fields.

EDIT: Relevant section of the code also include TODO comment to include all traits

if (metadata.filters) {
/* the `meta -> filters` JSON spec should define which filters are displayed in the footer.
Note that this UI may change, and if so then we can change this state name. */
state.filtersInFooter = [...metadata.filters];
/* TODO - these will be searchable => all available traits should be added and this block shifted up */
metadata.filters.forEach((v) => {
state.filters[v] = [];
});

@jameshadfield
Copy link
Member Author

jameshadfield commented Jan 8, 2024

I think this issue comment was written simultaneously with Jover's comment above.

I think this issue should be extended a bit (but I'm including here as it'll almost certainly be simpler to do it in a single push).

I think all node and branch attrs defined across a tree should be searchable via the dropdown sidebar. That is, the meta.filters array should no longer be used for the sidebar. For the filters listed in the footer we don't want this behaviour, and we could keep the meta.filters array to suit this purpose (as it currently does).

@joverlee521 joverlee521 changed the title Filtering options should include colorings Sidebar filtering options should include all node/branch attrs Jan 8, 2024
@jameshadfield jameshadfield self-assigned this Jan 29, 2024
jameshadfield added a commit that referenced this issue Jan 30, 2024
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
jameshadfield added a commit that referenced this issue Jan 30, 2024
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
jameshadfield added a commit that referenced this issue Feb 2, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants