Search in sources :

Example 1 with ViolinTrace

use of tech.tablesaw.plotly.traces.ViolinTrace in project tablesaw by jtablesaw.

the class ViolinPlot method create.

public static Figure create(String title, Table table, String groupingColumn, String numericColumn, boolean showBoxPlot, boolean showMeanLine) {
    Layout layout = Layout.builder().title(title).height(HEIGHT).width(WIDTH).build();
    ViolinTrace trace = ViolinTrace.builder(table.categoricalColumn(groupingColumn), table.nCol(numericColumn)).boxPlot(showBoxPlot).meanLine(showMeanLine).build();
    return new Figure(layout, trace);
}
Also used : Layout(tech.tablesaw.plotly.components.Layout) ViolinTrace(tech.tablesaw.plotly.traces.ViolinTrace) Figure(tech.tablesaw.plotly.components.Figure)

Example 2 with ViolinTrace

use of tech.tablesaw.plotly.traces.ViolinTrace in project tablesaw by jtablesaw.

the class ViolinTest method testAsJavascriptWithBoxPlot.

@Test
void testAsJavascriptWithBoxPlot() {
    ViolinTrace trace = ViolinTrace.builder(x, y).boxPlot(true).build();
    assertNotNull(trace.asJavascript(1));
}
Also used : ViolinTrace(tech.tablesaw.plotly.traces.ViolinTrace) Test(org.junit.jupiter.api.Test)

Example 3 with ViolinTrace

use of tech.tablesaw.plotly.traces.ViolinTrace in project tablesaw by jtablesaw.

the class ViolinTest method name.

/**
 * Test ensures that the name() method returns a ViolinTraceBuilder as expected.
 */
@Test
void name() {
    ViolinTrace trace = ViolinTrace.builder(x, y).name("my name").build();
    assertNotNull(trace);
}
Also used : ViolinTrace(tech.tablesaw.plotly.traces.ViolinTrace) Test(org.junit.jupiter.api.Test)

Example 4 with ViolinTrace

use of tech.tablesaw.plotly.traces.ViolinTrace in project tablesaw by jtablesaw.

the class ViolinTest method showWithBoxPlot.

@Test
void showWithBoxPlot() {
    ViolinTrace trace = ViolinTrace.builder(x, y).boxPlot(true).build();
    Figure figure = new Figure(trace);
    assertNotNull(figure);
    Plot.show(figure, "target");
}
Also used : ViolinTrace(tech.tablesaw.plotly.traces.ViolinTrace) Figure(tech.tablesaw.plotly.components.Figure) Test(org.junit.jupiter.api.Test)

Example 5 with ViolinTrace

use of tech.tablesaw.plotly.traces.ViolinTrace in project tablesaw by jtablesaw.

the class ViolinTest method showWithMeanLine.

@Test
void showWithMeanLine() {
    ViolinTrace trace = ViolinTrace.builder(x, y).meanLine(true).build();
    Figure figure = new Figure(trace);
    assertNotNull(figure);
    Plot.show(figure, "target");
}
Also used : ViolinTrace(tech.tablesaw.plotly.traces.ViolinTrace) Figure(tech.tablesaw.plotly.components.Figure) Test(org.junit.jupiter.api.Test)

Aggregations

ViolinTrace (tech.tablesaw.plotly.traces.ViolinTrace)5 Test (org.junit.jupiter.api.Test)4 Figure (tech.tablesaw.plotly.components.Figure)3 Layout (tech.tablesaw.plotly.components.Layout)1