<commit_before>/*global module: false, require: false, console: false */
'use strict';

var React = require('react');
var DataTable = require('react-data-components-bd2k').DataTable;
require('react-data-components-bd2k/css/table-twbs.css');

function buildHeader(onClick, title) {
	return (
		<span>
			{title}
			<span onClick={() => onClick(title)}
				className='help glyphicon glyphicon-question-sign superscript'/>
		</span>
	);
}

var VariantTable = React.createClass({
	render: function () {
		var {data, onHeaderClick, onRowClick} = this.props,
			columns = [
				{title: 'Gene', prop: 'Gene symbol'},
				{title: '  HGVS  ', prop: 'HGVS'},
				{title: 'Pathogenicity', prop: 'Clinical significance'},
				{title: 'Allele origin', prop: 'Allele origin'},
				{title: 'CVA', prop: 'ClinVarAccession'}
			];
		return (
			<DataTable
				buildRowOptions={r => ({onClick: () => onRowClick(r.id)})}
				buildHeader={title => buildHeader(onHeaderClick, title)}
				columns={columns}
				initialData={data}
				initialPageLength={10}
                initialSortBy={{ title: 'Gene', prop: 'Gene', order: 'descending' }}
                pageLengthOptions={[ 10, 50, 100 ]}
                keys={['id']}
            />
		);
	}
});


module.exports = VariantTable;<commit_msg>Add tooltip for variant detail click.<commit_after>/*global module: false, require: false, console: false */
'use strict';

var React = require('react');
var DataTable = require('react-data-components-bd2k').DataTable;
require('react-data-components-bd2k/css/table-twbs.css');

function buildHeader(onClick, title) {
	return (
		<span>
			{title}
			<span onClick={() => onClick(title)}
				className='help glyphicon glyphicon-question-sign superscript'/>
		</span>
	);
}

var VariantTable = React.createClass({
	render: function () {
		var {data, onHeaderClick, onRowClick} = this.props,
			columns = [
				{title: 'Gene', prop: 'Gene symbol'},
				{title: '  HGVS  ', prop: 'HGVS'},
				{title: 'Pathogenicity', prop: 'Clinical significance'},
				{title: 'Allele origin', prop: 'Allele origin'},
				{title: 'CVA', prop: 'ClinVarAccession'}
			];
		return (
			<DataTable
				buildRowOptions={r => ({title: 'click for details', onClick: () => onRowClick(r.id)})}
				buildHeader={title => buildHeader(onHeaderClick, title)}
				columns={columns}
				initialData={data}
				initialPageLength={10}
                initialSortBy={{ title: 'Gene', prop: 'Gene', order: 'descending' }}
                pageLengthOptions={[ 10, 50, 100 ]}
                keys={['id']}
            />
		);
	}
});


module.exports = VariantTable;
{'fraction_non_alphanumeric': 0.17128560431100848, 'fraction_numerical': 0.008468052347959968, 'mean_word_length': 3.551663747810858, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, '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': '5659667', 'n_tokens_mistral': 967, 'n_tokens_neox': 827, 'n_words': 188}