use of com.twosigma.beakerx.chart.xychart.Plot in project beakerx by twosigma.
the class GroovyEvaluatorChartTest method parsePlotWithCircleShapePointsScript_returnPlotObjectWithCircleShapePoints.
@Test
public void parsePlotWithCircleShapePointsScript_returnPlotObjectWithCircleShapePoints() {
// when
Object result = parseClassFromScript("def plot = new Plot();\n" + "def y1 = [1.5, 1, 6, 5, 2, 8]\n" + "plot << new Points(y: y1, shape: ShapeType.CIRCLE)");
// then
Assertions.assertThat(result instanceof Plot).isTrue();
Plot plot = (Plot) result;
Assertions.assertThat(plot.getGraphics()).isNotEmpty();
Assertions.assertThat(((Points) plot.getGraphics().get(0)).getShape()).isEqualTo(ShapeType.CIRCLE);
}
use of com.twosigma.beakerx.chart.xychart.Plot in project beakerx by twosigma.
the class GroovyEvaluatorChartTest method parsePlotWithConstantLineScript_returnPlotObjectWithConstantLine.
@Test
public void parsePlotWithConstantLineScript_returnPlotObjectWithConstantLine() {
// when
Object result = parseClassFromScript("def plot = new Plot ()\n" + "plot << new ConstantLine(x: 0.65)");
// then
Assertions.assertThat(result instanceof Plot).isTrue();
Plot plot = (Plot) result;
Assertions.assertThat(plot.getConstantLines()).isNotEmpty();
Assertions.assertThat(plot.getConstantLines().get(0)).isNotNull();
}
use of com.twosigma.beakerx.chart.xychart.Plot in project beakerx by twosigma.
the class GroovyEvaluatorChartTest method parsePlotWithBaseOfAreaScript_returnPlotObjectWithBaseOfArea.
@Test
public void parsePlotWithBaseOfAreaScript_returnPlotObjectWithBaseOfArea() {
// when
Object result = parseClassFromScript("def plot = new Plot()\n" + "def y = [3, 5, 2, 3]\n" + "def x0 = [0, 1, 2, 3]\n" + "plot << new Area(x: x0, y: y, base: 1)");
// then
Assertions.assertThat(result instanceof Plot).isTrue();
Plot plot = (Plot) result;
Assertions.assertThat(((Area) plot.getGraphics().get(0)).getBase().intValue()).isGreaterThan(0);
}
use of com.twosigma.beakerx.chart.xychart.Plot in project beakerx by twosigma.
the class GroovyEvaluatorChartTest method parsePlotWithStemsScript_returnPlotObjectWithStems.
@Test
public void parsePlotWithStemsScript_returnPlotObjectWithStems() {
// when
Object result = parseClassFromScript("def plot = new Plot();\n" + "def y1 = [1.5, 1, 6, 5, 2, 8]\n" + "plot << new Stems(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 Stems).isTrue();
}
use of com.twosigma.beakerx.chart.xychart.Plot in project beakerx by twosigma.
the class GroovyEvaluatorChartTest method parsePlotWithCrosshairScript_returnPlotObjectWithCrosshair.
@Test
public void parsePlotWithCrosshairScript_returnPlotObjectWithCrosshair() {
// when
Object result = parseClassFromScript("def plot = new Plot(crosshair: new Crosshair(color: Color.BLUE))");
// then
Assertions.assertThat(result instanceof Plot).isTrue();
Plot plot = (Plot) result;
Assertions.assertThat(plot.getCrosshair()).isNotNull();
}
Aggregations