~smagoun/whoopsie/whoopsie-lp1017637

« back to all changes in this revision

Viewing changes to backend/stats/static/js/d3/src/core/extent.js

  • Committer: Evan Dandrea
  • Date: 2012-05-09 05:53:45 UTC
  • Revision ID: evan.dandrea@canonical.com-20120509055345-z2j41tmcbf4as5uf
The backend now lives in lp:daisy and the website (errors.ubuntu.com) now lives in lp:errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
d3.extent = function(array, f) {
2
 
  var i = -1,
3
 
      n = array.length,
4
 
      a,
5
 
      b,
6
 
      c;
7
 
  if (arguments.length === 1) {
8
 
    while (++i < n && ((a = c = array[i]) == null || a != a)) a = c = undefined;
9
 
    while (++i < n) if ((b = array[i]) != null) {
10
 
      if (a > b) a = b;
11
 
      if (c < b) c = b;
12
 
    }
13
 
  } else {
14
 
    while (++i < n && ((a = c = f.call(array, array[i], i)) == null || a != a)) a = undefined;
15
 
    while (++i < n) if ((b = f.call(array, array[i], i)) != null) {
16
 
      if (a > b) a = b;
17
 
      if (c < b) c = b;
18
 
    }
19
 
  }
20
 
  return [a, c];
21
 
};