<commit_before>let React = require('react'),
    THREE = require('three'),
    ConfigurationStore = require('../stores/SearchConfigurationStore'),
    Rotation = require('../chaos/Rotation'),
    cx = require('react-addons').classSet;

/* Given a renderer, this component renders strange attractors, handles user input
* for rotating attractors, and animates rotating attractors, redrawing only
* when necessary */

let Viewport = React.createClass({
    getInitialState: function() {
        return { searching: false, rotation: new Rotation() };
    },

    render: function() {
        let progressClassName = cx({
            "search-progress-container": true,
            "hidden": !this.state.searching
        });

        return (
            <div
                className="viewport"
                ref="viewport"
                onMouseDown={this._dragStart}
                onMouseUp={this._dragStop}
                onMouseOut={this._dragStop}
                onMouseMove={this._drag}>
                <div className={progressClassName}>
                    <img src="./svg/lorentz.svg" />
                </div>
            </div>
        )
    },

    _dragStart(e) {
        this.state.rotation.startDrag(e.screenX, e.screenY);
        this._stopAnimation();
    },

    _dragStop(e) {
        if (this.state.rotation.stopDrag(e.screenX, e.screenY)) {
            this._startAnimation();
        }
    },

    _drag(e) {
        if (this.state.rotation.drag(e.screenX, e.screenY)) {
            this.renderScene();
        }
    },

    handleResize: function() {
        var viewport = this.refs.viewport.getDOMNode();
        var width = viewport.clientWidth;
        var height = viewport.clientHeight;
        var renderer = this.state.renderer;<commit_msg>Fix touch<commit_after>let React = require('react'),
    THREE = require('three'),
    ConfigurationStore = require('../stores/SearchConfigurationStore'),
    Rotation = require('../chaos/Rotation'),
    cx = require('react-addons').classSet;

/* Given a renderer, this component renders strange attractors, handles user input
* for rotating attractors, and animates rotating attractors, redrawing only
* when necessary */

let Viewport = React.createClass({
    getInitialState: function() {
        return { searching: false, rotation: new Rotation() };
    },

    render: function() {
        let progressClassName = cx({
            "search-progress-container": true,
            "hidden": !this.state.searching
        });

        return (
            <div
                className="viewport"
                ref="viewport"
                onMouseDown={this._dragStart}
                onMouseUp={this._dragStop}
                onMouseOut={this._dragStop}
                onMouseMove={this._drag}
                onTouchStart={this._dragStart}
                onTouchEnd={this._dragStop}
                onTouchLeave={this._dragStop}
                onTouchMove={this._drag}>
                <div className={progressClassName}>
                    <img src="./svg/lorentz.svg" />
                </div>
            </div>
        )
    },

    _dragStart(e) {
        this.state.rotation.startDrag(e.screenX, e.screenY);
        this._stopAnimation();
    },

    _dragStop(e) {
        if (this.state.rotation.stopDrag(e.screenX, e.screenY)) {
            this._startAnimation();
        }
    },

    _drag(e) {
        if (this.state.rotation.drag(e.screenX, e.screenY)) {
            this.renderScene();
        }
    },

    handleResize: function() {
        var viewport = this.refs.viewport.getDOMNode();
        var width = viewport.clientWidth;
        var height = viewport.clientHeight;
        var renderer = this.state.renderer;
{'fraction_non_alphanumeric': 0.12392703862660945, 'fraction_numerical': 0.0, 'mean_word_length': 1.9689490445859872, 'pattern_counts': {'":': 4, '<': 13, '<?xml version=': 0, '>': 13, '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': '2626331', 'n_tokens_mistral': 1049, 'n_tokens_neox': 1005, 'n_words': 194}