<commit_before>import React, {Component} from "react";
import PropTypes from "prop-types";

class Grid extends Component {
    static propTypes = {
        gridWidth: React.PropTypes.string,
        gridHeight: React.PropTypes.string
    }

    updateCanvas = () => {
        var canvas = document.getElementById("game-grid");
        var context = canvas.getContext("2d");

        for (var x = 0.5; x < 501; x += 10) {
            context.moveTo(x, 0);
            context.lineTo(x, 381);
        }

        for (var y = 0.5; y < 381; y += 10) {
            context.moveTo(0, y);
            context.lineTo(500, y);
        }

        context.strokeStyle = "#ddd";
        context.stroke();
    }

    componentDidMount() {
        this.updateCanvas();
    }

    render() {
        return(
            <canvas
                id="game-grid"
                width={this.props.gridWidth}
                height={this.props.gridHeight}></canvas>
        );
    }
}

export default Grid;
<commit_msg>Fix grid dimensions<commit_after>import React, {Component} from "react";
import PropTypes from "prop-types";

class Grid extends Component {
    static propTypes = {
        gridWidth: React.PropTypes.string,
        gridHeight: React.PropTypes.string
    }

    //length, height string - canvas length and height in px;
    updateCanvas = (length, height) => {
        var canvas = document.getElementById("game-grid");
        var context = canvas.getContext("2d");

        for (let x = 0.5; x < length; x += 10) {
            context.moveTo(x, 0);
            context.lineTo(x, height);
        }

        for (let y = 0.5; y < height; y += 10) {
            context.moveTo(0, y);
            context.lineTo(length, y);
        }

        context.strokeStyle = "#ddd";
        context.stroke();
    }

    componentDidMount() {
        let width = parseInt(this.props.gridWidth, 10);
        let height = parseInt(this.props.gridHeight, 10);
        this.updateCanvas(width, height);
    }

    render() {
        return(
            <canvas
                id="game-grid"
                width={this.props.gridWidth}
                height={this.props.gridHeight}></canvas>
        );
    }
}

export default Grid;

{'fraction_non_alphanumeric': 0.1302388463271744, 'fraction_numerical': 0.017124831004957188, 'mean_word_length': 1.8244274809160306, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '733992', 'n_tokens_mistral': 681, 'n_tokens_neox': 640, 'n_words': 150}