-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Plots.resize returns a Promise #253
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
Conversation
As the resize operation will modify the size of the plot only after a timeout, if you call resize and then immediately do something based on the current plot size, you'll get the "old" size. This fixes it.
Thanks for the PR. Nice find! 🍻 A few things will need to happen before we merge this in:
|
Heh! I'm so new to this (I mean git, not Javascript or developing in general). I didn't notice the style guides, and unfortunately I created the pull request just before leaving the office. I'll edit the code to make it compliant to the style guide and submit a new pull request. Is it OK? |
You can simply push new commits to your |
Done. One last question: I have installed eslint in my editor (VS Code) and it correctly picks up plotly's .eslintrc. However, it complains about "Promise" not being defined (see: http://eslint.org/docs/rules/no-undef). |
You must be running version 2.0.x of eslint through your editor. Looks like they cleaned up some of their namespacings in v2.0.0 (see here). plotly.js is still using So, don't worry about Your PR looks good, it's missing some tests though. Are you interested in adding some tests in https://github.com/plotly/plotly.js/blob/master/test/jasmine/tests/plot_promise_test.js ? If not, we'll take care of it. |
As this is my first time I'd prefer you to go ahead with the tests, so that i can see how it's done. Thanks! |
We'll merge this in then apply some tests on top. Thanks for the contribution! |
As the resize operation will modify the size of the plot only after a
timeout, if you call resize and then immediately do something based on
the current plot size, you'll get the "old" size. This fixes it.