<commit_before>export default Ember.View.extend({
	didInsertElement: function() {
		this.loadGraph();
	},
	willDestroyElement: function() {
		this.destroyGraph();
	},
	destroyGraph: function() {
		d3.select("svg").remove();
	},
	loadGraph: function() {
		var width = $(window).width();
		var height = $(window).height();
		
		var x = d3.scale.linear().range([0, width]);
		var y = d3.scale.ordinal().rangeRoundBands([0, height], 0.2);

		var xAxis = d3.svg.axis().scale(x).orient("top");
		
		var svg = d3.select('body').append('svg')
								.attr('width', width)
								.attr('height', height)
								.append('g');

		d3.json('http://meteoub.equip9.org/measures', function(error, data) {

			x.domain(d3.extent(data.measures, function(measure){
				return measure.temperature;
			}));
			
			y.domain(data.measures.map(function(measure) {
				return measure.datetime;
			}));

			svg.selectAll(".bar").data(data.measures).enter().append("rect")
						.attr("class", function(measure) { 
							return measure.temperature < 0 ? "bar negative" : "bar positive"; 
						})
						.attr("x", function(measure) { 
							return width / 10.0;
						})
						.attr("y", function(measure) { 
							return y(measure.datetime); 
						})
						.attr("width", function(measure) { 
							var relative_temperature = measure.temperature / 40.0; // relative to 0º C-40º C

							return width * relative_temperature;
						})
						.attr("height", y.rangeBand())
						.attr("fill", function(measure) {
							var relative_temperature = measure.temperature / 40.0; // relative to 0º C-40º C
							var color = 'orange';
							return color;
						});

			svg.append("g").attr("class", "x axis").call(xAxis);
			svg.append("g").attr("class", "y axis").append("line")
					.attr("x1", x(0))
					.attr("x2", x(0))
					.attr("y2", height);

		});
	}
});<commit_msg>fix jshint<commit_after>export default Ember.View.extend({
	didInsertElement: function() {
		this.loadGraph();
	},
	willDestroyElement: function() {
		this.destroyGraph();
	},
	destroyGraph: function() {
		d3.select("svg").remove();
	},
	loadGraph: function() {
		var width = this.$(window).width();
		var height = this.$(window).height();
		
		var x = d3.scale.linear().range([0, width]);
		var y = d3.scale.ordinal().rangeRoundBands([0, height], 0.2);

		var xAxis = d3.svg.axis().scale(x).orient("top");
		
		var svg = d3.select('body').append('svg')
								.attr('width', width)
								.attr('height', height)
								.append('g');

		d3.json('http://meteoub.equip9.org/measures', function(error, data) {

			x.domain(d3.extent(data.measures, function(measure){
				return measure.temperature;
			}));
			
			y.domain(data.measures.map(function(measure) {
				return measure.datetime;
			}));

			svg.selectAll(".bar").data(data.measures).enter().append("rect")
						.attr("class", function(measure) { 
							return measure.temperature < 0 ? "bar negative" : "bar positive"; 
						})
						.attr("x", function() { 
							return width / 10.0;
						})
						.attr("y", function(measure) { 
							return y(measure.datetime); 
						})
						.attr("width", function(measure) { 
							var relative_temperature = measure.temperature / 40.0; // relative to 0º C-40º C

							return width * relative_temperature;
						})
						.attr("height", y.rangeBand())
						.attr("fill", function() {
							// var relative_temperature = measure.temperature / 40.0; // relative to 0º C-40º C
							var color = 'orange';
							return color;
						});

			svg.append("g").attr("class", "x axis").call(xAxis);
			svg.append("g").attr("class", "y axis").append("line")
					.attr("x1", x(0))
					.attr("x2", x(0))
					.attr("y2", height);

		});
	}
});
{'fraction_non_alphanumeric': 0.19394921663965425, 'fraction_numerical': 0.017828200972447326, 'mean_word_length': 2.885624344176285, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3191114', 'n_tokens_mistral': 1631, 'n_tokens_neox': 1218, 'n_words': 227}