Skip to content

Commit

Permalink
improve intro example (#4652)
Browse files Browse the repository at this point in the history
Co-authored-by: Marc Skov Madsen <[email protected]>
  • Loading branch information
MarcSkovMadsen and Marc Skov Madsen authored Apr 15, 2023
1 parent a5a9e5f commit 0df3be5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions examples/homepage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,24 @@
"\"\"\")\n",
"\n",
"code = pn.widgets.CodeEditor(language='python', theme='monokai', height=360, value=\\\n",
"\"\"\"x = pn.widgets.Select(name='x', options=cols)\n",
"\"\"\"import panel as pn\n",
"\n",
"pn.extension()\n",
"\n",
"x = pn.widgets.Select(name='x', options=cols)\n",
"y = pn.widgets.Select(name='y', options=cols, value='bill_depth_mm')\n",
"n_clusters = pn.widgets.IntSlider(name='n_clusters', start=2, end=5, value=3)\n",
"\n",
"explanation = pn.pane.Markdown(...)\n",
"\n",
"def plot_clusters(x, y, n_clusters):\n",
"def plot(x, y, n_clusters):\n",
" ...\n",
" \n",
"interactive_plot = pn.bind(plot, x, y, n_clusters)\n",
" \n",
"pn.Row(\n",
" pn.WidgetBox(x, y, n_clusters, explanation), \n",
" pn.bind(plot, x, y, n_clusters)\n",
" interactive_plot\n",
")\"\"\", width=800)\n",
"\n",
"app = pn.Tabs(\n",
Expand Down

0 comments on commit 0df3be5

Please sign in to comment.