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

Parameter editor chart does not properly handle infinite values #2051

Open
MaxGhenis opened this issue Sep 30, 2024 · 5 comments
Open

Parameter editor chart does not properly handle infinite values #2051

MaxGhenis opened this issue Sep 30, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@MaxGhenis
Copy link
Contributor

MaxGhenis commented Sep 30, 2024

See this:
image

https://policyengine.org/us/policy?focus=gov.irs.deductions.itemized.salt_and_real_estate.cap.JOINT&region=enhanced_us&timePeriod=2026&baseline=2&reform=56251

It's correctly specified as 10,000 from 2018 to 2025, inf otherwise: https://github.com/PolicyEngine/policyengine-us/blob/master/policyengine_us/parameters/gov/irs/deductions/itemized/salt_and_real_estate/cap.yaml

Should display a line in that range.

@anth-volk
Copy link
Collaborator

In terms of displaying, since we can't plot infinity on a chart, we could:

  • Assign an arbitrary, extremely high value to be a stand-in for JS's Infinity (could be, say, MAX_SAFE_INTEGER)
  • (If this is possible) Manually add a chart break at the top of the chart whenever infinity is present among the values and plot along our new arbitrary replacement

This would allow us to visualize without having to arbitrarily calculate some sort of stand-in that could be wrong, error-prone, or misleading.

Setting something to infinity, on the other hand, could be a bit more challenging.

@anth-volk
Copy link
Collaborator

Incredibly, react-plotly does not natively support axis breaks

@MaxGhenis
Copy link
Contributor Author

How to display infinity in the years it's that value is a separate issue from what I reported here. For now I think not displaying it is fine.

@anth-volk anth-volk changed the title Parameters with inf in history only show points for non-inf values Parameter editor chart does not properly handle infinite values Oct 17, 2024
@anth-volk
Copy link
Collaborator

Note that this is almost certainly driven by infinity itself not being displayed, hence impossible to draw a line to meet with a point at infinity

@MaxGhenis
Copy link
Contributor Author

MaxGhenis commented Oct 18, 2024

Yeah for now we can suggest including the last finite value in the year prior to infinity in the country package (PolicyEngine/policyengine-us#5252), but let's keep this open as it would be cleaner to do it in the front-end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

2 participants