redmon 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -61,11 +61,17 @@ var Redmon = (function() {
61
61
  }
62
62
 
63
63
  function formatMetric(num) {
64
- return d3.format('s')(num);
64
+ var prefix = d3.formatPrefix(num),
65
+ scaled = prefix.scale(num);
66
+
67
+ if (scaled % 1 !== 0)
68
+ scaled = d3.format('.2f')(scaled);
69
+
70
+ return scaled+prefix.symbol;
65
71
  }
66
72
 
67
73
  function formatTime(time) {
68
- return d3.time.format('%H:%S')(new Date(time));
74
+ return d3.time.format('%H:%M:%S')(new Date(time));
69
75
  }
70
76
 
71
77
  /**
@@ -157,7 +163,7 @@ var Redmon = (function() {
157
163
  chart = nv.models.lineChart()
158
164
  .x(function(d) { return d.x })
159
165
  .y(function(d) { return d.y })
160
- .margin({top : 10, right : 20, bottom : 20, left : 60})
166
+ .margin({top : 10, right : 25, bottom : 20, left : 60})
161
167
  .showLegend(false);
162
168
 
163
169
  chart.xAxis
@@ -237,7 +243,7 @@ var Redmon = (function() {
237
243
  chart = nv.models.lineChart()
238
244
  .x(function(d) { return d.x })
239
245
  .y(function(d) { return d.y })
240
- .margin({top : 10, right : 20, bottom : 20, left : 60});
246
+ .margin({top : 10, right : 25, bottom : 20, left : 60});
241
247
 
242
248
  chart.xAxis
243
249
  .tickFormat(formatTime);
@@ -350,10 +356,6 @@ var Redmon = (function() {
350
356
  });
351
357
  }
352
358
 
353
- function formatNumber(num) {
354
- return (num + "").replace(/(\d)(?=(\d{3})+(\.\d+|)\b)/g, "$1,");
355
- }
356
-
357
359
  events.bind('data', onData);
358
360
  })();
359
361
 
@@ -1,3 +1,3 @@
1
1
  module Redmon
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-03 00:00:00.000000000 Z
12
+ date: 2013-04-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bson_ext
@@ -307,7 +307,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
307
307
  version: '0'
308
308
  segments:
309
309
  - 0
310
- hash: -912310078698028843
310
+ hash: -3799248200980618654
311
311
  required_rubygems_version: !ruby/object:Gem::Requirement
312
312
  none: false
313
313
  requirements:
@@ -316,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
316
316
  version: '0'
317
317
  segments:
318
318
  - 0
319
- hash: -912310078698028843
319
+ hash: -3799248200980618654
320
320
  requirements: []
321
321
  rubyforge_project: redmon
322
322
  rubygems_version: 1.8.23