<commit_before>import '../styles/main.scss';

import React from 'react';
import ReactDOM from 'react-dom';

import data from './settings.json';

// App Container
var App = React.createClass({
	getDefaultProps: function() {
		return(data);
	},
	handleChange: function(e) {
		var value = e.target.value;
		var name = e.target.id;
		switch (name) {
			case 'contrast':
				this.props.data.settings[0].value = value + '%';
				break;
			case 'hue':
				this.props.data.settings[1].value = value + 'deg';
				break;
			case 'brightness':
				this.props.data.settings[2].value = value + '%';
				break;
			case 'saturate':
				this.props.data.settings[3].value = value + '%';
				break;
			case 'sepia':
				this.props.data.settings[4].value = value + '%';
				break;
		}
		this.forceUpdate();
	},
	handleClick: function(e) {
		console.log(this.props);
		var index = e.target.id.replace('filter-','');
		// console.log(this.props.filters[index].settings);
		this.props.data.settings[0].value = this.props.data.filters[index].settings[0].value;
		this.props.data.settings[1].value = this.props.data.filters[index].settings[1].value;
		this.props.data.settings[2].value = this.props.data.filters[index].settings[2].value;
		this.props.data.settings[3].value = this.props.data.filters[index].settings[3].value;
		this.props.data.settings[4].value = this.props.data.filters[index].settings[4].value;
		this.forceUpdate();

	},
	render: function() {
		return(
			<div className="App">
				<ImageBG image={this.props.data.image} />
				<Settings onClick={this.handleClick} onChange={this.handleChange} data={this.props.data} />
			</div>
		)
	}
});

// Image Background
var ImageBG = React.createClass({
	render: function() {
		return (
			<div className="ImageBG" style={{backgroundImage: 'url('+ this.props.image + ')'}}></div>
		)<commit_msg>small fix<commit_after>import '../styles/main.scss';

import React from 'react';
import ReactDOM from 'react-dom';

import data from './settings.json';

// App Container
var App = React.createClass({
	getDefaultProps: function() {
		return(data);
	},
	handleChange: function(e) {
		var value = e.target.value;
		var name = e.target.id;
		switch (name) {
			case 'contrast':
				this.props.data.settings[0].value = value + '%';
				break;
			case 'hue':
				this.props.data.settings[1].value = value + 'deg';
				break;
			case 'brightness':
				this.props.data.settings[2].value = value + '%';
				break;
			case 'saturate':
				this.props.data.settings[3].value = value + '%';
				break;
			case 'sepia':
				this.props.data.settings[4].value = value + '%';
				break;
		}
		this.forceUpdate();
	},
	handleClick: function(e) {
		var index = e.target.id.replace('filter-','');
		// console.log(this.props.filters[index].settings);
		this.props.data.settings[0].value = this.props.data.filters[index].settings[0].value;
		this.props.data.settings[1].value = this.props.data.filters[index].settings[1].value;
		this.props.data.settings[2].value = this.props.data.filters[index].settings[2].value;
		this.props.data.settings[3].value = this.props.data.filters[index].settings[3].value;
		this.props.data.settings[4].value = this.props.data.filters[index].settings[4].value;
		this.forceUpdate();

	},
	render: function() {
		return(
			<div className="App">
				<ImageBG image={this.props.data.image} />
				<Settings onClick={this.handleClick} onChange={this.handleChange} data={this.props.data} />
			</div>
		)
	}
});

// Image Background
var ImageBG = React.createClass({
	render: function() {
		return (
			<div className="ImageBG" style={{backgroundImage: 'url('+ this.props.image + ')'}}></div>
		)
{'fraction_non_alphanumeric': 0.1873452544704264, 'fraction_numerical': 0.008253094910591471, 'mean_word_length': 3.777923784494087, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '1397722', 'n_tokens_mistral': 1383, 'n_tokens_neox': 1240, 'n_words': 206}