<commit_before>{% raw %}
<!doctype html>
<html>
<head>
	<title>NemWeb</title>
	<meta charset="utf-8">
<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">	
  <link href="static/css/bootstrap.min.css" rel="stylesheet">
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src= "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
-->
<script src="static/bower_components/angular/angular.min.js"></script>
<script src="static/bower_components/jquery/dist/jquery.min.js"></script>
<script src="static/bower_components/highcharts-ng/dist/highcharts-ng.min.js"></script>
<script src="http://code.highcharts.com/highcharts.src.js"></script>

</head>
<body>
  <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">Nemweb</a>
        </div>
        <div id="navbar" class="collapse navbar-collapse">
          <ul class="nav navbar-nav">
            <li><a href="/">Home</a></li>
            <li class="active"><a href="/stations">Stations</a></li>
            <li><a href="https://twitter.com/au_nem">Twitter</a></li>
            <li><a href="mailto:<EMAIL>">Contact</a></li>
            <li><a href="https://github.com/TheSkorm/nemweb">Source</a></li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </nav>
<div ng-app="nemweb" ng-controller="generators" style="min-width: 310px; height: 600px; margin: 0 auto; padding-top: 80px;">
<div class="row">
<div class="col-md-6">
<h3>Total Power being generated : {{totalmw | number : 2}} MW</h3>
</div>
<div class="col-md-6">
<h3>Total CO2e being generated : {{totalco2 | number : 2}} tonnes</h3>
</div>
</div>
<highchart id="chart1" config="chartConfigFuelType"></highchart>
<highchart id="chart2" config="chartConfigFuelSource"></highchart>
<highchart id="chart3" config="chartConfigTechSource"></highchart>
<!--
<table class="table table-bordered table-striped">
  <thead>
        <th>
		Fuel Type
	</th>
	<th>
		CO2e tonnes
	</th>
  </thead>
  <tr ng-repeat="(key, value) in fueltypeco2">
	<td>{{ key }}</td>
	<td>{{ value }}</td>
  </tr>
</table>
<table class="table table-bordered table-striped">
  <thead>
        <th>
	Fuel Source
	</th>
	<th>
	CO2e tonnes
	</th>
  </thead>
  <tr ng-repeat="(key, value) in fuelsourceco2">
	<td>{{ key }}</td>
	<td>{{ value }}</td>
  </tr>
</table>

<table class="table table-bordered table-striped">
  <thead>
        <th>
	Generator Tech
	</th>
	<th>
	CO2e tonnes
	</th>
  </thead>
  <tr ng-repeat="(key, value) in techco2">
	<td>{{ key }}</td>
	<td>{{ value }}</td>
  </tr>
</table>

<table class="table table-bordered table-striped">
  <thead>
        <th>
	Fuel Type
	</th>
	<th>
	MW
	</th>
  </thead>
  <tr ng-repeat="(key, value) in fueltype">
	<td>{{ key }}</td>
	<td>{{ value }}</td>
  </tr>
</table>


<table class="table table-bordered table-striped">
  <thead>
        <th>
	Fuel Source
	</th>
	<th>
	MW
	</th>
  </thead>
  <tr ng-repeat="(key, value) in fuelsource">
	<td>{{ key }}</td>
	<td>{{ value }}</td>
  </tr>
</table>

<table class="table table-bordered table-striped">
  <thead>
        <th>
	Generator Tech
	</th>
	<th>
	MW
	</th>
  </thead>
  <tr ng-repeat="(key, value) in tech">
	<td>{{ key }}</td>
	<td>{{ value }}</td>
  </tr>
</table>
-->
</div>
<script>

