Skip to content

Commit

Permalink
Merge branch 'tooltips'
Browse files Browse the repository at this point in the history
  • Loading branch information
c-martinez committed May 6, 2016
2 parents 83bc2ca + 8de67c3 commit 75a3271
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 4 deletions.
3 changes: 2 additions & 1 deletion webapp/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"angular-animate": "~1.4.8",
"angular-busy": "~4.1.3",
"nvd3": "https://github.com/c-martinez/nvd3.git#myrelease",
"ng-csv": "^0.3.6"
"ng-csv": "^0.3.6",
"angular-marked": "^1.2.0"
},
"devDependencies": {
"angular-mocks": "~1.4.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@

// We use the parameters variable from ParameterService directly.
vm.parameters = TrackerParametersService.getParameters();

//
vm.tooltips = TrackerParametersService.tooltips;
}
})();
13 changes: 12 additions & 1 deletion webapp/src/app/components/shico/trackerParameters.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.module('shico')
.service('TrackerParametersService', TrackerParametersService);

function TrackerParametersService() {
function TrackerParametersService($http, marked) {
var vm = this;

vm.parameters = {
Expand Down Expand Up @@ -37,9 +37,13 @@
}
};

vm.tooltips = {};
loadToolTip('/help/algorithm.md', 'algorithm');

var service = {
getParameters: getParameters,
setParameters: setParameters,
tooltips: vm.tooltips,
availableYears: vm.availableYears
};
return service;
Expand Down Expand Up @@ -68,5 +72,12 @@
vm.parameters.startKey = yearValues[idxYearFrom];
vm.parameters.endKey = yearValues[idxYearTo];
}

function loadToolTip(url, ttKey) {
$http({method: 'GET',url: url})
.success(function(content){
vm.tooltips[ttKey] = marked(content);
});
}
}
})();
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
</div>

<div class="form-group form-inline col-md-4">
<label for="algorithm">Algorithm: </label>
<label uib-popover-html="vm.tooltips['algorithm']"
popover-trigger="click" popover-placement="bottom" for="algorithm">Algorithm: </label>
<select ng-model="vm.parameters.algorithm" name="algorithm">
<option data-ng-repeat="algo in vm.algorithms" value="{{ algo }}">{{ algo }}</option>
</select>
Expand Down
3 changes: 2 additions & 1 deletion webapp/src/app/index.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'rzModule',
'cgBusy',
'ngSanitize',
'ngCsv'
'ngCsv',
'hc.marked'
]);
})();
6 changes: 6 additions & 0 deletions webapp/src/help/algorithm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### Algorithm

The vocabulary monitor contains can use two different algorithms for generating vocabularies. These control which words are used as seed terms for each model:

- The non-adaptive vocabulary generator uses the same seed terms each time to generate the related terms.
- The adaptive vocabulary generator uses the related terms generated by one semantic model as seed terms for the next semantic model. This adds an additional possibility: it allows for the semantic models to be used in chronological order, or in reverse chronological order -- searching forwards or backwards in time.

0 comments on commit 75a3271

Please sign in to comment.