static/js/miniplot.js
/**
 * Update mini plot controls by data columns.
 * @function updateMiniPlotCtrl
 * @param {Object} cols - cols object
 */
Update mini plot controls by data columns.
@function updateMiniPlotCtrl
@param {Object} cols - cols object
Update mini plot controls by data columns . @function updateMiniPlotCtrl @param { Object } cols - cols object
function updateMiniPlotCtrl(cols) {
  const names = cols.names,
        types = cols.types;
  const sel = byId('mini-field-sel');
  sel.innerHTML = '';
  sel.add(document.createElement('option'));
  const n = names.length;
  let opt;
  for (let i = 0; i < n; i++) {
    if (types[i] !== 'num') continue;    
    opt = document.createElement('option');
    opt.value = i;
    opt.text = names[i];
    sel.add(opt);
  }
}
function updateMiniPlotCtrl ( cols ) { const names = cols . names , types = cols . types ; const sel = byId ( 'mini-field-sel' ) ; sel . innerHTML = '' ; sel . add ( document . createElement ( 'option' ) ) ; const n = names . length ; let opt ; for ( let i = 0 ; i < n ; i ++ ) { if ( types [ i ] !== 'num' ) continue ; opt = document . createElement ( 'option' ) ; opt . value = i ; opt . text = names [ i ] ; sel . add ( opt ) ; } }
Update mini plot controls by data columns.
Update mini plot controls by data columns .
// create an empty option // create an option for each column