Conversation
- make use of new gl-plot3d setters - reduce passing arguments
…Plot functions method of Scene object - i.e. to avoid passing extra this argument - also let's use scene. instead of this. in Scene methods
src/plots/gl3d/scene.js
Outdated
| glOptions: { | ||
| preserveDrawingBuffer: isMobile, | ||
| premultipliedAlpha: true, | ||
| premultipliedAlpha: false, |
There was a problem hiding this comment.
Hmm. Does this lead to any changes in performance ?
There was a problem hiding this comment.
Good question. It shouldn't. Anyway I would double check.
There was a problem hiding this comment.
We decided not to change this config in this PR for now: ade22a6.
Is the only change in the WebGL config the |
Yes that is the only change in the config. |
|
Also added a codepen to the PR description to help compare the two options. |
|
Then in order to keep the best view and consistent png results we could default |
|
@etpinard all the tests passed and this PR should be ready to merge. |
| glOptions: { | ||
| preserveDrawingBuffer: isMobile, | ||
| premultipliedAlpha: true, | ||
| antialias: true | ||
| }, |
There was a problem hiding this comment.
Can I ask why you're now passing these options from plotly.js? The corresponding option object current on master is:
var glplotOptions = {
canvas: canvas,
gl: gl,
container: scene.container,
axes: scene.axesOptions,
spikes: scene.spikeOptions,
pickRadius: 10,
snapToData: true,
autoScale: true,
autoBounds: false,
cameraObject: cameraObject,
pixelRatio: pixelRatio
};that is, the glOptions container is new.
There was a problem hiding this comment.
Where is that set on master?
There was a problem hiding this comment.
plotly.js/src/plots/gl3d/scene.js
Lines 201 to 213 in 8122c21
There was a problem hiding this comment.
https://github.com/gl-vis/gl-plot3d/blob/d206f1f110d427b2baae0462964bc59cf7f59dae/scene.js#L80-L87
The glOptions used to be left undefined and hidden to plolty.js developers.
Now that are explicitly defined, it should be easier to figure out what the differences between static & interactive plots are.
There was a problem hiding this comment.
Ok, that's fair. But then is-mobile becomes a top-level dependency for plotly.js and we should add it to our package.json.
There was a problem hiding this comment.
Good catch. OK if I add it to package.json?
There was a problem hiding this comment.
OK if I add it to
package.json
yes please!
There was a problem hiding this comment.
Simply listed in ff2ecc7.
But also noticed that it was added in package-lock before which is not clear why?
75de9e5dea
There was a problem hiding this comment.
But also noticed that it was added in package-lock before which is not clear why?
Yeah it was in the package-lock before, because the package-lock lists all the dependencies not just the top-level ones. It's a best practice to include all the top-level dependencies in the package.json, and make npm handles the nested dependencies part in the package-lock.
|
💃 - nicely done! Before merging, could you change the PR title to something like "Refactor gl3d scene" as this PR no longer disables |



This PR adds setters to
gl-plot3dand refactors functions/methods ofgl3d/scene.jsfile to usegl-plot3dfunctions to change camera attributes and avoid two camera instances, etc.@plotly/plotly_js
Please review this PR commit by commit.
After all, this PR does NOT f_i_x #4236 by passing a different config (premultipliedAlpha: false) to
gl-plot3dmodule. As used to be suggested in this demo {to compare before and after effects on Windows(7/10) using Chrome/Firefox/Opera as well as on Ubuntu using Firefox}.That may be addressed in separated PR in future.