<commit_before>var colors = [ "#EEF", "#FEE", "#EFE" ];

function loadChart() {
	$("#tabs ul").append("<li><a href=\"#hc\">Figure Presence Chart</a></li>");
	$("#tabs").append("<div class=\"hc\" id=\"hc\"></div>");

	$("#hc")
			.highcharts(
					{
						title : null,
						chart : {
							type : 'line',
							zoomType : 'x'
						},
						xAxis : {
							plotBands : function() {
								var segments;
								if ("seg2" in data["segments"]) {
									segments = data["segments"]["seg2"];
								} else /*if ("seg1" in data["segments"])*/ {
									segments = data["segments"]["seg1"];
								}
								return segments.map(function(cur, i, _) {
									var o = {
											from:cur["begin"],
											to:cur["end"],
											color:colors[i % 3],
											label:{
												text:cur["heading"],
												rotation:270,
												align:"center",
												verticalAlign:"bottom",
												y:-30
											}
										};
									console.log(o);
									return o;
								})
							}
						},
						yAxis : {
						//categories: speakers
						},
						plotOptions : {
							series : {
								lineWidth : 1
							// connectNulls: false // by default
							}<commit_msg>fixed script bug with plotbands<commit_after>var colors = [ "#EEF", "#FEE", "#EFE" ];

function loadChart() {
	$("#tabs ul").append("<li><a href=\"#hc\">Figure Presence Chart</a></li>");
	$("#tabs").append("<div class=\"hc\" id=\"hc\"></div>");
	var segments;
	if ("seg2" in data["segments"]) {
		segments = data["segments"]["seg2"];
	} else /* if ("seg1" in data["segments"]) */ {
		segments = data["segments"]["seg1"];
	}
	var pb = segments.map(function(cur, i, _) {
		return {
			from:cur["begin"],
			to:cur["end"],
			color:colors[i % 3],
			label:{
				text:cur["heading"],
				rotation:270,
				align:"center",
				verticalAlign:"bottom",
				y:-30
			}
		}
	});
		
	$("#hc")
			.highcharts(
					{
						title : null,
						chart : {
							type : 'line',
							zoomType : 'x'
						},
						xAxis : {
							plotBands : pb
						},
						yAxis : {
						// categories: speakers
						},
						plotOptions : {
							series : {
								lineWidth : 1
							// connectNulls: false // by default
							}
{'fraction_non_alphanumeric': 0.20027124773960217, 'fraction_numerical': 0.009945750452079566, 'mean_word_length': 1.829923273657289, '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': '2276830', 'n_tokens_mistral': 1143, 'n_tokens_neox': 736, 'n_words': 143}