-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎉 (line+slope) add focus state / TAS-739 (#4272)
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
- Loading branch information
1 parent
f4a8e4c
commit 2c1bc83
Showing
35 changed files
with
1,010 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.