use of com.twosigma.beakerx.chart.xychart.plotitem.Rasters in project beakerx by twosigma.
the class PlotTest method addListOfPlotObjects_hasAllPlotObjects.
@Test
public void addListOfPlotObjects_hasAllPlotObjects() {
// given
Rasters rasters = new Rasters();
List<Number> value = Collections.singletonList(1);
rasters.setY(value);
rasters.setWidth(value);
rasters.setHeight(value);
// when
plot.add(Arrays.asList(line, new ConstantLine(), new ConstantBand(), rasters, new Text()));
// then
assertThat(plot.getGraphics().size()).isEqualTo(1);
assertThat(plot.getConstantLines().size()).isEqualTo(1);
assertThat(plot.getConstantBands().size()).isEqualTo(1);
assertThat(plot.getRasters().size()).isEqualTo(1);
assertThat(plot.getTexts().size()).isEqualTo(1);
}
use of com.twosigma.beakerx.chart.xychart.plotitem.Rasters in project beakerx by twosigma.
the class PlotTest method leftShiftForRasters_plotHasRastersListSizeIsOne.
@Test
public void leftShiftForRasters_plotHasRastersListSizeIsOne() {
// given
Rasters raster = new Rasters();
List<Number> value = Collections.singletonList(1);
raster.setY(value);
raster.setWidth(value);
raster.setHeight(value);
// when
plot.add(raster);
// then
assertThat(plot.getRasters().size()).isEqualTo(1);
}
use of com.twosigma.beakerx.chart.xychart.plotitem.Rasters in project beakerx by twosigma.
the class ChartToJson method serializeRasters.
public static Map<Object, Object> serializeRasters(List<Rasters> rasters) {
List result = new ArrayList();
for (Rasters item : rasters) {
result.add(toJson(item));
}
Map<Object, Object> value = new LinkedHashMap<>();
value.put(XYChartSerializer.RASTERS, toJsonList(result));
return value;
}
use of com.twosigma.beakerx.chart.xychart.plotitem.Rasters in project beakerx by twosigma.
the class RastersSerializerTest method setUp.
@Before
public void setUp() throws Exception {
rasters = new Rasters() {
};
List<Number> value = Collections.singletonList(1);
rasters.setY(value);
rasters.setWidth(value);
rasters.setHeight(value);
rasters.setOpacity(Arrays.asList(1, 1));
}
use of com.twosigma.beakerx.chart.xychart.plotitem.Rasters in project beakerx by twosigma.
the class XYChartTest method shouldSendCommMsgWhenAddRastersByLeftShift.
@Test
public void shouldSendCommMsgWhenAddRastersByLeftShift() throws Exception {
// given
XYChart xyChart = createWidget();
Rasters raster = new Rasters();
List<Number> value = Collections.singletonList(1);
raster.setY(value);
raster.setWidth(value);
raster.setHeight(value);
// when
xyChart.leftShift(raster);
// then
List valueAsArray = getValueAsArray(RASTERS);
Map actual = (Map) valueAsArray.get(0);
assertThat(actual.get(RastersSerializer.TYPE)).isEqualTo(Rasters.class.getSimpleName());
}
Aggregations