<commit_before>import React from 'react';
import { schemeCategory10, scaleOrdinal } from 'd3';
import ReactDOM from 'react-dom';
import bindAll from 'lodash/bindAll';
import xor from 'lodash/xor';
import maxBy from 'lodash/maxBy';
import minBy from 'lodash/minBy';
import map from 'lodash/map';
import uniqBy from 'lodash/uniqBy';

import StackedBarChart from './../../stacked/src/stacked';

import { dataGenerator } from '../../../../utils';
import groupBy from "lodash/groupBy";

const yearField = 'year_id';
const populationField = 'population';
const locationField = 'location';

const data = dataGenerator({
  primaryKeys: [
    { name: 'location', values: ['Brazil', 'Russia', 'India', 'China', 'Mexico', 'Indonesia', 'Nigeria', 'Vietnam'] }
  ],
  valueKeys: [
    { name: populationField, range: [100, 900], uncertainty: true }
  ]
});

const dataGroupedByLocation = groupBy(data, 'location');

const brazilDataGroupedByYear = groupBy(dataGroupedByLocation.Brazil, 'year_id');

const yearData = [
  { year: 2000, values: brazilDataGroupedByYear[2000] },
  { year: 2001, values: brazilDataGroupedByYear[2001] },
  { year: 2002, values: brazilDataGroupedByYear[2002] },
  { year: 2003, values: brazilDataGroupedByYear[2003] },
  { year: 2004, values: brazilDataGroupedByYear[2004] },
  { year: 2005, values: brazilDataGroupedByYear[2005] },
  { year: 2006, values: brazilDataGroupedByYear[2006] },
  { year: 2007, values: brazilDataGroupedByYear[2007] },<commit_msg>Stacked demo: sort imports by package and alphabetically.<commit_after>import React from 'react';
import { schemeCategory10, scaleOrdinal } from 'd3';
import ReactDOM from 'react-dom';
import bindAll from 'lodash/bindAll';
import groupBy from 'lodash/groupBy';
import map from 'lodash/map';
import maxBy from 'lodash/maxBy';
import minBy from 'lodash/minBy';
import uniqBy from 'lodash/uniqBy';
import xor from 'lodash/xor';

import StackedBarChart from './../../stacked/src/stacked';

import { dataGenerator } from '../../../../utils';

const yearField = 'year_id';
const populationField = 'population';
const locationField = 'location';

const data = dataGenerator({
  primaryKeys: [
    { name: 'location', values: ['Brazil', 'Russia', 'India', 'China', 'Mexico', 'Indonesia', 'Nigeria', 'Vietnam'] }
  ],
  valueKeys: [
    { name: populationField, range: [100, 900], uncertainty: true }
  ]
});

const dataGroupedByLocation = groupBy(data, 'location');

const brazilDataGroupedByYear = groupBy(dataGroupedByLocation.Brazil, 'year_id');

const yearData = [
  { year: 2000, values: brazilDataGroupedByYear[2000] },
  { year: 2001, values: brazilDataGroupedByYear[2001] },
  { year: 2002, values: brazilDataGroupedByYear[2002] },
  { year: 2003, values: brazilDataGroupedByYear[2003] },
  { year: 2004, values: brazilDataGroupedByYear[2004] },
  { year: 2005, values: brazilDataGroupedByYear[2005] },
  { year: 2006, values: brazilDataGroupedByYear[2006] },
  { year: 2007, values: brazilDataGroupedByYear[2007] },
{'fraction_non_alphanumeric': 0.14926372155287818, 'fraction_numerical': 0.048862115127175365, 'mean_word_length': 5.400428265524625, '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': '963613', 'n_tokens_mistral': 1148, 'n_tokens_neox': 969, 'n_words': 253}