Uh oh!
There was an error while loading. Please reload this page.
Enable restyle to redraw parcoords #3101 - #3125
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
alexcjohnson
commented
Oct 18, 2018
Alright, at some point we should dive in and figure out what it will take to make |
| var mouseEvent = require('../assets/mouse_event'); | ||
| var failTest = require('../assets/fail_test'); | ||
| var delay = require('../assets/delay'); | ||
| var RESIZE_DELAY = 300; |
There was a problem hiding this comment.
cc @antoinerg - bad day for circleci it seems, we were getting repeated test failures here so I encouraged @archmoj to try increasing this delay. At some point we may want to change this so we're waiting on some event (listen for plotly_afterplot perhaps?) rather than a fixed delay, that should be more robust (and usually faster!)
There was a problem hiding this comment.
@antoinerg What value you suggest we use here for RESIZE_DELAY now that the CI is back to normal?
There was a problem hiding this comment.
Don't bother reducing it (if the goal is essentially to save time) - just leave it until we get around to exploring an event-based delay, rather than time-based.
archmoj
commented
Oct 18, 2018
The restyle function is tested interactively. Do we still need to create a jasmine test? |
alexcjohnson
commented
Oct 18, 2018
Yes - especially since at some point we want to improve performance by fixing |
archmoj
commented
Oct 18, 2018
There was a test available for colorscale; so I added another one for line color. |
alexcjohnson
commented
Oct 19, 2018
Hmm, those tests only really verify the mechanics inside We need both of those tests to check what's actually on screen after the change, probably by using |
archmoj
commented
Oct 19, 2018
Yes totally agree on that. |
| if(d.viewModel) { | ||
| if(d.lineLayer) d.lineLayer.update(d); | ||
| else d.lineLayer = lineLayerMaker(this, d); | ||
| if((!d.lineLayer) || |
There was a problem hiding this comment.
That extra ( ) style feels somewhat new to our codebase. Maybe we could add https://eslint.org/docs/rules/no-extra-parens to our lintinting rules.
etpinard
commented
Oct 23, 2018
alexcjohnson
commented
Oct 23, 2018
Yes, most likely specifically fa1a436 |
archmoj
commented
Oct 24, 2018
@etpinard |
etpinard
commented
Oct 24, 2018
Very interesting. FF must not like this block plotly.js/src/plot_api/plot_api.js Lines 261 to 279 in 7ae6fd6 added in #2939 Could you check if |
archmoj
commented
Oct 24, 2018
On FF when width and height are not declared in the layout we get float values (e.g. fullLayout.width) that we shouldn't get. So they could be rounded somewhere upstream? by either floor function or another round to nearest function. What do you think @etpinard ? |
etpinard
commented
Oct 29, 2018
@archmoj do you need help adding a test for this thing? This is a pretty bad bug that we should merge in before releasing 1.42.0 |
archmoj
commented
Oct 29, 2018
Thank you! Yes actually I am working on a jasmine test for this. I would let you know. |
| canvases.each(function(element, index) { | ||
| if (index == 0) { // FIXME: we assumed here that the context is the first item but may be not. |
There was a problem hiding this comment.
Yes, the context should always be the first one, if it's not maybe other tests will fail (not just this one). No need to for an additional check.
| var canvases = d3.selectAll('.gl-canvas'); | ||
| expect(canvases.size()).toBe(3, msg); | ||
| canvases.each(function(element, index) { |
There was a problem hiding this comment.
... but alternatively, you could select .gl-canvas-context instead of all three <canvas> elements
| var b = imageArray[i][2]; | ||
| totalRGB += r + g + b; | ||
| } | ||
| if(secondPass > 0) { |
There was a problem hiding this comment.
I don't like this pattern. Let's keep getGrayRatio as just a getter function and move the expect statement to down to it block below:
vartotalRGB;Plotly.plot(gd,mock3).then(function(){totalRGB=_getGrayRatio();mockCopy.data[0].dimensions[1].constraintrange=[0.4,0.6];returnPlotly.react(gd,mockCopy);}).then(function(){vartotalRGB2=_getGrayRatio();expect(totalRGB2).toBe(totalRGB,'after react');}).catch(failTest).then(done);| @@ -17,7 +17,7 @@ | |||
| "3d-view-controls": { | |||
| "version": "2.2.2", | |||
| "resolved": "https://registry.npmjs.org/3d-view-controls/-/3d-view-controls-2.2.2.tgz", | |||
| "integrity": "sha512-WL0u3PN41lEx/4qvKqV6bJlweUYoW18FXMshW/qHb41AVdZxDReLoJNGYsI7x6jf9bYelEF62BJPQmO7yEnG2w==", | |||
| "integrity": "sha1-cXP8GX6efk28YyE0OEZwR9vIT6I=", | |||
There was a problem hiding this comment.
Can you undo these package-lock changes? They have nothing to do with this PR.
etpinard
commented
Oct 29, 2018
Now in #3178 |
This PR enables callbacks e.g. restyle to redraw parcoords.
This fixes#3101
@alexcjohnson