plotly / dash-slicer

A volume slicer for Dash
https://dash.plotly.com/slicer
MIT License
24 stars 8 forks source link

add thumbnail_size property #34

Closed emmanuelle closed 3 years ago

emmanuelle commented 3 years ago

[Updated]

This PR introduces a thumbnail_size property of the slicer, in order to be able to choose the size of the low-resolution images uploaded and available clientside. It is an integer, or None, in which case the full resolution data is uploaded clientside (I implemented this by not attaching the server callback, which was an easy solution).

almarklein commented 3 years ago

Also it could be a good idea to let thumbnail_size be a tuple instead of an integer.

I'm not sure if Pillow allows this. Pillow seems to consider the given size as a hint. Which is why we have get_thumbnail_size(). But we can try.

Another nice addition would be to select a better default size when the data is very anisotropic. I noticed too that with the xray app the low-res data is way too low-res :P

BTW: I suspect that we're using different versions of Black (CI runs the latest).

emmanuelle commented 3 years ago

Ready for review. I tested this on the xray app of the gallery. Probably I should add more tests and an example :-).

almarklein commented 3 years ago

This is nice!

emmanuelle commented 3 years ago

Thanks for the review @almarklein !

almarklein commented 3 years ago

This PR looks good to go. Do you know what's up with the circleci build, @emmanuelle ?