projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b843b52
)
Standardize isNullOrNan.
author
Robert Konigsberg
<konigsberg@google.com>
Fri, 1 Jun 2012 15:28:53 +0000
(11:28 -0400)
committer
Robert Konigsberg
<konigsberg@google.com>
Fri, 1 Jun 2012 15:28:53 +0000
(11:28 -0400)
dygraph-canvas.js
patch
|
blob
|
blame
|
history
diff --git
a/dygraph-canvas.js
b/dygraph-canvas.js
index
f19e7a3
..
d3e0d4f
100644
(file)
--- a/
dygraph-canvas.js
+++ b/
dygraph-canvas.js
@@
-691,7
+691,7
@@
DygraphCanvasRenderer.makeNextPointStep_ = function(
}
};
}
};
-
var _isNullOrNaN
= function(x) {
+
DygraphCanvasRenderer.isNullOrNaN_
= function(x) {
return (x === null || isNaN(x));
};
return (x === null || isNaN(x));
};
@@
-730,7
+730,7
@@
DygraphCanvasRenderer.prototype._drawNonTrivialLine = function(
point = points[firstIndexInSet + j];
nextY = (next(j) < setLength) ?
points[firstIndexInSet + next(j)].canvasy : null;
point = points[firstIndexInSet + j];
nextY = (next(j) < setLength) ?
points[firstIndexInSet + next(j)].canvasy : null;
- if (
_isNullOrNaN
(point.canvasy)) {
+ if (
DygraphCanvasRenderer.isNullOrNaN_
(point.canvasy)) {
if (stepPlot && prevX !== null) {
// Draw a horizontal line to the start of the missing data
ctx.beginPath();
if (stepPlot && prevX !== null) {
// Draw a horizontal line to the start of the missing data
ctx.beginPath();
@@
-744,12
+744,12
@@
DygraphCanvasRenderer.prototype._drawNonTrivialLine = function(
} else {
// A point is "isolated" if it is non-null but both the previous
// and next points are null.
} else {
// A point is "isolated" if it is non-null but both the previous
// and next points are null.
- var isIsolated = (!prevX &&
_isNullOrNaN
(nextY));
+ var isIsolated = (!prevX &&
DygraphCanvasRenderer.isNullOrNaN_
(nextY));
if (drawGapPoints) {
// Also consider a point to be is "isolated" if it's adjacent to a
// null point, excluding the graph edges.
if ((j > 0 && !prevX) ||
if (drawGapPoints) {
// Also consider a point to be is "isolated" if it's adjacent to a
// null point, excluding the graph edges.
if ((j > 0 && !prevX) ||
- (next(j) < setLength &&
_isNullOrNaN
(nextY))) {
+ (next(j) < setLength &&
DygraphCanvasRenderer.isNullOrNaN_
(nextY))) {
isIsolated = true;
}
}
isIsolated = true;
}
}
@@
-806,15
+806,15
@@
DygraphCanvasRenderer.prototype._drawTrivialLine = function(
for (var j = firstIndexInSet; j < firstIndexInSet + setLength; ++j) {
var point = points[j];
nextY = (j + 1 < firstIndexInSet + setLength) ? points[j + 1].canvasy : null;
for (var j = firstIndexInSet; j < firstIndexInSet + setLength; ++j) {
var point = points[j];
nextY = (j + 1 < firstIndexInSet + setLength) ? points[j + 1].canvasy : null;
- if (
_isNullOrNaN
(point.canvasy)) {
+ if (
DygraphCanvasRenderer.isNullOrNaN_
(point.canvasy)) {
prevX = prevY = null;
} else {
prevX = prevY = null;
} else {
- var isIsolated = (!prevX &&
_isNullOrNaN
(nextY));
+ var isIsolated = (!prevX &&
DygraphCanvasRenderer.isNullOrNaN_
(nextY));
if (drawGapPoints) {
// Also consider a point to be is "isolated" if it's adjacent to a
// null point, excluding the graph edges.
if ((j > firstIndexInSet && !prevX) ||
if (drawGapPoints) {
// Also consider a point to be is "isolated" if it's adjacent to a
// null point, excluding the graph edges.
if ((j > firstIndexInSet && !prevX) ||
- ((j + 1 < firstIndexInSet + setLength) &&
_isNullOrNaN
(nextY))) {
+ ((j + 1 < firstIndexInSet + setLength) &&
DygraphCanvasRenderer.isNullOrNaN_
(nextY))) {
isIsolated = true;
}
}
isIsolated = true;
}
}