IntSlider


In [ ]:
import com.twosigma.beakerx.widget.IntSlider
w = new IntSlider(value : 60)
w

In [ ]:
w.value

In [ ]:
w.value = 76

In [ ]:
w.description = "desc1"

In [ ]:
w.disabled = true

In [ ]:
w.disabled = false
w.max = 250
w.min = 50
w.value = 150

In [ ]:
w.orientation = "vertical"

In [ ]:
w.step = 20
w.value = 76

In [ ]:
w.style.handle_color = "#F04080"

FloatSlider


In [ ]:
import com.twosigma.beakerx.widget.FloatSlider
fs = new FloatSlider(value : 10.3)
fs

In [ ]:
fs.value

In [ ]:
fs.value = 7.6

In [ ]:
fs.description = "float"

In [ ]:
fs.disabled = true

In [ ]:
fs.disabled = false
fs.max = 2.50
fs.step = 0.1
fs.min = 0.5
fs.value = 1.5

In [ ]:
fs.orientation = "vertical"

In [ ]:
fs.step = 0.2
fs.value = 0.76

In [ ]:
fs.style.handle_color = "#F04080"

IntProgress


In [ ]:
import com.twosigma.beakerx.widget.IntProgress
bar = new IntProgress(value : 60)
bar

In [ ]:
bar.value

In [ ]:
bar.value = 76

In [ ]:
bar.description = "desc2"

In [ ]:
bar.max = 250
bar.min = 50
bar.value = 150

In [ ]:
bar.orientation = "vertical"

In [ ]:
import com.twosigma.beakerx.widget.IntProgress
bar.barStyle = IntProgress.BarStyle.SUCCESS

FloatProgress


In [ ]:
import com.twosigma.beakerx.widget.FloatProgress
fbar = new FloatProgress(value : 10.3)
fbar

In [ ]:
fbar.value

In [ ]:
fbar.value = 17.6

In [ ]:
fbar.description = "fbar"

In [ ]:
fbar.max = 2.5
fbar.step = 0.1
fbar.min = 0.5
fbar.value = 1.5

In [ ]:
fbar.orientation = "vertical"

IntRangeSlider


In [ ]:
import com.twosigma.beakerx.widget.IntRangeSlider
irs = new IntRangeSlider()
irs.value = [10,40]
irs

In [ ]:
irs.value

In [ ]:
irs.value = [20, 30]

In [ ]:
irs.description = "desc3"

In [ ]:
irs.disabled = true

In [ ]:
irs.disabled = false
irs.max = 250
irs.min = 50
irs.value = [150, 200]

In [ ]:
irs.orientation = "vertical"

In [ ]:
irs.step = 20
irs.value = [76, 96]

In [ ]:
irs.style.handle_color = "#F04080"

FloatRangeSlider


In [ ]:
import com.twosigma.beakerx.widget.FloatRangeSlider
frs = new FloatRangeSlider()
frs.value = [10.3, 40.4]
frs

In [ ]:
frs.value

In [ ]:
frs.value = [20.7, 30.8]

In [ ]:
frs.description = "desc4"

In [ ]:
frs.disabled = true

In [ ]:
frs.disabled = false
frs.step = 0.1
frs.max = 2.5
frs.min = 0.5
frs.value = [1.5, 2.0]

In [ ]:
frs.orientation = "vertical"

In [ ]:
frs.step = 0.2
frs.value = [0.76, 0.96]

In [ ]:
frs.style.handle_color = "#F04080"

Output usage


In [ ]:
import com.twosigma.beakerx.widget.Output
out = new Output()
OutputManager.setOutput(new Output())
out

In [ ]:
for (i = 0; i <10; i++) {
  println("Hello "+ i)
}
"result loop"

In [ ]:
out.appendStdout("Hello 2")

In [ ]:
out.appendStderr("Error 1")

In [ ]:
System.err.println("Error 2");

In [ ]:
out.clearOutput()

In [ ]:
println("Hello 3")

In [ ]:
import com.twosigma.beakerx.widget.IntSlider
out.display(new IntSlider())

In [ ]:
OutputManager.setOutput(null)

In [ ]:
println("Hello 6")

Only stdout


In [ ]:
import com.twosigma.beakerx.widget.Output
OutputManager.setStandardOutput(new Output())

In [ ]:
println("Hello only stdout")

In [ ]:
System.err.println("Error for onlyOut");

In [ ]:
OutputManager.clear()
OutputManager.setStandardOutput(null)

Only stderr


In [ ]:
import com.twosigma.beakerx.widget.Output
OutputManager.setStandardError(new Output())

In [ ]:
println("Hello only stderr")

In [ ]:
System.err.println("Error for onlyErr");

In [ ]:
OutputManager.setStandardError(null)

Rich material can also be directed to the output area


In [ ]:
import com.twosigma.beakerx.widget.Output
out2 = new Output()
OutputManager.setOutput(out2)
out2

In [ ]:
println("before")
out2.display(YoutubeVideo("gSVvxOchT8Y"))
println("inside")
out2.display(SVG("https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/car.svg"))
println("after")
"done"

In [ ]:
out2.display(YoutubeVideo("gSVvxOchT8Y"))

In [ ]:
out2.clearOutput()

In [ ]:
OutputManager.setOutput(null)