~smagoun/whoopsie/whoopsie-lp1017637

« back to all changes in this revision

Viewing changes to backend/stats/static/js/d3/src/core/selection-filter.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_selectionPrototype.filter = function(filter) {
2
 
  var subgroups = [],
3
 
      subgroup,
4
 
      group,
5
 
      node;
6
 
 
7
 
  if (typeof filter !== "function") filter = d3_selection_filter(filter);
8
 
 
9
 
  for (var j = 0, m = this.length; j < m; j++) {
10
 
    subgroups.push(subgroup = []);
11
 
    subgroup.parentNode = (group = this[j]).parentNode;
12
 
    for (var i = 0, n = group.length; i < n; i++) {
13
 
      if ((node = group[i]) && filter.call(node, node.__data__, i)) {
14
 
        subgroup.push(node);
15
 
      }
16
 
    }
17
 
  }
18
 
 
19
 
  return d3_selection(subgroups);
20
 
};
21
 
 
22
 
function d3_selection_filter(selector) {
23
 
  return function() {
24
 
    return d3_selectMatches(this, selector);
25
 
  };
26
 
}