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
Adds the option to highlight lines in line and slope charts
### Summary
- Adds a new config field, `focusedSeriesNames` (suggestions for a different name welcome)
- A line is identified by its series name which is either an entity name, a column display name or a combination of both
- The list of focused series names is persisted to the URL as `focus` query param
- The entity name utility functions are used to parse and serialise focused series names, so that the same delimiter is used and entity names are mapped to their codes if possible
- This breaks if a column name contains `~` (the delimiter) which theoretically is possible but I don't think we need to worry about that now
- Focused lines have bold labels, non-focused lines are grayed out
- Grapher makes an effort to prevent the chart to enter a 'bad state' where all lines are grayed out because the focused line doesn't exist
- This includes removing all elements from the focus array when the facet strategy changes and dismissing focused entities when they're unselected
#### In the admin
- There is a new 'Data to highlight' section below the entity selection section
- If the chart is in a bad state because one of the focused series names is invalid, saving is disabled and shows an error message
### Follow up
- It's a bit ugly that `selectedEntityNames` and `focusedSeriesNames` are always serialised, even for an empty Grapher. I've fixes that in a [follow-up PR](#4294)
- The line legend method that drops labels if there are to many is a bit difficult to read. I'll open another PR with a refactor
0 commit comments