<commit_before>package tech.tablesaw.plotly.api;

import tech.tablesaw.api.NumberColumn;
import tech.tablesaw.api.Table;
import tech.tablesaw.plotly.Plot;
import tech.tablesaw.plotly.components.Figure;
import tech.tablesaw.plotly.components.Layout;
import tech.tablesaw.plotly.traces.HistogramTrace;

public class Histogram {

    private static final int HEIGHT = 600;
    private static final int WIDTH = 800;

    public static void show(String title, double[] data) {
        Plot.show(asFigure(title, data));
    }

    public static void show(String title, NumberColumn data) {
        Plot.show(asFigure(title, data));
    }

    public static void show(String title, Table table, String numericColumName) {
        Plot.show(asFigure(title, table, numericColumName));
    }

    private static Figure asFigure(String title, NumberColumn data) {
        return asFigure(title, data.asDoubleArray());
    }

    private static Figure asFigure(String title, Table table, String numericColumnName) {
        return asFigure(title, table.numberColumn(numericColumnName));
    }

    private static Figure asFigure(String title, double[] data) {
        HistogramTrace trace = HistogramTrace.builder(data).build();
        return new Figure(standardLayout(title), trace);
    }

    private static Layout standardLayout(String title) {
        return Layout.builder()
                .title(title)
                .height(HEIGHT)
                .width(WIDTH)
                .build();
    }
}
<commit_msg>minor updates to histogram<commit_after>package tech.tablesaw.plotly.api;

import tech.tablesaw.api.CategoricalColumn;
import tech.tablesaw.api.NumberColumn;
import tech.tablesaw.api.Table;
import tech.tablesaw.plotly.Plot;
import tech.tablesaw.plotly.components.Figure;
import tech.tablesaw.plotly.components.Layout;
import tech.tablesaw.plotly.traces.HistogramTrace;
import tech.tablesaw.plotly.traces.Trace;

public class Histogram {

    private static final int HEIGHT = 600;
    private static final int WIDTH = 800;

    public static void show(String title, double[] data) {
        Plot.show(asFigure(title, data));
    }

    public static void show(String title, NumberColumn data) {
        Plot.show(asFigure(title, data));
    }

    public static void show(String title, Table table, String numericColumName) {
        Plot.show(asFigure(title, table, numericColumName));
    }

    public static void show(String title, Table table, String groupCol, String... numericColumnName) {

        Layout layout = standardLayout(title).build();
        CategoricalColumn catCol = table.categoricalColumn(groupCol);

        Trace[] traces = new Trace[catCol.unique().size()];

        for (int i = 0; i < numericColumnName.length; i++) {
            String name = catCol.getString(i);
            HistogramTrace trace = HistogramTrace.builder(
                    table.categoricalColumn(groupCol),
                    table.numberColumn(name))
                    .showLegend(true)
                    .name(name)
                    .build();
            traces[i] = trace;
        }
        Plot.show(new Figure(layout, traces));
    }

    private static Figure asFigure(String title, NumberColumn data) {
        return asFigure(title, data.asDoubleArray());
    }

    private static Figure asFigure(String title, Table table, String numericColumnName) {
        return asFigure(title, table.numberColumn(numericColumnName));
    }

    private static Figure asFigure(String title, double[] data) {
        HistogramTrace trace = HistogramTrace.builder(data).build();
        return new Figure(standardLayout(title), trace);
    }

    private static Layout.LayoutBuilder standardLayout(String title) {
        return Layout.builder()
                .title(title)
                .height(HEIGHT)
                .width(WIDTH);
    }
}

{'fraction_non_alphanumeric': 0.09875583203732503, 'fraction_numerical': 0.00336962156557802, 'mean_word_length': 2.8901209677419355, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4821855', 'n_tokens_mistral': 1089, 'n_tokens_neox': 1030, 'n_words': 262}