<commit_before>var React = require('react');
var dataScale = require('../core/space-transf.cs.js');
var imUtils = require('../core/im-utils.cs.js');

/*
	{
		draw: false,
		ds: {
			x: {},
			y: {}
		},
		position:{
			x: 0,
			y: 0
		},
		color: 'black',
		width: 0,
		fill: undefined,
		size: 0,
		shade: 1
	}
*/

var SquareMark = React.createClass({

	shouldComponentUpdate: function(props){
		return !imUtils.isEqual(props.state,this.props.state);
	},

	render: function(){
		var state = this.props.state;

		var x = dataScale.toC(state.ds.x,state.position.x) - state.size / 2;
		var y = dataScale.toC(state.ds.y,state.position.y) + state.size / 2;
		var f = state.fill || state.color;

		return <rect x={x} y={y} width={state.size} height={state.size} fill={f} opacity={state.shade} stroke={state.color} strokeWidth={state.width}/>;
	}
});

module.exports = SquareMark;
<commit_msg>Correction carré, et taille normalisée sur le point<commit_after>var React = require('react');
var dataScale = require('../core/space-transf.cs.js');
var imUtils = require('../core/im-utils.cs.js');

/*
	{
		draw: false,
		ds: {
			x: {},
			y: {}
		},
		position:{
			x: 0,
			y: 0
		},
		color: 'black',
		width: 0,
		fill: undefined,
		size: 0,
		shade: 1
	}
*/

var SquareMark = React.createClass({

	shouldComponentUpdate: function(props){
		return !imUtils.isEqual(props.state,this.props.state);
	},

	render: function(){
		var state = this.props.state;

		var x = dataScale.toC(state.ds.x,state.position.x) - state.size;
		var y = dataScale.toC(state.ds.y,state.position.y) - state.size;
		var f = state.fill || state.color;

		return <rect x={x} y={y} width={2 * state.size} height={2 * state.size} fill={f} opacity={state.shade} stroke={state.color} strokeWidth={state.width}/>;
	}
});

module.exports = SquareMark;

{'fraction_non_alphanumeric': 0.18929359823399558, 'fraction_numerical': 0.00772626931567329, 'mean_word_length': 3.521197007481297, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4184147', 'n_tokens_mistral': 754, 'n_tokens_neox': 685, 'n_words': 141}