<commit_before>'use strict';

angular.module('machine-learning').controller('MlController', ['$scope',
	function($scope) {

		$scope.buildData = function() {
			$scope.loading = undefined;
			$scope.error = undefined;

			if ($scope.rawData === undefined || $scope.rawData === '') {
				$scope.error = "I need dat raw data, yo.";
				return;
			} else if ($scope.clusterData === undefined || $scope.clusterData === '') {
				$scope.error = "I need dat cluster data, yo.";
				return;
			}

			$scope.loading = true;

			var rawData = parseData($scope, $scope.rawData);
			var clusterData = parseData($scope, $scope.clusterData);
			if (rawData.length !== clusterData[0].length) {
				$scope.error = "N in the raw data does not match N in the cluster data.";
				$scope.loading = false;
				return;
			}

			google.load('visualization', '1.1', {packages:['scatter']});
			google.setOnLoadCallback(drawChart);
			$scope.loading = undefined;
		};
		function drawChart() {
			console.log('Calling draw Chart');
			var data = google.visualization.arrayToDataTable([
				['Age', 'Weight'],
				[ 8,      12],
				[ 4,      5.5],
				[ 11,     14],
				[ 4,      5],
				[ 3,      3.5],
				[ 6.5,    7]
			]);

			var options = {
				title: 'Age vs. Weight comparison',
				hAxis: {title: 'Age', minValue: 0, maxValue: 15},
				vAxis: {title: 'Weight', minValue: 0, maxValue: 15},
				legend: 'none'
			};

			var chart = new google.visualization.ScatterChart(document.getElementById('chart_div'));
			chart.draw(data, options);<commit_msg>Ready to add nvd3<commit_after>'use strict';

angular.module('machine-learning').controller('MlController', ['$scope',
	function($scope) {

		$scope.buildData = function() {
			$scope.loading = undefined;
			$scope.error = undefined;

			if ($scope.rawData === undefined || $scope.rawData === '') {
				$scope.error = "I need dat raw data, yo.";
				return;
			} else if ($scope.clusterData === undefined || $scope.clusterData === '') {
				$scope.error = "I need dat cluster data, yo.";
				return;
			}

			$scope.loading = true;

			var rawData = parseData($scope, $scope.rawData);
			var clusterData = parseData($scope, $scope.clusterData);
			if (rawData.length !== clusterData[0].length) {
				$scope.error = "N in the raw data does not match N in the cluster data.";
				$scope.loading = false;
				return;
			}

			$scope.loading = true;
{'fraction_non_alphanumeric': 0.1710802858343842, 'fraction_numerical': 0.012189995796553174, 'mean_word_length': 3.197530864197531, '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': '5527843', 'n_tokens_mistral': 932, 'n_tokens_neox': 756, 'n_words': 193}