static/js/control.js
/**
 * Update information of selected contigs.
 * @function updateInfoRow
 * @param {Object} row - information table row DOM
 * @param {Object} mo - master object
 * @param {Array} [arr] - data column
 * @param {Array} [refarr] - reference column
 */
Update information of selected contigs.
Update information of selected contigs .
function updateInfoRow(row, mo, arr, refarr) {
  if (arr === undefined) {
    var data_ = Object.keys(mo.pick).sort()
      .map(function (i) { return mo.data.df[i]; });
    var idx = row.getAttribute('data-index');
    arr = data_.map(function (x) { return x[idx]; });
    var refcol = row.getAttribute('data-refcol');
    if (refcol) {
      idx = mo.data.cols.indexOf(refcol);
      refarr = data_.map(function (x) { return x[idx]; });
    } else refarr = null;
  }
  arr = arr || Object.keys(mo.pick).sort()
    .map(function (i) { return mo.data.df[i]; })
    .map(function (x) { return x[row.getAttribute('data-index')]; });
  var type = row.getAttribute('data-type');
  if (type !== 'number') {
    row.cells[1].innerHTML = row.cells[1].title = columnInfo(arr, type);
  } else {
    var met = row.getAttribute('data-metric');
    var deci = mo.view.decimals[row.getAttribute('data-col')];
    var refcol = row.getAttribute('data-refcol');
    row.cells[1].innerHTML = columnInfo(arr, type, met, deci, refarr);
  }
}
function updateInfoRow ( row , mo , arr , refarr ) { if ( arr === undefined ) { var data_ = Object . keys ( mo . pick ) . sort ( ) . map ( function ( i ) { return mo . data . df [ i ] ; } ) ; var idx = row . getAttribute ( 'data-index' ) ; arr = data_ . map ( function ( x ) { return x [ idx ] ; } ) ; var refcol = row . getAttribute ( 'data-refcol' ) ; if ( refcol ) { idx = mo . data . cols . indexOf ( refcol ) ; refarr = data_ . map ( function ( x ) { return x [ idx ] ; } ) ; } else refarr = null ; } arr = arr || Object . keys ( mo . pick ) . sort ( ) . map ( function ( i ) { return mo . data . df [ i ] ; } ) . map ( function ( x ) { return x [ row . getAttribute ( 'data-index' ) ] ; } ) ; var type = row . getAttribute ( 'data-type' ) ; if ( type !== 'number' ) { row . cells [ 1 ] . innerHTML = row . cells [ 1 ] . title = columnInfo ( arr , type ) ; } else { var met = row . getAttribute ( 'data-metric' ) ; var deci = mo . view . decimals [ row . getAttribute ( 'data-col' ) ] ; var refcol = row . getAttribute ( 'data-refcol' ) ; row . cells [ 1 ] . innerHTML = columnInfo ( arr , type , met , deci , refarr ) ; } }
Update information of selected contigs.
Update information of selected contigs .