holoviz/panel

Enable users to easily get running environment: notebook, lab, colab, vscode, server, na

MarcSkovMadsen opened this issue · 1 comments

Sometimes you need to do different things depending on in which environment you are.

For example right now I am developing a notebook with Sophia for a blog post https://github.com/sophiamyang/hvplot_interactive/blob/main/hvplot_interactive.ipynb.

The app uses Tabulator and the FastListTemplate. I want to give Tabulator the fast theme. But unfortunately this only works on the server. Thus I need to do different things depending on whether I am on server or something else.

image

image

Solution

pn.config.environment

where environment value is one of notebook, lab, colab, vscode, server or na.

Additional Context

  • The comms of pn.extension should be determined using the same functionality.
  • Colab should automatically be determined. Not something I have to set specifically. See #2242 (comment)

Closing as obsolete.