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

Fix graph output by reverting to InputField #968

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

anth-volk
Copy link
Collaborator

@anth-volk anth-volk commented Dec 15, 2023

Fixes #952. Our implementation of antd's InputValue component uses an overly eager onChange handler, creating numerous household creation requests and get_household_under_policy requests that sometimes don't sequence properly. When the output pages receive a version of the household that's one or two requests behind, the relevant piece of data is often one or more orders of magnitude too low, creating the strange difference between the line (which runs off of a calculate request) and the dot (from get_household_under_policy, using a stale household).

I will continue working on this bug. If I can get the antd implementation to work properly, I will withdraw this PR and open a new one for that.

Note: There's also a weirdly large amount of linting by prettier, hence the weirdly high number of files edited.

🤖[deprecated] Generated by Copilot at 9579116

Summary

📝📊🐛

This pull request improves the formatting and readability of the code in various components that render charts, tables, and inputs for the policy engine app. It also updates the colab link for the US country to use the latest notebook version. The main change is to indent the nested ternary operators for consistency and clarity. The pull request affects the following files: VariableEditor.jsx, AverageImpactByDecile.jsx, AverageImpactByWealthDecile.jsx, BudgetaryImpact.jsx, CliffImpact.jsx, DeepPovertyImpact.jsx, DeepPovertyImpactByGender.jsx, InequalityImpact.jsx, PovertyImpact.jsx, PovertyImpactByGender.jsx, PovertyImpactByRace.jsx, RelativeImpactByDecile.jsx, RelativeImpactByWealthDecile.jsx, Header.jsx, Posts.jsx, Analysis.jsx, PolicyReproducibility.jsx, PolicyRightSidebar.jsx, PolicyEngineCountry.jsx, and PolicyEngine.jsx.

The pull request had many changes
To indent the nested ? : ranges
The code became clearer
The charts looked much neater
And the colab link had some exchanges

Walkthrough

@anth-volk anth-volk requested a review from MaxGhenis December 15, 2023 03:19
@anth-volk anth-volk marked this pull request as ready for review December 15, 2023 03:30
@anth-volk anth-volk changed the title Fix graph output by Fix graph output by reverting to InputField Dec 15, 2023
@anth-volk anth-volk force-pushed the fix/correct_graph_output branch from 9579116 to 56296ff Compare December 15, 2023 03:31
@anth-volk
Copy link
Collaborator Author

Force-pushed to remove over-eager linting

@MaxGhenis MaxGhenis merged commit f060134 into PolicyEngine:master Dec 15, 2023
2 checks passed
@anth-volk anth-volk deleted the fix/correct_graph_output branch December 15, 2023 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

"You are here" point on earnings chart isn't on the line
2 participants