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

Enable using Perspective in Panel similarly to using Perspective in Jupyter #942

Closed
MarcSkovMadsen opened this issue Feb 22, 2020 · 8 comments
Labels
enhancement Feature requests or improvements Python

Comments

@MarcSkovMadsen
Copy link

My Pain

I (try to) develop awesome analytics apps in Python for traders at work and for fun and to share knowledge in my spare time. One of the python frameworks I enjoy using is Panel. See also awesome-panel.org that I'm developing.

I would really like to use Perspective in Panel and I also would like to that others have the opportunity as well.

But currently this is not supported.

Solution

Add a Perspective widget to Panel or alternatively add support for Panel to Perspective.

Additional info

  • Panel normally runs on top of the Bokeh Server but can also run on top of other Servers like Flask, Django and Voila.

  • To enable support in Panel you would start building a Bokeh model of Perspective

    • Normally the Bokeh model on the server and in the client is kept in sync by Bokeh serialization and communication. Here we would have to consider whether the Perspective communication based on Arrow could be used instead to speed up thing.
  • An alternative to a custom implementation for Panel is just to use the Perspective Jupyter version. Because soon all IPyWidgets can be used directly in Panel. But this is not as performant and powerfull (I believe) as a "native" Panel implementation.

  • There is already a feature request for Perspective in the Panel repo Add perspective widget holoviz/panel#1107

I added a feature request in the Perspective project because maybe there is some interest in this community and some of you might want to contribute interest, ideas, knowledge, support or actual code. Furthermore I just wanted to share the progress from Panel if any. I have a hope to be able to contribute something my self.

@MarcSkovMadsen MarcSkovMadsen changed the title Enable using perspective in Panel (similarly to using perspective in Jupyter) Enable using perspective in Panel (similarly to using Perspective in Jupyter Notebook + Voila) Feb 22, 2020
@MarcSkovMadsen
Copy link
Author

MarcSkovMadsen commented Feb 22, 2020

To put the expected effort into perspective :-) I co-contributed a widget for DeckGl to Panel.

I had never tried it before. I needed to learn something about Bokeh Models and how they are implemented using TypeScript. Then I implemented the first version of the DeckGL widget. It took me ~10hours. The Philipp (BDFL of Panel) helped get all the details right and he worked very hard for a day or two.

I also co-contributed two reference example notebooks to illustrate how the widget was used. Spend maybe 5 hours on this.

https://panel.holoviz.org/gallery/param/deck_gl_global_power_plants.html#param-gallery-deck-gl-global-power-plants

image

@MarcSkovMadsen MarcSkovMadsen changed the title Enable using perspective in Panel (similarly to using Perspective in Jupyter Notebook + Voila) Enable using Perspective in Panel similarly to using Perspective in Jupyter Feb 22, 2020
@timkpaine timkpaine added enhancement Feature requests or improvements Python labels Feb 22, 2020
@timkpaine
Copy link
Member

@MarcSkovMadsen this has always been on our radar as @ceball and I work on the same team at JP Morgan. We will discuss priorities and respond here next week

@MarcSkovMadsen
Copy link
Author

FYI.

I've started adding support for the perspective-viewer web component to Panel. Only.

For more information see holoviz/panel#1122 (comment)

@MarcSkovMadsen
Copy link
Author

MarcSkovMadsen commented Mar 21, 2020

Just for the record. The basic functionality for the perspective-viewer web component (not python package) has been implemented and is working well. The things that I would expect not working are streaming and getting selected rows back. But the rest I would expect to work just fine.

It would support my use case for now based on this simple implementation.

But I hope someone would take it to a higher level implementing this as a true Panel pane that supports all the functionality of the Perspective python package and fast data transfer including streaming.

perspective

FYI. @timkpaine

@MarcSkovMadsen
Copy link
Author

FYI. I've added an example to the gallery at awesome-panel.org

test_perspective

@MarcSkovMadsen
Copy link
Author

MarcSkovMadsen commented Aug 23, 2020

I've added the perspective-viewer to the awesome-panel-extensions Package so that it is available for all Panel users.

Use it via from awesome_panel_extensions.widgets.perspective_viewer import PerspectiveViewer.

I hope it will be moved to Panel in the next release.

FYI. @timkpaine. Feel free to check it out. Any suggestions and comments are much appreciated. Its based on a Bokeh extension (typescript + python).

https://github.com/MarcSkovMadsen/awesome-panel-extensions/blob/master/awesome_panel_extensions/bokeh_extensions/perspective_viewer.ts
https://github.com/MarcSkovMadsen/awesome-panel-extensions/blob/master/awesome_panel_extensions/bokeh_extensions/perspective_viewer.py

It could actually be made generally available in general to Bokeh users with a few steps like adding documenation and examples.

I've announced it on the Bokeh discourse here https://discourse.bokeh.org/t/perspectiveviewer-extension/6204. Maybe someone shows interest one day.

The Panel extension is here.

https://github.com/MarcSkovMadsen/awesome-panel-extensions/blob/master/awesome_panel_extensions/widgets/perspective_viewer.py

There is a jupyter reference notebook as well.

@MarcSkovMadsen
Copy link
Author

I see indications that some of the plugins support row selection and editing. But I've not been able to find any documention on this. Please provide links or information if possible. Then I could support this in the Panel widget.

Thanks.

@MarcSkovMadsen
Copy link
Author

MarcSkovMadsen commented Jun 8, 2023

Perspective has been available in Panel for a long time now. And its awesome. See https://panel.holoviz.org/reference/panes/Perspective.html

I will close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests or improvements Python
Projects
None yet
Development

No branches or pull requests

2 participants