www/js/visuility.js
// Find source [of type] where target = id
Find source [of type] where target = id
Find source [ of type ] where target = id
function findChild(id, type) {
   var i = 0;
   while(i<links.length) {
    if (links[i].targetId === id) {
      if (type) {
        if (links[i].source.type === type) {
          return links[i].sourceId;
        }
      } else {
        return links[i].sourceId;
      }
    }
    i++;
  } 
}
function findChild ( id , type ) { var i = 0 ; while ( i < links . length ) { if ( links [ i ] . targetId === id ) { if ( type ) { if ( links [ i ] . source . type === type ) { return links [ i ] . sourceId ; } } else { return links [ i ] . sourceId ; } } i ++ ; } }
Find source [of type] where target = id
Find source [ of type ] where target = id