ui/plugins/cubism/cubism.v1.js
function prepare(start1, stop) {
    var steps = Math.min(size, Math.round((start1 - start) / step));
    if (!steps || fetching) return; // already fetched, or fetching!
    fetching = true;
    steps = Math.min(size, steps + cubism_metricOverlap);
    var start0 = new Date(stop - steps * step);
    request(start0, stop, step, function(error, data) {
      fetching = false;
      if (error) return console.warn(error);
      var i = isFinite(start) ? Math.round((start0 - start) / step) : 0;
      for (var j = 0, m = data.length; j < m; ++j) values[j + i] = data[j];
      event.change.call(metric, start, stop);
    });
  }
function prepare(start1, stop) {
    var steps = Math.min(size, Math.round((start1 - start) / step));
    if (!steps || fetching) return; // already fetched, or fetching!
    fetching = true;
    steps = Math.min(size, steps + cubism_metricOverlap);
    var start0 = new Date(stop - steps * step);
    request(start0, stop, step, function(error, data) {
      fetching = false;
      if (error) return console.warn(error);
      var i = isFinite(start) ? Math.round((start0 - start) / step) : 0;
      for (var j = 0, m = data.length; j < m; ++j) values[j + i] = data[j];
      event.change.call(metric, start, stop);
    });
  }
function prepare ( start1 , stop ) { var steps = Math . min ( size , Math . round ( ( start1 - start ) / step ) ) ; if ( ! steps || fetching ) return ; // already fetched, or fetching! fetching = true ; steps = Math . min ( size , steps + cubism_metricOverlap ) ; var start0 = new Date ( stop - steps * step ) ; request ( start0 , stop , step , function ( error , data ) { fetching = false ; if ( error ) return console . warn ( error ) ; var i = isFinite ( start ) ? Math . round ( ( start0 - start ) / step ) : 0 ; for ( var j = 0 , m = data . length ; j < m ; ++ j ) values [ j + i ] = data [ j ] ; event . change . call ( metric , start , stop ) ; } ) ; }
Prefetch new data into a temporary array.
Prefetch new data into a temporary array .