In [1]:
import com.twosigma.beaker.jvm.object.OutputContainer;
def o = new OutputContainer()
o.addItem("simplest example")
o << [2, 3, 5, 7] // shorter syntax
In [2]:
import com.twosigma.beaker.fileloader.CsvPlotReader

def rates = new CsvPlotReader().readAsList("tableRows.csv")
def c = new Color(120, 120, 120, 100)
plot1 = new Plot(initWidth: 300, initHeight: 400) \
     << new Points(x:rates.y1, y:rates.y30, size: 3, displayName:"y1 vs y30") \
     << new Points(x:rates.m3, y:rates.y5, size: 3, displayName:"m3 vs y5") \
     << new Line(x:rates.m3, y:rates.y5, color: c) \
     << new Line(x:rates.y1, y:rates.y30, color: c)

plot2 = new SimpleTimePlot(rates, ["m3", "y1"], showLegend:false, initWidth: 300, initHeight: 400)
plot3 = new SimpleTimePlot(rates, ["y5", "y10"], showLegend:false, initWidth: 300, initHeight: 400)
table = rates[0]
"ok"
Out[2]:
ok
In [4]:
import com.twosigma.beaker.jvm.object.TabbedOutputContainerLayoutManager;
import com.twosigma.beaker.jvm.object.OutputContainer;

def l = new TabbedOutputContainerLayoutManager()
l.setBorderDisplayed(false)
def o = new OutputContainer()
o.setLayoutManager(l)
o.addItem(plot1, "Scatter with History")
o.addItem(plot2, "Short Term")
o.addItem(plot3, "Long Term")
o.addItem(table, "1990/01")
o
In [6]:
import com.twosigma.beaker.jvm.object.GridOutputContainerLayoutManager;
import com.twosigma.beaker.jvm.object.OutputContainer;

bars = new CategoryBars(value: [[1, 2, 3], [1, 3, 5]])

def lg = new GridOutputContainerLayoutManager(3)

def og = new OutputContainer()
og.setLayoutManager(lg)
og.addItem(plot1, "Scatter with History")
og.addItem(plot2, "Short Term")
og.addItem(plot3, "Long Term1")
og.addItem(plot3, "Long Term2")
og.addItem(table, "1990/01")
og.addItem(plot3, "Long Term3")
og.addItem(plot3, "Long Term4")
og.addItem(plot3, "Long Term5")
og.addItem(plot3, "Long Term6")
og.addItem(plot3, "Long Term7")

og
In [ ]: