Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Fix contour plot colorscale domain #6625
Fix contour plot colorscale domain #6625
Changes from 11 commits
66e7b3c
fb7e181
ae34826
29bf5db
e889dd1
27d84f1
736242c
fa5c3e3
bda830b
807504e
9f730ea
aea023c
1bd6571
af9a1d3
aea78dd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Could you please explain this change?
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.
Well, it's a bit tricky to explain.. The first thing to note is that when calling
Plotly.newPlot()
, the colorbar is drawn twice, ie. the code above runs twice (which might be a bug (?) as the first draw seems correct, but I didn't dig much into that). When callingPlotly.react()
though, it runs once.Now, we have (before this commit) :
So, if I'm not wrong :
Plotly.newPlot()
, because the code runs twice, there is no missing<rect>
on the second pass obviously, and in the end all of them have an emptystyle
attribute (for contour colorbar, each element get colored via thefill
attribute)Plotly.react()
however, because the code runs once, those<rect>
that were newly added, if any, will have in the endstyle='stroke: none;'
This discrepancy causes this test case to fail, because some attributes are changing between transition/redraw. So this commit is just to fix that.
Now the question is : how the heck this test case hasn't ever failed until this PR ?
I think this could have to do with the double call and possible race conditions.. Hopefully I've been able to reproduce the failure without the colorbar fix, by using a mock with more data than those used previously by the test (longer to draw, hence the suspicion about race conditions), also fixed the promise chaining. I'm going to commit that so you can double check all of this.
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 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.
Hey, I was doing some testing and just realized there are still issues with my code (if user explicitly sets larger z range with smaller contour size), so it needs more work, I will fix that tomorrow I think.