flotr2.amd.js
function (mouse) {

    var
      options = this.options,
      prevHit = this.prevHit,
      closest, sensibility, dataIndex, seriesIndex, series, value, xaxis, yaxis, n;

    if (this.series.length === 0) return;

    // Nearest data element.
    // dist, x, y, relX, relY, absX, absY, sAngle, eAngle, fraction, mouse,
    // xaxis, yaxis, series, index, seriesIndex
    n = {
      relX : mouse.relX,
      relY : mouse.relY,
      absX : mouse.absX,
      absY : mouse.absY
    };

    if (options.mouse.trackY &&
        !options.mouse.trackAll &&
        this.hit.executeOnType(this.series, 'hit', [mouse, n]) &&
        !_.isUndefined(n.seriesIndex))
      {
      series    = this.series[n.seriesIndex];
      n.series  = series;
      n.mouse   = series.mouse;
      n.xaxis   = series.xaxis;
      n.yaxis   = series.yaxis;
    } else {

      closest = this.hit.closest(mouse);

      if (closest) {

        closest     = options.mouse.trackY ? closest.point : closest.x;
        seriesIndex = closest.seriesIndex;
        series      = this.series[seriesIndex];
        xaxis       = series.xaxis;
        yaxis       = series.yaxis;
        sensibility = 2 * series.mouse.sensibility;

        if
          (options.mouse.trackAll ||
          (closest.distanceX < sensibility / xaxis.scale &&
          (!options.mouse.trackY || closest.distanceY < sensibility / yaxis.scale)))
        {
          n.series      = series;
          n.xaxis       = series.xaxis;
          n.yaxis       = series.yaxis;
          n.mouse       = series.mouse;
          n.x           = closest.x;
          n.y           = closest.y;
          n.dist        = closest.distance;
          n.index       = closest.dataIndex;
          n.seriesIndex = seriesIndex;
        }
      }
    }

    if (!prevHit || (prevHit.index !== n.index || prevHit.seriesIndex !== n.seriesIndex)) {
      this.hit.clearHit();
      if (n.series && n.mouse && n.mouse.track) {
        this.hit.drawMouseTrack(n);
        this.hit.drawHit(n);
        Flotr.EventAdapter.fire(this.el, 'flotr:hit', [n, this]);
      }
    }

    return n;
  }
function (mouse) {

    var
      options = this.options,
      prevHit = this.prevHit,
      closest, sensibility, dataIndex, seriesIndex, series, value, xaxis, yaxis, n;

    if (this.series.length === 0) return;

    // Nearest data element.
    // dist, x, y, relX, relY, absX, absY, sAngle, eAngle, fraction, mouse,
    // xaxis, yaxis, series, index, seriesIndex
    n = {
      relX : mouse.relX,
      relY : mouse.relY,
      absX : mouse.absX,
      absY : mouse.absY
    };

    if (options.mouse.trackY &&
        !options.mouse.trackAll &&
        this.hit.executeOnType(this.series, 'hit', [mouse, n]) &&
        !_.isUndefined(n.seriesIndex))
      {
      series    = this.series[n.seriesIndex];
      n.series  = series;
      n.mouse   = series.mouse;
      n.xaxis   = series.xaxis;
      n.yaxis   = series.yaxis;
    } else {

      closest = this.hit.closest(mouse);

      if (closest) {

        closest     = options.mouse.trackY ? closest.point : closest.x;
        seriesIndex = closest.seriesIndex;
        series      = this.series[seriesIndex];
        xaxis       = series.xaxis;
        yaxis       = series.yaxis;
        sensibility = 2 * series.mouse.sensibility;

        if
          (options.mouse.trackAll ||
          (closest.distanceX < sensibility / xaxis.scale &&
          (!options.mouse.trackY || closest.distanceY < sensibility / yaxis.scale)))
        {
          n.series      = series;
          n.xaxis       = series.xaxis;
          n.yaxis       = series.yaxis;
          n.mouse       = series.mouse;
          n.x           = closest.x;
          n.y           = closest.y;
          n.dist        = closest.distance;
          n.index       = closest.dataIndex;
          n.seriesIndex = seriesIndex;
        }
      }
    }

    if (!prevHit || (prevHit.index !== n.index || prevHit.seriesIndex !== n.seriesIndex)) {
      this.hit.clearHit();
      if (n.series && n.mouse && n.mouse.track) {
        this.hit.drawMouseTrack(n);
        this.hit.drawHit(n);
        Flotr.EventAdapter.fire(this.el, 'flotr:hit', [n, this]);
      }
    }

    return n;
  }
function ( mouse ) { var options = this . options , prevHit = this . prevHit , closest , sensibility , dataIndex , seriesIndex , series , value , xaxis , yaxis , n ; if ( this . series . length === 0 ) return ; // Nearest data element. // dist, x, y, relX, relY, absX, absY, sAngle, eAngle, fraction, mouse, // xaxis, yaxis, series, index, seriesIndex n = { relX : mouse . relX , relY : mouse . relY , absX : mouse . absX , absY : mouse . absY } ; if ( options . mouse . trackY && ! options . mouse . trackAll && this . hit . executeOnType ( this . series , 'hit' , [ mouse , n ] ) && ! _ . isUndefined ( n . seriesIndex ) ) { series = this . series [ n . seriesIndex ] ; n . series = series ; n . mouse = series . mouse ; n . xaxis = series . xaxis ; n . yaxis = series . yaxis ; } else { closest = this . hit . closest ( mouse ) ; if ( closest ) { closest = options . mouse . trackY ? closest . point : closest . x ; seriesIndex = closest . seriesIndex ; series = this . series [ seriesIndex ] ; xaxis = series . xaxis ; yaxis = series . yaxis ; sensibility = 2 * series . mouse . sensibility ; if ( options . mouse . trackAll || ( closest . distanceX < sensibility / xaxis . scale && ( ! options . mouse . trackY || closest . distanceY < sensibility / yaxis . scale ) ) ) { n . series = series ; n . xaxis = series . xaxis ; n . yaxis = series . yaxis ; n . mouse = series . mouse ; n . x = closest . x ; n . y = closest . y ; n . dist = closest . distance ; n . index = closest . dataIndex ; n . seriesIndex = seriesIndex ; } } } if ( ! prevHit || ( prevHit . index !== n . index || prevHit . seriesIndex !== n . seriesIndex ) ) { this . hit . clearHit ( ) ; if ( n . series && n . mouse && n . mouse . track ) { this . hit . drawMouseTrack ( n ) ; this . hit . drawHit ( n ) ; Flotr . EventAdapter . fire ( this . el , 'flotr:hit' , [ n , this ] ) ; } } return n ; }
Retrieves the nearest data point from the mouse cursor. If it's within
a certain range, draw a point on the overlay canvas and display the x and y
value of the data.
@param {Object} mouse - Object that holds the relative x and y coordinates of the cursor.
Retrieves the nearest data point from the mouse cursor . If it s within a certain range draw a point on the overlay canvas and display the x and y value of the data .