<commit_before>import React from 'react';

const propTypes = {
	source: React.PropTypes.object.isRequired,
	target: React.PropTypes.object.isRequired,
	className: React.PropTypes.string,
	keyProp: React.PropTypes.string.isRequired,
	onClick: React.PropTypes.func
};

function diagonal(x1, y1, x2, y2) {
	return `M${y1},${x1}C${(y1+y2)/2},${x1} ${(y1+y2)/2},${x2} ${y2},${x2}`;
}

export default class Link extends React.PureComponent{
	constructor(props) {
		super(props);
		this.handleClick = this.handleClick.bind(this);
	}
	handleClick() {
		this.props.onClick && this.props.onClick(this.props.source[this.props.keyProp], this.props.target[this.props.keyProp]);
	}
	render() {
		let d = diagonal(
			this.props.source.x,
			this.props.source.y,
			this.props.target.x,
			this.props.target.y);

		return (
			<path className={this.props.className} d={d} onClick={this.handleClick}/>);
	}
}

Link.propTypes = propTypes;<commit_msg>Fixed undefined being passed into Link's onClick handler<commit_after>import React from 'react';

const propTypes = {
	source: React.PropTypes.object.isRequired,
	target: React.PropTypes.object.isRequired,
	className: React.PropTypes.string,
	keyProp: React.PropTypes.string.isRequired,
	onClick: React.PropTypes.func
};

function diagonal(x1, y1, x2, y2) {
	return `M${y1},${x1}C${(y1+y2)/2},${x1} ${(y1+y2)/2},${x2} ${y2},${x2}`;
}

export default class Link extends React.PureComponent{
	constructor(props) {
		super(props);
		this.handleClick = this.handleClick.bind(this);
	}
	handleClick() {
		this.props.onClick && this.props.onClick(this.props.source.data[this.props.keyProp], this.props.target.data[this.props.keyProp]);
	}
	render() {
		let d = diagonal(
			this.props.source.x,
			this.props.source.y,
			this.props.target.x,
			this.props.target.y);

		return (
			<path className={this.props.className} d={d} onClick={this.handleClick}/>);
	}
}

Link.propTypes = propTypes;
{'fraction_non_alphanumeric': 0.17352787910369985, 'fraction_numerical': 0.016675351745700884, 'mean_word_length': 4.818181818181818, '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': '4073880', 'n_tokens_mistral': 748, 'n_tokens_neox': 715, 'n_words': 114}