Limit the selectable filter values according to the current data availability and to the current selection
As a .Stat DE user
In order to never end up with an empty data table/chart
I want to know and be guided to selection combinations that always assure data availability.
Current behavior
Example of clickable filter without data:
https://de-qa.siscc.org/vis?lc=en&df[ds]=qa%3Astable&df[id]=DF_CPI&df[ag]=PT&df[vs]=1.0.0&av=true&pd=2015-Q1%2C2019-Q2&dq=.102674...Q
Scenario 1: Default state of filter values
Given that I'm using the DE visualisation page
When I have nothing selected myself (default view)
Then the values in all filters are updated automatically (enabled/disabled) according to the current data availability within the current default data selection: Filter values without data are disabled, and filter values with data are enabled.
Scenario 2: Selection change of filter values
Given that I'm using the DE visualisation page
When I have made a new selection in one of the filter (select or unselect)
And I navigated to (/open) another filter
Then the values in that other filter are updated automatically (enabled/disabled) according to the current data availability within the current data selection: Filter values without data are disabled, and filter values with data are enabled.
Notes:
The functional specifications are similar to data availability already implemented in search result facets.
Disabled filter values (items of the list without data) are kept visible in the hierarchical list, but change their state: The icon image colour (see #111 (closed)) and the filter value text colour change to light grey. The chosen light grey must be WCAG Level AA (minimum) compliant. Filter values in such state cannot be selected, but the user can navigate to the children.
-
The green number of available items per filters is not impacted by the data availability, and it should always returns the same total number of available nodes.
-
A parent can have no data but its children can have data. In this case, the parent appears in the list as a non-selectable item, but its "hierarchical arrow" is clickable.
-
A child with no data stays in the children list but is not selectable.
Example: at the root level, there is no data for the"Non-OECD Economies" but children list with data is available:
This dynamic data availability for a specific selection can be obtained from an SDMX API through the "available content constraint", which is fully specified here: https://github.com/sdmx-twg/sdmx-rest/blob/v1.5.0/v2_1/ws/rest/docs/4_6_1_other_queries.md, and was implemented in .Stat Core nsiws with dotstatsuite-core-sdmxri-nsi-ws#123 (closed).
note
"updated constraints" are different from content constraints received from the structure. They are different only in the way they are applied
- "updated constraints" do not let disappear values from a dimension, but only disable them.
- it is not possible to add "updated constraints" with the data request (two requests has to be done) !warning DE performance
- frequency and time period will be done in a new ticket (BE not ready)
- "updated constraints" are always applied. No matter the "data availability" is activated or not