Open kszlim opened 1 month ago
I have also been meditating on the fact that this would be an incredible feature. Assuming this is running on a webserver, the interactivity would be at least somewhat tied to the framework that a user chooses (e.g. Flask or Django).
One interesting possibility I've daydreamed about is to provide htmx attributes to different table components that correspond to actions to be performed on the dataframe. This way, great-tables has to incorporate very little (if any) JS and can instead rerender the parts of the table updated by the change using the already existing layout framework.
I would be interested in helping to make this a reality :)
I think this should theoretically be doable without a webserver, in fact, I think I wouldn't want this feature if it required a webserver.
It should be all doable clientside. Even supporting SQL theoretically can be done clientside (though I think some minimal interactivity is usually all that's needed).
Thanks for opening this--we're definitely eager to support something like this! Right now, we're syncing with the shiny team (cc @schloerke) on potentially...
AFAIK they're using the tanstack table.
The R version of Great Tables (gt) uses a wrapper around the tanstack table, called reactable, to generate interactive tables. If we could create a similar wrapper in python, it shouldn't be too hard to wire up Great Tables to it.
Here are some examples of the gt packages interactive tables.
If anyone knows of something better, we're open to it! I know there are a lot of interactive table tools out there that we've probably overlooked!
I've seen an example from Panel
a few months ago that might be a potential solution for our use case.
Oh cool! Here's the panel Tabulator page, which seems to be similar to reactable
Prework
Proposal
Support interactivity for html output of great tables. This might be a big ask, I don't know how technically involved it would be, but it would be great to allow basic interactivity like sorting by column, filtering.
I think you'd then want to support a new param in
as_raw_html
withinteractive=True
which would then enable these features. Or perhaps it could be a bunch of method calls on table to enable piecemeal interactivity.This would be a killer feature personally.
Some inspiration could be the level of interactivity of https://docs.datapane.com/blocks/display-blocks/#tables-and-data