jupyter-widgets / ipydatagrid

Fast Datagrid widget for the Jupyter Notebook and JupyterLab
BSD 3-Clause "New" or "Revised" License
573 stars 51 forks source link

Example of datagrid using cell renderer that renders an ipywidget #207

Open bytesemantics opened 3 years ago

bytesemantics commented 3 years ago

Can an example notebook be provided demonstrating the embedding of an ipywidget within a cell ?

E.g. DatePicker (for date cells) ? ipyupload for a file selection cell ? checkbox for a toggle cell ?

martinRenou commented 3 years ago

It is not possible at the moment.

It's also not on the roadmap AFAIK. We could maybe think of a design where custom widgets could be used as cell editors (not cell renderer), this might not affect performances too much.

ibdafna commented 3 years ago

It is an interesting idea! Can you elaborate more on your use case for embedding widgets versus having them in a layout consisting of ipydatagrid?

joseberlines commented 3 years ago

A use case for embedding widgets would be editing a table in which text in cells might have to be classified good/bad. Two columns ipygrid could be built left one texts right one toggle button. This can be further extended to text that has to be classified in several classes, so any of the classes would be a column containing a toggle button.

joseberlines commented 3 years ago

As for numbering examples imagine a table with expenses in column 1, items in column two. Those expenses habe to be assigned to different client accounts. Depending on the account selected (drop down ipywidget in third column for every row) the total amount really asigned might be re-calculated to a further 4th column (applying discounts etc)

bytesemantics commented 3 years ago

Thanks for expressing the use case. There are plenty of examples in the ipyaggrid (another table ipywidget) repository. Unfortunately both table widgets do not meet my scalability needs (met with qgrid and server side data push).

Ipyaggrid is visually the most appealing but is several versions behind the underlying aggrid JS library and exposes only a fraction of the aggrid functionality. It's documentation is wholly inconsistent. It also appears to be a one-man Dev team.

Qgrid is the least visually appealing. But scales best and provides the minimal feature set necessary for a table widget to be used by end users. Questions remain around its longevity given Quantopian's demise.

So there's a great opportunity here for ipydatagrid, if the Dev team want to take it.

On Wed, 12 May 2021, 19:42 joseberlines, @.***> wrote:

As for numbering examples imagine a table with expenses in column 1, items in column two. Those expenses habe to be assigned to different client accounts. Depending on the account selected (drop down ipywidget in third column for every row) the total amount really asigned might be re-calculated to a further 4th column (applying discounts etc)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bloomberg/ipydatagrid/issues/207#issuecomment-840013187, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALD6QOBGYBNPB4LGM5LPELTNLDXZANCNFSM4YQ33PJQ .

joseberlines commented 3 years ago

Its always the case that finding the ultimate solution covering absolutely all your needs in the best way possible only happens in dreams. There are indeed some features that could bring ipydatagrid to a super higher level, including injecting ipywidgets within cells and wrapping text #210 in several lines in cells, but all in all the amount of work and speedy development of ipydatagrid makes me only believe that this solution will be a reference soon. The advantage of following the people related to this library and other "cousines" of it at @bloomberg and @quandtstack let know what these people of capable of, and it is a hell of a lot.

ibdafna commented 3 years ago

ipydatagrid relies on canvas rendering - it's the biggest factor in enabling strong performance. Widgets use regular DOM objects and unfortunately mixing the two is not a trivial task. It will definitely be something to consider down the line, but realistically it is not something that will make it to the top of the priority list for now. If you are up for a challenge, we'd love to see a proof of concept PR! 😸

joseberlines commented 3 years ago

What sonyou mean by "proof of concept"?