<commit_before>var React = require('react');
var render = require('../../lib/render.jsx');
var Link = require('../../components/link/link.jsx');

// TEMP: Change div w. zIndex to Draggable to enable drag
// var Draggable = require('react-draggable');

var Hammer = require('react-hammerjs');
var Grid = require('./grid.jsx');

var App = React.createClass({
  getInitialState: function () {
    return {
      zoomLevel: 6.25
    }
  },
  contextTypes: {
    router: React.PropTypes.func
  },
  setGridZoomLevel: function (amount) {
    this.refs.masterGrid.setZoomLevel(amount);
  },
  componentDidMount: function () {
    // Pass container dimensions in once initial render is complete
    //   since container must be measured before tiles can be properly laid out...
    var elWrapper = this.refs.wrapper.getDOMNode();
    this.refs.masterGrid.setContainerDimensions(elWrapper.clientWidth, elWrapper.clientHeight);

    setTimeout(function() {
      this.refs.masterGrid.setZoomLevel(this.state.zoomLevel);
    }.bind(this), 100);
  },
  onZoomChange: function (event) {
    this.setState({
      zoomLevel: event.pagesWide
    });
  },
  render: function () {
    return (
      <div className="section-2">
        <div ref="wrapper" className="wrapper">
          <div zIndex={100}>
            <div>
              <Grid ref="masterGrid" aspectRatio={"35:40"} onZoomChange={ this.onZoomChange } />
            </div>
          </div>
        </div>
        <div className="segmented-control">
          <Hammer
            className={ this.state.zoomLevel < 6.25 ? 'enabled' : 'disabled' }
            component="button"
            onTap={ this.setGridZoomLevel.bind(this, 6.25) }>
            -
          </Hammer>
          <Hammer component="button" className="disabled">+</Hammer>
          <Link href="/project/1234">Go to project view!</Link>
        </div>
      </div>
    );
  }
});

render(App);<commit_msg>Add url attribute to link in map<commit_after>var React = require('react');
var render = require('../../lib/render.jsx');
var Link = require('../../components/link/link.jsx');

// TEMP: Change div w. zIndex to Draggable to enable drag
// var Draggable = require('react-draggable');

var Hammer = require('react-hammerjs');
var Grid = require('./grid.jsx');

var App = React.createClass({
  getInitialState: function () {
    return {
      zoomLevel: 6.25
    }
  },
  contextTypes: {
    router: React.PropTypes.func
  },
  setGridZoomLevel: function (amount) {
    this.refs.masterGrid.setZoomLevel(amount);
  },
  componentDidMount: function () {
    // Pass container dimensions in once initial render is complete
    //   since container must be measured before tiles can be properly laid out...
    var elWrapper = this.refs.wrapper.getDOMNode();
    this.refs.masterGrid.setContainerDimensions(elWrapper.clientWidth, elWrapper.clientHeight);

    setTimeout(function() {
      this.refs.masterGrid.setZoomLevel(this.state.zoomLevel);
    }.bind(this), 100);
  },
  onZoomChange: function (event) {
    this.setState({
      zoomLevel: event.pagesWide
    });
  },
  render: function () {
    return (
      <div className="section-2">
        <div ref="wrapper" className="wrapper">
          <div zIndex={100}>
            <div>
              <Grid ref="masterGrid" aspectRatio={"35:40"} onZoomChange={ this.onZoomChange } />
            </div>
          </div>
        </div>
        <div className="segmented-control">
          <Hammer
            className={ this.state.zoomLevel < 6.25 ? 'enabled' : 'disabled' }
            component="button"
            onTap={ this.setGridZoomLevel.bind(this, 6.25) }>
            -
          </Hammer>
          <Hammer component="button" className="disabled">+</Hammer>
          <Link url="/project/1234" href="/page/project">Go to project view!</Link>
        </div>
      </div>
    );
  }
});

render(App);
{'fraction_non_alphanumeric': 0.14954954954954955, 'fraction_numerical': 0.012355212355212355, 'mean_word_length': 2.578268876611418, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 37, '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': '5906957', 'n_tokens_mistral': 1203, 'n_tokens_neox': 1150, 'n_words': 254}