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

w = new IntSlider()
w.value = 60
display(w)


Out[2]:
null

In [3]:
w.value


Out[3]:
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
display(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"
display(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"
display(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()
display(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"
display(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"
display(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"
display(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 [37]:
import com.twosigma.beaker.widgets.bools.ToggleButton
tb = new ToggleButton()
tb.tooltip = "ToggleButton tooltip 1"
display(tb)


Out[37]:
null

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
display(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
display(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"
display(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>"
display(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
display(image)


Out[52]:
null

In [53]:
import com.twosigma.beaker.widgets.DatePicker
datePicker = new DatePicker()
display(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"
display(w)


Out[55]:
null

In [56]:
import com.twosigma.beaker.widgets.integers.BoundedIntText
w = new BoundedIntText()
w.min = 0
w.max = 10
display(w)


Out[56]:
null

In [57]:
import com.twosigma.beaker.widgets.integers.IntText
w = new IntText()
display(w)


Out[57]:
null

In [58]:
import com.twosigma.beaker.widgets.integers.IntText
w = new IntText()
display(w)


Out[58]:
null

In [59]:
import com.twosigma.beaker.widgets.integers.Play
w = new Play()
display(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"
display(w)


Out[60]:
null

In [61]:
import com.twosigma.beaker.widgets.floats.BoundedFloatText
w = new BoundedFloatText()
w.min = 0 
w.max = 10
display(w)


Out[61]:
null

In [62]:
import com.twosigma.beaker.widgets.floats.FloatText
w = new FloatText()
display(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"
display(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"
display(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
display(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')
display(accordion)


Out[66]:
null

In [ ]: