-
-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grapher Settings Drawer Redesign #2591
Conversation
4ebec80
to
626e05d
Compare
c9c6eb9
to
2e87408
Compare
5cfd181
to
a919235
Compare
} = this.props.manager | ||
|
||
const [icon, label] = showSelectEntitiesButton | ||
? [faEye, `Select ${entityTypePlural}`] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, many charts don't specify the proper entityType
and entityTypePlural
. entityTypePlural
in particular is often not set since it's only used for some scatter plots, and entityType
is mainly used for faceting, so I wouldn't expect this to be set for charts that can't be faceted. We've discussed this in this thread in a different context. Back then I did a quick analysis and since we don't have many non-country charts, it's only around 120 charts that would need to be updated (maybe more, I don't remember what I checked specifically). Some of these charts could be updated in bulk (e.g. if "egg" is one of the entities, use "product" and "products", etc.) but others would need to be updated manually. I wanted to do that in this cycle but I didn't find the time. It's definitely something we should consider doing when overhauling the entity picker (currently, the heading is "Choose data to show"), but if it's useful for the controls as well, then we might as well do it now. If you do end up doing the data work, it would be nice to also update the heading in the entity picker modal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed that it's probably worth fixing at the data level since we'll be able to make use of the names again in the entity-selector UI.
Just to clarify though: when the config doesn't override the entity type names, they default to country or region
and countries or regions
, so there will always be a string for this, it will just be the wrong string until we update those un-customized, non-country charts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it would show the default (which for non-country entities is wrong).
// TODO: | ||
// grapher passes a SelectionArray instance but programmatically defined | ||
// managers treat `selection` as a string[] of entity names. do we need both? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why selection is sometimes treated as SelectionArray instance, sometimes as string[]. That's probably a question for @marcelgerber.
I've seen the makeSelectionArray in use, so you could use that here as well?
} | ||
|
||
.selected .FacetStrategyPreview-split-child { | ||
background: #d9eafb; | ||
@at-root { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know about @at-root
. Neat!
Hey! I hope it's okay I looked at the code today. I thought it would be good to do this before I'm off and tomorrow is a short day for me, so I worry that might not have the time tomorrow.. It's really neat to see the drawer in action and it makes me so happy that our controls and their look & feel get overhauled. It looks fantastic! These are my notes:
I think we need to do some more harmonising of our work on narrative charts. This piece of Archie syntax shouldn't show any controls:
And this one should show the
I'm not sure what's needed to make this happen but one piece to the puzzle is this method that should also account for controls. |
- detects when any of the enclosed controls are needed
- it now passes the relevant state on to SettingsMenu and allows it to decide which widgets to display
- and remove the one that was at the section-level
- increase contrast in bg color for Other row - drop Country entirely (the column head is enough) - offset the alternating row background by 1 to compensate
- once again trying to win a race against page-level styles, this time for key insights' `.slides .slide p`
This PR moves the collection of one-off controls that are contextually inserted above the chart into a pop-up dialog box which is summoned by a button in the upper right corner labeled Settings. On grapher and explorer pages, a
nav#grapher-settings-drawer
element has been added to the markup outside of the grapher instance. When present, the settings menu will use a portal to render its contents into this<nav>
(which slides in from the right edge of the viewport). If the<nav>
is not present, the menu is presented as a pop-up whose bounds are fit to the containing grapher instance.Tracking issue: #2486
Related issue: #1714