<commit_before>"use strict";

$(function () {
	$('#motif-table').dataTable({
		aoColumnDefs: [{sType: 'scientific', aTargets: [5]}],
		aaSorting: [[5, 'asc']],
		fnRowCallback: function (nRow, aData, iDisplayIndex) {
			if (aData[5] > 0.001) {
				var roundp = Number(aData[5]).toPrecision(2);
			} else {
				var roundp = Number(Number(aData[5]).toPrecision(3)).toExponential();
			}
			$('td:eq(5)', nRow).html(roundp);
			$('td:eq(4)', nRow).html(Number(aData[4]).toPrecision(4));
			return nRow;
		}
	});

	$.plot('#flot-expression', [expression]);
});<commit_msg>don't plot if no data<commit_after>"use strict";

$(function () {
	$('#motif-table').dataTable({
		aoColumnDefs: [{sType: 'scientific', aTargets: [5]}],
		aaSorting: [[5, 'asc']],
		fnRowCallback: function (nRow, aData, iDisplayIndex) {
			if (aData[5] > 0.001) {
				var roundp = Number(aData[5]).toPrecision(2);
			} else {
				var roundp = Number(Number(aData[5]).toPrecision(3)).toExponential();
			}
			$('td:eq(5)', nRow).html(roundp);
			$('td:eq(4)', nRow).html(Number(aData[4]).toPrecision(4));
			return nRow;
		}
	});

	if (expression.length === 0) {
		$('#flot-expression').append($('</p>').html('No expression data available'))
	} else {
		$.plot('#flot-expression', [expression], {
			series: {
				lines: {show: true},
				points: {show: true}
			}
		});
	}
});
{'fraction_non_alphanumeric': 0.23735119047619047, 'fraction_numerical': 0.023065476190476192, 'mean_word_length': 4.38, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, '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': '1827078', 'n_tokens_mistral': 598, 'n_tokens_neox': 523, 'n_words': 89}