Commit 04cf4a95 authored by Mathieu Rodic's avatar Mathieu Rodic

[INTERFACE] minor changes on advanced charts

 - renamed "ngram" to "expression"
 - better interface for metadata
 - documents count is chosen over ngrams count by default
parent fdb50a23
...@@ -177,17 +177,17 @@ angular.module('Gargantext').run(function($rootScope, $http, $cookies){ ...@@ -177,17 +177,17 @@ angular.module('Gargantext').run(function($rootScope, $http, $cookies){
// Controller for datasets // Controller for datasets
gargantext.controller('DatasetController', function($scope, $http) { gargantext.controller('DatasetController', function($scope, $http) {
// are we loading data from the server right now? // are we loading data from the server right now?
$scope.is_loading = false; $scope.is_loading = false;
// initital parameters for the y-axis of the query // initital parameters for the y-axis of the query
$scope.query_y = { $scope.query_y = {
'value': 'ngrams_count', 'value': 'documents_count',
'is_relative': false, 'is_relative': false,
'divided_by': 'total_ngrams_count', 'divided_by': 'total_ngrams_count',
}; };
// filters: corpora retrieval // filters: corpora retrieval
$scope.corpora = []; $scope.corpora = [];
if (/^\/project\/\d+\/corpus\/\d+/.test(location.pathname)) { if (/^\/project\/\d+\/corpus\/\d+/.test(location.pathname)) {
...@@ -209,7 +209,7 @@ gargantext.controller('DatasetController', function($scope, $http) { ...@@ -209,7 +209,7 @@ gargantext.controller('DatasetController', function($scope, $http) {
} }
}); });
}; };
var getSelectedCorporaIdList = function() { var getSelectedCorporaIdList = function() {
var corpus_id_list = []; var corpus_id_list = [];
$.each($scope.corpora, function(c, corpus) { $.each($scope.corpora, function(c, corpus) {
if (corpus.is_selected) { if (corpus.is_selected) {
...@@ -316,7 +316,7 @@ gargantext.controller('DatasetController', function($scope, $http) { ...@@ -316,7 +316,7 @@ gargantext.controller('DatasetController', function($scope, $http) {
// Controller for graphs // Controller for graphs
gargantext.controller('GraphController', function($scope, $http, $element) { gargantext.controller('GraphController', function($scope, $http, $element) {
// initial values // initial values
$scope.query_x = { $scope.query_x = {
......
...@@ -71,10 +71,10 @@ ...@@ -71,10 +71,10 @@
<button ng-click="removeDataset($index)">Remove dataset</button> <button ng-click="removeDataset($index)">Remove dataset</button>
<!-- description of Y values --> <!-- description of Y values -->
Evolution of the Evolution of the
<select ng-model="query_y.value" ng-options="value as key for (key, value) in {'ngrams count': 'ngrams_count', 'documents count': 'documents_count'}" ng-change="updateDataset()"></select> <select ng-model="query_y.value" ng-options="value as key for (key, value) in {'documents count': 'documents_count', 'expressions count': 'ngrams_count'}" ng-change="updateDataset()"></select>
<select ng-model="query_y.is_relative" ng-options="value as key for (key, value) in {'in absolute terms': false, 'relative to the': true}" ng-change="updateDataset()"></select> <select ng-model="query_y.is_relative" ng-options="value as key for (key, value) in {'in absolute terms': false, 'relative to the': true}" ng-change="updateDataset()"></select>
<span ng-if="query_y.is_relative"> <span ng-if="query_y.is_relative">
<select ng-model="query_y.divided_by" ng-options="value as key for (key, value) in {'total ngrams count': 'total_ngrams_count', 'total documents count': 'total_documents_count'}" ng-change="updateDataset()"></select> <select ng-model="query_y.divided_by" ng-options="value as key for (key, value) in {'total expressions count': 'total_ngrams_count', 'total documents count': 'total_documents_count'}" ng-change="updateDataset()"></select>
</span> </span>
</div> </div>
<!-- filters --> <!-- filters -->
...@@ -95,8 +95,8 @@ ...@@ -95,8 +95,8 @@
</li> </li>
<!-- filter ngrams --> <!-- filter ngrams -->
<li class="ngrams"> <li class="ngrams">
...only consider documents containing the following ngrams: ...only consider documents containing the following expressions:
<tags-input ng-model="query_y.ngrams" display-property="terms" placeholder="Add an ngram" on-tag-added="updateDataset()" on-tag-removed="updateDataset()" add-from-autocomplete-only="true"> <tags-input ng-model="query_y.ngrams" display-property="terms" placeholder="Add an expression" on-tag-added="updateDataset()" on-tag-removed="updateDataset()" add-from-autocomplete-only="true">
<auto-complete source="getNgrams($query)"></auto-complete> <auto-complete source="getNgrams($query)"></auto-complete>
</tags-input ng-model="tags"> </tags-input ng-model="tags">
</li> </li>
...@@ -104,18 +104,12 @@ ...@@ -104,18 +104,12 @@
<li> <li>
<ul> <ul>
<li ng-repeat="hyperdata in hyperdataList"> <li ng-repeat="hyperdata in hyperdataList">
...where ...where the value of
<span ng-if="!hyperdata.operator &amp;&amp; (!hyperdata.values || !hyperdata.value)">"{{ hyperdata.key }}"</span> <span ng-if="!hyperdata.operator">"{{ hyperdata.key }}"</span>
<strong ng-if="hyperdata.operator || (hyperdata.values &amp;&amp; hyperdata.value)">{{ hyperdata.key }}</strong> <strong ng-if="hyperdata.operator">{{ hyperdata.key }}</strong>
<span ng-if="hyperdata.values"> <select ng-model="hyperdata.operator" ng-options="operator.key as operator.label for operator in operators[hyperdata.type]"></select>
is <input type="text" ng-if="hyperdata.operator" ng-model="hyperdata.value" ng-change="updateDataset()" placeholder="type a value here..." />
<select ng-model="hyperdata.value" ng-options="value for value in hyperdata.values" ng-change="updateDataset()"></select>
</span>
<span ng-if="!hyperdata.values">
<select ng-model="hyperdata.operator" ng-options="operator.key as operator.label for operator in operators[hyperdata.type]"></select>
<input type="text" ng-if="hyperdata.operator" ng-model="hyperdata.value" ng-change="updateDataset()" placeholder="type a value here..." />
</span>
</li> </li>
</ul> </ul>
</li> </li>
......
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