Skip to content
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

feat: multi-dim data pages #3657

Merged
merged 65 commits into from
Aug 21, 2024
Merged

feat: multi-dim data pages #3657

merged 65 commits into from
Aug 21, 2024

Conversation

marcelgerber
Copy link
Member

@marcelgerber marcelgerber commented May 28, 2024

Implements #3795.

Review notes

You can fully ignore the stuff in public/multi-dim. These are the 6 currently available MDD pages, with hardcoded slugs and configs. Go to /grapher/mdd-poverty, /grapher/mdd-causes-of-death etc. to access them. This folder makes up most of the 6000 lines of code added.

To enable baking locally, add FEATURE_FLAGS = MultiDimDataPage to your .env file.

Most stuff is going on in MultiDimDataPageContent, MultiDimDataPageBaker, and MultiDimDataPageSettingsPanel.

And, feel free to reach out if anything is unclear!

TODOs

  • Fix test failures

@owidbot
Copy link
Contributor

owidbot commented May 28, 2024

Quick links (staging server):

Site Admin Wizard

Login: ssh owid@staging-site-multi-dim-data-pages

SVG tester:

Number of differences (default views): 0 ✅
Number of differences (all views): 0 ✅

Edited: 2024-07-25 17:23:31 UTC
Execution time: 1.28 seconds

@marcelgerber marcelgerber force-pushed the multi-dim-data-pages branch from 661ebdd to f47861a Compare May 30, 2024 12:30
@marcelgerber marcelgerber force-pushed the multi-dim-data-pages branch 3 times, most recently from 6e96779 to df0572f Compare June 14, 2024 13:10
Copy link

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.

@github-actions github-actions bot added the stale label Jun 29, 2024
@github-actions github-actions bot closed this Jul 2, 2024
@marcelgerber marcelgerber reopened this Jul 2, 2024
@marcelgerber marcelgerber removed the stale label Jul 2, 2024
Copy link

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.

@github-actions github-actions bot added the stale label Jul 17, 2024
@marcelgerber marcelgerber force-pushed the multi-dim-data-pages branch from df0572f to 4fd99bb Compare July 17, 2024 15:56
@github-actions github-actions bot removed the stale label Jul 18, 2024
@marcelgerber marcelgerber force-pushed the multi-dim-data-pages branch 6 times, most recently from 8b77661 to f28470d Compare July 30, 2024 12:11
@marcelgerber marcelgerber force-pushed the multi-dim-data-pages branch 3 times, most recently from b693073 to c6cf2ca Compare August 9, 2024 12:13
@marcelgerber marcelgerber requested a review from danyx23 August 13, 2024 17:15
@marcelgerber marcelgerber marked this pull request as ready for review August 13, 2024 17:15
Copy link
Contributor

@danyx23 danyx23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice work! I had a few comments about moving some code and whether we should bake the default view into HTML.

I reviewed the react hooks code as far as I could but I am not familiar enough to be able to suggest improvements here - e.g. maybe there is an elegant way of implementing useMobxStateToReactState that does not mandate correctly wrapping the state getter in a useCallback, but I don't know about these things. Maybe it would be good if Ike could have a look over the hooks code specifically in this PR?

functions/grapher/[slug].ts Show resolved Hide resolved
site/multiDim/MultiDimDataPageTypes.ts Outdated Show resolved Hide resolved
site/multiDim/MultiDimDataPageTypes.ts Outdated Show resolved Hide resolved
site/multiDim/MultiDimDataPageConfig.ts Outdated Show resolved Hide resolved
}}
/>
<div id={OWID_DATAPAGE_CONTENT_ROOT_ID}>
{/* <DebugProvider debug={isPreviewing}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, wouldn't it be good to bake the default view into the HTML?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we should definitely bake something, yes.
I'm not sure about what will make for the best UX - if a load of things are displayed and then are switched out one second after, that's not great. Will have to think about this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've now added this to #3874.

site/multiDim/MultiDimDataPageContent.tsx Outdated Show resolved Hide resolved
@marcelgerber
Copy link
Member Author

-> This is now ready to be merged tomorrow; in this case with a squash merge!

@marcelgerber marcelgerber merged commit 4d0564c into master Aug 21, 2024
20 checks passed
@marcelgerber marcelgerber deleted the multi-dim-data-pages branch August 21, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants