-
-
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
Revised pixelRatio in 3D plots to address multiple bugs #3573
Conversation
…tly.js side to work fine on iOS and FireFox bug fix issue 3572 to preserve line widths in save 3d plots as image button as well as CI removed an unused ortho argument from plot_api subroutine improved ticks distances in orthographic views using latest gl-axes3d
package.json
Outdated
"gl-pointcloud2d": "^1.0.2", | ||
"gl-scatter3d": "^1.1.6", | ||
"gl-scatter3d": "git://github.com/gl-vis/gl-scatter3d.git#6292ada845bdcd44a8e2db2d3c5e18c96c9ac210", |
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.
package.json
Outdated
"gl-plot2d": "^1.4.2", | ||
"gl-plot3d": "^2.0.0", | ||
"gl-plot3d": "git://github.com/gl-vis/gl-plot3d.git#3580a0eedd81b9f212186caa8e7018d8016274fe", |
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.
package.json
Outdated
"gl-contour2d": "^1.1.5", | ||
"gl-error3d": "^1.0.13", | ||
"gl-error3d": "git://github.com/gl-vis/gl-error3d.git#75ec29dd1dde51a697f718cdacf76e36a7bfd38c", |
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.
package.json
Outdated
"gl-streamtube3d": "^1.1.2", | ||
"gl-surface3d": "^1.4.1", | ||
"gl-streamtube3d": "git://github.com/gl-vis/gl-streamtube3d.git#ecdaa1dbbcd315ba06133aeccf870c98b993a8ae", | ||
"gl-surface3d": "git://github.com/gl-vis/gl-surface3d.git#96e61eebac18e9b525f7f3e6b714291b5d1b4bad", |
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. Fantastic PR @archmoj !
Are there any noticeable differences in the new baselines? Glancing at them quickly didn't reveal anything, but I'd like to double-check with you. |
test/image/mocks/gl3d_mesh3d_surface3d_scatter3d_line3d_error3d_log_reversed_ranges.json
Outdated
Show resolved
Hide resolved
@@ -384,7 +384,7 @@ describe('Test gl3d plots', function() { | |||
.then(done); | |||
}); | |||
|
|||
it('@gl should display correct hover labels (mesh3d case)', function(done) { | |||
it('@noCI @gl should display correct hover labels (mesh3d case)', function(done) { |
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.
Does this test still pass locally using
(plotly.js) $ ./tasks/noci_test.sh
?
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.
Unfortunately no. The mock is unexpectedly rotated after the click possibly related to uirevision
.
But I need to figure that out.`
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.
Yes please,
(plotly.js) $ ./tasks/noci_test.sh
should (always 😄 ) pass.
@@ -340,7 +341,7 @@ function Scene(options, fullLayout) { | |||
this.spikeOptions = createSpikeOptions(fullLayout[this.id]); | |||
this.container = sceneContainer; | |||
this.staticMode = !!options.staticPlot; | |||
this.pixelRatio = options.plotGlPixelRatio || 2; | |||
this.pixelRatio = this.pixelRatio || options.plotGlPixelRatio || 2; |
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.
This may break graphs where users set config option plotGlPixelRatio
:
plotly.js/src/plot_api/plot_config.js
Lines 309 to 319 in 13b925c
plotGlPixelRatio: { | |
valType: 'number', | |
dflt: 2, | |
min: 1, | |
max: 4, | |
description: [ | |
'Set the pixel ratio during WebGL image export.', | |
'This config option was formerly named `plot3dPixelRatio`', | |
'which is now deprecated.' | |
].join(' ') | |
}, |
Orca does it here:
using (a strange) value:
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.
Oh wait nevermind, this.pixelRatio
isn't set by default (correct?) so options.plotGlPixelRatio
is honoured.
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.
Yes I think so.
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.
Ok great. Can you try generating the gl3d_*
baseline using orca with a few different plotGlPixelRatio
values?
You may want to modify:
Lines 31 to 39 in 3e15f17
test_image () { | |
$root/../orca/bin/orca.js graph \ | |
$root/test/image/mocks/mapbox_* \ | |
$root/test/image/mocks/gl3d_cone* \ | |
--plotly $root/build/plotly.js \ | |
--mapbox-access-token "pk.eyJ1IjoiZXRwaW5hcmQiLCJhIjoiY2luMHIzdHE0MGFxNXVubTRxczZ2YmUxaCJ9.hwWZful0U2CQxit4ItNsiQ" \ | |
--output-dir $root/test/image/baselines/ \ | |
--verbose || EXIT_STATE=$? | |
} |
to get orca started easily and you might have to tweak the orca src
files e.g. here:
or
to pass the different plotGlPixelRatio
values down to plotly.js
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 Thank you so much for the links. Using orca I was able to produce gl3d_* images from this branch and compared them against the master branch. I also tweaked the pixelRatio
of orca module and the configuration has an impact.
Well the primary goal of this PR was to possibly improve rendering of 3-D plots on different browsers & OS. Although in the other PR #3571 I was able to improve the quality of CI images by doubling the |
new baselines using previous dims
baseline with original width
I don't think that's necessary, but we should make sure that users setting https://github.com/plotly/plotly.js/blob/master/test/jasmine/assets/read_pixel.js |
Regarding your question changes are noticeable in the following examples i.e. mainly related to surface contour lines and error bars. |
Going to slip this in 1.45.0. This is the last PR for 1.45.0 I promise 😄 |
|
💃 💃 💃 |
Supersedes #3571.
pixelRatio
in various 3d modules and on theplotly.js
side to work well on iOS, FireFox as well as Chrome.ortho
argument fromplot_api/subroutines.js
added in Orthographic projection for 3D plots - finalist #3550.Codepen to test the fix for #3387.
Codepen to test the fix for #3572.
Codepen to test the fix for #3014.
@plotly/plotly_js