// something we don't want to see
def big(x) {
return (x < 2) ? x : [x, big(x - 1), big(x - 2)]
}
x = big(10)
OutputCell.HIDDEN
def o = new OutputContainer()
o.addItem("simplest example")
o << [2, 3, 5, 7] // shorter syntax
o << HTML("
title
")
o << null
def rates = new CSV().read("../resources/data/interest-rates.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]
OutputCell.HIDDEN
TableDisplay t = new TableDisplay(table);
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(t, "1990/01")
o
plot1.setShowLegend(false)
bars = new CategoryPlot(initWidth: 300, initHeight: 400) << new CategoryBars(value: [[1.1, 2.4, 3.8], [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(bars, "Bar Chart")
og
l = new CyclingOutputContainerLayoutManager()
l.setPeriod(2345); // milliseconds
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