How to pass a smaller size image from backend to plotly using imshow? #4076
Unanswered
aljosahafner
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
Hello,
On the website I have a
fig = ui.plotly
element in which I then update the figure by updating thefig.figure
property with settingfig.figure = px.imshow(new_data, binary_string=True)
. However, since the image is sometimes quite large, upwards of 2k x 4k pixels (making a total size of ~10 MB), the responsiveness suffers.What I'd like to achieve is to pass the actual size of the viewport/canvas from the browser to the backend and rescale the image before passing it to the interface. Because right now I am passing an image which is approx. 3 or 4 times bigger than the canvas size. Any comments on how I could do that and if it makes sense what I am describing?
Beta Was this translation helpful? Give feedback.
All reactions