<commit_before>var asLines = function () {
	this.redraw  = function (d, quantifier) { 
		this.callbacks = {};
		var data = d.data;
		d.scale.range ([this.height, 0]); // this comes from the prequantifier and it is used by the quantifier 
		var lines = data; //TODO verify if this works with a single line..
		if (data.nests == 2) {
			lines = data.items ();
		}
		var itemsMax = d3.max (lines, function (l) { return l.values.length; });
		var pointDistance = this.width / itemsMax;
		var height = this.height;

		var after = function (container, origAttrs) { 
			return function (rets, a) { 
				var ys = [], rs = [];
				var attrs = {};
				var cHeight = height;
				for (var i in rets) {
					var origY = rets [i].y;
					rets [i].y = 0;
					rets [i].x = pointDistance * i;
					rets [i].width = pointDistance;
					rets [i].height = cHeight; 

					var rect = container.insert ("rect", ":first-child")
						.on ("click", this.createCallback ("mouseover"))
						.on ("mouseover", this.createCallback ("mouseover"));
					this.setElementAttributes (rect, rets [i]);

					rets [i].y = origY;
					rets [i].cx = rets [i].x;
					rets [i].cy = rets [i].y;
					ys.push (rets [i].y);
					rs.push (rets [i].r);

					var circle = container.insert ("circle")
						.on ("click", this.createCallback ("mouseover"))
						.on ("mouseover", this.createCallback ("mouseover"));
					this.setElementAttributes (circle, rets [i]);
					if (rets [i].value) {
						var text = container.append("text").text (rets [i].value);
						this.setElementAttributes (text, rets [i]);
					}
					if (rets [i].label) {
						var text = container.append ("text").text (rets [i].label).classed ("label", true);
						var r = rets [i];
						r.y = cHeight; 
						this.setElementAttributes (text, rets [i]);
					}
					rets [i].y = null;
				//	$.extend (attrs, rets);
				}
				var x = function (d, e) { return pointDistance * e; };
				var y = function (d, e) { return ys [e]; };

				var line = container.insert ("path");
				var svgLine = d3.svg.line ().x (x).y (y);
				line.attr ("d", function (t) { return svgLine (ys) })
					.on ("click", this.createCallback ("mouseover"));
				this.setElementAttributes (line, origAttrs);
				

				return attrs;
			}
		}<commit_msg>Implemented chart notes and stepped lines.<commit_after>var asLines = function () {
	this.redraw  = function (d, quantifier) { 
		this.callbacks = {};
		var data = d.data;
		d.scale.range ([this.height, 0]); // this comes from the prequantifier and it is used by the quantifier 
		var lines = data; //TODO verify if this works with a single line..
		if (data.nests == 2) {
			lines = data.items ();
		}
		var itemsMax = d3.max (lines, function (l) { return l.values.length; });
		var pointDistance = this.width / itemsMax;
		var height = this.height;

		var after = function (container, origAttrs) { 
			return function (rets, a) { 
				var ys = [], rs = [];
				var attrs = {};
				var cHeight = height;
				for (var i in rets) {
					var origY = rets [i].y;
					rets [i].y = 0;
					rets [i].x = pointDistance * i;
					rets [i].width = pointDistance;
					rets [i].height = cHeight; 

					var rect = container.insert ("rect", ":first-child")
						.on ("click", this.createCallback ("mouseover"))
						.on ("mouseover", this.createCallback ("mouseover"));
					this.setElementAttributes (rect, rets [i]);

					rets [i].y = origY;
					rets [i].cx = rets [i].x;
					rets [i].cy = rets [i].y;
					if (origAttrs && origAttrs ["stepped"] == true) {
						ys.push ({y: rets [i].y, x: rets [i].x - (pointDistance / 2)});
						ys.push ({y: rets [i].y, x: rets [i].x});
						ys.push ({y: rets [i].y, x: rets [i].x + (pointDistance / 2)});
					} else {
						ys.push ({y: rets [i].y, x: rets [i].x});
					}
					rs.push (rets [i].r);

					var circle = container.insert ("circle")
						.on ("click", this.createCallback ("mouseover"))
						.on ("mouseover", this.createCallback ("mouseover"));
					this.setElementAttributes (circle, rets [i]);
					if (rets [i].value) {
						var text = container.append("text").text (rets [i].value);
						this.setElementAttributes (text, rets [i]);
						text.classed ("value", true);
					}
					if (rets [i].label) {
						var text = container.append ("text").text (rets [i].label);
						var r = rets [i];
						r.y = cHeight; 
						this.setElementAttributes (text, r);
						text.classed ("label", true);
					}
					if (rets [i].note) {
						var text = container.append ("text").text (rets [i].note);
						var r = rets [i];
						r.y = 0;
						this.setElementAttributes (text, r);
						text.classed ("note", true);

					}
					rets [i].y = null;
				//	$.extend (attrs, rets);
				}
				var x = function (d, e) { return ys [e].x; };
				var y = function (d, e) { return ys [e].y; };

				var line = container.insert ("path");
				var svgLine = d3.svg.line ().x (x).y (y);
				line.attr ("d", function (t) { return svgLine (ys) })
					.on ("click", this.createCallback ("mouseover"));
				this.setElementAttributes (line, origAttrs);
				

				return attrs;
			}
		}
{'fraction_non_alphanumeric': 0.17605356439543127, 'fraction_numerical': 0.0025600630169358013, 'mean_word_length': 2.512448132780083, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '1833303', 'n_tokens_mistral': 2209, 'n_tokens_neox': 1730, 'n_words': 520}