use of com.twosigma.beakerx.chart.xychart.plotitem.Stems in project beakerx by twosigma.
the class StemsSerializerTest method initTestStubData.
@Before
public void initTestStubData() throws IOException {
sw = new StringWriter();
jgen = mapper.getJsonFactory().createJsonGenerator(sw);
stems = new Stems();
stems.setX(Arrays.asList(1, 2));
stems.setY(Arrays.asList(1, 2));
}
use of com.twosigma.beakerx.chart.xychart.plotitem.Stems 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.plotitem.Stems 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);
}
Aggregations