-
-
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
fix(grapher): don't offer non-plottable entities for selection #2763
fix(grapher): don't offer non-plottable entities for selection #2763
Conversation
cd2a3c2
to
8845200
Compare
994659e
to
45d7e0f
Compare
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.
Nice work, overall I think this makes sense.
However, I'm thinking that the whole tableForSelection
concept is hindering us a bit, and it would be a bit more straightforward to just make availableEntities
an (optional) chart instance getter.
That way, any charts could run some code to tell grapher which entities they have available (potentially by running table transforms), and otherwise, they just default to this.inputTable.availableEntities
.
Overall, just getting rid of the tableForSelection
indirection in between. An OwidTable is not the best format to communicate available entities, I think...
mhh.. I mean for now we're only grabbing the available entities, but I imagine that Christian builds the new entity selector on top of a table – so we might be a little more flexible in the future if chart instances were allowed to customise that table (cc @samizdatco) |
packages/@ourworldindata/grapher/src/stackedCharts/AbstractStackedChart.tsx
Show resolved
Hide resolved
Ah, you're right about that of course. Good thinking! |
This PR has had no activity within the last two weeks. It is considered stale and will be closed in 3 days if no further activity is detected. |
c3db031
to
4fcd7e8
Compare
I didn't change much in terms of how the entity-selector populates its list of items: they're still coming from the grapher object's owid-grapher/packages/@ourworldindata/grapher/src/modal/EntitySelectorModal.tsx Lines 111 to 118 in dbe6f21
The rest of my changes can be found in https://github.com/owid/owid-grapher/commits/entity-selector-redesign |
Co-authored-by: Marcel Gerber <[email protected]>
4fcd7e8
to
3e99975
Compare
Problem
missingDataStrategy
was set tohide
Technical details
transformTableForSelection
transformTableForSelection
is responsible to exclude all entities that are not plottablegrapher.tableForSelection
callstransformTableForSelection
of the current chart instance (if defined)transformTableForSelection
has been implemented for a subset of chart types whose entity selector was sometimes buggy (see above)