mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 14:45:35 +00:00
Further improvement to size ratio
This commit is contained in:
@@ -1,8 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
angular.module('app').directive('powerBands', ['$window', '$translate', '$rootScope', function($window, $translate, $rootScope) {
|
||||
=======
|
||||
angular.module('app').directive('powerBands', ['$window', '$rootScope', function($window, $rootScope) {
|
||||
>>>>>>> Another improvement to font-size adjustments
|
||||
return {
|
||||
restrict: 'A',
|
||||
scope: {
|
||||
@@ -44,6 +40,7 @@ angular.module('app').directive('powerBands', ['$window', '$rootScope', function
|
||||
// Create Y Axis SVG Elements
|
||||
vis.append('g').attr('class', 'watt axis');
|
||||
vis.append('g').attr('class', 'pct axis');
|
||||
|
||||
var retLbl = vis.append('text').attr('x', -35).attr('y', 16).attr('class', 'primary upp');
|
||||
var depLbl = vis.append('text').attr('x', -35).attr('y', barHeight + 18).attr('class', 'primary upp');
|
||||
var retVal = vis.append('text').attr('y', 16);
|
||||
@@ -81,7 +78,7 @@ angular.module('app').directive('powerBands', ['$window', '$rootScope', function
|
||||
}
|
||||
|
||||
function render() {
|
||||
var size = $rootScope.sizeRatio;
|
||||
var size = $rootScope.sizeRatio,
|
||||
mTop = Math.round(25 * size),
|
||||
mRight = Math.round(130 * size),
|
||||
mBottom = Math.round(25 * size),
|
||||
@@ -110,7 +107,6 @@ angular.module('app').directive('powerBands', ['$window', '$rootScope', function
|
||||
vis.selectAll('.watt.axis').call(wattAxis);
|
||||
vis.selectAll('.pct.axis').attr('transform', 'translate(0,' + innerHeight + ')').call(pctAxis);
|
||||
|
||||
<<<<<<< HEAD
|
||||
for (var b = 0, l = bands.length; b < l; b++) {
|
||||
if (bands[b].retSelected) {
|
||||
retractedSum += bands[b].retracted + bands[b].retOnly;
|
||||
@@ -173,16 +169,16 @@ angular.module('app').directive('powerBands', ['$window', '$rootScope', function
|
||||
|
||||
}
|
||||
|
||||
function updateLabel(lbl, width, y, selected, sum, available) {
|
||||
function updateLabel(lbl, width, y, selected, sum, avail) {
|
||||
lbl
|
||||
.attr('x', width + 5 )
|
||||
.attr('y', y)
|
||||
.attr('class', getClass(selected, sum, available))
|
||||
.text(wattFmt(Math.max(0, sum)) + ' (' + pctFmt(Math.max(0, sum / available)) + ')');
|
||||
.attr('class', getClass(selected, sum, avail))
|
||||
.text(wattFmt(Math.max(0, sum)) + ' (' + pctFmt(Math.max(0, sum / avail)) + ')');
|
||||
}
|
||||
|
||||
function getClass(selected, sum, available) {
|
||||
return selected ? 'secondary' : (sum > available) ? 'warning' : 'primary';
|
||||
function getClass(selected, sum, avail) {
|
||||
return selected ? 'secondary' : (sum > avail) ? 'warning' : 'primary';
|
||||
}
|
||||
|
||||
function bandText(val, index) {
|
||||
|
||||
Reference in New Issue
Block a user