-
-
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
Introduces attribute source
to image traces
#5075
Conversation
@antoinerg could you possibly add the new mock plotly.js/test/jasmine/tests/mock_test.js Line 637 in d45496d
and test it after plotly.js/test/jasmine/tests/mock_test.js Line 1684 in d45496d
This is an extra step (until we could find a way to automate it) required to ensure the new mocks pass validation process. |
Thank you @antoinerg ! Will there be a way to access the pixel value in a hovertemplate? If the answer is "no only the default hover is possible" it's ok, just wanted to know to adapt the python imshow function. |
@archmoj I am not familiar with |
@emmanuelle: yes there is a way! See https://github.com/plotly/plotly.js/pull/5075/files#r470673042 |
var c; | ||
for(i = 0; i < cd0.w; i++) { | ||
var ipx0 = ipx(i); var ipx1 = ipx(i + 1); | ||
if(ipx1 === ipx0 || isNaN(ipx1) || isNaN(ipx0)) continue; |
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.
Why we need to test for NaN
s?
Could we skip this process?
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.
Why we need to test for
NaN
s?
Could we skip this process?
I'm not sure at the moment.
However, this PR didn't change this logic: I simply moved it into a function. Could we maybe revisit this topic in a later PR?
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.
But they still be called in the case of non-fast-image!
So let's add some logic to skip these isNaN
calls when source
is present.
if(ipx1 === ipx0 || (
!hasSource && (isNaN(ipx1) || isNaN(ipx0))
)) continue;
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 not confident about this change. Checking for NaN might be necessary even when the image is defined via source
if there are a logarithmic scale and negative values involved (ie. Math.log(-10) is NaN
).
cc @archmoj
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.
Alright. Let's skip this for now.
Using the following Codepen: https://codepen.io/antoinerg/full/wvGWgMY I could test that Firefox, Edge, Chromium, Opera supports pixelated image-rendering on Windows, Mac, and Linux 🎉 Pixelated image rendering does NOT work in:
|
Apparently IE11 has issues with |
Fixed in f2caed8 |
Fixed with f2caed8 ! This also fixes |
Reacting |
I'll play around with it a bit but I think @emmanuelle will want to recheck her open Python branch against the tip of this one :) |
|
In commit 3b75921 I slightly change the code to follow the pattern of |
Great addition. |
which renders much faster!
Demo: https://codepen.io/antoinerg/full/wvGWgMY
TODO:
plot
step is now async. Fixed in e4b923b cc @alexcjohnson