flex_source_code = "https://github.com/danielfrg/jupyter-flex/blob/master/examples/widgets/ipywidgets.ipynb"
import ipywidgets as widgets
w1 = widgets.IntSlider()
w2 = widgets.Text(value='Hello World!')
w3 = widgets.IntRangeSlider(value=[5, 7], max=10)
w4 = widgets.IntProgress(value=7, max=10,)
w5 = widgets.BoundedIntText(value=7, min=0, max=10)
w6 = widgets.Checkbox(value=False, description='Check me', disabled=False)
w7 = widgets.Dropdown(options=['1', '2', '3'], value='2', description='Number:', disabled=False)
w8 = widgets.RadioButtons(
options=['pepperoni', 'pineapple', 'anchovies'],
value='pineapple',
description='Pizza topping:',
disabled=False
)
w9 = widgets.Select(
options=['Linux', 'Windows', 'OSX'],
value='OSX',
# rows=10,
description='OS:',
disabled=False
)
w10 = widgets.VBox([widgets.Label(value="VBox and Label"), widgets.FloatSlider()])
w11 = widgets.HTML(
value="Hello <b>World</b>",
placeholder='Some HTML',
description='Some HTML',
)
w12 = widgets.Button(
description='Click me',
disabled=False,
button_style='', # 'success', 'info', 'warning', 'danger' or ''
tooltip='Click me',
icon='check'
)
w13 = widgets.ToggleButton(
value=False,
description='Click me',
disabled=False,
button_style='', # 'success', 'info', 'warning', 'danger' or ''
tooltip='Description',
icon='check'
)
w14 = widgets.ToggleButtons(
options=['Slow', 'Regular', 'Fast'],
description='Speed:',
disabled=False,
button_style='', # 'success', 'info', 'warning', 'danger' or ''
tooltips=['Description of slow', 'Description of regular', 'Description of fast'],
# icons=['check'] * 3
)
w15 = widgets.Play(
# interval=10,
value=50,
min=0,
max=100,
step=1,
description="Press play",
disabled=False
)
w15_slider = widgets.IntSlider()
widgets.jslink((w15, 'value'), (w15_slider, 'value'))
w20 = widgets.Text(
value='Hello World',
placeholder='Type something',
description='String:',
disabled=False
)
w21 = widgets.Textarea(
value='Hello World',
placeholder='Type something',
description='String:',
disabled=False
)
w22 = widgets.Combobox(
# value='John',
placeholder='Choose Someone',
options=['Paul', 'John', 'George', 'Ringo'],
description='Combobox:',
ensure_option=True,
disabled=False
)
w23 = widgets.DatePicker(
description='Pick a Date',
disabled=False
)
w24 = widgets.ColorPicker(
concise=False,
description='Pick a color',
value='blue',
disabled=False
)
w25 = widgets.FileUpload(
accept='', # Accepted file extension e.g. '.txt', '.pdf', 'image/*', 'image/*,.pdf'
multiple=False # True to accept multiple files upload else False
)
display(w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w15, w15_slider, w20, w21, w22, w23, w24, w25)
Page 1 - text
"The code"
Page 2 text
"More code"