Table layout variations relative to user's actions
Context
The default layout when the table view is first displayed should be as follow (also from the feature https://oecd.aha.io/features/ONEDATA-44):
- Independently from default layouts defined by annotations, first all dimensions with exactly one item (selected or returned) are not shown inside the table grid but in the table grid sub-title. Only those dimensions can be hidden through the "NOT_DISPLAYED" annotation.
- Second, the default table layout defined by annotations ("LAYOUT_ROW" or "LAYOUT_COLUMN" or "LAYOUT_ROW_SECTION") should be applied to the remaining dimensions.
- Third, if there is no Column dimension yet, then the first dimension without a layout annotation (but not more items than would fit on the screen without horizontal scrolling) is moved to the Column axis (if possible then Time_Period dimension, but not the Ref_Area dimension).
- Fourth, if there is no Row dimension yet, then the last dimension without a layout annotation (if possible then Ref_Area dimension, but not the Time_Period dimension) is moved to the Rows axis.
- Fifth, all other dimensions +without a layout annotation+ are moved to the Row Section axis.
Acceptance Criteria
When the user changes the selection, it impacts simply if a dimension has more than 1 item or exactly one, and so if it is in the table view or in the table sub-title. The following rules apply when the user makes filter selection changes:
- The current layout position of the any dimension for which the number of available items (selected or returned) has not changed (between one and many), should not be modified.
- When the numbers of available items (selected or returned) changes from many to one, then the corresponding dimension moves from wherever it is in the table grid into the table sub-title.
- When the numbers of available items (selected or returned) changes from one to many, then the corresponding dimension moves from the table sub-title into the table grid. The above default rules should re-apply:
- If technically possible, move it back into its last previous table axis.
- Otherwise, if possible, then move it to the axis defined by the layout annotation of the dimension.
- Otherwise, if it is not the Time_Period dimension and if there is currently no ROW dimension, move into the Row axis.
- Otherwise, if it is not the Ref_Area dimension and if there is currently no COLUMN dimension, move into the Column axis.
- Otherwise move it into the Row Section axis.
Use case to apply with the above rules
- Browse for 'Dropout rate' dataflow https://dotstatcor-dev2.main.oecd.org/PMPMDataExplorer/#/vis?locale=en&endpointId=PM&agencyId=MA_545&code=DF_DROPOUT_RT&version=1.0&viewerId=table&data=......&startPeriod=2008&endPeriod=2018
- From the default layout: move 'Indicator' and 'Sex' from 'Sections' to 'Rows'.
- Select 'Cambodia' in 'reference area'.
- 'Reference area' moves from the table to the header, BUT 'Indicator' and 'Sex' MUST STAY in 'Rows' AND NOT go back to 'Sections'.
Technical consideration
- Part of the solution could be to embed the layout in the URL, all of part of it, meaning what dimension in what axis with or without the position, e.g. http://...&rows=time_period&header=section_1+section_2§ions=row_1/