diff --git a/plottable.js b/plottable.js index 330d031eed..4ec0ce77b8 100644 --- a/plottable.js +++ b/plottable.js @@ -2004,7 +2004,7 @@ var Plottable; */ function Scale(scale) { _super.call(this); - this._autoDomain = true; + this._autoDomainAutomatically = true; this.rendererID2Perspective = {}; this.dataSourceReferenceCounter = new Plottable.Util.IDCounter(); this._autoNice = false; @@ -2049,12 +2049,12 @@ var Plottable; var dataSourceID = dataSource._plottableID; if (this.dataSourceReferenceCounter.increment(dataSourceID) === 1) { dataSource.registerListener(this, function () { - if (_this._autoDomain) { + if (_this._autoDomainAutomatically) { _this.autoDomain(); } }); } - if (this._autoDomain) { + if (this._autoDomainAutomatically) { this.autoDomain(); } return this; @@ -2068,7 +2068,7 @@ var Plottable; } delete this.rendererID2Perspective[rendererIDAttr]; - if (this._autoDomain) { + if (this._autoDomainAutomatically) { this.autoDomain(); } return this; @@ -2088,7 +2088,7 @@ var Plottable; if (values == null) { return this._d3Scale.domain(); } else { - this._autoDomain = false; + this._autoDomainAutomatically = false; this._setDomain(values); return this; } @@ -2903,7 +2903,7 @@ var Plottable; InterpolatedColor.prototype._resetScale = function () { this._d3Scale = InterpolatedColor.getD3InterpolatedScale(this._colorRange, this._scaleType); - if (this._autoDomain) { + if (this._autoDomainAutomatically) { this.autoDomain(); } this._broadcast(); diff --git a/src/core/scale.ts b/src/core/scale.ts index 2e22de31dd..3db8a17162 100644 --- a/src/core/scale.ts +++ b/src/core/scale.ts @@ -8,7 +8,7 @@ export module Abstract { } export class Scale extends Broadcaster { public _d3Scale: D3.Scale.Scale; - public _autoDomain = true; + public _autoDomainAutomatically = true; private rendererID2Perspective: {[rendererID: string]: IPerspective} = {}; private dataSourceReferenceCounter = new Util.IDCounter(); public _autoNice = false; @@ -59,12 +59,12 @@ export module Abstract { var dataSourceID = dataSource._plottableID; if (this.dataSourceReferenceCounter.increment(dataSourceID) === 1 ) { dataSource.registerListener(this, () => { - if (this._autoDomain) { + if (this._autoDomainAutomatically) { this.autoDomain(); } }); } - if (this._autoDomain) { + if (this._autoDomainAutomatically) { this.autoDomain(); } return this; @@ -78,7 +78,7 @@ export module Abstract { } delete this.rendererID2Perspective[rendererIDAttr]; - if (this._autoDomain) { + if (this._autoDomainAutomatically) { this.autoDomain(); } return this; @@ -109,7 +109,7 @@ export module Abstract { if (values == null) { return this._d3Scale.domain(); } else { - this._autoDomain = false; + this._autoDomainAutomatically = false; this._setDomain(values); return this; } diff --git a/src/scales/interpolatedColorScale.ts b/src/scales/interpolatedColorScale.ts index 58e7cd3c74..d9f968fcd6 100644 --- a/src/scales/interpolatedColorScale.ts +++ b/src/scales/interpolatedColorScale.ts @@ -181,7 +181,7 @@ export module Scale { private _resetScale(): any { this._d3Scale = InterpolatedColor.getD3InterpolatedScale(this._colorRange, this._scaleType); - if (this._autoDomain) { + if (this._autoDomainAutomatically) { this.autoDomain(); } this._broadcast(); diff --git a/test/scaleTests.ts b/test/scaleTests.ts index f12f43483c..df906ea730 100644 --- a/test/scaleTests.ts +++ b/test/scaleTests.ts @@ -49,9 +49,9 @@ describe("Scales", () => { it("scale autoDomain flag is not overwritten without explicitly setting the domain", () => { scale._addPerspective("1", dataSource, "foo"); scale.autoDomain().padDomain().nice(); - assert.isTrue(scale._autoDomain, "the autoDomain flag is still set after autoranginging and padding and nice-ing"); + assert.isTrue(scale._autoDomainAutomatically, "the autoDomain flag is still set after autoranginging and padding and nice-ing"); scale.domain([0, 5]); - assert.isFalse(scale._autoDomain, "the autoDomain flag is false after domain explicitly set"); + assert.isFalse(scale._autoDomainAutomatically, "the autoDomain flag is false after domain explicitly set"); }); it("scale autorange works as expected with single dataSource", () => { @@ -74,17 +74,17 @@ describe("Scales", () => { }); it("scale perspectives can be removed appropriately", () => { - assert.isTrue(scale._autoDomain, "autoDomain enabled1"); + assert.isTrue(scale._autoDomainAutomatically, "autoDomain enabled1"); scale._addPerspective("1x", dataSource, "foo"); scale._addPerspective("2x", dataSource, "bar"); - assert.isTrue(scale._autoDomain, "autoDomain enabled2"); + assert.isTrue(scale._autoDomainAutomatically, "autoDomain enabled2"); assert.deepEqual(scale.domain(), [-20, 5], "scale domain includes both perspectives"); - assert.isTrue(scale._autoDomain, "autoDomain enabled3"); + assert.isTrue(scale._autoDomainAutomatically, "autoDomain enabled3"); scale._removePerspective("1x"); - assert.isTrue(scale._autoDomain, "autoDomain enabled4"); + assert.isTrue(scale._autoDomainAutomatically, "autoDomain enabled4"); assert.deepEqual(scale.domain(), [-20, 1], "only the bar accessor is active"); scale._addPerspective("2x", dataSource, "foo"); - assert.isTrue(scale._autoDomain, "autoDomain enabled5"); + assert.isTrue(scale._autoDomainAutomatically, "autoDomain enabled5"); assert.deepEqual(scale.domain(), [0, 5], "the bar accessor was overwritten"); }); }); diff --git a/test/tests.js b/test/tests.js index f76d0d7e78..cc66af28c7 100644 --- a/test/tests.js +++ b/test/tests.js @@ -3036,9 +3036,9 @@ describe("Scales", function () { it("scale autoDomain flag is not overwritten without explicitly setting the domain", function () { scale._addPerspective("1", dataSource, "foo"); scale.autoDomain().padDomain().nice(); - assert.isTrue(scale._autoDomain, "the autoDomain flag is still set after autoranginging and padding and nice-ing"); + assert.isTrue(scale._autoDomainAutomatically, "the autoDomain flag is still set after autoranginging and padding and nice-ing"); scale.domain([0, 5]); - assert.isFalse(scale._autoDomain, "the autoDomain flag is false after domain explicitly set"); + assert.isFalse(scale._autoDomainAutomatically, "the autoDomain flag is false after domain explicitly set"); }); it("scale autorange works as expected with single dataSource", function () { @@ -3064,17 +3064,17 @@ describe("Scales", function () { }); it("scale perspectives can be removed appropriately", function () { - assert.isTrue(scale._autoDomain, "autoDomain enabled1"); + assert.isTrue(scale._autoDomainAutomatically, "autoDomain enabled1"); scale._addPerspective("1x", dataSource, "foo"); scale._addPerspective("2x", dataSource, "bar"); - assert.isTrue(scale._autoDomain, "autoDomain enabled2"); + assert.isTrue(scale._autoDomainAutomatically, "autoDomain enabled2"); assert.deepEqual(scale.domain(), [-20, 5], "scale domain includes both perspectives"); - assert.isTrue(scale._autoDomain, "autoDomain enabled3"); + assert.isTrue(scale._autoDomainAutomatically, "autoDomain enabled3"); scale._removePerspective("1x"); - assert.isTrue(scale._autoDomain, "autoDomain enabled4"); + assert.isTrue(scale._autoDomainAutomatically, "autoDomain enabled4"); assert.deepEqual(scale.domain(), [-20, 1], "only the bar accessor is active"); scale._addPerspective("2x", dataSource, "foo"); - assert.isTrue(scale._autoDomain, "autoDomain enabled5"); + assert.isTrue(scale._autoDomainAutomatically, "autoDomain enabled5"); assert.deepEqual(scale.domain(), [0, 5], "the bar accessor was overwritten"); }); });