ipydatagrid icon indicating copy to clipboard operation
ipydatagrid copied to clipboard

Example of datagrid using cell renderer that renders an ipywidget

Open bytesemantics opened this issue 3 years ago • 8 comments

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 ?

bytesemantics avatar Mar 03 '21 09:03 bytesemantics

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.

martinRenou avatar Mar 03 '21 09:03 martinRenou

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?

ibdafna avatar Mar 03 '21 23:03 ibdafna

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 avatar May 12 '21 18:05 joseberlines

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)

joseberlines avatar May 12 '21 18:05 joseberlines

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 .

bytesemantics avatar May 12 '21 19:05 bytesemantics

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.

joseberlines avatar May 14 '21 08:05 joseberlines

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! 😸

ibdafna avatar May 18 '21 19:05 ibdafna

What sonyou mean by "proof of concept"?

joseberlines avatar May 19 '21 19:05 joseberlines