use of tech.tablesaw.plotly.traces.Scatter3DTrace in project tablesaw by jtablesaw.
the class Scatter3DPlot method create.
public static Figure create(String title, Table table, String xCol, String yCol, String zCol, String sizeColumn, String groupCol) {
TableSliceGroup tables = table.splitOn(table.categoricalColumn(groupCol));
Layout layout = standardLayout(title, xCol, yCol, zCol, false);
Scatter3DTrace[] traces = new Scatter3DTrace[tables.size()];
for (int i = 0; i < tables.size(); i++) {
List<Table> tableList = tables.asTableList();
Marker marker = Marker.builder().size(tableList.get(i).numberColumn(sizeColumn)).build();
traces[i] = Scatter3DTrace.builder(tableList.get(i).numberColumn(xCol), tableList.get(i).numberColumn(yCol), tableList.get(i).numberColumn(zCol)).marker(marker).showLegend(true).name(tableList.get(i).name()).build();
}
return new Figure(layout, traces);
}
use of tech.tablesaw.plotly.traces.Scatter3DTrace in project tablesaw by jtablesaw.
the class Scatter3DTest method showText.
@Test
public void showText() {
Scatter3DTrace trace = Scatter3DTrace.builder(x, y, z).mode(Scatter3DTrace.Mode.TEXT).text(labels).build();
Plot.show(new Figure(trace));
}
use of tech.tablesaw.plotly.traces.Scatter3DTrace in project tablesaw by jtablesaw.
the class Scatter3DTest method testAsJavascript.
@Test
public void testAsJavascript() {
Scatter3DTrace trace = Scatter3DTrace.builder(x, y, z).text(labels).build();
assertNotNull(trace.asJavascript(1));
}
use of tech.tablesaw.plotly.traces.Scatter3DTrace in project tablesaw by jtablesaw.
the class Scatter3DTest method showScatter.
@Test
public void showScatter() {
Scatter3DTrace trace = Scatter3DTrace.builder(x, y, z).mode(Scatter3DTrace.Mode.MARKERS).text(labels).build();
Layout layout = Layout.builder().xAxis(Axis.builder().title("x title").build()).build();
assertEquals("x title", layout.getTitle());
Plot.show(new Figure(layout, trace));
}
use of tech.tablesaw.plotly.traces.Scatter3DTrace in project tablesaw by jtablesaw.
the class Scatter3DTest method showLineAndMarkers.
@Test
public void showLineAndMarkers() {
Scatter3DTrace trace = Scatter3DTrace.builder(x, y, z).mode(Scatter3DTrace.Mode.LINE_AND_MARKERS).build();
Layout layout = Layout.builder().xAxis(Axis.builder().title("x title").build()).build();
Plot.show(new Figure(layout, trace));
}
Aggregations