import com.twosigma.beaker.widgets.integers.IntSlider
w = new IntSlider()
w.value = 60
w
w.value
60
w.value =76
76
w.description = "desc1"
desc1
w.disabled = false
//w.disabled = trw.tooltip = "ToggleButton tooltip 2"ue
false
w.max = 200
w.min = 50
50
w.orientation = "horizontal"
//w.orientation = "vertical"
horizontal
w.slider_color = "#087636"
#087636
w.step = 20
20
w.visible = true
//w.visible = false
true
import com.twosigma.beaker.widgets.integers.IntProgress
bar = new IntProgress()
bar.value = 10
bar
null
bar.value
10
bar.value =110
110
bar.max = 300
bar.min = 50
50
bar.step = 20
20
bar.orientation = "horizontal"
//bar.orientation = "vertical"
horizontal
import com.twosigma.beaker.widgets.selections.RadioButtons
rb = new RadioButtons()
rb.options=['1', '2', '3', '4', '5']
rb.value = "4"
rb
null
rb.value
4
rb.value ="1"
1
import com.twosigma.beaker.widgets.selections.Select
select = new Select()
select.options=['Linux', 'Windows', 'OSX']
select.value = "Windows"
select
null
select.value
Windows
select.value = "Linux"
Linux
import com.twosigma.beaker.widgets.bools.Checkbox
cb = new Checkbox()
cb
null
cb.value
false
cb.value = true
true
import com.twosigma.beaker.widgets.ColorPicker
cp = new ColorPicker()
cp.value = "blue"
cp
null
cp.value
blue
cp.value ="red"
red
cp.concise = false
//cp.concise = true
false
import com.twosigma.beaker.widgets.strings.Text
t = new Text()
t.value = "Text example 1"
t
null
t.value
Text example 1
t.value ="Text example 2"
Text example 2
import com.twosigma.beaker.widgets.strings.Textarea
ta = new Textarea()
ta.value = "Textarea example 1"
ta
null
ta.value
Textarea example 1
ta.value ="Textarea example 2"
Textarea example 2
import com.twosigma.beaker.widgets.bools.ToggleButton
tb = new ToggleButton()
tb.tooltip = "ToggleButton tooltip 1"
tb.button_style = 'success'
tb.icon='check'
tb.description='Click me'
tb
tb.value
false
tb.value = true
//tb.value = false
true
tb.tooltip = "ToggleButton tooltip 2"
ToggleButton tooltip 2
import com.twosigma.beaker.widgets.floats.FloatSlider
fs = new FloatSlider()
fs.value = 10.1
fs
null
fs.value
0.0
fs.value = 22.2
22.2
import com.twosigma.beaker.widgets.floats.FloatProgress
floatProgress = new FloatProgress()
floatProgress.value = 10.2
floatProgress
null
floatProgress.value
0.0
floatProgress.value = 33.3
33.3
import com.twosigma.beaker.widgets.strings.Label
label = new Label()
label.value = "Label 1"
label
null
label.value
Label 1
label.value = "Label 2"
Label 2
import com.twosigma.beaker.widgets.strings.HTML
label = new HTML()
label.value = "Hello <b>World</b>"
label
null
label.value = "<b>Hello World</b>"
<b>Hello World</b>
import com.twosigma.beaker.widgets.Image
import java.nio.file.Files
byte[] picture = Files.readAllBytes(new File("widgetArch.png").toPath());
image = new Image()
image.format='png'
image.value= picture
image.width=300
image.height=400
image
null
import com.twosigma.beaker.widgets.DatePicker
datePicker = new DatePicker()
datePicker
null
datePicker.value
{}
import com.twosigma.beaker.widgets.integers.IntRangeSlider
w = new IntRangeSlider()
w.value = [10,40]
w.orientation = "horizontal"
//w.orientation = "vertical"
w
null
import com.twosigma.beaker.widgets.integers.BoundedIntText
w = new BoundedIntText()
w.min = 0
w.max = 10
w
null
import com.twosigma.beaker.widgets.integers.IntText
w = new IntText()
w
null
import com.twosigma.beaker.widgets.integers.IntText
w = new IntText()
w
null
import com.twosigma.beaker.widgets.integers.Play
w = new Play()
w
null
import com.twosigma.beaker.widgets.floats.FloatRangeSlider
w = new FloatRangeSlider()
w.value = [10,40]
w.orientation = "horizontal"
//w.orientation = "vertical"
w
null
import com.twosigma.beaker.widgets.floats.BoundedFloatText
w = new BoundedFloatText()
w.min = 0
w.max = 10
w
null
import com.twosigma.beaker.widgets.floats.FloatText
w = new FloatText()
w
null
//Example with passing different type to value
import com.twosigma.beaker.widgets.integers.IntRangeSlider
w = new IntRangeSlider()
w.value = ["10",[49.6]]
w.orientation = "horizontal"
//w.orientation = "vertical"
w
null
//Example with passing different type to value
import com.twosigma.beaker.widgets.integers.IntRangeSlider
import java.util.Collection
Collection<Object> list = new ArrayList<>()
list.add(["19"])
list.add("53")
w = new IntRangeSlider()
w.value = list
w.orientation = "horizontal"
//w.orientation = "vertical"
w
null
import com.twosigma.beaker.widgets.bools.Valid
w = new Valid()
w.description = 'Valid!'
w.value = true
w.disabled = false
w
null
import com.twosigma.beaker.widgets.selectioncontainer.Accordion
import com.twosigma.beaker.widgets.bools.Valid
import com.twosigma.beaker.widgets.floats.BoundedFloatText
import com.twosigma.beaker.widgets.strings.Text
t = new Text()
t.value = "Text example 1"
valid = new Valid()
valid.description = 'Valid!'
valid.value = true
valid.disabled = false
accordion = new Accordion([t , valid], ['t' , 'valid']);
//accordion.set_title(0, 'Text')
//accordion.set_title(1, 'Valid')
accordion
null
import com.twosigma.beaker.widgets.strings.Label
widget = new Label()
widget.value = "\$\$\\frac{n!}{k!(n-k)!} = \\binom{n}{k}\$\$"
widget
import com.twosigma.beaker.widgets.selections.SelectionSlider
widget = new SelectionSlider()
widget.options=['scrambled', 'sunny side up', 'poached', 'over easy']
widget.value='sunny side up'
widget.description='I like my eggs ...'
widget.orientation='horizontal'
//widget.orientation='vertical'
widget
import com.twosigma.beaker.widgets.strings.HTMLMath
widget = new HTMLMath()
widget.value = "\$x^2\$ and \$\$\\frac{x+1}{x-1}\$\$"
widget
widget.value
Regular
import com.twosigma.beaker.widgets.selections.ToggleButtons
widget = new ToggleButtons()
widget.description='Speed:'
widget.options=['Slow', 'Regular', 'Fast']
widget.button_style = 'success'
widget.tooltips=['SL', 'RE', 'Fast']
widget.icons=['check', 'check', 'check']
widget
import com.twosigma.beaker.widgets.integers.Play
import com.twosigma.beaker.widgets.integers.IntSlider
import com.twosigma.beaker.widgets.box.HBox
import com.twosigma.beaker.widgets.link.Link
import com.twosigma.beaker.widgets.link.DirectionalLink
import static com.twosigma.beaker.widgets.link.Link.jslink
import static com.twosigma.beaker.widgets.link.DirectionalLink.jsdlink
slider = new IntSlider()
play= new Play()
play.value=50
play.min=0
play.max=100
//link = new Link(play, "value", slider, "value")
link = jslink(play, "value", slider, "value")
//link = new DirectionalLink(play, "value", slider, "value")
//link = jsdlink(play, "value", slider, "value")
box = new HBox([play,slider])