static/js/control.js
/**
 * When user changes display item.
 * @function displayItemChange
 * @param {Object} item - display variable
 * @param {Object} i - field index
 * @param {Object} scale - scaling factor
 * @param {Object} mo - master object
 * @todo throw if max === min
 */
When user changes display item.
When user changes display item .
function displayItemChange(item, i, scale, mo) {
  mo.view[item].i = i;
  mo.view[item].scale = scale;
  var isCat = (item === 'color' && mo.data.types[i] === 'category');
  if (item === 'x' || item === 'y') {
    resetView(mo, true);
  }
  else {
    if (isCat) updateColorMap(mo);
    else calcDispMinMax(mo, [item]);
    renderArena(mo);
  }
  updateLegends(mo, [item]);
}
function displayItemChange ( item , i , scale , mo ) { mo . view [ item ] . i = i ; mo . view [ item ] . scale = scale ; var isCat = ( item === 'color' && mo . data . types [ i ] === 'category' ) ; if ( item === 'x' || item === 'y' ) { resetView ( mo , true ) ; } else { if ( isCat ) updateColorMap ( mo ) ; else calcDispMinMax ( mo , [ item ] ) ; renderArena ( 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 // update legend