Skip to content

Commit

Permalink
rebasing on master and fixing linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed Jan 13, 2017
1 parent ebe5a6a commit f1c014d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ngMock from 'ng_mock';
describe('Tick Generator', function () {

let generateTicks;
let axes = [
const axes = [
{
min: 0,
max: 5000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = function generateTicksProvider() {

function floorInBase(n, base) {
return base * Math.floor(n / base);
};
}

function generateTicks(axis) {
const returnTicks = [];
Expand Down Expand Up @@ -35,7 +35,7 @@ module.exports = function generateTicksProvider() {
} while (tickVal < axis.max);

return returnTicks;
};
}

return function (axis) {
return generateTicks(axis);
Expand Down
22 changes: 11 additions & 11 deletions src/core_plugins/timelion/public/services/tick_formatters.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
define(function (require) {

return function ticketFormatters() {
var formatters = {
const formatters = {
'bits': function (val, axis) {
var labels = ['b','kb','mb','gb','tb','pb'];
var index = 0;
const labels = ['b','kb','mb','gb','tb','pb'];
let index = 0;
while (val >= 1000 && index < labels.length) {
val /= 1000;
index++;
}
return (Math.round(val * 100) / 100) + labels[index];
},
'bits/s': function (val, axis) {
var labels = ['b/s','kb/s','mb/s','gb/s','tb/s','pb/s'];
var index = 0;
const labels = ['b/s','kb/s','mb/s','gb/s','tb/s','pb/s'];
let index = 0;
while (val >= 1000 && index < labels.length) {
val /= 1000;
index++;
}
return (Math.round(val * 100) / 100) + labels[index];
},
'bytes': function (val, axis) {
var labels = ['B','KB','MB','GB','TB','PB'];
var index = 0;
const labels = ['B','KB','MB','GB','TB','PB'];
let index = 0;
while (val >= 1024 && index < labels.length) {
val /= 1024;
index++;
}
return (Math.round(val * 100) / 100) + labels[index];
},
'bytes/s': function (val, axis) {
var labels = ['B/s','KB/s','MB/s','GB/s','TB/s','PB/s'];
var index = 0;
const labels = ['B/s','KB/s','MB/s','GB/s','TB/s','PB/s'];
let index = 0;
while (val >= 1024 && index < labels.length) {
val /= 1024;
index++;
Expand All @@ -42,8 +42,8 @@ define(function (require) {
return val.toLocaleString('en', { style: 'currency', currency: axis.options.units.prefix || 'USD' });
},
'custom': function (val, axis) {
var prefix = axis.options.units.prefix;
var suffix = axis.options.units.suffix;
const prefix = axis.options.units.prefix;
const suffix = axis.options.units.suffix;
return prefix + val + suffix;
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/core_plugins/timelion/server/series_functions/yaxis.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports = new Chainable('yaxis', {
myAxis.axisLabelUseCanvas = true;

if (units) {
var unitTokens = units.split(':');
const unitTokens = units.split(':');
if (!tickFormatters[unitTokens[0]]) {
throw new Error (`${units} is not a supported unit type.`);
}
Expand Down

0 comments on commit f1c014d

Please sign in to comment.