Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
balast committed Oct 29, 2020
1 parent 44211ac commit aa2870f
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions learning_aid.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"metadata": {},
"source": [
"<div class=\"alert alert-info\">\n",
"Note: For the app below to work in jupyterlab, you'll need to run <b>jupyter labextension install @pyviz/jupyterlab_pyviz</b> in the terminal to install the needed labextension.\n",
"Note: For the app below to work in JupyterLab, you'll need to run <b>jupyter labextension install @pyviz/jupyterlab_pyviz</b> in the terminal to install the needed labextension. This is not needed if running in a Jupyter notebook outside of JupyterLab.\n",
"</div>"
]
},
Expand Down Expand Up @@ -104,9 +104,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Prototyping in Jupyterlab\n",
"### Prototyping in Jupyter\n",
"Panel and Holoviews are nice because they integrate well with Jupyter notebooks and Jupyterlab. You can build your app and display it interactively in Jupyterlab to speed up development. For this to work however, make sure to:\n",
"1. Run `jupyter labextension install @pyviz/jupyterlab_pyviz` in the terminal to install the needed labextension if you didn't above.\n",
"1. If running in JupyterLab, run `jupyter labextension install @pyviz/jupyterlab_pyviz` in the terminal to install the needed labextension if you didn't above. This is not needed if running in a Jupyter notebook outside of JupyterLab.\n",
"2. Run `import panel as pn` and `pn.extension()` at the top of the notebook.\n",
"\n",
"After doing so, you should be all set to prototype the app within jupyterlab."
Expand Down Expand Up @@ -134,6 +134,13 @@
"## 2. Building the App Backbone"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"First, let's make a widget by running the code below."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -167,13 +174,23 @@
"### Making a sample Layout"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We combine a widget and some markdown panes with a Column panel in the next cell."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Markdown Pane\n",
"radio_button_display = pn.pane.Markdown(f'Radio Button Value: {radio_button.value}')\n",
"\n",
"# Combine Panes and Widget in the Column panel\n",
"layout = pn.Column('## My Radio Button App', radio_button, radio_button_display)\n",
"layout"
]
Expand All @@ -190,7 +207,7 @@
"metadata": {},
"source": [
"<div class=\"alert alert-info\">\n",
"Panel has four different API's. This learning aid uses the callback API, which is the lowest level of the four, and gives the most control.\n",
"Note: Panel has four different API's. This learning aid uses the callback API, which is the lowest level of the four, and gives the most control.\n",
"</div>"
]
},
Expand Down Expand Up @@ -260,7 +277,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"A complete tutorial of plotting in Holoviews is beyond the scope of this learning aid. For this example, let it suffice that `hv.Scatter(dataframe, kdims='x_column', vdims='y_column')` will produce a scatter plot.\n",
"A complete tutorial of plotting in Holoviews is beyond the scope of this learning aid. For this example, just know that `hv.Scatter(dataframe, kdims='x_column', vdims='y_column')` will produce a scatter plot.\n",
"The documentation [https://holoviews.org/getting_started/Introduction.html](https://holoviews.org/getting_started/Introduction.html) can be consulted for additional specifics."
]
},
Expand All @@ -270,7 +287,7 @@
"metadata": {},
"outputs": [],
"source": [
"hv.Scatter(data=autompg, kdims='mpg', vdims='weight').opts(tools=['hover'], size=6)"
"hv.Scatter(data=autompg, kdims='mpg', vdims='weight').opts(tools=['hover'], size=6, title='Example Scatter Plot')"
]
},
{
Expand All @@ -296,7 +313,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now let's set up the layout of the plot"
"Now let's set up the layout of the plot."
]
},
{
Expand All @@ -306,6 +323,7 @@
"outputs": [],
"source": [
"auto_plot = pn.pane.HoloViews(object=None, sizing_mode='stretch_width') # empty plot initially\n",
"\n",
"layout = pn.Column(\n",
" '## Auto MPG App',\n",
" pn.Row('#### x-axis:', auto_mpg_radio_x),\n",
Expand All @@ -318,7 +336,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Next let's set up the plot to update."
"Next let's configure the plot to update when the widget values are changed."
]
},
{
Expand Down Expand Up @@ -375,7 +393,7 @@
"metadata": {},
"outputs": [],
"source": [
"layout.show()"
"layout.show() # You won't be able to view this from binder, but will be able to if running locally."
]
},
{
Expand Down

0 comments on commit aa2870f

Please sign in to comment.