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

Simplify homepage #2850

Merged
merged 19 commits into from
Nov 23, 2021
Merged
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
conda config --set always_yes True
conda install -c pyviz "pyctdev>=0.5"
doit ecosystem_setup
doit env_create ${{ env.CHANS_DEV}} --python=3.7
doit env_create ${{ env.CHANS_DEV}} --python=3.8
- uses: actions/setup-node@v2
with:
node-version: '15'
Expand Down
16 changes: 16 additions & 0 deletions doc/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,19 @@
.fa-discourse:before {
color: white;
}

button.toggle-button {
display: none;
}

.toggle-hidden:not(.admonition) {
height: 0;
}

.tag_hide-input {
margin-bottom: 0 !important;
}

.toggle-hidden + .cell_output {
margin-top: 0 !important;
}
33 changes: 33 additions & 0 deletions doc/getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,39 @@ Support for classic Jupyter Notebook is included with Panel. If you want to work
.. |License| image:: https://img.shields.io/pypi/l/panel.svg
.. _License: https://github.com/pyviz/panel/blob/master/LICENSE.txt

Development
-----------

Editor + Server
===============

You can edit your Panel code as a .py file in any text editor, marking the objects you want to render as ``.servable()``, then launch a server with ``panel serve my_script.py --show`` to open a browser tab showing your app or dashboard and backed by a live Python process.

JupyterLab and Classic notebook
===============================

In the classic Jupyter notebook environment and JupyterLab, first make sure to load the ``pn.extension()``. Panel objects will then render themselves if they are the last item in a notebook cell. For versions of ``jupyterlab>=3.0`` the necessary extension is automatically bundled in the ``pyviz_comms`` package, which must be >=2.0. However note that for version of ``jupyterlab<3.0`` you must also manually install the JupyterLab extension with::
philippjfr marked this conversation as resolved.
Show resolved Hide resolved

jupyter labextension install @pyviz/jupyterlab_pyviz

Google Colab
============

In Google Colaboratory, rendering for each notebook cell is isolated, which means that every cell must reload the Panel extension code separately. Panel can do this automatically when you first load the extension if you declare that you are running in Colab: ``pn.extension(comms='colab')``. Otherwise you will need to put ``pn.extension()`` in each cell where you want to display Panel output. Either way, you should be able to have access to all of Panel's functionality, though with a larger notebook size than with other notebook technologies that allow display code to be shared across cells.

VSCode
======

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(comms='vscode')``.

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
==================
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.

Using Panel
-----------
Expand Down
94 changes: 19 additions & 75 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
.. raw:: html

<h1><img src="_static/logo_stacked.png" width="125"></h1>


A high-level app and dashboarding solution for Python
-----------------------------------------------------
.. title:: Panel Documentation

.. raw:: html

<img src="_static/logo_stacked.png" width="125">
<h2 style="margin-top: 0.3em;">A high-level app and dashboarding solution for Python</h2>

<table class="showcase-table">
<tr>
<td border=1><a href="https://examples.pyviz.org/attractors/attractors_panel.html"><b>Attractors</b></a><br><a href="https://attractors.pyviz.demo.anaconda.com/attractors_panel"><img src="https://assets.holoviews.org/panel/thumbnails/index/attractors.png" /></a></td>
Expand All @@ -17,34 +14,27 @@ A high-level app and dashboarding solution for Python
<td border=1><a href="https://examples.pyviz.org/portfolio_optimizer/portfolio.html"><b>Portfolio Optimizer</b></a><br><a href="https://portfolio-optimizer.pyviz.demo.anaconda.com"><img src="https://assets.holoviews.org/panel/thumbnails/index/portfolio_optimizer.png" /></a></td>
<tr>
</table>
<hr>

Panel is an `open-source <https://github.com/pyviz/panel/blob/master/LICENSE.txt>`_ Python library that lets you create custom interactive web apps and dashboards by connecting user-defined widgets to plots, images, tables, or text.

