Skip to content

Commit

Permalink
Updated UI for coverage selection
Browse files Browse the repository at this point in the history
  • Loading branch information
viklund committed Jun 25, 2018
1 parent 93f8a00 commit c7cc4c9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
7 changes: 7 additions & 0 deletions frontend/src/js/controller.browserController.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
localThis.activeSuggestion = -1;
localThis.orderByField = "variantId";
localThis.reverseSort = false;

localThis.coverage = {};
localThis.coverage.region = {"start":null,
"stop":null,
Expand All @@ -16,10 +17,13 @@
};
localThis.coverage.zoom = "overview";
localThis.coverage.function = "mean";
localThis.coverage.coverageMetric = "mean";
localThis.coverage.overValue = 50;
localThis.coverage.includeUTR = true;
localThis.coverage.data = [];
localThis.coverage.update = 0;
localThis.variants = [];
localThis.updatedOverValue = updatedOverValue;

localThis.item = null;
localThis.itemType = null;
Expand Down Expand Up @@ -185,5 +189,8 @@
localThis.orderByField = field;
}

function updatedOverValue() {
localThis.coverage.coverageMetric = "over";
}
}]);
})();
8 changes: 8 additions & 0 deletions frontend/src/js/directive.coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@
});

scope.$watch("ctrl.coverage", function(newValue) {
// Update the coverage function
if ( newValue.coverageMetric == "over" ) {
newValue.function = newValue.overValue;
}
else {
newValue.function = newValue.coverageMetric;
}

// set zoom level
var width = element[0].parentElement.clientWidth;
if (newValue.zoom == "detail") {
Expand Down
10 changes: 6 additions & 4 deletions frontend/templates/ng-templates/browser-coverage-plot.jj2
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,19 @@
<label>Coverage metrics:</label>
<span>
<label>
<input type="radio" ng-model="ctrl.coverage.function" value="mean">
<input type="radio" ng-model="ctrl.coverage.coverageMetric" value="mean">
Mean
</label>
<label>
<input type="radio" ng-model="ctrl.coverage.function" value="median">
<input type="radio" ng-model="ctrl.coverage.coverageMetric" value="median">
Median
</label>
<label>
<input type="radio" ng-model="ctrl.coverage.coverageMetric" value="over">
Individuals over
<select ng-model="ctrl.coverage.function" ng-selected="ctrl.coverage.function"
ng-options="cov for cov in [1,5,10,15,20,25,30,50,100]">
<select ng-model="ctrl.coverage.overValue" ng-selected="ctrl.coverage.overValue"
ng-options="cov for cov in [1,5,10,15,20,25,30,50,100]"
ng-change="ctrl.updatedOverValue()">
{{ cov }}
</select> X coverage
</label>
Expand Down

0 comments on commit c7cc4c9

Please sign in to comment.