<commit_before>
d3.chart('Line').extend('Area', {

	initialize: function(options) {
		options = options || {};

		var self = this;

		this.area = d3.svg.area();

		this.areaPath = this.base.append('path').attr({
			'class': 'area',
		});

		this.area
			.x(this.line.x())
			.y1(this.line.y())
			.y0(this.yScale(0));

		return this;
	},

	transform: function(data) {

		if(this.onDataBind) { this.onDataBind(); }

		this.areaPath.datum(data).attr('d', this.area);

		this._onWindowResize();

		return data;
	},

	// Update Scale, Box Size, and attr values
	_update: function(_width, _height) {

		this.areaPath.attr({
			'd': this.area
		});
	}
});<commit_msg>update the area variable instead of line var<commit_after>/*
	by default, the line is expect the data like this structure { x: 0.3434, y: 0.3242}
	but if the object data is rather different like { z: 0.3434, y: 0.3242}


	var line = this.mixin("Line", this.base.append('g').classed('lines', true), {
		info: containerInfo
	});

	line.line.x(function(d){
		return line.xScale(d.z);
	});

	Use this.line # this will be replaced with its current context like line here.
	context.xScale will access the this.xScale here.

	class:  dot

	this.path leave in transform, so that it could be extended by Area chart
 */
d3.chart('Base').extend('Area', {

	initialize: function(options) {
		options = options || {};

		this.layer('area', this.base, {
			dataBind: function(data) {
				var chart = this.chart();

				chart.area = d3.svg.area();

				// Setup the auto resize to handle the on resize event
				// chart.dispatch.on('d3maSingleWindowResize', function(chart, single){
				// 	single.attr({ 'd': chart.line });
				// });

				chart.area
					.x(function(d) { return chart.xScale(d.x); })
					.y(function(d) { return chart.yScale(d.y);  });

				if(chart.onDataBind) { chart.onDataBind(chart, data,  (options.data) ? options.data : undefined ); }

				// data[options.data]  will return a single array, data will bind path element to each array index,
				// by pushing options array into an anonymous array, ONLY one path element will be created
				//return this.selectAll('path').data( (options.data) ? [ data[options.data] ]: data );
				return this.selectAll('path').data( [data] );
			},

			insert: function(){
				var chart = this.chart();
				if(chart.onInsert) { chart.onInsert(chart); }
				return this.append('path').classed('line', true);
			},

			events: {
				'enter': function() {
					var chart = this.chart();

					// chart  # refer to this context, used it to access xScale, yScale, width, height, etc. chart property
					// this   # refer to each individual group just appended by insert command
					if(chart.onEnter) { chart.onEnter(chart, this); }

					chart._onWindowResize(chart, this);

					this.attr({
						'd': chart.area,
						'opacity': 1e-6
					});
				},

				'enter:transition': function() {
					var chart = this.chart();
					return this
							.duration(1000)
							.style('opacity', 1);
				}
			}
		});
	}

	// 	this.linePath = this.base.append('path').attr({
	// 		'class': 'line',
	// 	});

	// 	if(this.onDataBind) { this.onDataBind(); }

	// 	this.linePath.datum(data).attr('d', this.line);

	// 	// Define this fn where the data is manipulated
	// 	// after all the data var has the correct value, then call it on Window resize
	// 	// Normally, after calling this fn, need to define the _update to handle the Scale change, box size changes, attr updates
	// 	this._onWindowResize();

	// 	return data;
	// }

	// Update Scale, Box Size, and attr values
	// _update: function(_width, _height) {

	// 	this.linePath.attr({
	// 		'd': this.line
	// 	});
	// }
});
{'fraction_non_alphanumeric': 0.16244897959183674, 'fraction_numerical': 0.009523809523809525, 'mean_word_length': 2.9315508021390375, 'pattern_counts': {'":': 0, '<': 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': '1154928', 'n_tokens_mistral': 1444, 'n_tokens_neox': 1213, 'n_words': 334}