diff --git a/doc/_static/images/colab-notebook.png b/doc/_static/images/colab-notebook.png new file mode 100644 index 0000000000..50b0504d18 Binary files /dev/null and b/doc/_static/images/colab-notebook.png differ diff --git a/doc/_static/images/pycharm-notebook.png b/doc/_static/images/pycharm-notebook.png new file mode 100644 index 0000000000..fe98b3b53a Binary files /dev/null and b/doc/_static/images/pycharm-notebook.png differ diff --git a/doc/explanation/develop_seamlessly.md b/doc/explanation/develop_seamlessly.md index c9191e12b3..0f4e622d5b 100644 --- a/doc/explanation/develop_seamlessly.md +++ b/doc/explanation/develop_seamlessly.md @@ -143,7 +143,7 @@ template.main.append(p_hearts) template.servable() ``` -From the VS Code terminal run the following command. +From the terminal run the following command. ```bash panel serve app.py --show --autoreload @@ -163,5 +163,6 @@ The `--show` flag will open a browser tab with the live app and the `--autoreloa ### How-to +- [Configure PyCharm](../how_to/editor/pycharm_configure.md) - [Configure VS Code](../how_to/editor/vscode_configure.md) - [Write apps in Markdown](../how_to/editor/markdown.md) diff --git a/doc/how_to/editor/pycharm_configure.md b/doc/how_to/editor/pycharm_configure.md index f52d58be41..f7e8dcc07e 100644 --- a/doc/how_to/editor/pycharm_configure.md +++ b/doc/how_to/editor/pycharm_configure.md @@ -40,3 +40,13 @@ With the configuration in place, you can now easily `run` Panel apps via the `pa With the configuration in place, you can now easily `debug` Panel apps via the `panel serve` configuration. The picture below shows debugging in action, where a breakpoint is hit when the Button is clicked. ![Debug Panel App in PyCharm](../../_static/images/pycharm-debug-panel.png) + +## Notebook Environment + +PyCharm Professional offers support for [Jupyter Notebooks](https://www.jetbrains.com/help/pycharm/ipython-notebook-support.html) and [ipywidgets](https://www.jetbrains.com/help/pycharm/interactive-js-widgets.html), enhancing interactive Python development. + +To integrate Panel effectively, ensure the installation of `jupyter_bokeh` by executing `pip install jupyter jupyter_bokeh` or `conda install jupyter jupyter_bokeh`. Subsequently, activate the extension using `pn.extension()`. + +Below, observe the implementation of a notebook within the PyCharm Notebook Environment. + +![Panel in PyCharm Notebook Environment](../../_static/images/pycharm-notebook.png) diff --git a/doc/how_to/notebook/other_nb.md b/doc/how_to/notebook/other_nb.md index 8513a79ec8..6b92ec5c31 100644 --- a/doc/how_to/notebook/other_nb.md +++ b/doc/how_to/notebook/other_nb.md @@ -4,21 +4,49 @@ This guide addresses how to develop apps in Google Colab, VSCode, nteract, and o --- -### Google Colab +## Google Colab -In the Google Colaboratory notebook, first make sure to load the `pn.extension()`. Panel objects will then render themselves if they are the last item in a notebook cell. Please note that in Colab rendering for each notebook cell is isolated, which means that every cell must reload the Panel extension code separately. This will result in somewhat slower and larger notebook than with other notebook technologies. +:::{tip} -### VSCode notebook +Before using a new [Colab notebook](https://colab.google/) you should make sure you are running on the latest version of Panel and that the latest version of [`jupyter_bokeh`](https://github.com/bokeh/jupyter_bokeh) is installed. -Visual Studio Code (VSCode) versions 2020.4.74986 and later support ipywidgets, and Panel objects can be used as ipywidgets since Panel 0.10 thanks to `jupyter_bokeh`, which means that you can now use Panel components interactively in VSCode. Ensure you install `jupyter_bokeh` with `pip install jupyter_bokeh` or `conda install -c bokeh jupyter_bokeh` and then enable the extension with `pn.extension()`. +You can update Panel and `jupyter_bokeh` with + +```bash +!pip install panel param bokeh jupyter_bokeh -U +``` + +::: + +In the Google Colaboratory notebook, first make sure to load the `pn.extension()`. As usual Panel objects will then render themselves if they are the last item in a notebook cell. + +![Colab Panel Notebook](../../_static/images/colab-notebook.png) + +:::{note} +Please note that in Colab rendering for each notebook cell is isolated, which means that every cell must reload the Panel extension code separately. This will result in somewhat slower and larger notebook than with other notebook technologies. +::: + +:::{warning} +The [IpyWidgets](../../reference/panes/IpyWidget.ipynb) pane does not work in Google Colab. Thus you cannot use IpyWidgets with Panel in Colab. +::: + +## PyCharm Notebook + +PyCharm Professional offers support for [notebooks](https://www.jetbrains.com/help/pycharm/ipython-notebook-support.html) and [ipywidgets](https://www.jetbrains.com/help/pycharm/interactive-js-widgets.html). Thanks to the [`jupyter_bokeh`](https://github.com/bokeh/jupyter_bokeh) integration, Panel objects can be utilized as ipywidgets, allowing for interactive use of Panel components within PyCharm Professional. To ensure full functionality, install `jupyter_bokeh` using `pip install jupyter jupyter_bokeh` or `conda install jupyter jupyter_bokeh`, followed by activating the extension with `pn.extension()`. + +For additional guidance, refer to the [How-To Configure PyCharm Guide](../editor/pycharm_configure.md). + +## VSCode notebook + +Visual Studio Code (VS Code) supports notebooks and ipywidgets, and Panel objects can be used as ipywidgets thanks to [`jupyter_bokeh`](https://github.com/bokeh/jupyter_bokeh), which means that you can use Panel components interactively in VS Code. Ensure you install `jupyter_bokeh` with `pip install jupyter_bokeh` or `conda install -c bokeh jupyter_bokeh` and then enable the extension with `pn.extension()`. See also the [How-To Configure VS Code Guide](../editor/vscode_configure.md). -### nteract and other ipywidgets notebooks +## nteract and other ipywidgets notebooks In other notebook environments that support rendering ipywidgets interactively, such as nteract, you can use the same underlying ipywidgets support as for vscode: Install ``jupyter_bokeh`` and then use ``pn.extension(comms='ipywidgets')``. -### Other environments +## Other environments If your development environment offers embedded Python processes but does not support ipywidgets or Jupyter "comms" (communication channels), you will notice that some or all interactive functionality is missing. Some widgets that operate only in JavaScript will work fine, but others require communication channels between JavaScript and Python. In such cases you can either request ipywidgets or Panel support from the editor or environment, or else use the Editor + Server approach above. diff --git a/doc/tutorials/basic/develop_editor.md b/doc/tutorials/basic/develop_editor.md index ab6eb50714..1c0ca5bb4f 100644 --- a/doc/tutorials/basic/develop_editor.md +++ b/doc/tutorials/basic/develop_editor.md @@ -160,6 +160,7 @@ For more advanced techniques and configuration options, check out the resources ### How-to - [Configure VS Code](../../how_to/editor/vscode_configure.md) +- [Configure PyCharm](../../how_to/editor/pycharm_configure.md) - [Write Apps in Markdown](../../how_to/editor/markdown.md) Happy coding! 🚀 diff --git a/doc/tutorials/basic/develop_notebook.md b/doc/tutorials/basic/develop_notebook.md index db854a99b1..9131c59b61 100644 --- a/doc/tutorials/basic/develop_notebook.md +++ b/doc/tutorials/basic/develop_notebook.md @@ -250,6 +250,7 @@ For more detailed instructions and explanations, check out the resources below: - [Display Output in Notebooks](../../how_to/notebook/notebook.md) - [Preview Apps in JupyterLab](../../how_to/notebook/jupyterlabpreview.md) - [Serve an App from a Notebook File](serve.md) -- [Use VS Code Notebook and Interactive Environment](https://panel.holoviz.org//how_to/editor/vscode_configure.html#notebook-and-interactive-environment) +- [Use PyCharm Notebook Environment](https://panel.holoviz.org/how_to/editor/pycharm_configure.html#notebook-environment) +- [Use VS Code Notebook Environment](https://panel.holoviz.org/how_to/editor/vscode_configure.html#notebook-and-interactive-environment) Happy developing! 🚀 diff --git a/doc/tutorials/intermediate/develop_editor.md b/doc/tutorials/intermediate/develop_editor.md index 119173ddd5..7c77cf5bbf 100644 --- a/doc/tutorials/intermediate/develop_editor.md +++ b/doc/tutorials/intermediate/develop_editor.md @@ -105,6 +105,7 @@ You have learned to ### How-to +- [Configure PyCharm](../../how_to/editor/pycharm_configure.md) - [Configure VS Code](../../how_to/editor/vscode_configure.md) ## Explanation