Visualisation URL to include table layout customisation
When saving (e.g. in browser favourites) or re-using a browser URL to a specific Data Explorer visualisation page, then currently mainly only the filter settings are included in the URL but not the table layout customization made by the user with the "customize" function of the DE.
Such table layout customisation should also be kept in the URL, so that when a link is saved or re-used then the reproduced table reapplies the customised table layout. Indeed, in case any dimension customisation cannot be applied anymore because the underlying web service data has changed (e.g. less observations), then the layout is adapted (using the same business rules as used for the default layout application).
The layout includes:
- disposition and order of dimensions on Rows sections, Rows and Columns
- Sorting of Time_Period values (asc/desc)
- If possible, it should also include the option for Labels=Name/Identifier/Both
Technical insights:
- flawless fallback for underlying components if layout is impossible (data has changed or user is not auth)
- check if request is ok if dataquery is impossible (selection, auth, data)
@dosse @j3an-baptiste should it be somewhere?)
tech overview (- browser url hydrate the store of the app at first load (router entry)
- components exclusively rely on selectors plugged on the store for their props
- each action (interactive or programmatic) is dispatched by the store to pass through middlewares
- a middleware (history) provides the ability for an action to update the browser url (using PUSH to avoid an app reload)
- add
pushHistory
prop to an action to impact the browser url - the payload prop of the action will be used as entries for the browser url query params
- the middleware rely on a method that can evolve browser url entries to prepare them (action payload props into query params)
- browser url entries are ghosted in the store to handle complex mechanism like contraints (avoid parsing/stringifying query string params)
- selectors rely on ghosted store location state to get browser url info
tech memo
-
changeHasAccessibility -
changeLocale -
changeDataflow -
resetDataflow -
changeFilter -
changeDataquery -
changeLastNObservations -
changeFrequencyPeriod -
deleteSpecialFilter -
deleteAllFilters -
applyDataAvailability -
resetSearch -
changeTerm -
changeFacet -
changeStart -
changeConstraints -
changeViewer -
table layout -
changeDisplay -
changeTimeDimensionOrders -
browser arrow nav -
DLM data availability true/false instead of on/off -
keep accessibility on reset
url overview
key | type | definition | exemple |
---|---|---|---|
locale | string | locale of the app | locale=fr |
facet | string | open box in side in search results | facet=qmsoRy4r |
term | string | search term | term=people |
start | integer | page index of the search | start=0 |
constraints | array | selected facets of the search | constraints[0]=SIS-CC-stable |
dataflow | object | dataflow identifiers | dataflow[datasourceId]=SIS-CC-stable&dataflow[dataflowId]=DF_AIR_EMISSIONS&dataflow[agencyId]=OECD&dataflow[version]=2.1 |
filter | string | open box in side in viz | filter=COU |
dataquery | string | sdmx dataquery | dataquery=.AUS+AUT.GP.A |
hasAccessibility | boolean | a11y mode of the app | hasAccessibility=false |
hasDataAvailability | boolean | sdmx data availability mode | hasDataAvailability=false |
viewer | string | type of viewer component used | viewer=table |
period | string | period of the sdmx data request | period=2017,2020 |
frequency | string | frequency of the app | frequency=Q |
layout | object | layout of the table in the vis page | layout[sections]=&layout[rows]=STO&layout[header]=TIME_PERIOD |
display | string | display mode of sdmx (label, code, both) | display=code |
time | object | order of time dimension(s) | time[TIME_PERIOD]=true |
notes:
- values (ie datasourceId%2Cstaging%3ASIS-CC-stable) are url encoded
usecases
- init of vis
- bug in subject: search for key, select Q as frequency then export in int trade of subject -> subject value is not selected anymore
- reset all filters should keep Q only and have the warning truncate
- start here, select NAMAIN_ALL - UoM 5 then go back to search results and reselect NAMAIN_ALL - UoM 5 -> period should not be undefined
- test of layout + display + time order
Edited by Nicolas Briemant