Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 #5075Introduces attribute
source
to image traces #5075Changes from 4 commits
1c893e2
d45496d
f03c7ae
2a687f2
aaf7cbc
e693446
130593e
09eb1d0
9b8a843
2ba0998
a2ea331
4f807c5
7dd3b68
f2caed8
d91e0c1
fe1d208
2960e55
3717cbe
b586a86
d73f4c4
18133c9
19ce21d
74574b6
8c736f7
3b75921
66c58f6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Hmm...
We need to update description for
colormodel
plotly.js/src/traces/image/attributes.js
Lines 33 to 40 in 3781f48
Or even better if you not set this parameter this way.
What about adding an underscore variable e.g.
here and then
in
calc
andplot
?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.
Wondering also what happens if one pass a
jpeg
(often has no alpha channel) instead of apng
?In that case the default should be
rgba
or simplyrgb
?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.
Codepen for
jpeg
: https://codepen.io/MojtabaSamimi/pen/zYqKOKyThis seems correct to me.
cc @alexcjohnson
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.
Thinking more about this
automatic
default behaviour.I still believe we should respect
colormodel
to be defined by the user.And we must remove
colormodel.dflt
and set it duringsupplyDefaults
.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.
Do you mean supporting colormodel
hsl
with say a PNG image? That seems like a weird thing to do and support. Also, it would be slow: now we would have to read all the pixels one by one and convert them into the new colorspace. cc @archmojThere 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.
cc @alexcjohnson @nicolaskruchten ☝️
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.
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 whensource
is present.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.
Large diffs are not rendered by default.