static/js/calculate.js
/**
 * Initialize calculation controls.
 * @function initCalcBoxCtrl
 * @param {Object} mo - main object
 */
Initialize calculation controls.
@function initCalcBoxCtrl
@param {Object} mo - main object
Initialize calculation controls . @function initCalcBoxCtrl @param { Object } mo - main object
function initCalcBoxCtrl(mo) {
  byId('silh-calc-btn').addEventListener('click', function () {
    calcSilhouette(mo);
  });
  for (let item of ['x', 'y', 'size', 'opacity', 'color']) {
    byId(`${item}-calc-chk`).addEventListener('change', function () {
      updateCalcBoxCtrl(mo);
    });
  }
  byId('silh-done-btn').addEventListener('click', function () {
    byId('silh-modal').classList.add('hidden');
    if (byId('silh-save-chk').checked) saveSilhToCol(
      mo, byId('silh-col-text').value);
    if (byId('silh-export-chk').checked) exportSilh(mo);
  });
  byId('silh-help-btn').addEventListener('click', function () {
    window.open('https://github.com/qiyunlab/binarena#' +
      'binning-confidence-evaluation', '_blank');
  });
}
function initCalcBoxCtrl ( mo ) { byId ( 'silh-calc-btn' ) . addEventListener ( 'click' , function ( ) { calcSilhouette ( mo ) ; } ) ; for ( let item of [ 'x' , 'y' , 'size' , 'opacity' , 'color' ] ) { byId ( ` ${ item } ` ) . addEventListener ( 'change' , function ( ) { updateCalcBoxCtrl ( mo ) ; } ) ; } byId ( 'silh-done-btn' ) . addEventListener ( 'click' , function ( ) { byId ( 'silh-modal' ) . classList . add ( 'hidden' ) ; if ( byId ( 'silh-save-chk' ) . checked ) saveSilhToCol ( mo , byId ( 'silh-col-text' ) . value ) ; if ( byId ( 'silh-export-chk' ) . checked ) exportSilh ( mo ) ; } ) ; byId ( 'silh-help-btn' ) . addEventListener ( 'click' , function ( ) { window . open ( 'https://github.com/qiyunlab/binarena#' + 'binning-confidence-evaluation' , '_blank' ) ; } ) ; }
Initialize calculation controls.
Initialize calculation controls .