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

Add hovertemplate for all plots #673

Merged
merged 13 commits into from
Oct 12, 2023

Conversation

jacky5124
Copy link
Collaborator

@jacky5124 jacky5124 commented Aug 9, 2023

Fixes #634 , fixes #603

For household output plots, the hover messages are simple such that they are in "if x then y" format, so hovertemplate for such plots is just a template.

But for policy reform plots, the hover messages are dynamic such that the entire messages can change depending on the x and/or the y value, so a simple template no longer works for such plots, and customdata is required to pre-compute the messages, which will be available in hovertemplate as a variable like x and y.

Added a prop useHoverCard to every plot component so that switching between Plotly's hovertemplate and the custom HoverCard is as easy as passing a boolean value to the component.

household

policy

🤖 Generated by Copilot at 0f05690

Summary

No summary available (Limit exceeded: required to process 64082 tokens, but only 50000 are allowed per call)

Walkthrough

No walkthrough available (Limit exceeded: required to process 64082 tokens, but only 50000 are allowed per call)

@jacky5124 jacky5124 reopened this Aug 14, 2023
@jacky5124
Copy link
Collaborator Author

Apology for closing this pull request for a while. The entire code base was linted few days ago and it had conflict with the original commits in this PR, but I accidentally rebased this PR's branch instead of merging with master branch, which caused parallel changes on master branch being recognized as my changes and messed up things. Now the changes can be properly merged with master branch.

Copy link
Contributor

@nikhilwoodruff nikhilwoodruff left a comment

Choose a reason for hiding this comment

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

Amazing- apologies for the lateness and a belated thanks!

@nikhilwoodruff nikhilwoodruff merged commit 0a6b6e1 into PolicyEngine:master Oct 12, 2023
4 checks passed
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.

Write hovertemplate for Plotly plots to serve as backup Move back to hovertemplate in Plotly charts
2 participants