var _76=null;
var _77=null;
var _78=null;
-var px=PlotKit.Base.findPosX(this.canvas_);
-var py=PlotKit.Base.findPosY(this.canvas_);
+var px=-1000;
+var py=-1000;
var _81=function(e){
return e.mouse().page.x-px;
};
});
connect(this.hidden_,"onmousedown",function(_84){
_73=true;
+px=PlotKit.Base.findPosX(_72.canvas_);
+py=PlotKit.Base.findPosY(_72.canvas_);
_74=_81(_84);
_75=_82(_84);
});
_72.drawGraph_(_72.rawData_);
var _91=_72.rawData_[0][0];
var _92=_72.rawData_[_72.rawData_.length-1][0];
+if(_72.zoomCallback_){
_72.zoomCallback_(_91,_92);
+}
});
};
DateGraph.prototype.drawZoomRect_=function(_93,_94,_95){
}
this.dateWindow_=[_99,_100];
this.drawGraph_(this.rawData_);
+if(this.zoomCallback_){
this.zoomCallback_(_99,_100);
+}
};
DateGraph.prototype.mouseMove_=function(_102){
var _103=_102.mouse().page.x-PlotKit.Base.findPosX(this.hidden_);
var _76=null;
var _77=null;
var _78=null;
-var px=PlotKit.Base.findPosX(this.canvas_);
-var py=PlotKit.Base.findPosY(this.canvas_);
+var px=-1000;
+var py=-1000;
var _81=function(e){
return e.mouse().page.x-px;
};
});
connect(this.hidden_,"onmousedown",function(_84){
_73=true;
+px=PlotKit.Base.findPosX(_72.canvas_);
+py=PlotKit.Base.findPosY(_72.canvas_);
_74=_81(_84);
_75=_82(_84);
});
_72.drawGraph_(_72.rawData_);
var _91=_72.rawData_[0][0];
var _92=_72.rawData_[_72.rawData_.length-1][0];
+if(_72.zoomCallback_){
_72.zoomCallback_(_91,_92);
+}
});
};
DateGraph.prototype.drawZoomRect_=function(_93,_94,_95){
}
this.dateWindow_=[_99,_100];
this.drawGraph_(this.rawData_);
+if(this.zoomCallback_){
this.zoomCallback_(_99,_100);
+}
};
DateGraph.prototype.mouseMove_=function(_102){
var _103=_102.mouse().page.x-PlotKit.Base.findPosX(this.hidden_);
var prevEndX = null;
// Utility function to convert page-wide coordinates to canvas coords
- var px = PlotKit.Base.findPosX(this.canvas_);
- var py = PlotKit.Base.findPosY(this.canvas_);
+ var px = 0;
+ var py = 0;
var getX = function(e) { return e.mouse().page.x - px };
var getY = function(e) { return e.mouse().page.y - py };
// Track the beginning of drag events
connect(this.hidden_, 'onmousedown', function(event) {
mouseDown = true;
+ px = PlotKit.Base.findPosX(self.canvas_);
+ py = PlotKit.Base.findPosY(self.canvas_);
dragStartX = getX(event);
dragStartY = getY(event);
});
self.drawGraph_(self.rawData_);
var minDate = self.rawData_[0][0];
var maxDate = self.rawData_[self.rawData_.length - 1][0];
- self.zoomCallback_(minDate, maxDate);
+ if (self.zoomCallback_) {
+ self.zoomCallback_(minDate, maxDate);
+ }
});
};
this.dateWindow_ = [minDate, maxDate];
this.drawGraph_(this.rawData_);
- this.zoomCallback_(minDate, maxDate);
+ if (this.zoomCallback_) {
+ this.zoomCallback_(minDate, maxDate);
+ }
};
/**