static/js/display.js
/**
 * When user changes display item.
 * @function displayItemChange
 * @param {Object} item - display item
 * @param {Object} i - new field index
 * @param {Object} scale - new scaling factor
 * @param {Object} mo - main object
 */
When user changes display item.
When user changes display item .
function displayItemChange(item, i, scale, mo) {
  mo.view[item].i = parseInt(i);
  mo.view[item].scale = scale;
  if (item === 'x' || item === 'y') {
    resetView(mo);
    return;
  }
  const isCat = (item === 'color' && mo.cols.types[i] === 'cat');
  if (isCat) updateColorMap(mo);
  prepDataForDisplay(mo, [item]);
  renderArena(mo);
  renderSelection(mo);
  updateLegends(mo, [item]);
}
function displayItemChange ( item , i , scale , mo ) { mo . view [ item ] . i = parseInt ( i ) ; mo . view [ item ] . scale = scale ; if ( item === 'x' || item === 'y' ) { resetView ( mo ) ; return ; } const isCat = ( item === 'color' && mo . cols . types [ i ] === 'cat' ) ; if ( isCat ) updateColorMap ( mo ) ; prepDataForDisplay ( mo , [ item ] ) ; renderArena ( mo ) ; renderSelection ( mo ) ; updateLegends ( mo , [ item ] ) ; }
When user changes display item.
When user changes display item .
// if x- or y-coordinates change, reset view // otherwise, keep current viewport