Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds better Tables and interactive analysis via Perspective, Tabulator and PivotTable #1690

Closed
wants to merge 6 commits into from

Conversation

MarcSkovMadsen
Copy link
Collaborator

@MarcSkovMadsen MarcSkovMadsen commented Oct 24, 2020

The support for DataFrame Tables in Panel is strong if you look at the underlying functionality. But the look, feel and user experience could be better. See

This PR addresses this by adding the awesome PerspectiveViewer, Tabulator and PivotTable widgets.

Background Info

I believe the PerspectiveViewer and Tabulator widgets are ready for deployment. I would expect no issues from normal usage. I have used them. There are a lot of pytests in the PR and there are working Jupyter Notebook examples included.

In some advanced streaming example there might be some issues. But for that we need the use cases and request from users.

But I strongly believe these widgets should get out there and be available to the Panel community. They are (also) game changers for Panel.

The implementation of the PivotTable widget is very basic. But the functionality that is there works.

I contribute these together in one PR as they share some common code for "Dataframe" widgets. So actually this PR also contributes some code that should make it easier to contribute Dataframe based widgets in the future. An example from awesome-panel-extensions is the

Notes

PerspectiveViewer

The tests are in the test_perspective.py file.

It also contains a test app you can run with python -m panel serve 'panel\tests\widgets\test_perspective.py' --dev or python 'panel\tests\widgets\test_perspective.py'. There is also a reference guide notebook called PerspectiveViewer.ipynb

image

Roadmap

  • Support other Dataframe types than Pandas.
  • Improve implementation of streaming and patching. Currently the perspective-viewer webcomponent loads all data from scratch.
  • Eventually integrate with the full Perspective package and apache arrow

FYI. @ceball. This might interest you.

Tabulator

The tests are in the test_tabulator folder.

It also contains a test app you can run with python -m panel serve 'panel\tests\widgets\test_tabulator\test_tabulator_examples.py' --dev. There is also a reference guide notebook called Tabulator.ipynb.

As you can see below the Tabulator Widget will support the dark themed Templates pretty well using the midnight theme. It also contains other themes like bootstrap and material.

image

For some reason the streaming did not working for me in the Notebook. But it works in the server example. I would just forget about it until some user requests a fix. It's a small detail.

PivotTable JS

The tests are in test_pivottable.py.

This also contains a test app you can run with python -m panel serve 'panel\tests\widgets\test_pivottable.py' --dev and a reference notebook PivotTable.ipynb.

The implementation is simple. But Works. If you (@philippjfr ) thinks it's too bare bones feel free to leave it out. But now you have the code.

image

Ready for review

FYI. @philippjfr . This is ready for review. I believe its mature enough to include. But I know you can do awesome improvements. Don't know if you want to do that first or get it out to the community to see if they need these components at all first.

Please note that the Notebooks contain some links to images, gifs and csv files in my github repos. You can use them for now if you want. But they should be moved to a Panel location eventually.

@xavArtley
Copy link
Collaborator

I just run tabulator but I can already see an issue:
Peek 24-10-2020 08-43

@MarcSkovMadsen
Copy link
Collaborator Author

MarcSkovMadsen commented Oct 24, 2020

Thanks @xavArtley . The cause of the Tabulator problem is that I did not specify a css theme up front. Then Tabulator loads the default site css later in the process.

At least adding

image

Solves the problem for me. This is already done in the notebook example. And I just added it to the test_tabulator_examples.py file.

Let me know if this does not solve your issue or you see other issues. Thanks

tabulator_fix mp4

@MarcSkovMadsen
Copy link
Collaborator Author

MarcSkovMadsen commented Oct 24, 2020

@xavArtley . I've on purpose not added the css file to the Tabulator bokeh model as then the user cannot later specify one of the many available css Themes for Tabulator. At least that is what I have seen: loading multiple of these themes is not a good idea.

@MarcSkovMadsen
Copy link
Collaborator Author

My suggestion for these widgets is to add a disclaimer to the notebook. That these are up for review and the api might change.

But lets get them in. If we have to wait 6 more months before we get some decent tables into Panel then that is simply way to long. :-)

Every time I have a plot my users also wants an nice looking table they can sort and filter. That is my experience.

@philippjfr
Copy link
Member

-1 on merging before release. I will promise there will never be another 6 month gap. I'm happy to release 0.11 as soon as I'm done with the tabulator integration which I'm fully funded to work on in the coming weeks.

@MarcSkovMadsen
Copy link
Collaborator Author

MarcSkovMadsen commented Mar 2, 2021

Promise kept @philippjfr (see post above). It did not take 6 months. But maybe a little bit longer than you anticipated? Always multiply with 3. :-)

Congrats with the release.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants