document.body.innerHTML = "<div id='graph'></div>";
};
-RangeTestCase.prototype.createGraph = function(opts, data, expectRangeX, expectRangeY) {
+var createGraph = function(opts, data, expectRangeX, expectRangeY) {
if (data === undefined) data = ZERO_TO_FIFTY_STEPS;
if (expectRangeX === undefined) expectRangeX = [10, 20];
if (expectRangeY === undefined) expectRangeY = [0, 55];
* appropriately.
*/
RangeTestCase.prototype.testRangeSetOperations = function() {
- var g = this.createGraph({valueRange : [ 0, 55 ]});
+ var g = createGraph({valueRange : [ 0, 55 ]});
g.updateOptions({ dateWindow : [ 12, 18 ] });
assertEquals([12, 18], g.xAxisRange());
* Verify that when zoomed in by mouse operations, an empty call to
* updateOptions doesn't change the displayed ranges.
*/
-RangeTestCase.prototype.zoom = function(g, xRange, yRange) {
+var zoom = function(g, xRange, yRange) {
var originalXRange = g.xAxisRange();
var originalYRange = g.yAxisRange(0);
* updateOptions doesn't change the displayed ranges.
*/
RangeTestCase.prototype.testEmptyUpdateOptions_doesntUnzoom = function() {
- var g = this.createGraph();
- this.zoom(g, [ 11, 18 ], [ 35, 40 ]);
+ var g = createGraph();
+ zoom(g, [ 11, 18 ], [ 35, 40 ]);
assertEqualsDelta([11, 18], g.xAxisRange(), 0.1);
assertEqualsDelta([35, 40], g.yAxisRange(0), 0.2);
* unzooms.
*/
RangeTestCase.prototype.testRestoreOriginalRanges_viaUpdateOptions = function() {
- var g = this.createGraph();
- this.zoom(g, [ 11, 18 ], [ 35, 40 ]);
+ var g = createGraph();
+ zoom(g, [ 11, 18 ], [ 35, 40 ]);
g.updateOptions({ dateWindow : null, valueRange : null });
* Verify old-style avoidMinZero option.
*/
RangeTestCase.prototype.testAvoidMinZero = function() {
- var g = this.createGraph({
+ var g = createGraph({
avoidMinZero: true,
}, ZERO_TO_FIFTY_STEPS, [10, 20], [-5, 55]);
};
* Verify ranges with user-specified padding, implicit avoidMinZero.
*/
RangeTestCase.prototype.testPaddingAuto = function() {
- var g = this.createGraph({
+ var g = createGraph({
xRangePad: 42,
yRangePad: 30
}, ZERO_TO_FIFTY_STEPS, [9, 21], [-5, 55]);
* Verify auto range with drawAxesAtZero.
*/
RangeTestCase.prototype.testPaddingAutoAxisAtZero = function() {
- var g = this.createGraph({
+ var g = createGraph({
drawAxesAtZero: true,
}, ZERO_TO_FIFTY_STEPS, [10, 20], [0, 55]);
};
* Try explicit range matching the auto range, should have identical results.
*/
RangeTestCase.prototype.testPaddingRange1 = function() {
- var g = this.createGraph({
+ var g = createGraph({
valueRange: [0, 50],
xRangePad: 42,
yRangePad: 30,
* User-supplied range differs from the auto range.
*/
RangeTestCase.prototype.testPaddingRange2 = function() {
- var g = this.createGraph({
+ var g = createGraph({
valueRange: [10, 60],
xRangePad: 42,
yRangePad: 30,
* Verify drawAxesAtZero and includeZero.
*/
RangeTestCase.prototype.testPaddingYAtZero = function() {
- var g = this.createGraph({
+ var g = createGraph({
includeZero: true,
xRangePad: 42,
yRangePad: 30,
* Verify logscale, compat mode.
*/
RangeTestCase.prototype.testLogscaleCompat = function() {
- var g = this.createGraph({
+ var g = createGraph({
logscale: true
},
[[-10, 10], [10, 10], [30, 1000]],
* Verify logscale, new mode.
*/
RangeTestCase.prototype.testLogscalePad = function() {
- var g = this.createGraph({
+ var g = createGraph({
logscale: true,
yRangePad: 30
},