Commit 60d4cbf7 authored by delanoe's avatar delanoe

[FIX] User experience

	modifié :         gargantext.angular.js
        Column is the default since counts are discrets

	modifié :         ../../templates/chart.html
        By default: adding Doc count normalized option + stripes is a detail
parent 6923f2fb
...@@ -386,7 +386,7 @@ gargantext.controller("GraphController", function($scope, $http, $element) { ...@@ -386,7 +386,7 @@ gargantext.controller("GraphController", function($scope, $http, $element) {
$scope.seriesOptions = { $scope.seriesOptions = {
thicknessNumber: 3, thicknessNumber: 3,
thickness: '3px', thickness: '3px',
type: 'area', type: 'column',
striped: false striped: false
}; };
$scope.graph = { $scope.graph = {
...@@ -471,13 +471,11 @@ gargantext.controller("GraphController", function($scope, $http, $element) { ...@@ -471,13 +471,11 @@ gargantext.controller("GraphController", function($scope, $http, $element) {
// calculate average for earch dataset // calculate average for earch dataset
var sums = []; var sums = [];
for (var i=0; i<$scope.datasets.length;i++){ for (var i=0; i<$scope.datasets.length;i++){
sums.push(0); sums.push(0);
} }
var count = 0 ; var count = 0 ;
for (var x in dataObject) { for (var x in dataObject) {
count ++ ; count ++ ;
...@@ -486,12 +484,11 @@ gargantext.controller("GraphController", function($scope, $http, $element) { ...@@ -486,12 +484,11 @@ gargantext.controller("GraphController", function($scope, $http, $element) {
sums[i] += yList[i]; sums[i] += yList[i];
} }
} }
for (var i=0; i<$scope.datasets.length;i++){ for (var i=0; i<$scope.datasets.length;i++){
sums[i] /= count; sums[i] /= count;
} }
// Convert this object back to a sorted array // Convert this object back to a sorted array
var yMin, yMax; var yMin, yMax;
var linearData = []; var linearData = [];
...@@ -500,7 +497,7 @@ gargantext.controller("GraphController", function($scope, $http, $element) { ...@@ -500,7 +497,7 @@ gargantext.controller("GraphController", function($scope, $http, $element) {
var yList = dataObject[x]; var yList = dataObject[x];
for (var i=0; i<yList.length; i++) { for (var i=0; i<yList.length; i++) {
y = yList[i]; y = yList[i];
row['y' + i] = y - sums[i]; row['y' + i] = y - sums[i]; // position vs average
if (yMax == undefined || y > yMax) { if (yMax == undefined || y > yMax) {
yMax = y; yMax = y;
} }
......
...@@ -229,7 +229,7 @@ ...@@ -229,7 +229,7 @@
<hr/> <hr/>
<div class="corpus"> <div class="corpus">
<button ng-click="removeDataset($index)" title="remove this dataset">X</button> <button ng-click="removeDataset($index)" title="remove this dataset">X</button>
<select ng-model="mesured" style="background-color:{{ getColor($index, datasets.length) }}" ng-options="value as key for (key, value) in {'Documents count': 'nodes.count', 'Ngrams count': 'ngrams.count'}" ng-change="updateQuery()"></select> <select ng-model="mesured" style="background-color:{{ getColor($index, datasets.length) }}" ng-options="value as key for (key, value) in {'Documents count': 'nodes.count', 'Documents count (normalized)': 'nodes.countnorm', 'Ngrams count': 'ngrams.count'}" ng-change="updateQuery()"></select>
in the project in the project
<select ng-model="projectId" ng-change="updateCorpora()" ng-options="project.id as project.name for project in projects"></select>, <select ng-model="projectId" ng-change="updateCorpora()" ng-options="project.id as project.name for project in projects"></select>,
corpus corpus
...@@ -279,13 +279,17 @@ ...@@ -279,13 +279,17 @@
<hr/> <hr/>
Represent data with Represent data with
<select ng-model="seriesOptions.type" ng-options="type for type in ['line', 'area', 'column']" ng-change="query()"></select> <select ng-model="seriesOptions.type" ng-options="type for type in ['column', 'area', 'line']" ng-change="query()"></select>
<span ng-show="seriesOptions.type == 'area'">
(<select ng-model="seriesOptions.striped" ng-options="value as key for (key, value) in {'with':true, 'without':false}" ng-change="query()"></select> stripes)
</span>
<span ng-show="seriesOptions.type == 'area' || seriesOptions.type == 'column'"> <span ng-show="seriesOptions.type == 'area' || seriesOptions.type == 'column'">
(<select ng-model="options.stacking" ng-options="value as key for (key, value) in {'with':true, 'without':false}" ng-change="query()"></select> stacking) (<select ng-model="options.stacking" ng-options="value as key for (key, value) in {'with':true, 'without':false}" ng-change="query()"></select> stacking)
</span> </span>
<span ng-show="seriesOptions.type == 'area'">
(<select ng-model="seriesOptions.striped" ng-options="value as key for (key, value) in {'with':true, 'without':false}" ng-change="query()"></select> stripes)
</span>
<br/> <br/>
<span ng-hide="seriesOptions.type == 'column'"> <span ng-hide="seriesOptions.type == 'column'">
......
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