New user questions around custom data table implementation

Hi @CmpCtrl !

I feel that the root cause of your issues starting off with Panel come down to its documentation, which is planned to be reworked for Panel 1.0.

There’s certainly a lot of magics in Panel, and to be honest in Python in general. This is a tradeoff though, with Panel (or other dashboarding libraries) you can build a web app in a few lines of Python code. This is just an insane amount of power! But maybe what you meant by magic is just that things are confusing, and in that regard the documentation work should improve things.

Yep googling Panel doesn’t return great results unfortunately. I would say though that the best and most comprehensive content you can find on Panel is in three different sites so you don’t really need to Google anything:

Param (the proper name) is also very confusing, it feels like its fighting python. How can i define a param (proper name) as a class attribute, then pass the class a kwarg with the same key at instantiation, and then have it behave as an instance variable? I agree those behaviors are handy, but they’re very confusing since that’s not how python works normally.

Oh this is very much how Python works, see dataclasses for a reference from the standard library itself. I will say though that the first time I used the Param library I was a tiny bit surprised by that too, but I wasn’t aware at the time of dataclasses or other frameworks like pydantic. It feels quite natural now.

First, i want a widget for editing table data, but my table data is not in a pandas dataframe and it is often 2d.

Isn’t a table a 2D object? And why can’t you have it as a dataframe?

I would like to have an active cell, keyboard navigation, and for the cell values to be editable.

The Tabulator widget allows users to edit a cell, and you can register callbacks with the on_edit method to do whatever you want to do with the edited value (and its location in the table, returned by the callback event), if you want to do anything with that. Users can also navigate through the table. The only thing you won’t get (I think) is the active cell highlighting.

Panel already provides lots of components, including tons of widgets, multiple layouts, and a great deal of panes to display all sorts of stuff. This covers most of what people need, but sometimes you just need that extra functionality. I see the ReactiveHTML component as a way to unlock Panel developers in those situations, the tradeoff being that they have to be comfortable with front-end technologies (HTML, JavaScript, CSS). What I wish to see and what would unlock even more Panel developers would be a nice way to share these custom components, transferring the knowledge and output of power devs to more regular devs.

4 Likes