Commit aee4893c authored by Mathieu Rodic's avatar Mathieu Rodic

[FEATURE] Graph now refreshes automatically

[BUGFIX] Corrected aggregation by decade & century
parent 8a314114
...@@ -47,11 +47,11 @@ var groupings = { ...@@ -47,11 +47,11 @@ var groupings = {
datetime: { datetime: {
century: { century: {
truncate: function(x) {return x.substr(0, 2) + '00-01-01T00:00:00Z';}, truncate: function(x) {return x.substr(0, 2) + '00-01-01T00:00:00Z';},
next: function(x) {addZeros((parseInt(x.substr(0, 2) + 1) % 100), 2) + x.substr(2);}, next: function(x) {x = new Date(x); x.setFullYear(x.getFullYear()+100); return strDate(x);},
}, },
decade: { decade: {
truncate: function(x) {return x.substr(0, 3) + '0-01-01T00:00:00Z';}, truncate: function(x) {return x.substr(0, 3) + '0-01-01T00:00:00Z';},
next: function(x) {addZeros((parseInt(x.substr(0, 3) + 1) % 1000), 2) + x.substr(3);}, next: function(x) {x = new Date(x); x.setFullYear(x.getFullYear()+10); return strDate(x);},
}, },
year: { year: {
truncate: function(x) {return x.substr(0, 4) + '-01-01T00:00:00Z';}, truncate: function(x) {return x.substr(0, 4) + '-01-01T00:00:00Z';},
...@@ -408,7 +408,7 @@ gargantext.controller("GraphController", function($scope, $http, $element) { ...@@ -408,7 +408,7 @@ gargantext.controller("GraphController", function($scope, $http, $element) {
filters: data.filters, filters: data.filters,
mesured: data.mesured mesured: data.mesured
}; };
// $scope.query(); $scope.query();
}); });
}); });
......
...@@ -266,7 +266,7 @@ ...@@ -266,7 +266,7 @@
</div> </div>
<div class="graph-parameters"> <div class="graph-parameters">
X-axis: groups the results by X-axis: groups the results by
<select ng-model="groupingKey" ng-options="key for key in ['day', 'month', 'year', 'decade', 'century']"> <select ng-model="groupingKey" ng-options="key for key in ['day', 'month', 'year', 'decade', 'century']" ng-change="showResults()">
</select> </select>
<br/> <br/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment