{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "tags": [ "parameters" ] }, "outputs": [], "source": [ "flex_source_code = \"https://github.com/danielfrg/jupyter-flex/blob/master/examples/widgets/ipywidgets.ipynb\"" ] }, { "cell_type": "markdown", "metadata": { "tags": [ "sidebar" ] }, "source": [ "# Sidebar" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Widgets" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import ipywidgets as widgets" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [ "chart" ] }, "outputs": [], "source": [ "w1 = widgets.IntSlider()\n", "w2 = widgets.Text(value='Hello World!')\n", "w3 = widgets.IntRangeSlider(value=[5, 7], max=10)\n", "w4 = widgets.IntProgress(value=7, max=10,)\n", "w5 = widgets.BoundedIntText(value=7, min=0, max=10)\n", "w6 = widgets.Checkbox(value=False, description='Check me', disabled=False)\n", "w7 = widgets.Dropdown(options=['1', '2', '3'], value='2', description='Number:', disabled=False)\n", "\n", "w8 = widgets.RadioButtons(\n", " options=['pepperoni', 'pineapple', 'anchovies'],\n", " value='pineapple',\n", " description='Pizza topping:',\n", " disabled=False\n", ")\n", "w9 = widgets.Select(\n", " options=['Linux', 'Windows', 'OSX'],\n", " value='OSX',\n", " # rows=10,\n", " description='OS:',\n", " disabled=False\n", ")\n", "\n", "w10 = widgets.VBox([widgets.Label(value=\"VBox and Label\"), widgets.FloatSlider()])\n", "\n", "w11 = widgets.HTML(\n", " value=\"Hello World\",\n", " placeholder='Some HTML',\n", " description='Some HTML',\n", ")\n", "\n", "w12 = widgets.Button(\n", " description='Click me',\n", " disabled=False,\n", " button_style='', # 'success', 'info', 'warning', 'danger' or ''\n", " tooltip='Click me',\n", " icon='check'\n", ")\n", "\n", "w13 = widgets.ToggleButton(\n", " value=False,\n", " description='Click me',\n", " disabled=False,\n", " button_style='', # 'success', 'info', 'warning', 'danger' or ''\n", " tooltip='Description',\n", " icon='check'\n", ")\n", "\n", "w14 = widgets.ToggleButtons(\n", " options=['Slow', 'Regular', 'Fast'],\n", " description='Speed:',\n", " disabled=False,\n", " button_style='', # 'success', 'info', 'warning', 'danger' or ''\n", " tooltips=['Description of slow', 'Description of regular', 'Description of fast'],\n", "# icons=['check'] * 3\n", ")\n", "\n", "w15 = widgets.Play(\n", "# interval=10,\n", " value=50,\n", " min=0,\n", " max=100,\n", " step=1,\n", " description=\"Press play\",\n", " disabled=False\n", ")\n", "w15_slider = widgets.IntSlider()\n", "widgets.jslink((w15, 'value'), (w15_slider, 'value'))\n", "\n", "w20 = widgets.Text(\n", " value='Hello World',\n", " placeholder='Type something',\n", " description='String:',\n", " disabled=False\n", ")\n", "\n", "w21 = widgets.Textarea(\n", " value='Hello World',\n", " placeholder='Type something',\n", " description='String:',\n", " disabled=False\n", ")\n", "\n", "w22 = widgets.Combobox(\n", " # value='John',\n", " placeholder='Choose Someone',\n", " options=['Paul', 'John', 'George', 'Ringo'],\n", " description='Combobox:',\n", " ensure_option=True,\n", " disabled=False\n", ")\n", "\n", "\n", "w23 = widgets.DatePicker(\n", " description='Pick a Date',\n", " disabled=False\n", ")\n", "\n", "\n", "w24 = widgets.ColorPicker(\n", " concise=False,\n", " description='Pick a color',\n", " value='blue',\n", " disabled=False\n", ")\n", "\n", "w25 = widgets.FileUpload(\n", " accept='', # Accepted file extension e.g. '.txt', '.pdf', 'image/*', 'image/*,.pdf'\n", " multiple=False # True to accept multiple files upload else False\n", ")\n", "\n", "display(w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w15, w15_slider, w20, w21, w22, w23, w24, w25)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Page 1" ] }, { "cell_type": "markdown", "metadata": { "tags": [ "text" ] }, "source": [ "Page 1 - text" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [ "chart" ] }, "outputs": [], "source": [ "\"The code\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Page 2" ] }, { "cell_type": "markdown", "metadata": { "tags": [ "text" ] }, "source": [ "Page 2 text" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [ "chart" ] }, "outputs": [], "source": [ "\"More code\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "celltoolbar": "Tags", "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" } }, "nbformat": 4, "nbformat_minor": 2 }