Passing identical, or seemingly identical, operands to an operator such as subtraction or conjunction may indicate a typo; even if it is intentional, it makes the code hard to read.
The operands are for - in the first array slot of the call to domain() in each of these two lines:
|
.domain([domain.x[0] - domain.x[0], domain.x[1] - domain.x[0]]) |
- .domain([domain.x[0] - domain.x[0], domain.x[1] - domain.x[0]])
+ .domain([0, domain.x[1] - domain.x[0]])
|
.domain([domain.y[0] - domain.y[0], domain.y[1] - domain.y[0]]) |
- .domain([domain.y[0] - domain.y[0], domain.y[1] - domain.y[0]])
+ .domain([0, domain.y[1] - domain.y[0]])
The diffs I'm providing are equivalent minus being much cheaper. I'm not saying that's necessarily the intent of the code, but it's what's happening here (minus extra cycles either at compile time or runtime).
The operands are for
-in the first array slot of the call to domain() in each of these two lines:rickshaw/src/js/Rickshaw.Graph.js
Line 125 in 0e0671e
rickshaw/src/js/Rickshaw.Graph.js
Line 129 in 0e0671e
The diffs I'm providing are equivalent minus being much cheaper. I'm not saying that's necessarily the intent of the code, but it's what's happening here (minus extra cycles either at compile time or runtime).