use of com.twosigma.beakerx.chart.xychart.Plot in project beakerx by twosigma.
the class GroovyEvaluatorChartTest method parsePlotWithConstantBandScript_returnPlotObjectWithConstantBand.
@Test
public void parsePlotWithConstantBandScript_returnPlotObjectWithConstantBand() {
// when
Object result = parseClassFromScript("def plot = new Plot()\n" + "plot << new ConstantBand(x: [1, 2])");
// then
Assertions.assertThat(result instanceof Plot).isTrue();
Plot plot = (Plot) result;
Assertions.assertThat(plot.getConstantBands()).isNotEmpty();
Assertions.assertThat(plot.getConstantBands().get(0)).isNotNull();
}
use of com.twosigma.beakerx.chart.xychart.Plot in project beakerx by twosigma.
the class GroovyEvaluatorChartTest method parsePlotWithBarsScript_returnPlotObjectWithBars.
@Test
public void parsePlotWithBarsScript_returnPlotObjectWithBars() {
// when
Object result = parseClassFromScript("def plot = new Plot()\n" + "plot << new Bars(x: (1..5), y: [3, 5, 2, 3, 7])");
// then
Assertions.assertThat(result instanceof Plot).isTrue();
Plot plot = (Plot) result;
Assertions.assertThat(plot.getGraphics()).isNotEmpty();
Assertions.assertThat(plot.getGraphics().get(0) instanceof Bars).isTrue();
}
use of com.twosigma.beakerx.chart.xychart.Plot in project beakerx by twosigma.
the class GroovyEvaluatorChartTest method parsePlotWithDashStyleStemsScript_returnPlotObjectWithDashStyleStems.
@Test
public void parsePlotWithDashStyleStemsScript_returnPlotObjectWithDashStyleStems() {
// when
Object result = parseClassFromScript("def plot = new Plot();\n" + "def y1 = [1.5, 1, 6, 5, 2, 8]\n" + "plot << new Stems(y: y1, style: StrokeType.DASH)");
// then
Assertions.assertThat(result instanceof Plot).isTrue();
Plot plot = (Plot) result;
Assertions.assertThat(plot.getGraphics()).isNotEmpty();
Assertions.assertThat(((Stems) plot.getGraphics().get(0)).getStyle()).isEqualTo(StrokeType.DASH);
}
use of com.twosigma.beakerx.chart.xychart.Plot in project beakerx by twosigma.
the class GroovyEvaluatorChartTest method parsePlotWithTextScript_returnPlotObjectWithText.
@Test
public void parsePlotWithTextScript_returnPlotObjectWithText() {
// when
Object result = parseClassFromScript("def plot = new Plot ()\n" + "plot << new Text(text: \"labelText \")");
// then
Assertions.assertThat(result instanceof Plot).isTrue();
Plot plot = (Plot) result;
Assertions.assertThat(plot.getTexts()).isNotEmpty();
Assertions.assertThat(plot.getTexts().get(0)).isNotNull();
}
Aggregations