<commit_before>(function(d3, fc) {
    'use strict';

    var chartLayout = fc.utilities.chartLayout();

    // Setup the chart
    var chart = d3.select('#stacked-bar')
        .call(chartLayout);

    d3.csv('stackedBarData.csv', function(error, data) {

        // Collect all series keys.
        var seriesKeys = data.reduce(function(previous, current) {
            var currentKeys = fc.utilities.object.keys(current).filter(function(element) { 
                return element !== 'State';
            });
            return previous.concat(currentKeys);
        }, []);
        seriesKeys = d3.set(seriesKeys).values();
        
        // Create an array of series objects.
        var series = seriesKeys.map(function(element) {
            return { name: element, data: [] };
        });

        // Populate those series objects with data objects.
        var series = data.reduce(function(series, current) {
            series.forEach(function(element) {
                element.data.push({
                    state: current.State,
                    value: parseFloat(current[element.name])
                });
            });

            return series;
        }, series);

        // Collect the X values.
        var xCategories = series.reduce(function(previous, current) {
            return previous.concat(current.data.map(function(element) { return element.state; }));
        }, []);
        xCategories = d3.set(xCategories).values();

        // create scales
        var x = d3.scale.ordinal()<commit_msg>Fixes various styling issues.<commit_after>(function(d3, fc) {
    'use strict';

    var chartLayout = fc.utilities.chartLayout();

    // Setup the chart
    var chart = d3.select('#stacked-bar')
        .call(chartLayout);

    d3.csv('stackedBarData.csv', function(error, data) {

        // Collect all series keys.
        var seriesKeys = data.reduce(function(previous, current) {
            var currentKeys = fc.utilities.object.keys(current).filter(function(element) {
                return element !== 'State';
            });
            return previous.concat(currentKeys);
        }, []);
        seriesKeys = d3.set(seriesKeys).values();

        // Create an array of series objects.
        var emptySeries = seriesKeys.map(function(element) {
            return {name: element, data: []};
        });

        // Populate those series objects with data objects.
        var series = data.reduce(function(allSeries, current) {
            allSeries.forEach(function(element) {
                element.data.push({
                    state: current.State,
                    value: parseFloat(current[element.name])
                });
            });

            return allSeries;
        }, emptySeries);

        // Collect the X values.
        var xCategories = series.reduce(function(previous, current) {
            return previous.concat(current.data.map(function(element) { return element.state; }));
        }, []);
        xCategories = d3.set(xCategories).values();

        // create scales
        var x = d3.scale.ordinal()
{'fraction_non_alphanumeric': 0.12524271844660195, 'fraction_numerical': 0.003883495145631068, 'mean_word_length': 1.9326375711574952, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5826477', 'n_tokens_mistral': 825, 'n_tokens_neox': 793, 'n_words': 176}