Compared to other approaches, Panel is novel in that it supports nearly all plotting libraries, works just as well in a Jupyter notebook as on a standalone secure web server, uses the same code for both those cases, supports both Python-backed and static HTML/JavaScript exported applications, and can be used to develop rich interactive applications without tying your domain-specific code to any particular GUI or web tools.

Panel makes it simple to make:
Panel is an `open-source <https://github.com/holoviz/panel/blob/master/LICENSE.txt>`_ Python library that lets you create custom interactive web apps and dashboards by connecting user-defined widgets to plots, images, tables, or text.

- Plots with user-defined controls
- Property sheets for editing parameters of objects in a workflow
- Control panels for simulations or experiments
- Custom data-exploration tools
- Dashboards reporting key performance indicators (KPIs) and trends
- Data-rich Python-backed web servers
- and anything in between
.. notebook:: panel ../examples/homepage.ipynb
:disable_interactivity_warning: True

Panel objects are reactive, immediately updating to reflect changes to their state, which makes it simple to compose viewable objects and link them into simple, one-off apps to do a specific exploratory task. The same objects can then be reused in more complex combinations to build more ambitious apps, while always sharing the same code that works well on its own.

Panel lets you move the same code freely between an interactive `Jupyter Notebook <https://jupyter.org>`__ prompt and a fully deployable standalone server. That way you can easily switch between exploring your data, building visualizations, adding custom interactivity, sharing with non-technical users, and back again at any point, using the same tools and the same code throughout. Panel thus helps support your entire workflow, so that you never have to commit to only one way of using your data and your analyses, and don't have to rewrite your code just to make it usable in a different way. In many cases, using Panel can turn projects that used to take weeks or months into something you finish on the same day you started, creating a full Python-backed deployed web service for your visualized data in minutes or hours without having to run a software development project or hand your work over to another team.

Using Panel for declarative, reactive programming
-------------------------------------------------
Compared to other approaches, Panel is novel in that it supports nearly all plotting libraries, works just as well in a Jupyter notebook as on a standalone secure web server, uses the same code for both those cases, supports both Python-backed and static HTML/JavaScript exported applications, and can be used to develop rich interactive applications without tying your domain-specific code to any particular GUI or web tools.

Panel can also be used with the separate `Param <https://param.pyviz.org>`__ project to create interactively configurable objects with or without associated visualizations, in a fully declarative way. With this approach, you declare your configurable object using the pure-Python, zero-dependency ``param`` library, annotating your code with parameter ranges, documentation, and dependencies between parameters and your code. Using this information, you can make all of your domain-specific code be *optionally* configurable in a GUI, with *optional* visual displays and debugging information if you like, all with just a few lines of declarations. With this approach, you don't ever have to decide whether your code will eventually be used in a notebook, in a GUI app, or completely behind the scenes in batch processing, servers, or reports -- the same code can support all of these cases equally well, once you declare the associated parameters and constraints. This approach lets you completely separate your domain-specific code from anything to do with web browsers, GUI toolkits, or other volatile technologies that would otherwise make your hard work become obsolete as they change over time.
Panel makes it simple to:

- Use the PyData tools and plotting libraries that you know and love
- Develop in your favorite editor or notebook environment and seamlessly deploy the resulting application
- Iterate quickly to prototype apps and dashboards while offering polished templates for your final deployment
- Support deep interactivity by communicating client-side interactions and events to Python
- Stream data large and small to the frontend
- Add authentication to your application using the inbuilt OAuth providers

The `Getting Started <getting_started>`_ will provide a quick introduction to the panel API and get you started while the `User Guide <user_guide>`_ provides a more detailed guide on how to use Panel.

For usage questions or technical assistance, please head over to `Discourse <https://discourse.holoviz.org/>`_. If you have any `issues <https://github.com/pyviz/panel/issues>`_ or wish to `contribute code <https://help.github.com/articles/about-pull-requests>`_, you can visit our `GitHub site <https://github.com/pyviz/panel>`_.

