-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Second jasmine test to lock issue 3101 #3195
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
Conversation
var canvas = d3.select(id).node(); | ||
|
||
var imgData = readPixel(canvas, 0, 0, canvas.width, canvas.height); | ||
var n = imgData.length * 0.25; |
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.
A minor change here:
instead of dividing by 4, we use multiply by 0.25 so that we return rgb fractions and avoid possibility of rounding small values to 0.
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.
shouldn't cause problems but... is there actually a difference between these in js? anyway n
should always be an integer, right?
var pixels = new Uint8Array(4 * w * h); |
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.
I'm curious. Can you share an example of this happening in 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.
(am I missing something? why didn't that link get turned into a code snippet?)
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.
You are totally right and I tested this on IE, FF and Chrome too.
In JS there is actually no difference in JS between multiplying by 0.25.
Thanks for the note.
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.
Thanks for the test @archmoj Let's merge this in 💃 |
Fixes #3178.
The
getAvgPixelByChannel
function is revised and now accepts an id to select which gl layer (e.g. focus/pick/context) to be used by different tests.The new jasmine test, checks for the parcoords context layer to remain visible after a restyle call.
@etpinard
@alexcjohnson