<commit_before>import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import {Link} from 'react-router';
import Translate from 'react-translate-component';

class Data extends Component {
  datasets() {
    return {
      cities: 'https://dataclips.heroku.com/fnvcwipfhumbbkedepfjbajbqqvq-cities',
      systems: 'https://dataclips.heroku.com/aprshsrwvsfdyfbwrkmuxznutfka-systems',
      lines: 'https://dataclips.heroku.com/yfwuchrcmbjnslnewiediitnfhup-lines',
      features: 'https://dataclips.heroku.com/gugsgunqfrrzftoxsyphiwkmhhae-features',
      stations: 'https://dataclips.heroku.com/nsdgftlpvsnevtphlkuwbnzzglrt-stations'
    }
  }

  formats() {
    return ['xls', 'csv']
  }

  render() {
    return (
        <div className="o-container o-container--small">
          <div className="u-letter-box--large">
            <Translate component="h1" className="c-heading" content="data.title" />

            <Translate component="h3" className="c-heading" content="data.download"/>
            <p><Translate content="data.license" unsafe />. <Translate content="data.see_terms_1" /> <Translate component={Link} className="c-link" to="/terms" content="data.see_terms_2" />.</p>
            { Object.entries(this.datasets()).map(entry => {
              const label = entry[0];
              const url = entry[1];
              return <p key={label}><Translate content={`data.${label}`} />: {this.formats().map(format => <a key={`${label}-${format}`} className="data-link c-link" href={`${url}.${format}`}>{format}</a>)} </p>;<commit_msg>Send ga event when clicking download links<commit_after>import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import {Link} from 'react-router';
import Translate from 'react-translate-component';

class Data extends Component {
  datasets() {
    return {
      cities: 'https://dataclips.heroku.com/fnvcwipfhumbbkedepfjbajbqqvq-cities',
      systems: 'https://dataclips.heroku.com/aprshsrwvsfdyfbwrkmuxznutfka-systems',
      lines: 'https://dataclips.heroku.com/yfwuchrcmbjnslnewiediitnfhup-lines',
      features: 'https://dataclips.heroku.com/gugsgunqfrrzftoxsyphiwkmhhae-features',
      stations: 'https://dataclips.heroku.com/nsdgftlpvsnevtphlkuwbnzzglrt-stations'
    }
  }

  formats() {
    return ['xls', 'csv']
  }

  sendGAEvent(e) {
    const name = e.target.attributes.name.value;

    ga('send', 'event', 'data', 'download', name);
  }

  render() {
    return (
        <div className="o-container o-container--small">
          <div className="u-letter-box--large">
            <Translate component="h1" className="c-heading" content="data.title" />

            <Translate component="h3" className="c-heading" content="data.download"/>
            <p><Translate content="data.license" unsafe />. <Translate content="data.see_terms_1" /> <Translate component={Link} className="c-link" to="/terms" content="data.see_terms_2" />.</p>
            { Object.entries(this.datasets()).map(entry => {
              const label = entry[0];
              const url = entry[1];
              return <p key={label}><Translate content={`data.${label}`} />: {this.formats().map(format => <a key={`${label}-${format}`} name={`${label}-${format}`} className="data-link c-link" href={`${url}.${format}`} onClick={this.sendGAEvent}>{format}</a>)} </p>;
{'fraction_non_alphanumeric': 0.17590650284686846, 'fraction_numerical': 0.003596044351213665, 'mean_word_length': 3.642559109874826, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 35, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '943665', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1119, 'n_words': 178}