In [1]:
import com.twosigma.beaker.widgets.integers.IntSlider

w = new IntSlider()
w.value = 60
w
In [2]:
w.value
Out[2]:
60
In [4]:
w.value =76
Out[4]:
76
In [5]:
w.description = "desc1"
Out[5]:
desc1
In [6]:
w.disabled = false
//w.disabled = trw.tooltip = "ToggleButton tooltip 2"ue
Out[6]:
false
In [7]:
w.max = 200
w.min = 50
Out[7]:
50
In [8]:
w.orientation = "horizontal"
//w.orientation = "vertical"
Out[8]:
horizontal
In [9]:
w.slider_color = "#087636"
Out[9]:
#087636
In [10]:
w.step = 20
Out[10]:
20
In [11]:
w.visible = true
//w.visible = false
Out[11]:
true
In [12]:
import com.twosigma.beaker.widgets.integers.IntProgress
bar = new IntProgress()
bar.value = 10
bar
Out[12]:
null
In [13]:
bar.value
Out[13]:
10
In [14]:
bar.value =110
Out[14]:
110
In [15]:
bar.max = 300
bar.min = 50
Out[15]:
50
In [16]:
bar.step = 20
Out[16]:
20
In [17]:
bar.orientation = "horizontal"
//bar.orientation = "vertical"
Out[17]:
horizontal
In [18]:
import com.twosigma.beaker.widgets.selections.RadioButtons
rb = new RadioButtons()
rb.options=['1', '2', '3', '4', '5']
rb.value = "4"
rb
Out[18]:
null
In [19]:
rb.value
Out[19]:
4
In [20]:
rb.value ="1"
Out[20]:
1
In [21]:
import com.twosigma.beaker.widgets.selections.Select
select = new Select()
select.options=['Linux', 'Windows', 'OSX']
select.value = "Windows"
select
Out[21]:
null
In [22]:
select.value
Out[22]:
Windows
In [23]:
select.value = "Linux"
Out[23]:
Linux
In [24]:
import com.twosigma.beaker.widgets.bools.Checkbox
cb = new Checkbox()
cb
Out[24]:
null
In [25]:
cb.value
Out[25]:
false
In [26]:
cb.value = true
Out[26]:
true
In [27]:
import com.twosigma.beaker.widgets.ColorPicker
cp = new ColorPicker()
cp.value = "blue"
cp
Out[27]:
null
In [28]:
cp.value
Out[28]:
blue
In [29]:
cp.value ="red"
Out[29]:
red
In [30]:
cp.concise = false
//cp.concise = true
Out[30]:
false
In [31]:
import com.twosigma.beaker.widgets.strings.Text
t = new Text()
t.value = "Text example 1"
t
Out[31]:
null
In [32]:
t.value
Out[32]:
Text example 1
In [33]:
t.value ="Text example 2"
Out[33]:
Text example 2
In [34]:
import com.twosigma.beaker.widgets.strings.Textarea
ta = new Textarea()
ta.value = "Textarea example 1"
ta
Out[34]:
null
In [35]:
ta.value
Out[35]:
Textarea example 1
In [36]:
ta.value ="Textarea example 2"
Out[36]:
Textarea example 2
In [3]:
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
In [38]:
tb.value
Out[38]:
false
In [39]:
tb.value = true
//tb.value = false
Out[39]:
true
In [40]:
tb.tooltip = "ToggleButton tooltip 2"
Out[40]:
ToggleButton tooltip 2
In [41]:
import com.twosigma.beaker.widgets.floats.FloatSlider
fs = new FloatSlider()
fs.value = 10.1
fs
Out[41]:
null
In [42]:
fs.value
Out[42]:
0.0
In [43]:
fs.value = 22.2
Out[43]:
22.2
In [44]:
import com.twosigma.beaker.widgets.floats.FloatProgress
floatProgress = new FloatProgress()
floatProgress.value = 10.2
floatProgress
Out[44]:
null
In [45]:
floatProgress.value
Out[45]:
0.0
In [46]:
floatProgress.value = 33.3
Out[46]:
33.3
In [47]:
import com.twosigma.beaker.widgets.strings.Label
label = new Label()
label.value = "Label 1"
label
Out[47]:
null
In [48]:
label.value
Out[48]:
Label 1
In [49]:
label.value = "Label 2"
Out[49]:
Label 2
In [50]:
import com.twosigma.beaker.widgets.strings.HTML
label = new HTML()
label.value = "Hello <b>World</b>"
label
Out[50]:
null
In [51]:
label.value = "<b>Hello World</b>"
Out[51]:
<b>Hello World</b>
In [52]:
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
Out[52]:
null
In [53]:
import com.twosigma.beaker.widgets.DatePicker
datePicker = new DatePicker()
datePicker
Out[53]:
null
In [54]:
datePicker.value
Out[54]:
{}
In [55]:
import com.twosigma.beaker.widgets.integers.IntRangeSlider
w = new IntRangeSlider()
w.value = [10,40]
w.orientation = "horizontal"
//w.orientation = "vertical"
w
Out[55]:
null
In [56]:
import com.twosigma.beaker.widgets.integers.BoundedIntText
w = new BoundedIntText()
w.min = 0
w.max = 10
w
Out[56]:
null
In [57]:
import com.twosigma.beaker.widgets.integers.IntText
w = new IntText()
w
Out[57]:
null
In [58]:
import com.twosigma.beaker.widgets.integers.IntText
w = new IntText()
w
Out[58]:
null
In [59]:
import com.twosigma.beaker.widgets.integers.Play
w = new Play()
w
Out[59]:
null
In [60]:
import com.twosigma.beaker.widgets.floats.FloatRangeSlider
w = new FloatRangeSlider()
w.value = [10,40]
w.orientation = "horizontal"
//w.orientation = "vertical"
w
Out[60]:
null
In [61]:
import com.twosigma.beaker.widgets.floats.BoundedFloatText
w = new BoundedFloatText()
w.min = 0 
w.max = 10
w
Out[61]:
null
In [62]:
import com.twosigma.beaker.widgets.floats.FloatText
w = new FloatText()
w
Out[62]:
null
In [63]:
//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
Out[63]:
null
In [64]:
//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
Out[64]:
null
In [65]:
import com.twosigma.beaker.widgets.bools.Valid

w = new Valid()
w.description = 'Valid!'
w.value = true
w.disabled = false
w
Out[65]:
null
In [66]:
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
Out[66]:
null
In [1]:
import com.twosigma.beaker.widgets.strings.Label
widget = new Label()
widget.value = "\$\$\\frac{n!}{k!(n-k)!} = \\binom{n}{k}\$\$"
widget
In [4]:
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
In [2]:
import com.twosigma.beaker.widgets.strings.HTMLMath
widget = new HTMLMath()
widget.value = "\$x^2\$ and \$\$\\frac{x+1}{x-1}\$\$"
widget
In [4]:
widget.value
Out[4]:
Regular
In [2]:
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
In [8]:
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])
In [ ]: