<commit_before>import React from 'react';
import ReactHighcharts from 'react-highcharts/dist/ReactHighcharts.js';
import ReactHighmaps from 'react-highcharts/dist/ReactHighmaps.js';
import highchartsExporting from 'highcharts-exporting';
highchartsExporting(ReactHighcharts.Highcharts);

const maps = require('./world-eckert3-lowres');

class GeoChart extends React.Component {

  getConfig() {
    const { data } = this.props;

    const config = {
      // Initiate the chart
      title: {
        text: '',
      },
      mapNavigation: {
        enabled: false,
      },
      exporting: {
        enabled: true,
      },
      navigation: {
        buttonOptions: {
          align: 'right',
        },
      },
      colorAxis: {
        min: 0.00001,
        max: 1.0,
        type: 'logarithmic',
      },
      tooltip: {
        pointFormatter: function afmtxn() {
          const pct = this.count * 100 + ' %';
          return pct;
        },
      },
      series: [{
        data: data,
        mapData: maps,
        joinBy: 'iso-a2',
        name: 'Sentence percentage',
        allowPointSelect: true,
        cursor: 'pointer',
        states: {
          hover: {
            color: '#BADA55',
          },
          select: {
            color: '#a4edba',
            borderColor: 'black',
            dashStyle: 'shortdot',
          },
        },
        dataLabels: {
          enabled: false,
          format: '{point.name} {point.count} ',
        },
      }],
    };
    return config;
  }
  gotoDashboard(handle) {
    // dispatch to dashboard
  }
  render() {
    const config = this.getConfig();
    const gtDashboard = this.gotoDashboard;
    config.exporting = true;
    config.plotOptions = {
      series: {
        point: {
          events: {
            click: function afn() {
              gtDashboard();
              alert('will go to dashboard');
            },
          },
        },
      },
    }
    return (
       React.createElement(ReactHighmaps, { config })
    );
  }
}


GeoChart.propTypes = {
  data: React.PropTypes.array.isRequired,
  dispatchGoToDashboard: React.PropTypes.func,
};

export default GeoChart;<commit_msg>code cleanup<commit_after>import React from 'react';
import ReactHighcharts from 'react-highcharts/dist/ReactHighcharts.js';
import ReactHighmaps from 'react-highcharts/dist/ReactHighmaps.js';
import highchartsExporting from 'highcharts-exporting';
highchartsExporting(ReactHighcharts.Highcharts);

const maps = require('./world-eckert3-lowres');

class GeoChart extends React.Component {

  getConfig() {
    const { data } = this.props;

    const config = {
      // Initiate the chart
      title: {
        text: '',
      },
      mapNavigation: {
        enabled: false,
      },
      exporting: {
        enabled: true,
      },
      navigation: {
        buttonOptions: {
          align: 'right',
        },
      },
      colorAxis: {
        min: 0.00001,
        max: 1.0,
        type: 'logarithmic',
      },
      tooltip: {
        pointFormatter: function afmtxn() {
          const pct = `${this.count * 100}%`;
          return pct;
        },
      },
      series: [{
        data,
        mapData: maps,
        joinBy: 'iso-a2',
        name: 'Sentence percentage',
        allowPointSelect: true,
        cursor: 'pointer',
        states: {
          hover: {
            color: '#BADA55',
          },
          select: {
            color: '#a4edba',
            borderColor: 'black',
            dashStyle: 'shortdot',
          },
        },
        dataLabels: {
          enabled: false,
          format: '{point.name} {point.count} ',
        },
      }],
    };
    return config;
  }
  gotoDashboard(evt) {
    // dispatch to dashboard
    console.log('will go to dashboard');
    console.log(evt);
  }
  render() {
    const config = this.getConfig();
    config.exporting = true;
    config.plotOptions = {
      series: {
        point: {
          events: {
            click: this.gotoDashboard,
          },
        },
      },
    };
    return (
       React.createElement(ReactHighmaps, { config })
    );
  }
}


GeoChart.propTypes = {
  data: React.PropTypes.array.isRequired,
  dispatchGoToDashboard: React.PropTypes.func,
};

export default GeoChart;
{'fraction_non_alphanumeric': 0.12479551297032017, 'fraction_numerical': 0.007478382799719561, 'mean_word_length': 1.7348242811501597, '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': '2989443', 'n_tokens_mistral': 1308, 'n_tokens_neox': 1271, 'n_words': 257}