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) {
$scope.seriesOptions = {
thicknessNumber: 3,
thickness: '3px',
type: 'area',
type: 'column',
striped: false
};
$scope.graph = {
......@@ -471,13 +471,11 @@ gargantext.controller("GraphController", function($scope, $http, $element) {
// calculate average for earch dataset
var sums = [];
for (var i=0; i<$scope.datasets.length;i++){
sums.push(0);
}
var count = 0 ;
for (var x in dataObject) {
count ++ ;
......@@ -486,12 +484,11 @@ gargantext.controller("GraphController", function($scope, $http, $element) {
sums[i] += yList[i];
}
}
for (var i=0; i<$scope.datasets.length;i++){
sums[i] /= count;
}
// Convert this object back to a sorted array
var yMin, yMax;
var linearData = [];
......@@ -500,7 +497,7 @@ gargantext.controller("GraphController", function($scope, $http, $element) {
var yList = dataObject[x];
for (var i=0; i<yList.length; i++) {
y = yList[i];
row['y' + i] = y - sums[i];
row['y' + i] = y - sums[i]; // position vs average
if (yMax == undefined || y > yMax) {
yMax = y;
}
......
......@@ -229,7 +229,7 @@
<hr/>
<div class="corpus">
<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
<select ng-model="projectId" ng-change="updateCorpora()" ng-options="project.id as project.name for project in projects"></select>,
corpus
......@@ -279,13 +279,17 @@
<hr/>
Represent data with
<select ng-model="seriesOptions.type" ng-options="type for type in ['line', 'area', 'column']" 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>
<select ng-model="seriesOptions.type" ng-options="type for type in ['column', 'area', 'line']" ng-change="query()"></select>
<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)
</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/>
<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