var app = angular.module('nemweb', ["highcharts-ng"]);
var controller = app.controller('generators', function($scope, $http, $timeout) {

 $http.get("/stations-data").success(function (response) {$scope.results = response.results;
 $scope.getData();
});
    

    $scope.getData = function(){
        $http.get("/scada").success(function (response) { 
		jQuery.extend(true, $scope.results, response.results)
		var totalmw = 0;
		var totalco2 = 0;
		var fuelsource = {};
		var fueltype = {};
		var tech = {};
		var fuelsourceco2 = {};
		var fueltypeco2 = {};
		var techco2 = {};
		for (x in $scope.results) {
			if($scope.results[x].CO2E){ 
				totalco2 = totalco2 + $scope.results[x].CO2E
				if ($scope.results[x].FuelSource){
					if (!fuelsourceco2[$scope.results[x].FuelSource]) fuelsourceco2[$scope.results[x].FuelSource] = 0
					fuelsourceco2[$scope.results[x].FuelSource] += $scope.results[x].CO2E
				}
				if ($scope.results[x].FuelSourceDescriptior){
					if (!fueltypeco2[$scope.results[x].FuelSourceDescriptior]) fueltypeco2[$scope.results[x].FuelSourceDescriptior] = 0
					fueltypeco2[$scope.results[x].FuelSourceDescriptior] += $scope.results[x].CO2E
				}<commit_msg>fix bug that caused zero emission users not to graph<commit_after>{% raw %}
<!doctype html>
<html>
<head>
	<title>NemWeb</title>
	<meta charset="utf-8">
<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">	
  <link href="static/css/bootstrap.min.css" rel="stylesheet">
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src= "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
-->
<script src="static/bower_components/angular/angular.min.js"></script>
<script src="static/bower_components/jquery/dist/jquery.min.js"></script>
<script src="static/bower_components/highcharts-ng/dist/highcharts-ng.min.js"></script>
<script src="http://code.highcharts.com/highcharts.src.js"></script>

</head>
<body>
  <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">Nemweb</a>
        </div>
        <div id="navbar" class="collapse navbar-collapse">
          <ul class="nav navbar-nav">
            <li><a href="/">Home</a></li>
            <li class="active"><a href="/stations">Stations</a></li>
            <li><a href="https://twitter.com/au_nem">Twitter</a></li>
            <li><a href="mailto:<EMAIL>">Contact</a></li>
            <li><a href="https://github.com/TheSkorm/nemweb">Source</a></li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </nav>
<div ng-app="nemweb" ng-controller="generators" style="min-width: 310px; height: 600px; margin: 0 auto; padding-top: 80px;">
<div class="row">
<div class="col-md-6">
<h3>Total Power being generated : {{totalmw | number : 2}} MW</h3>
</div>
<div class="col-md-6">
<h3>Total CO2e being generated : {{totalco2 | number : 2}} tonnes</h3>
</div>
</div>
<highchart id="chart1" config="chartConfigFuelType"></highchart>
<highchart id="chart2" config="chartConfigFuelSource"></highchart>
<highchart id="chart3" config="chartConfigTechSource"></highchart>
<!--
<table class="table table-bordered table-striped">
  <thead>
        <th>
		Fuel Type
	</th>
	<th>
		CO2e tonnes
	</th>
  </thead>
  <tr ng-repeat="(key, value) in fueltypeco2">
	<td>{{ key }}</td>
	<td>{{ value }}</td>
  </tr>
</table>
<table class="table table-bordered table-striped">
  <thead>
        <th>
	Fuel Source
	</th>
	<th>
	CO2e tonnes
	</th>
  </thead>
  <tr ng-repeat="(key, value) in fuelsourceco2">
	<td>{{ key }}</td>
	<td>{{ value }}</td>
  </tr>
</table>

<table class="table table-bordered table-striped">
  <thead>
        <th>
	Generator Tech
	</th>
	<th>
	CO2e tonnes
	</th>
  </thead>
  <tr ng-repeat="(key, value) in techco2">
	<td>{{ key }}</td>
	<td>{{ value }}</td>
  </tr>
</table>

<table class="table table-bordered table-striped">
  <thead>
        <th>
	Fuel Type
	</th>
	<th>
	MW
	</th>
  </thead>
  <tr ng-repeat="(key, value) in fueltype">
	<td>{{ key }}</td>
	<td>{{ value }}</td>
  </tr>
</table>


<table class="table table-bordered table-striped">
  <thead>
        <th>
	Fuel Source
	</th>
	<th>
	MW
	</th>
  </thead>
  <tr ng-repeat="(key, value) in fuelsource">
	<td>{{ key }}</td>
	<td>{{ value }}</td>
  </tr>
</table>

<table class="table table-bordered table-striped">
  <thead>
        <th>
	Generator Tech
	</th>
	<th>
	MW
	</th>
  </thead>
  <tr ng-repeat="(key, value) in tech">
	<td>{{ key }}</td>
	<td>{{ value }}</td>
  </tr>
</table>
-->
</div>
<script>

var app = angular.module('nemweb', ["highcharts-ng"]);
var controller = app.controller('generators', function($scope, $http, $timeout) {

 $http.get("/stations-data").success(function (response) {$scope.results = response.results;
 $scope.getData();
});
    

    $scope.getData = function(){
        $http.get("/scada").success(function (response) { 
		jQuery.extend(true, $scope.results, response.results)
		var totalmw = 0;
		var totalco2 = 0;
		var fuelsource = {};
		var fueltype = {};
		var tech = {};
		var fuelsourceco2 = {};
		var fueltypeco2 = {};
		var techco2 = {};
		for (x in $scope.results) {
			if(typeof $scope.results[x].CO2E != 'undefined'){ 
				totalco2 = totalco2 + $scope.results[x].CO2E
				if ($scope.results[x].FuelSource){
					if (!fuelsourceco2[$scope.results[x].FuelSource]) fuelsourceco2[$scope.results[x].FuelSource] = 0
					fuelsourceco2[$scope.results[x].FuelSource] += $scope.results[x].CO2E
				}
				if ($scope.results[x].FuelSourceDescriptior){
					if (!fueltypeco2[$scope.results[x].FuelSourceDescriptior]) fueltypeco2[$scope.results[x].FuelSourceDescriptior] = 0
					fueltypeco2[$scope.results[x].FuelSourceDescriptior] += $scope.results[x].CO2E
				}
{'fraction_non_alphanumeric': 0.21082846679204198, 'fraction_numerical': 0.011481738097594774, 'mean_word_length': 3.5370453524921417, 'pattern_counts': {'":': 0, '<': 349, '<?xml version=': 0, '>': 349, 'https://': 8, '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': '613113', 'n_tokens_mistral': 3952, 'n_tokens_neox': 3690, 'n_words': 729}