static/js/control.js
/**
 * Update information of selected contigs.
 * @function updateSelectionInfo
 * @param {Object} mo - master object
 */
Update information of selected contigs.
@function updateSelectionInfo
@param {Object} mo - master object
Update information of selected contigs . @function updateSelectionInfo @param { Object } mo - master object
function updateSelectionInfo(mo) {
  var table = document.getElementById('info-table');
  var indices = Object.keys(mo.pick);
  if (indices.length === 0) { 
    table.classList.add('hidden');
  } else {
    var rows = table.rows;
    if (indices.length === 1) {
      var selData = mo.data.df[indices[0]];
      for (var i = 0; i < rows.length; i++) {
        var val = selData[rows[i].getAttribute('data-index')];
        var type = rows[i].getAttribute('data-type');
        rows[i].cells[1].innerHTML = value2Str(val, type);
      }
    }
    else {
      var selData =
        transpose(indices.sort().map(function (i) { return mo.data.df[i]; }));
      for (var i = 0; i < rows.length; i++) {
        var arr = selData[rows[i].getAttribute('data-index')];
        var refcol = rows[i].getAttribute('data-refcol');
        var refarr = refcol ? selData[mo.data.cols.indexOf(refcol)] : null;
        updateInfoRow(rows[i], mo, arr, refarr);
      }
    }
    table.classList.remove('hidden');
  }
}
function updateSelectionInfo ( mo ) { var table = document . getElementById ( 'info-table' ) ; var indices = Object . keys ( mo . pick ) ; if ( indices . length === 0 ) { table . classList . add ( 'hidden' ) ; } else { var rows = table . rows ; if ( indices . length === 1 ) { var selData = mo . data . df [ indices [ 0 ] ] ; for ( var i = 0 ; i < rows . length ; i ++ ) { var val = selData [ rows [ i ] . getAttribute ( 'data-index' ) ] ; var type = rows [ i ] . getAttribute ( 'data-type' ) ; rows [ i ] . cells [ 1 ] . innerHTML = value2Str ( val , type ) ; } } else { var selData = transpose ( indices . sort ( ) . map ( function ( i ) { return mo . data . df [ i ] ; } ) ) ; for ( var i = 0 ; i < rows . length ; i ++ ) { var arr = selData [ rows [ i ] . getAttribute ( 'data-index' ) ] ; var refcol = rows [ i ] . getAttribute ( 'data-refcol' ) ; var refarr = refcol ? selData [ mo . data . cols . indexOf ( refcol ) ] : null ; updateInfoRow ( rows [ i ] , mo , arr , refarr ) ; } } table . classList . remove ( 'hidden' ) ; } }
Update information of selected contigs.
Update information of selected contigs .
// no contig is selected // single contig // multiple contigs