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

Make you are here on household charts a point instead of line #652

Merged
merged 4 commits into from
Aug 6, 2023

Conversation

patrickhanl
Copy link
Contributor

@patrickhanl patrickhanl commented Aug 4, 2023

Fixes #611

πŸ€– Generated by Copilot at e7e3b65

Summary

πŸ§ͺπŸ“ŠπŸ› οΈ

This pull request enhances the BaselineAndReformChart component, which shows the impact of policy reforms on a household's income. It adds a baseline prop, switches to scatter traces, and updates the hover card. It also adds a test file for the component, which checks the toggle button.

BaselineAndReformChart shows us the fate
Of the households under different policies
We mock the api and the plotly trace
To test the toggle and the hover messages

Walkthrough

  • Add a new prop baselineValue to BaselineAndReformTogetherPlot component to show the baseline value on the chart (link)
  • Replace line traces with scatter traces for the current and baseline values of the variable in BaselineAndReformTogetherPlot component to improve the plot appearance and clarity (link)
  • Adjust the hover card message for the points on BaselineAndReformTogetherPlot component to indicate whether they belong to the reform or the baseline scenario (link)
  • Replace line trace with scatter trace for the change in the variable value in BaselineReformDeltaPlot component to improve the plot appearance and clarity (link)
  • Add a test file BaselineAndReformChart.test.js for the BaselineAndReformChart component, which checks the toggle button functionality using a mock metadata object and api functions (link)

Changed the baseline and reform comparison charts to have separate points for baseline and reform based on current variable value.

They appear in the legend by default so I left them in for now but can take out if not needed.

baseline-reform
delta

Also added test cases.

@MaxGhenis
Copy link
Contributor

Thank you @patrickhanl! The baseline and reform view looks perfect. On the difference plot, could you remove the line from the legend entry for the you are here series? Also could you show a screenshot of a scenario without a reform?

@patrickhanl
Copy link
Contributor Author

Thank you @patrickhanl! The baseline and reform view looks perfect. On the difference plot, could you remove the line from the legend entry for the you are here series? Also could you show a screenshot of a scenario without a reform?

@MaxGhenis , I wasn't sure if you wanted the baseline only updated since it doesn't have the issue of multiple lines, so that looks the same (see below). I can make that update pretty quickly if you want it updated as well. I'll push the legend update with that if so.

baseline-only

@MaxGhenis
Copy link
Contributor

yes please do it for baseline only as well

@MaxGhenis MaxGhenis linked an issue Aug 6, 2023 that may be closed by this pull request
@patrickhanl
Copy link
Contributor Author

@MaxGhenis please see screenshots below with hovercards for updated plots. Let me know if you see anything else that needs to be fixed. Not sure exactly why the CI check is failing? Looks like the request to the Node server is failing?

Baseline and Reform together plot
base-hover-reform

base-reform-hover

Baseline and Reform delta plot
diff-hover

Baseline only plot
baseline-only-hover

@MaxGhenis
Copy link
Contributor

Thanks @patrickhanl, all looks good here. Just looks like a nodejs.org issue holding back the CI: nodejs/nodejs.org#4495 (comment)

@MaxGhenis
Copy link
Contributor

The nodejs.org issue resolved itself, so merging. Thanks!

@MaxGhenis MaxGhenis merged commit fc04917 into PolicyEngine:master Aug 6, 2023
2 checks passed
@patrickhanl patrickhanl deleted the issue611 branch August 7, 2023 15:16
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.

"Your current net income" bug Make you are here on household charts a point instead of line
2 participants