Closed joseberlines closed 9 months ago
Hello @joseberlines 👋
It's not possible to display JPEG/PNG or any other images in a ipydatagrid cell. Would you be able to elaborate on your use case?
Many thanks
Use case: a product/company comparison table. Imagine a table where a company financial values have to be compared (and/or edited). On every column name you might write APPLE INC, MICROSOFT whatever, but instead it's much nicer to include the logo. Of course the logo might be any pic type (jpg png whatever) since they could be converted with PIL probably. Another example is product comparison as the tables you get when you google "nikon SLR D5000 vs CANON EOS 50" on the top of every column again you might have the name of the product or a pic of the product (or both actually). Please comment if it is not clear.
As example including a jpeg in ipydatagrid would allow the following:
Or put in other way it would allow to include symbols on the column names in situations like this: []()
This will probably inherit from the widget ABC class I describe in #262. The main thing here is that we also need to work with binary data for the image which, in some cases, will be serialized from the Python side (unless it's retrieved via a fetch request from a 3rd source in the browser). This will increase the complexity during the serialization proces. @martinRenou any thoughts on this?
I believe we can do this :) I've seen beakerx people using images inside lumino datagrid cells.
It would be nice to upstream such an ImageRenderer class to Lumino.
In the case of using an image from the hard drive, are they saving it as a blob and then rendering? What would this look like on the Lumino side of things?
EDIT: will take a look at what they're doing
+1 :)
Preparing the upstream work to allow this in ipydatagrid: https://github.com/jupyterlab/lumino/pull/630
Include jpeg in cell? Is it possible to display jpegs in cells?