You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On topic-specific country profile pages, charts use the default country selection instead of the specific country. For example, here charts should show the data for Spain.
Fixes#3931
The global entity selector manages the selection of a chart from outside by passing in its own `selection` object, which should take precedence over the config's `selectedEntityNames`.
In #3793, Grapher's `updateFromObject` method was updated to also change the current selection if `selectedEntityNames` is given. That's sensible (and is needed in the admin), but `updateFromObject` is also called in the constructor. If `selectedEntityNames` and `selection` both are given then `selectedEntityNames` always won, which broke the global entity selector (since it relies on `selection` being respected).
I think it's sensible to apply the passed-in selection only if it's non-empty, but this leads to funny behaviour of the global entity selector if the selection happens to be empty (e.g., http://staging-site-fix-global-entity-selector/energy/country/spain?country=). But, apparently, even before #3793, the global entity selector has behaved weirdly for empty selections (e.g., https://e7fd384b.owid.pages.dev/energy/country/spain?country=). It's not ideal, but I don't think it's too bad.
Description
On topic-specific country profile pages, charts use the default country selection instead of the specific country. For example, here charts should show the data for Spain.
It seems to work correctly for explorers.
Additional context
The text was updated successfully, but these errors were encountered: