<commit_before>import React            from 'react';
import PureRenderMixin  from 'react-addons-pure-render-mixin';
import Title            from './Title';
import {Treemap}        from 'react-d3';
import {getRegionLabel} from '../label';
import {isFipsState}    from '../fips';

export default React.createClass({
  mixins: [PureRenderMixin],

  transformTreemap: function() {
    if(!this.props.productData.fips) { return false; }

    console.log('transform treemap');
    var
      data      = this.props.productData.fips,
      keys      = Object.keys(data),
      stateKeys = keys.filter(key => isFipsState(key))
    ;
    return stateKeys.map(key => ({label: getRegionLabel(key), value: data[key]}))
  },

  render: function() {
    return (
      <div className="stats-container">
        <Treemap
          data={this.transformTreemap()}
          width={450}
          height={250}
          textColor="#484848"
          fontSize="12px"
          title="Treemap"
          hoverAnimation={false}
        />
      </div>
    );
  }
<commit_msg>stats -- ready to plug in a horizontal bar chart...<commit_after>import React            from 'react';
import PureRenderMixin  from 'react-addons-pure-render-mixin';
import Title            from './Title';
import {Treemap}        from 'react-d3';
import {getRegionLabel} from '../label';
import {isFipsState}    from '../fips';

export default React.createClass({
  mixins: [PureRenderMixin],

  dataForBarChart: function() {
    var data = this.props.productData.fips;
    console.log('transform bar chart', data);

    if(!data) { return false; }

    var
      keys = Object.keys(data),
      stateKeys = keys.filter(key => isFipsState(key))
    ;
    console.log(stateKeys);

    return stateKeys.map(key => ({ label: getRegionLabel(key), v: data[key] }));
  },

  render: function() {
    return (
      <div className="stats-container">
      </div>
    );
  }

{'fraction_non_alphanumeric': 0.14375, 'fraction_numerical': 0.008333333333333333, 'mean_word_length': 2.6109022556390977, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 12, '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': '6625823', 'n_tokens_mistral': 616, 'n_tokens_neox': 591, 'n_words': 132}