Closed martinRenou closed 9 months ago
Ready for review!! CI failure seems unrelated, I don't have the right to restart it
All green! Thanks to the person who restarted it :D
@krassowski thanks a lot for the useful review!
I just pushed another commit:
width
and height
properties which supports sizes in percentage or pixels. If one property is set to an empty string, it will be computed depending on the other and respecting the original image size ratio. If both are set to an empty string, the original image size will be used.
I figured width=''
and height=100%
could be a good default (respect the image size ratio and take the whole height available), tell me what you think.Also, we now have a minimal scaffold for datagrid tests here, it would be greatly appreciated if the critical subset of the new API was unit-tested
Oops forgot to tackle this, will do
@krassowski I think it's good for another round of review if you have time!
This is a step towards fixing https://github.com/bloomberg/ipydatagrid/issues/253
Introducing
AsyncCellRenderer
Prior to this change, the Lumino datagrid would not allow rendering cells asynchronously. This means that rendering images was not really possible (unless the cell renderer had a reference to the datagrid and requested a redraw once the asynchronous task was done).
This PR introduces the
AsyncCellRenderer
abstract class, which the datagrid uses as following (more or less pseudo-code):This allows supporting asynchronous cell rendering without slowing down the synchronous way.
Introducing the
ImageRenderer
This implements the
AsyncCellRenderer
and allows to load images in the datagrid: