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

Stub experiments #3132

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,4 @@ discover/
node_modules/*
/tmp
.devcontainer/*
out
94 changes: 94 additions & 0 deletions panel/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,97 @@
"""
Panel is a high level app and dashboarding framework
====================================================

Works with the tools you know and ❤️.

`Getting Started<https://panel.holoviz.org>`_ \| `Discourse`_ \| `Github`_ \| `Twitter`_ \|
`LinkedIn`_

Interactive models with ``.bind``
---------------------------------

.. figure:: https://user-images.githubusercontent.com/42288570/150686594-21b03e55-79ef-406b-9e61-1764c6b493c3.gif
:alt: Interactive Model App

Interactive Model App

You can use Panels ``.bind`` to bind your models to widgets.

.. code:: python

import panel as pn

color = "#C43F66"

pn.extension(sizing_mode="stretch_width", template="fast")


def model(a, b, emoji):
result = "#" + (emoji * a) + " + " + (emoji * b) + " = " + (emoji * (a + b))
return result

pn.pane.Markdown("## Input", margin=(5, 10)).servable(area="sidebar")
input1 = pn.widgets.RadioButtonGroup(value=1, options=[1, 2, 3], button_type="success", name="A").servable(area="sidebar")
input2 = pn.widgets.IntSlider(value=2, start=0, end=3, step=1, margin=(20, 10)).servable(area="sidebar")

interactive_add = pn.bind(model, a=input1, b=input2, emoji="⭐")
pn.panel(interactive_add).servable(area="main", title="My interactive MODEL")

pn.state.template.param.update(site="Panel", accent_base_color=color, header_background=color)

You can serve your app via

.. code:: bash

$ panel serve 'script.py' --autoreload
2022-01-23 15:00:31,373 Starting Bokeh server version 2.4.2 (running on Tornado 6.1)
2022-01-23 15:00:31,387 User authentication hooks NOT provided (default user enabled)
2022-01-23 15:00:31,389 Bokeh app running at: http://localhost:5006/script

The file can be a ``.py`` script or ``.ipynb`` notebook.

Try changing the return value of the function. Panel will magically ✨
understand how to show the objects you know and ❤️.

| This includes `Bokeh`_,
| `HoloViews`_,
| `Matplotlib`_ and
| `Plotly`_ figures.

Interactive dataframes with ``.interactive``
--------------------------------------------

.. figure:: https://user-images.githubusercontent.com/42288570/150683991-9cece6a1-3751-42d2-8256-505f5deb12be.gif
:alt: Interactive DataFrame App

Interactive DataFrame App

You can use `hvplot .interactive`_ to make your dataframes interactive.

\```python import panel as pn import pandas as pd import hvplot.pandas

color = “#0072B5” df = pd.DataFrame(data={“x”: [0, 1, 2, 3, 4], “y”: [0,
2, 1, 3, 4]})

pn.extension(sizing_mode=“stretch_width”, template=“fast”)

pn.pane.Markdown(“## Selection”, margin=(10,
10)).servable(area=“sidebar”) count =
pn.widgets.RadioButtonGroup(value=5, options=[3, 4, 5], name=“Count”,
button_type=“success”).servable(area=“sidebar”)

interactive_df = df.interactive().head

.. _Discourse: https://discourse.holoviz.org/
.. _Github: https://github.com/holoviz/panel
.. _Twitter: https://twitter.com/Panel_org
.. _LinkedIn: https://www.linkedin.com/company/79754450
.. _Bokeh: https://panel.holoviz.org/reference/panes/Bokeh.html#panes-gallery-bokeh
.. _HoloViews: https://panel.holoviz.org/reference/panes/HoloViews.html#panes-gallery-holoviews
.. _Matplotlib: https://panel.holoviz.org/reference/panes/Matplotlib.html#panes-gallery-matplotlib
.. _Plotly: https://panel.holoviz.org/reference/panes/Plotly.html#panes-gallery-plotly
.. _hvplot .interactive: https://hvplot.holoviz.org/user_guide/Interactive.html
"""
from . import layout # noqa
from . import links # noqa
from . import pane # noqa
Expand Down
Loading