projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix bug 329 which accumulates clipping rectangles on subsequent draws.
[dygraphs.git]
/
dygraph-layout.js
diff --git
a/dygraph-layout.js
b/dygraph-layout.js
index
900db68
..
a14e7f6
100644
(file)
--- a/
dygraph-layout.js
+++ b/
dygraph-layout.js
@@
-53,12
+53,13
@@
DygraphLayout.prototype.addDataset = function(setname, set_xy) {
};
DygraphLayout.prototype.getPlotArea = function() {
};
DygraphLayout.prototype.getPlotArea = function() {
- return this.
computePlotArea_()
;
+ return this.
area_
;
};
// Compute the box which the chart should be drawn in. This is the canvas's
// box, less space needed for axis and chart labels.
};
// Compute the box which the chart should be drawn in. This is the canvas's
// box, less space needed for axis and chart labels.
-DygraphLayout.prototype.computePlotArea_ = function() {
+// NOTE: This should only be called by Dygraph.predraw_().
+DygraphLayout.prototype.computePlotArea = function() {
var area = {
// TODO(danvk): per-axis setting.
x: 0,
var area = {
// TODO(danvk): per-axis setting.
x: 0,
@@
-119,12
+120,7
@@
DygraphLayout.prototype.computePlotArea_ = function() {
};
this.dygraph_.cascadeEvents_('layout', e);
};
this.dygraph_.cascadeEvents_('layout', e);
- // Add space for range selector, if needed.
- if (this.attr_('showRangeSelector')) {
- area.h -= this.attr_('rangeSelectorHeight') + 4;
- }
-
- return area;
+ this.area_ = area;
};
DygraphLayout.prototype.setAnnotations = function(ann) {
};
DygraphLayout.prototype.setAnnotations = function(ann) {
@@
-134,7
+130,7
@@
DygraphLayout.prototype.setAnnotations = function(ann) {
var parse = this.attr_('xValueParser') || function(x) { return x; };
for (var i = 0; i < ann.length; i++) {
var a = {};
var parse = this.attr_('xValueParser') || function(x) { return x; };
for (var i = 0; i < ann.length; i++) {
var a = {};
- if (!ann[i].xval &&
!ann[i].x
) {
+ if (!ann[i].xval &&
ann[i].x === undefined
) {
this.dygraph_.error("Annotations must have an 'x' property");
return;
}
this.dygraph_.error("Annotations must have an 'x' property");
return;
}
@@
-233,7
+229,7
@@
DygraphLayout.prototype._evaluateLineCharts = function() {
var setName = this.setNames[setIdx];
var axis = this.dygraph_.axisPropertiesForSeries(setName);
// TODO (konigsberg): use optionsForAxis instead.
var setName = this.setNames[setIdx];
var axis = this.dygraph_.axisPropertiesForSeries(setName);
// TODO (konigsberg): use optionsForAxis instead.
- var logscale = this.dygraph_.attributes_.getForSeries("logscale", set
Idx
);
+ var logscale = this.dygraph_.attributes_.getForSeries("logscale", set
Name
);
// Preallocating the size of points reduces reallocations, and therefore,
// calls to collect garbage.
// Preallocating the size of points reduces reallocations, and therefore,
// calls to collect garbage.
@@
-325,7
+321,7
@@
DygraphLayout.prototype.evaluateWithError = function() {
var setName = this.setNames[setIdx];
var axis = this.dygraph_.axisPropertiesForSeries(setName);
// TODO (konigsberg): use optionsForAxis instead.
var setName = this.setNames[setIdx];
var axis = this.dygraph_.axisPropertiesForSeries(setName);
// TODO (konigsberg): use optionsForAxis instead.
- var logscale = this.dygraph_.attributes_.getForSeries("logscale", set
Idx
);
+ var logscale = this.dygraph_.attributes_.getForSeries("logscale", set
Name
);
for (j = 0; j < dataset.length; j++, i++) {
var item = dataset[j];
for (j = 0; j < dataset.length; j++, i++) {
var item = dataset[j];