-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Improving the quality of surface objects to better follow the data by using LCM or highly composite numbers #3281
Conversation
@@ -66,7 +66,7 @@ describe('Test gl3d plots', function() { | |||
gd = createGraphDiv(); | |||
ptData = {}; | |||
|
|||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 4000; | |||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 8000; |
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.
Hmm. I was about to ask if you noticed any performance deterioration on your branch. I guess this here answers my question. 🤔
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.
... would there be a way to increase the resolution just for traces that need it? In other words, is a way to determine if a given z
2D array requires extra resolution?
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.
One idea could be to allow resetting this resolution via the api.
I can imagine of auto-detect solutions; but considering animations I suggest we keep this constant.
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.
@etpinard Rather than using 1024
, now by simply using 120
instead of `128' the performance is untouched; while the quality of the graphs are remarkably improved. If we want to go further than that the next magic values that could be applied are 180, 240, 360, 720 and 840.
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.
Fantastic! Could you explain briefly why 120
is better than 128
?
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.
128 = 27 so it is divisible by (1 + 7) numbers {1, 2, 4, 8, 16, 32, 64, 128}
120 = 23x31x51 therefore divisible by (1+3)x(1+1)x(1+1) = 16 numbers {1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 16, 20, 24, 30, 60, 120}.
So it is more likely that the refined grid match actual data points in this case.
https://en.wikipedia.org/wiki/Highly_composite_number
Base on this investigation I am now thinking to rewriting the function that refines scale.
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.
Wow @archmoj is the man! Thanks!
Impressive work @archmoj this PR is looking very strong 🍾 The new logic looks good to me. Now, would you mind doing some performance testing on ~5 surface mocks, just to make sure we're not slowing things down too much? Using something like console.time('surface')
Plotly.newPlot(gd, [/* */])
console.timeEnd('surface') in the browser console would suffice. Thanks in advance! |
Thank you @alexcjohnson for the review. This is pretty much fixed for parametric cases. I was able to create two mocks related to |
There are two separate issues here: DRY 🌴 and performance 🐎. 🌴 we could investigate replacing both of these implementations with 🐎 I would just imagine keeping both copies, but short-circuiting the one in |
…hanges realted to ticks and surface contours
@alexcjohnson after investigation of using |
Looks good to me! 💃 after merging |
🎉 this will be part of 1.43.0! |
Fixes #2713 by increasing the resolution of surface objects.
With previous set up resolution (128x128) surfaces with any remarkable changes in z-axis were not displayed well.
Also to mention: the issue #2208 and #3262 would be fixed in this PR as well.
@etpinard
@alexcjohnson