For usage questions or technical assistance, please head over to `Discourse <https://discourse.holoviz.org/>`_. If you have any `issues <https://github.com/holoviz/panel/issues>`_ or wish to `contribute code <https://help.github.com/articles/about-pull-requests>`_, you can visit our `GitHub site <https://github.com/holoviz/panel>`_.

Installation
------------
Expand All @@ -59,56 +49,10 @@ or using PyPI::

pip install panel


Getting Started
---------------

Once you've installed Panel, you can get your own copy of all the notebooks used to make this website by running the following commands on the commandline in your conda or pip environment::

panel examples
cd panel-examples

And then you can launch Jupyter to explore them yourself using either Jupyter Notebook or JupyterLab (having first installed the extension!)::

jupyter notebook
jupyter lab

Usage
-----

Panel can be used in a wide range of development environments:

Editor + Server
===============

You can edit your Panel code as a .py file in any text editor, marking the objects you want to render as ``.servable()``, then launch a server with ``panel serve my_script.py --show`` to open a browser tab showing your app or dashboard and backed by a live Python process.

JupyterLab and Classic notebook
===============================

In the classic Jupyter notebook environment and JupyterLab, first make sure to load the ``pn.extension()``. Panel objects will then render themselves if they are the last item in a notebook cell. For versions of ``jupyterlab>=3.0`` the necessary extension is automatically bundled in the ``pyviz_comms`` package, which must be >=2.0. However note that for version of ``jupyterlab<3.0`` you must also manually install the JupyterLab extension with::

jupyter labextension install @pyviz/jupyterlab_pyviz

Google Colab
============

In Google Colaboratory, rendering for each notebook cell is isolated, which means that every cell must reload the Panel extension code separately. Panel can do this automatically when you first load the extension if you declare that you are running in Colab: ``pn.extension(comms='colab')``. Otherwise you will need to put ``pn.extension()`` in each cell where you want to display Panel output. Either way, you should be able to have access to all of Panel's functionality, though with a larger notebook size than with other notebook technologies that allow display code to be shared across cells.

VSCode
======

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(comms='vscode')``.

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
==================
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.

Panel can be used in a wide range of development environments from a simple Python REPL, in a notebook or your favorite IDE such as VSCode. Visit the `Getting Started Guide <getting_started#installation>`_ to discover how to get set up in your favorite development environment.
philippjfr marked this conversation as resolved.
Show resolved Hide resolved

Sponsors
--------
Expand Down
6 changes: 1 addition & 5 deletions examples/getting_started/Introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
"metadata": {},
"source": [
"<div style=\"background-color: #007bff; border-radius: 5px; width: 100%; padding: 10px; color: white\">\n",
" <b>Note:</b> This guide is written for an interactive environment such as Jupyter notebooks. The interactive widgets will not work in a static version of this documentation. \n",
" \n",
"Instructions for installing Panel and the example notebooks can be found in the <a href=\"https://panel.holoviz.org/#installation\" target=\"_blank\" style=\"color:white\">Installation Guide</a>\n",
" <b>Note:</b> This guide is written for an interactive environment such as Jupyter notebooks. The interactive widgets will not work in a static version of this documentation. Instructions for installing Panel and the example notebooks can be found in the <a href=\"https://panel.holoviz.org/#installation\" target=\"_blank\" style=\"color:white\">Installation Guide</a>\n",
"</div>\n",
"\n",
"\n",
"\n",
"Panel lets you add interactive controls for just about anything you can display in Python. Panel can help you build simple interactive apps, complex multi-page dashboards, or anything in between. As a simple example, let's say we have loaded the [UCI ML dataset measuring the environment in a meeting room](http://archive.ics.uci.edu/ml/datasets/Occupancy+Detection+):"
]
},
Expand Down
Loading