use of com.twosigma.beakerx.chart.xychart.Plot in project beakerx by twosigma.
the class GroovyEvaluatorChartTest method parsePlotWithPointsScript_returnPlotObjectWithPoints.
@Test
public void parsePlotWithPointsScript_returnPlotObjectWithPoints() {
// when
Object result = parseClassFromScript("def plot = new Plot();\n" + "def y1 = [6, 7, 12, 11, 8, 14]\n" + "plot << new Points(y: y1)");
// then
Assertions.assertThat(result instanceof Plot).isTrue();
Plot plot = (Plot) result;
Assertions.assertThat(plot.getGraphics()).isNotEmpty();
Assertions.assertThat(plot.getGraphics().get(0) instanceof Points).isTrue();
}
use of com.twosigma.beakerx.chart.xychart.Plot in project beakerx by twosigma.
the class GroovyEvaluatorChartTest method parsePlotWithLineScript_returnPlotObjectWithLine.
@Test
public void parsePlotWithLineScript_returnPlotObjectWithLine() {
// when
Object result = parseClassFromScript("def plot = new Plot()\n" + "def ys = [0, 1, 6, 5, 2, 8]\n" + "plot << new Line(y: ys)");
// then
Assertions.assertThat(result instanceof Plot).isTrue();
Plot plot = (Plot) result;
Assertions.assertThat(plot.getGraphics()).isNotEmpty();
Assertions.assertThat(plot.getGraphics().get(0) instanceof Line).isTrue();
}
use of com.twosigma.beakerx.chart.xychart.Plot in project beakerx by twosigma.
the class GroovyEvaluatorChartTest method parsePlotWithLegendPositionScript_returnPlotObjectWithLegendPosition.
@Test
public void parsePlotWithLegendPositionScript_returnPlotObjectWithLegendPosition() {
// when
Object result = parseClassFromScript("def pp = new Plot(legendPosition: LegendPosition.TOP)");
// then
Assertions.assertThat(result instanceof Plot).isTrue();
Plot plot = (Plot) result;
Assertions.assertThat(plot.getLegendPosition()).isEqualTo(LegendPosition.TOP);
}
use of com.twosigma.beakerx.chart.xychart.Plot in project beakerx by twosigma.
the class GroovyEvaluatorChartTest method parsePlotWithLegendLayoutScript_returnPlotObjectWithLegendLayout.
@Test
public void parsePlotWithLegendLayoutScript_returnPlotObjectWithLegendLayout() {
// when
Object result = parseClassFromScript("def pp = new Plot(legendLayout: LegendLayout.HORIZONTAL)");
// then
Assertions.assertThat(result instanceof Plot).isTrue();
Plot plot = (Plot) result;
Assertions.assertThat(plot.getLegendLayout()).isEqualTo(LegendLayout.HORIZONTAL);
}
use of com.twosigma.beakerx.chart.xychart.Plot in project beakerx by twosigma.
the class GroovyEvaluatorChartTest method parsePlotWithXYStackerScript_returnPlotObjectWithGraphics.
@Test
public void parsePlotWithXYStackerScript_returnPlotObjectWithGraphics() {
// when
Object result = parseClassFromScript("def y1 = [1,5,3,2,3]\n" + "def y2 = [7,2,4,1,3]\n" + "def p = new Plot()\n" + "def a1 = new Area(y: y1, displayName: 'y1')\n" + "def a2 = new Area(y: y2, displayName: 'y2')\n" + "p << XYStacker.stack([a1, a2])");
// then
Assertions.assertThat(result instanceof Plot).isTrue();
Plot plot = (Plot) result;
Assertions.assertThat(plot.getGraphics()).isNotEmpty();
}
Aggregations