Search in sources :

Example 1 with NanoPlot

use of com.twosigma.beakerx.chart.xychart.NanoPlot in project beakerx by twosigma.

the class GroovyEvaluatorChartTest method parseNanoPlotWithPointsScript_returnNanoPlotObjectWithPoints.

@Test
public void parseNanoPlotWithPointsScript_returnNanoPlotObjectWithPoints() {
    // when
    Object result = parseClassFromScript("def today  = new Date()\n" + "def millis = today.time\n" + "def nanos  = millis * 1000 * 1000g // g makes it arbitrary precision\n" + "def np = new NanoPlot()\n" + "np << new Points(x:(0..10).collect{nanos + 7 * it}, y:(0..10))");
    // then
    Assertions.assertThat(result instanceof NanoPlot).isTrue();
    NanoPlot nanoPlot = (NanoPlot) result;
    Assertions.assertThat(nanoPlot.getGraphics()).isNotEmpty();
}
Also used : NanoPlot(com.twosigma.beakerx.chart.xychart.NanoPlot) Test(org.junit.Test)

Aggregations

NanoPlot (com.twosigma.beakerx.chart.xychart.NanoPlot)1 Test (org.junit.Test)1