-
-
Notifications
You must be signed in to change notification settings - Fork 525
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
Finalize Basic Tutorials #6425
Finalize Basic Tutorials #6425
Conversation
doc/tutorials/basic/pn_bind.md
Outdated
|
||
Try dragging the `wind_speed` slider. Notice that the `power_generation` function is called twice every time you change the `wind_speed` `value`. | ||
|
||
To solve this problem you should add *caching* or use *reactive expressions* (`pn.rx`). You will learn about *reactive expressions* in the next section. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we ask the user to add caching as an exercise?
pn.Column(submit, b_stop_wind_turbine).servable() | ||
``` | ||
|
||
### Keep the UI responsive with threads or processes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide your best practice version of the example in this section Philipp taking into account holoviz/param#806 (comment), #6426 and holoviz/param#912.
I've requested a preliminary of the content of this PR from @philippjfr . Does this cover the skills we want to teach our basic users? Are the examples best practice? If not please update the code. Please also guide how we get the issues mentioned fixed or worked around. Thanks. |
@@ -75,6 +75,18 @@ Now that you've got the basics down, it's time to put your skills to the test: | |||
- **[Build a Streaming Dashboard](build_streaming_dashboard.md)** | |||
- **[Build a Chat Bot](build_chatbot.md)** | |||
|
|||
## Community Tutorials |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will probably have to update this list once in a while.
It would be really awesome if @sophiamyang would update the 3 Ways to Build a Panel Visualization Dashboard blog post. Main points to update would be
- hvplot.interactive to
pn.rx
(code below) - button_type+button_style (as in code below)
- sizing_mode of HoloViews pane (as in code below)
- accent (as in code below)
- the picture showing logos and download numbers. Panel logo is blue number and download numbers much higher.
import panel as pn
import hvplot.pandas
# Load Data
from bokeh.sampledata.autompg import autompg_clean as df
# Make DataFrame Pipeline Interactive
idf = pn.rx(df)
# Define Panel widgets
cylinders = pn.widgets.IntSlider(name='Cylinders', start=4, end=8, step=2)
mfr = pn.widgets.ToggleGroup(
name='MFR',
options=['ford', 'chevrolet', 'honda', 'toyota', 'audi'],
value=['ford', 'chevrolet', 'honda', 'toyota', 'audi'],
button_type='primary',
button_style="outline",
)
yaxis = pn.widgets.RadioButtonGroup(
name='Y axis',
options=['hp', 'weight'],
button_type='primary',
button_style="outline",
)
# Combine pipeline and widgets
rx_pipeline = (
idf[
(idf.cyl == cylinders) &
(idf.mfr.isin(mfr))
]
.groupby(['origin', 'mpg'])[yaxis].mean()
.to_frame()
.reset_index()
.sort_values(by='mpg')
.reset_index(drop=True)
)
# Pipe to hvplot
rx_plot = rx_pipeline.hvplot(x='mpg', y=yaxis, by='origin', color=["#ff6f69", "#ffcc5c", "#88d8b0"], line_width=6, height=400)
# Layout using Template
template = pn.template.FastListTemplate(
title='Interactive DataFrame Dashboards with hvplot .interactive',
sidebar=[cylinders, 'Manufacturers', mfr, 'Y axis' , yaxis],
main=[pn.pane.HoloViews(rx_plot, sizing_mode="stretch_width")],
accent="#88d8b0",
)
template.servable()
…ent/finalize-basic-tutorial
…ent/finalize-basic-tutorial
Merging this as is for now and picking it up again tomorrow for final edits. |
WAITING FOR PHILIPP REVIEW AND GUIDANCE
Closes #6390
Adds the missing content to the basic tutorials
Todo
pn.panel
. If it feels too repetitive it can quickly be skimmed. But its there to be able to compare and contrast the two approaches.{pyodide}
code blocks to render output when build and interactive when run.Related issues
To finish the Todo list above Philipp would have to help fix or workaround the issues below.
pn.pane
namespace #6427param.watch
function/decorator param#806 (comment)