web/lib/browse-facet.js
function augment(el) {
  // FIXME should always have a type
  el.type = el.type || 'category';
  el.icon = (typesIcons[el.type] || typesIcons.default).icon;
  el.data = { value: el.text, type: el.type };
  // branch
  if (el.children && el.children.length > 0) {
    el.state = { opened: el.children.length > 50 ? false : true };
    el.children.forEach(function(c) {
      c = augment(c);
    });
    el.text = el.text + ' [' + el.children.length + ']';
  // value or category
  } else if (el.size && el.size > 0) {
    if (curAnnos.indexOf(el.text) > -1) {
      el.state = { selected: true };
    }
    el.text = el.text + ' (' + el.size + ')';
  }
  return el;

}
function augment(el) {
  // FIXME should always have a type
  el.type = el.type || 'category';
  el.icon = (typesIcons[el.type] || typesIcons.default).icon;
  el.data = { value: el.text, type: el.type };
  // branch
  if (el.children && el.children.length > 0) {
    el.state = { opened: el.children.length > 50 ? false : true };
    el.children.forEach(function(c) {
      c = augment(c);
    });
    el.text = el.text + ' [' + el.children.length + ']';
  // value or category
  } else if (el.size && el.size > 0) {
    if (curAnnos.indexOf(el.text) > -1) {
      el.state = { selected: true };
    }
    el.text = el.text + ' (' + el.size + ')';
  }
  return el;

}
function augment ( el ) { // FIXME should always have a type el . type = el . type || 'category' ; el . icon = ( typesIcons [ el . type ] || typesIcons . default ) . icon ; el . data = { value : el . text , type : el . type } ; // branch if ( el . children && el . children . length > 0 ) { el . state = { opened : el . children . length > 50 ? false : true } ; el . children . forEach ( function ( c ) { c = augment ( c ) ; } ) ; el . text = el . text + ' [' + el . children . length + ']' ; // value or category } else if ( el . size && el . size > 0 ) { if ( curAnnos . indexOf ( el . text ) > - 1 ) { el . state = { selected : true } ; } el . text = el . text + ' (' + el . size + ')' ; } return el ; }
add facet counts &c
add facet counts &c