-
Notifications
You must be signed in to change notification settings - Fork 915
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
use-resze-observer impl. #5166
base: master
Are you sure you want to change the base?
use-resze-observer impl. #5166
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been testing this locally and while the resizing seem to work now, it seems to have broken this code somehow:
electricitymaps-contrib/web/src/features/charts/graphUtils.ts
Lines 20 to 22 in d7250e9
const dx = event_.pageX | |
? event_.pageX - svgNode.getBoundingClientRect().left | |
: pointer(event_); // TODO: check if this works |
I'm not really sure why it broke and have not had the time to dig into it further but until that is fixed we can't merge this as it breaks hovering over (some of) the graphs.
201f487
to
ad5a6f7
Compare
✅ Deploy Preview for phenomenal-syrniki-c5ceaa ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
@15Arindam please do not use force push, it makes it impossible to review changes since the last commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell everything is working as expected now, nice work!
In order for this to pass the CI though you need to run pnpx prettier --write .
in the /web
folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be some inconsistencies with the initial values that need to be corrected and/or explained, this PR is currently not consistent all the way and these seems to be no real need to set an initial value in the first place.
@15Arindam I noticed you created a new PR but I would prefer we keep using this one to preserve the discussions and comments in the original PR. |
Hi @VIKTORVAV99 , The type value of width, height returned from |
handled negative cases
handled negative cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🎉
Thanks for implementing the change!
I'll merge this later today after #5183 is merged to see that the tests are still passing but they should be as I saw no changes that should have affected them.
@tonypls do you know why cypress is failing in here? As far as I can tell there is no direct changes that should affect the tests. |
It looks like the resize observer doesn't see the size of the container of the AreaGraph in cypress. The graph just keeps growing so Cypress in unable to hover |
web/cypress/e2e/countrypanel.spec.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tonypls would you mind reviwing the changes to the tests here?
I'm not super familiar with how cypress works 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn, looks like there's some sort of loop in the width observer.
Screen.Recording.2023-03-20.at.21.31.18.mov
changes have been made since the last review
Issue
Charts don't re-size when the window size changes #5141
Description
Implemented use-resize-observer hook for this scenario
Preview
Double check
poetry run test_parser "zone_key"
pnpx prettier --write .
andpoetry run format
to format my changes.closes: #5184