<commit_before><div class="card">
	<div class="content">
		<h2 class="header"><g:message code="widget.event.gender.header"/></h2>
		<div id="gender"></div>
	</div>
</div>
<script>
	var genders = {
		0: '<g:message code="gender.unknown"/>',
		1: '<g:message code="gender.male"/>',
		2: '<g:message code="gender.female"/>'
	};
	$(function() {
		var drugEvents = $.grep(events, function(event) {
			return !$.isArray(event.patient);
		});
		var genderMap = drugEvents.reduce(function(map, cur) {
			var gender = genders[cur.patient.patientsex] || genders[0];
			if (!map[gender]) {
				map[gender] = 0;
			}
			map[gender]++;
			return map;
		}, {});
		var columns = Object.keys(genderMap).reduce(function(cols, key) {
			var col = [key].concat(genderMap[key]);
			cols.push(col);
			return cols;
		}, []);
		console.log(columns);
		var chart = c3.generate({
			bindto: '#gender',
			data: {
				columns: columns,
				type : 'pie',
				colors: {
					Unknown: '#DCDDDE',
					Male:    '#54C8FF',
					Female:  '#FF8EDF'
				},
			}
		});
	});
</script><commit_msg>Altered the pink/blue shades and moved the legend to the right.<commit_after><div class="card">
	<div class="content">
		<h2 class="header"><g:message code="widget.event.gender.header"/></h2>
		<div id="gender"></div>
	</div>
</div>
<script>
	var genders = {
		0: '<g:message code="gender.unknown"/>',
		1: '<g:message code="gender.male"/>',
		2: '<g:message code="gender.female"/>'
	};
	$(function() {
		var drugEvents = $.grep(events, function(event) {
			return !$.isArray(event.patient);
		});
		var genderMap = drugEvents.reduce(function(map, cur) {
			var gender = genders[cur.patient.patientsex] || genders[0];
			if (!map[gender]) {
				map[gender] = 0;
			}
			map[gender]++;
			return map;
		}, {});
		var columns = Object.keys(genderMap).reduce(function(cols, key) {
			var col = [key].concat(genderMap[key]);
			cols.push(col);
			return cols;
		}, []);
		console.log(columns);
		var chart = c3.generate({
			bindto: '#gender',
			data: {
				columns: columns,
				type : 'pie',
				colors: {
					Unknown: '#dcddde',
					Male:    '#bde7ff',
					Female:  '#ffc2bd'
				}
			},
			legend: {
				position: 'right'
			}
		});
	});
</script>
{'fraction_non_alphanumeric': 0.20976491862567812, 'fraction_numerical': 0.009945750452079566, 'mean_word_length': 3.390873015873016, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, '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': '5004798', 'n_tokens_mistral': 961, 'n_tokens_neox': 814, 'n_words': 160}