From 3d8be609fab2808d4c666fce60ccd143846a2f71 Mon Sep 17 00:00:00 2001 From: Daniel Mane Date: Mon, 28 Jul 2014 11:51:55 -0700 Subject: [PATCH] Rename QuantitiveScale to QuantitativeScale, in accordance with common usage of the english language Close #711 --- examples/component_example_list.ts | 24 +-- plottable.d.ts | 86 ++++----- plottable.js | 164 +++++++++--------- src/components/gridlines.ts | 10 +- src/components/numericAxis.ts | 8 +- src/components/plots/abstractBarPlot.ts | 4 +- src/components/plots/areaPlot.ts | 2 +- src/components/plots/horizontalBarPlot.ts | 4 +- src/components/plots/verticalBarPlot.ts | 4 +- src/components/plots/xyPlot.ts | 8 +- src/core/domainer.ts | 8 +- src/interactions/drag/dragInteraction.ts | 2 +- src/interactions/panZoomInteraction.ts | 10 +- src/reference.ts | 2 +- src/scales/interpolatedColorScale.ts | 8 +- src/scales/linearScale.ts | 2 +- src/scales/logScale.ts | 2 +- src/scales/modifiedLogScale.ts | 2 +- ...uantitiveScale.ts => quantitativeScale.ts} | 42 ++--- src/scales/timeScale.ts | 4 +- test/interactions/interactionTests.ts | 8 +- test/scales/scaleTests.ts | 2 +- test/tests.js | 2 +- 23 files changed, 204 insertions(+), 204 deletions(-) rename src/scales/{quantitiveScale.ts => quantitativeScale.ts} (74%) diff --git a/examples/component_example_list.ts b/examples/component_example_list.ts index 04c8c9aa82..8781c9e7ff 100644 --- a/examples/component_example_list.ts +++ b/examples/component_example_list.ts @@ -2,8 +2,8 @@ var ordinalDomain: string[] = ["a", "b", "c", "d", "e"]; var ordinalData = [{x: "a", y: 3}, {x: "b", y: -2}, {x: "c", y: 4}, {x: "d", y: -3}, {x: "e", y: 5}]; -var quantitiveData = [{x: -2, y: 15}, {x: 1, y: 20}, {x: 4, y: -3}, {x: 8, y: 0}, {x: 10, y: -10}]; -var quantitiveData2 = [{x: -2, y: 20}, {x: 5, y: -10}, {x: 7, y: 10}, {x: 10, y: 7}]; +var quantitativeData = [{x: -2, y: 15}, {x: 1, y: 20}, {x: 4, y: -3}, {x: 8, y: 0}, {x: 10, y: -10}]; +var quantitativeData2 = [{x: -2, y: 20}, {x: 5, y: -10}, {x: 7, y: 10}, {x: 10, y: 7}]; var colors = new Plottable.Scale.Color("Category10").range(); function generateSVG(width = 400, height = 400): D3.Selection { @@ -111,7 +111,7 @@ function getXYPlot(type: string, data: any[]): Plottable.Abstract.Plot { function makeXYPlot(type: string) { var svg = generateSVG(); - var plot = getXYPlot(type, quantitiveData); + var plot = getXYPlot(type, quantitativeData); plot.renderTo(svg); } @@ -119,8 +119,8 @@ function makeXYPlotMulti(type: string) { var svg = generateSVG(); - var plot = getXYPlot(type, quantitiveData); - var plot2 = getXYPlot(type, quantitiveData2); + var plot = getXYPlot(type, quantitativeData); + var plot2 = getXYPlot(type, quantitativeData2); if (type === "line") { plot.project("stroke", colors[0]); plot2.project("stroke", colors[1]); @@ -136,7 +136,7 @@ function makeAreaStroke() { var svg = generateSVG(); var xScale = new Plottable.Scale.Linear(); var yScale = new Plottable.Scale.Linear(); - var ds = new Plottable.DataSource(quantitiveData); + var ds = new Plottable.DataSource(quantitativeData); var plot = new Plottable.Plot.Area(ds, xScale, yScale); plot.project("stroke", colors[0]); @@ -175,7 +175,7 @@ function xydrag() { var svg = generateSVG(); var xScale = new Plottable.Scale.Linear(); var yScale = new Plottable.Scale.Linear(); - var plot = new Plottable.Plot.Scatter(quantitiveData, xScale, yScale); + var plot = new Plottable.Plot.Scatter(quantitativeData, xScale, yScale); plot.renderTo(svg); new Plottable.Interaction.XYDragBox(plot).callback(() => {return;}).registerWithComponent(); @@ -185,7 +185,7 @@ function xdrag() { var svg = generateSVG(); var xScale = new Plottable.Scale.Linear(); var yScale = new Plottable.Scale.Linear(); - var plot = new Plottable.Plot.Area(quantitiveData, xScale, yScale); + var plot = new Plottable.Plot.Area(quantitativeData, xScale, yScale); plot.renderTo(svg); new Plottable.Interaction.XDragBox(plot).callback(() => {return;}).registerWithComponent(); @@ -213,8 +213,8 @@ function animate1() { var yAxis = new Plottable.Axis.Numeric(yScale, "left"); var gridlines = new Plottable.Component.Gridlines(xScale, yScale); - var plot1 = new Plottable.Plot.Line(quantitiveData, xScale, yScale).animate(true); - var plot2 = new Plottable.Plot.Line(quantitiveData2, xScale, yScale).animate(true); + var plot1 = new Plottable.Plot.Line(quantitativeData, xScale, yScale).animate(true); + var plot2 = new Plottable.Plot.Line(quantitativeData2, xScale, yScale).animate(true); plot1.project("stroke", colors[0]); plot2.project("stroke", colors[1]); @@ -233,8 +233,8 @@ function animate2() { var yAxis = new Plottable.Axis.Numeric(yScale, "left"); var gridlines = new Plottable.Component.Gridlines(xScale, yScale); - var plot1 = new Plottable.Plot.Area(quantitiveData, xScale, yScale).animate(true); - var plot2 = new Plottable.Plot.Area(quantitiveData2, xScale, yScale).animate(true); + var plot1 = new Plottable.Plot.Area(quantitativeData, xScale, yScale).animate(true); + var plot2 = new Plottable.Plot.Area(quantitativeData2, xScale, yScale).animate(true); plot1.project("fill", colors[0]); plot2.project("fill", colors[1]); diff --git a/plottable.d.ts b/plottable.d.ts index 9fd73a07c3..9d6d7cc57d 100644 --- a/plottable.d.ts +++ b/plottable.d.ts @@ -1203,13 +1203,13 @@ declare module Plottable { /** * @param {any[][]} extents The list of extents to be reduced to a single * extent. - * @param {Abstract.QuantitiveScale} scale + * @param {Abstract.QuantitativeScale} scale * Since nice() must do different things depending on Linear, Log, * or Time scale, the scale must be passed in for nice() to work. * @return {any[]} The domain, as a merging of all exents, as a [min, max] * pair. */ - public computeDomain(extents: any[][], scale: Abstract.QuantitiveScale): any[]; + public computeDomain(extents: any[][], scale: Abstract.QuantitativeScale): any[]; /** * Sets the Domainer to pad by a given ratio. * @@ -1282,12 +1282,12 @@ declare module Plottable { declare module Plottable { module Abstract { - class QuantitiveScale extends Scale { + class QuantitativeScale extends Scale { /** - * Creates a new QuantitiveScale. + * Creates a new QuantitativeScale. * * @constructor - * @param {D3.Scale.QuantitiveScale} scale The D3 QuantitiveScale backing the QuantitiveScale. + * @param {D3.Scale.QuantitiveScale} scale The D3 QuantitativeScale backing the QuantitativeScale. */ constructor(scale: D3.Scale.QuantitiveScale); /** @@ -1298,40 +1298,40 @@ declare module Plottable { */ public invert(value: number): number; /** - * Creates a copy of the QuantitiveScale with the same domain and range but without any registered listeners. + * Creates a copy of the QuantitativeScale with the same domain and range but without any registered listeners. * - * @returns {QuantitiveScale} A copy of the calling QuantitiveScale. + * @returns {QuantitativeScale} A copy of the calling QuantitativeScale. */ - public copy(): QuantitiveScale; + public copy(): QuantitativeScale; public domain(): any[]; - public domain(values: any[]): QuantitiveScale; + public domain(values: any[]): QuantitativeScale; /** - * Sets or gets the QuantitiveScale's output interpolator + * Sets or gets the QuantitativeScale's output interpolator * * @param {D3.Transition.Interpolate} [factory] The output interpolator to use. - * @returns {D3.Transition.Interpolate|QuantitiveScale} The current output interpolator, or the calling QuantitiveScale. + * @returns {D3.Transition.Interpolate|QuantitativeScale} The current output interpolator, or the calling QuantitativeScale. */ public interpolate(): D3.Transition.Interpolate; - public interpolate(factory: D3.Transition.Interpolate): QuantitiveScale; + public interpolate(factory: D3.Transition.Interpolate): QuantitativeScale; /** - * Sets the range of the QuantitiveScale and sets the interpolator to d3.interpolateRound. + * Sets the range of the QuantitativeScale and sets the interpolator to d3.interpolateRound. * * @param {number[]} values The new range value for the range. */ - public rangeRound(values: number[]): QuantitiveScale; + public rangeRound(values: number[]): QuantitativeScale; /** - * Gets the clamp status of the QuantitiveScale (whether to cut off values outside the ouput range). + * Gets the clamp status of the QuantitativeScale (whether to cut off values outside the ouput range). * * @returns {boolean} The current clamp status. */ public clamp(): boolean; /** - * Sets the clamp status of the QuantitiveScale (whether to cut off values outside the ouput range). + * Sets the clamp status of the QuantitativeScale (whether to cut off values outside the ouput range). * - * @param {boolean} clamp Whether or not to clamp the QuantitiveScale. - * @returns {QuantitiveScale} The calling QuantitiveScale. + * @param {boolean} clamp Whether or not to clamp the QuantitativeScale. + * @returns {QuantitativeScale} The calling QuantitativeScale. */ - public clamp(clamp: boolean): QuantitiveScale; + public clamp(clamp: boolean): QuantitativeScale; /** * Generates tick values. * @@ -1351,7 +1351,7 @@ declare module Plottable { * Retrieve a Domainer of a scale. A Domainer is responsible for combining * multiple extents into a single domain. * - * @return {QuantitiveScale} The scale's current domainer. + * @return {QuantitativeScale} The scale's current domainer. */ public domainer(): Domainer; /** @@ -1363,9 +1363,9 @@ declare module Plottable { * includes 0, etc., will be the responsability of the new domainer. * * @param {Domainer} domainer The domainer to be set. - * @return {QuantitiveScale} The calling scale. + * @return {QuantitativeScale} The calling scale. */ - public domainer(domainer: Domainer): QuantitiveScale; + public domainer(domainer: Domainer): QuantitativeScale; } } } @@ -1373,7 +1373,7 @@ declare module Plottable { declare module Plottable { module Scale { - class Linear extends Abstract.QuantitiveScale { + class Linear extends Abstract.QuantitativeScale { /** * Creates a new LinearScale. * @@ -1395,7 +1395,7 @@ declare module Plottable { declare module Plottable { module Scale { - class Log extends Abstract.QuantitiveScale { + class Log extends Abstract.QuantitativeScale { /** * Creates a new Scale.Log. * @@ -1417,7 +1417,7 @@ declare module Plottable { declare module Plottable { module Scale { - class ModifiedLog extends Abstract.QuantitiveScale { + class ModifiedLog extends Abstract.QuantitativeScale { /** * Creates a new Scale.ModifiedLog. * @@ -1558,7 +1558,7 @@ declare module Plottable { declare module Plottable { module Scale { - class Time extends Abstract.QuantitiveScale { + class Time extends Abstract.QuantitativeScale { /** * Creates a new Time Scale. * @@ -1583,7 +1583,7 @@ declare module Plottable { declare module Plottable { module Scale { - class InterpolatedColor extends Abstract.QuantitiveScale { + class InterpolatedColor extends Abstract.QuantitativeScale { /** * Creates a InterpolatedColorScale. * @@ -1787,11 +1787,11 @@ declare module Plottable { * Creates a NumericAxis. * * @constructor - * @param {QuantitiveScale} scale The QuantitiveScale to base the NumericAxis on. - * @param {string} orientation The orientation of the QuantitiveScale (top/bottom/left/right) + * @param {QuantitativeScale} scale The QuantitativeScale to base the NumericAxis on. + * @param {string} orientation The orientation of the QuantitativeScale (top/bottom/left/right) * @param {Formatter} [formatter] A function to format tick labels. */ - constructor(scale: Abstract.QuantitiveScale, orientation: string, formatter?: any); + constructor(scale: Abstract.QuantitativeScale, orientation: string, formatter?: any); /** * Gets the tick label position relative to the tick marks. * @@ -1955,10 +1955,10 @@ declare module Plottable { * Creates a set of Gridlines. * @constructor * - * @param {QuantitiveScale} xScale The scale to base the x gridlines on. Pass null if no gridlines are desired. - * @param {QuantitiveScale} yScale The scale to base the y gridlines on. Pass null if no gridlines are desired. + * @param {QuantitativeScale} xScale The scale to base the x gridlines on. Pass null if no gridlines are desired. + * @param {QuantitativeScale} yScale The scale to base the y gridlines on. Pass null if no gridlines are desired. */ - constructor(xScale: Abstract.QuantitiveScale, yScale: Abstract.QuantitiveScale); + constructor(xScale: Abstract.QuantitativeScale, yScale: Abstract.QuantitativeScale); public remove(): Gridlines; } } @@ -2112,9 +2112,9 @@ declare module Plottable { * @constructor * @param {IDataset} dataset The dataset to render. * @param {Scale} xScale The x scale to use. - * @param {QuantitiveScale} yScale The y scale to use. + * @param {QuantitativeScale} yScale The y scale to use. */ - constructor(dataset: any, xScale: Abstract.Scale, yScale: Abstract.QuantitiveScale); + constructor(dataset: any, xScale: Abstract.Scale, yScale: Abstract.QuantitativeScale); } } } @@ -2132,10 +2132,10 @@ declare module Plottable { * * @constructor * @param {IDataset} dataset The dataset to render. - * @param {QuantitiveScale} xScale The x scale to use. + * @param {QuantitativeScale} xScale The x scale to use. * @param {Scale} yScale The y scale to use. */ - constructor(dataset: any, xScale: Abstract.QuantitiveScale, yScale: Abstract.Scale); + constructor(dataset: any, xScale: Abstract.QuantitativeScale, yScale: Abstract.Scale); } } } @@ -2355,17 +2355,17 @@ declare module Plottable { declare module Plottable { module Interaction { class PanZoom extends Abstract.Interaction { - public xScale: Abstract.QuantitiveScale; - public yScale: Abstract.QuantitiveScale; + public xScale: Abstract.QuantitativeScale; + public yScale: Abstract.QuantitativeScale; /** * Creates a PanZoomInteraction. * * @constructor * @param {Component} componentToListenTo The component to listen for interactions on. - * @param {QuantitiveScale} xScale The X scale to update on panning/zooming. - * @param {QuantitiveScale} yScale The Y scale to update on panning/zooming. + * @param {QuantitativeScale} xScale The X scale to update on panning/zooming. + * @param {QuantitativeScale} yScale The Y scale to update on panning/zooming. */ - constructor(componentToListenTo: Abstract.Component, xScale: Abstract.QuantitiveScale, yScale: Abstract.QuantitiveScale); + constructor(componentToListenTo: Abstract.Component, xScale: Abstract.QuantitativeScale, yScale: Abstract.QuantitativeScale); public resetZoom(): void; } } @@ -2391,7 +2391,7 @@ declare module Plottable { * @returns {AreaInteraction} The calling AreaInteraction. */ public callback(cb?: (a: any) => any): Drag; - public setupZoomCallback(xScale?: Abstract.QuantitiveScale, yScale?: Abstract.QuantitiveScale): Drag; + public setupZoomCallback(xScale?: Abstract.QuantitativeScale, yScale?: Abstract.QuantitativeScale): Drag; } } } diff --git a/plottable.js b/plottable.js index cc058db8a2..e42d6eb72a 100644 --- a/plottable.js +++ b/plottable.js @@ -493,12 +493,12 @@ var Plottable; if (selection.node().nodeName === "text") { var originalText = selection.text(); selection.text(s); - bb = Util.DOM.getBBox(selection); + bb = Plottable.Util.DOM.getBBox(selection); selection.text(originalText); return { width: bb.width, height: bb.height }; } else { var t = selection.append("text").text(s); - bb = Util.DOM.getBBox(t); + bb = Plottable.Util.DOM.getBBox(t); t.remove(); return { width: bb.width, height: bb.height }; } @@ -582,7 +582,7 @@ var Plottable; */ function CachingCharacterMeasurer(g) { var _this = this; - this.cache = new Util.Cache(getTextMeasure(g), CANONICAL_CHR, Util.Methods.objEq); + this.cache = new Plottable.Util.Cache(getTextMeasure(g), CANONICAL_CHR, Plottable.Util.Methods.objEq); this.measure = combineWhitespace(measureByCharacter(wrapWhitespace(function (s) { return _this.cache.get(s); }))); @@ -675,11 +675,11 @@ var Plottable; var innerG = g.append("g"); var textEl = innerG.append("text"); textEl.text(line); - var bb = Util.DOM.getBBox(textEl); + var bb = Plottable.Util.DOM.getBBox(textEl); var h = bb.height; var w = bb.width; if (w > width || h > height) { - Util.Methods.warn("Insufficient space to fit text"); + Plottable.Util.Methods.warn("Insufficient space to fit text"); return { width: 0, height: 0 }; } var anchorConverter = { left: "start", center: "middle", right: "end" }; @@ -688,7 +688,7 @@ var Plottable; var yOff = height * yOffsetFactor[yAlign] + h * (1 - yOffsetFactor[yAlign]); var ems = -0.4 * (1 - yOffsetFactor[yAlign]); textEl.attr("text-anchor", anchor).attr("y", ems + "em"); - Util.DOM.translate(innerG, xOff, yOff); + Plottable.Util.DOM.translate(innerG, xOff, yOff); return { width: w, height: h }; } Text.writeLineHorizontally = writeLineHorizontally; @@ -723,7 +723,7 @@ var Plottable; var blockG = g.append("g"); brokenText.forEach(function (line, i) { var innerG = blockG.append("g"); - Util.DOM.translate(innerG, 0, i * h); + Plottable.Util.DOM.translate(innerG, 0, i * h); var wh = writeLineHorizontally(line, innerG, width, h, xAlign, yAlign); if (wh.width > maxWidth) { maxWidth = wh.width; @@ -732,7 +732,7 @@ var Plottable; var usedSpace = h * brokenText.length; var freeSpace = height - usedSpace; var translator = { center: 0.5, top: 0, bottom: 1 }; - Util.DOM.translate(blockG, 0, freeSpace * translator[yAlign]); + Plottable.Util.DOM.translate(blockG, 0, freeSpace * translator[yAlign]); return { width: maxWidth, height: usedSpace }; } Text.writeTextHorizontally = writeTextHorizontally; @@ -746,7 +746,7 @@ var Plottable; var blockG = g.append("g"); brokenText.forEach(function (line, i) { var innerG = blockG.append("g"); - Util.DOM.translate(innerG, i * h, 0); + Plottable.Util.DOM.translate(innerG, i * h, 0); var wh = writeLineVertically(line, innerG, h, height, xAlign, yAlign, rotation); if (wh.height > maxHeight) { maxHeight = wh.height; @@ -755,7 +755,7 @@ var Plottable; var usedSpace = h * brokenText.length; var freeSpace = width - usedSpace; var translator = { center: 0.5, left: 0, right: 1 }; - Util.DOM.translate(blockG, freeSpace * translator[xAlign], 0); + Plottable.Util.DOM.translate(blockG, freeSpace * translator[xAlign], 0); return { width: usedSpace, height: maxHeight }; } @@ -773,7 +773,7 @@ var Plottable; var orientHorizontally = (horizontally != null) ? horizontally : width * 1.1 > height; var primaryDimension = orientHorizontally ? width : height; var secondaryDimension = orientHorizontally ? height : width; - var wrappedText = Util.WordWrap.breakTextToFitRect(text, primaryDimension, secondaryDimension, tm); + var wrappedText = Plottable.Util.WordWrap.breakTextToFitRect(text, primaryDimension, secondaryDimension, tm); if (wrappedText.lines.length === 0) { return { textFits: wrappedText.textFits, usedWidth: 0, usedHeight: 0 }; @@ -836,7 +836,7 @@ var Plottable; lines = lines.splice(0, nLinesThatFit); if (nLinesThatFit > 0) { // Overwrite the last line to one that has had a ... appended to the end - lines[nLinesThatFit - 1] = Util.Text._addEllipsesToLine(lines[nLinesThatFit - 1], width, measureText); + lines[nLinesThatFit - 1] = Plottable.Util.Text._addEllipsesToLine(lines[nLinesThatFit - 1], width, measureText); } } return { originalText: text, lines: lines, textFits: textFit }; @@ -1330,7 +1330,7 @@ var Plottable; return formattedValue; }; return Currency; - })(Formatter.Fixed); + })(Plottable.Formatter.Fixed); Formatter.Currency = Currency; })(Plottable.Formatter || (Plottable.Formatter = {})); var Formatter = Plottable.Formatter; @@ -1367,7 +1367,7 @@ var Plottable; return formattedValue; }; return Percentage; - })(Formatter.Fixed); + })(Plottable.Formatter.Fixed); Formatter.Percentage = Percentage; })(Plottable.Formatter || (Plottable.Formatter = {})); var Formatter = Plottable.Formatter; @@ -2185,7 +2185,7 @@ var Plottable; }; Component.AUTORESIZE_BY_DEFAULT = true; return Component; - })(Abstract.PlottableObject); + })(Plottable.Abstract.PlottableObject); Abstract.Component = Component; })(Plottable.Abstract || (Plottable.Abstract = {})); var Abstract = Plottable.Abstract; @@ -2295,7 +2295,7 @@ var Plottable; }); }; return ComponentContainer; - })(Abstract.Component); + })(Plottable.Abstract.Component); Abstract.ComponentContainer = ComponentContainer; })(Plottable.Abstract || (Plottable.Abstract = {})); var Abstract = Plottable.Abstract; @@ -2904,7 +2904,7 @@ var Plottable; return this; }; return Scale; - })(Abstract.PlottableObject); + })(Plottable.Abstract.PlottableObject); Abstract.Scale = Scale; })(Plottable.Abstract || (Plottable.Abstract = {})); var Abstract = Plottable.Abstract; @@ -3123,7 +3123,7 @@ var Plottable; } }; return Plot; - })(Abstract.Component); + })(Plottable.Abstract.Component); Abstract.Plot = Plot; })(Plottable.Abstract || (Plottable.Abstract = {})); var Abstract = Plottable.Abstract; @@ -3139,7 +3139,7 @@ var Plottable; function Immediate() { } Immediate.prototype.render = function () { - RenderController.flush(); + Plottable.Core.RenderController.flush(); }; return Immediate; })(); @@ -3149,7 +3149,7 @@ var Plottable; function AnimationFrame() { } AnimationFrame.prototype.render = function () { - Plottable.Util.DOM.requestAnimationFramePolyfill(RenderController.flush); + Plottable.Util.DOM.requestAnimationFramePolyfill(Plottable.Core.RenderController.flush); }; return AnimationFrame; })(); @@ -3160,7 +3160,7 @@ var Plottable; this._timeoutMsec = Plottable.Util.DOM.POLYFILL_TIMEOUT_MSEC; } Timeout.prototype.render = function () { - setTimeout(RenderController.flush, this._timeoutMsec); + setTimeout(Plottable.Core.RenderController.flush, this._timeoutMsec); }; return Timeout; })(); @@ -3191,7 +3191,7 @@ var Plottable; var _componentsNeedingRender = {}; var _componentsNeedingComputeLayout = {}; var _animationRequested = false; - RenderController._renderPolicy = new RenderController.RenderPolicy.AnimationFrame(); + RenderController._renderPolicy = new Plottable.Core.RenderController.RenderPolicy.AnimationFrame(); function setRenderPolicy(policy) { RenderController._renderPolicy = policy; @@ -3259,7 +3259,7 @@ var Plottable; } // Reset resize flag regardless of queue'd components - Core.ResizeBroadcaster.clearResizing(); + Plottable.Core.ResizeBroadcaster.clearResizing(); } RenderController.flush = flush; })(Core.RenderController || (Core.RenderController = {})); @@ -3288,7 +3288,7 @@ var Plottable; function _lazyInitialize() { if (broadcaster === undefined) { - broadcaster = new Core.Broadcaster(ResizeBroadcaster); + broadcaster = new Plottable.Core.Broadcaster(ResizeBroadcaster); window.addEventListener("resize", _onResize); } } @@ -3383,7 +3383,7 @@ var Plottable; /** * @param {any[][]} extents The list of extents to be reduced to a single * extent. - * @param {Abstract.QuantitiveScale} scale + * @param {Abstract.QuantitativeScale} scale * Since nice() must do different things depending on Linear, Log, * or Time scale, the scale must be passed in for nice() to work. * @return {any[]} The domain, as a merging of all exents, as a [min, max] @@ -3589,22 +3589,22 @@ var __extends = this.__extends || function (d, b) { var Plottable; (function (Plottable) { (function (Abstract) { - var QuantitiveScale = (function (_super) { - __extends(QuantitiveScale, _super); + var QuantitativeScale = (function (_super) { + __extends(QuantitativeScale, _super); /** - * Creates a new QuantitiveScale. + * Creates a new QuantitativeScale. * * @constructor - * @param {D3.Scale.QuantitiveScale} scale The D3 QuantitiveScale backing the QuantitiveScale. + * @param {D3.Scale.QuantitiveScale} scale The D3 QuantitativeScale backing the QuantitativeScale. */ - function QuantitiveScale(scale) { + function QuantitativeScale(scale) { _super.call(this, scale); this._lastRequestedTickCount = 10; this._PADDING_FOR_IDENTICAL_DOMAIN = 1; this._userSetDomainer = false; this._domainer = new Plottable.Domainer(); } - QuantitiveScale.prototype._getExtent = function () { + QuantitativeScale.prototype._getExtent = function () { return this._domainer.computeDomain(this._getAllExtents(), this); }; @@ -3614,35 +3614,35 @@ var Plottable; * @param {number} value: A value from the Scale's range. * @returns {number} The domain value corresponding to the supplied range value. */ - QuantitiveScale.prototype.invert = function (value) { + QuantitativeScale.prototype.invert = function (value) { return this._d3Scale.invert(value); }; /** - * Creates a copy of the QuantitiveScale with the same domain and range but without any registered listeners. + * Creates a copy of the QuantitativeScale with the same domain and range but without any registered listeners. * - * @returns {QuantitiveScale} A copy of the calling QuantitiveScale. + * @returns {QuantitativeScale} A copy of the calling QuantitativeScale. */ - QuantitiveScale.prototype.copy = function () { - return new QuantitiveScale(this._d3Scale.copy()); + QuantitativeScale.prototype.copy = function () { + return new QuantitativeScale(this._d3Scale.copy()); }; - QuantitiveScale.prototype.domain = function (values) { + QuantitativeScale.prototype.domain = function (values) { return _super.prototype.domain.call(this, values); }; - QuantitiveScale.prototype._setDomain = function (values) { + QuantitativeScale.prototype._setDomain = function (values) { var isNaNOrInfinity = function (x) { return x !== x || x === Infinity || x === -Infinity; }; if (isNaNOrInfinity(values[0]) || isNaNOrInfinity(values[1])) { - Plottable.Util.Methods.warn("Warning: QuantitiveScales cannot take NaN or Infinity as a domain value. Ignoring."); + Plottable.Util.Methods.warn("Warning: QuantitativeScales cannot take NaN or Infinity as a domain value. Ignoring."); return; } _super.prototype._setDomain.call(this, values); }; - QuantitiveScale.prototype.interpolate = function (factory) { + QuantitativeScale.prototype.interpolate = function (factory) { if (factory == null) { return this._d3Scale.interpolate(); } @@ -3651,16 +3651,16 @@ var Plottable; }; /** - * Sets the range of the QuantitiveScale and sets the interpolator to d3.interpolateRound. + * Sets the range of the QuantitativeScale and sets the interpolator to d3.interpolateRound. * * @param {number[]} values The new range value for the range. */ - QuantitiveScale.prototype.rangeRound = function (values) { + QuantitativeScale.prototype.rangeRound = function (values) { this._d3Scale.rangeRound(values); return this; }; - QuantitiveScale.prototype.clamp = function (clamp) { + QuantitativeScale.prototype.clamp = function (clamp) { if (clamp == null) { return this._d3Scale.clamp(); } @@ -3674,7 +3674,7 @@ var Plottable; * @param {number} [count] The number of ticks to generate. * @returns {any[]} The generated ticks. */ - QuantitiveScale.prototype.ticks = function (count) { + QuantitativeScale.prototype.ticks = function (count) { if (count != null) { this._lastRequestedTickCount = count; } @@ -3688,7 +3688,7 @@ var Plottable; * @param {string} [format] A format specifier string. * @returns {(n: number) => string} A formatting function. */ - QuantitiveScale.prototype.tickFormat = function (count, format) { + QuantitativeScale.prototype.tickFormat = function (count, format) { return this._d3Scale.tickFormat(count, format); }; @@ -3696,11 +3696,11 @@ var Plottable; * Given a domain, expands its domain onto "nice" values, e.g. whole * numbers. */ - QuantitiveScale.prototype._niceDomain = function (domain, count) { + QuantitativeScale.prototype._niceDomain = function (domain, count) { return this._d3Scale.copy().domain(domain).nice(count).domain(); }; - QuantitiveScale.prototype.domainer = function (domainer) { + QuantitativeScale.prototype.domainer = function (domainer) { if (domainer == null) { return this._domainer; } else { @@ -3711,12 +3711,12 @@ var Plottable; } }; - QuantitiveScale.prototype._defaultExtent = function () { + QuantitativeScale.prototype._defaultExtent = function () { return [0, 1]; }; - return QuantitiveScale; - })(Abstract.Scale); - Abstract.QuantitiveScale = QuantitiveScale; + return QuantitativeScale; + })(Plottable.Abstract.Scale); + Abstract.QuantitativeScale = QuantitativeScale; })(Plottable.Abstract || (Plottable.Abstract = {})); var Abstract = Plottable.Abstract; })(Plottable || (Plottable = {})); @@ -3745,7 +3745,7 @@ var Plottable; return new Linear(this._d3Scale.copy()); }; return Linear; - })(Plottable.Abstract.QuantitiveScale); + })(Plottable.Abstract.QuantitativeScale); Scale.Linear = Linear; })(Plottable.Scale || (Plottable.Scale = {})); var Scale = Plottable.Scale; @@ -3779,7 +3779,7 @@ var Plottable; return [1, 10]; }; return Log; - })(Plottable.Abstract.QuantitiveScale); + })(Plottable.Abstract.QuantitativeScale); Scale.Log = Log; })(Plottable.Scale || (Plottable.Scale = {})); var Scale = Plottable.Scale; @@ -3994,7 +3994,7 @@ var Plottable; } }; return ModifiedLog; - })(Plottable.Abstract.QuantitiveScale); + })(Plottable.Abstract.QuantitativeScale); Scale.ModifiedLog = ModifiedLog; })(Plottable.Scale || (Plottable.Scale = {})); var Scale = Plottable.Scale; @@ -4194,7 +4194,7 @@ var Plottable; var Time = (function (_super) { __extends(Time, _super); function Time(scale) { - // need to cast since d3 time scales do not descend from quantitive scales + // need to cast since d3 time scales do not descend from Quantitative scales _super.call(this, scale == null ? d3.time.scale() : scale); this._PADDING_FOR_IDENTICAL_DOMAIN = 1000 * 60 * 60 * 24; } @@ -4229,7 +4229,7 @@ var Plottable; return new Time(this._d3Scale.copy()); }; return Time; - })(Plottable.Abstract.QuantitiveScale); + })(Plottable.Abstract.QuantitativeScale); Scale.Time = Time; })(Plottable.Scale || (Plottable.Scale = {})); var Scale = Plottable.Scale; @@ -4274,7 +4274,7 @@ var Plottable; * values in hex ("#FFFFFF") or keywords ("white"). * @param {string} scaleType a string representing the underlying scale * type (linear/log/sqrt/pow) - * @returns a quantitive d3 scale. + * @returns a Quantitative d3 scale. */ InterpolatedColor.getD3InterpolatedScale = function (colors, scaleType) { var scale; @@ -4293,7 +4293,7 @@ var Plottable; break; } if (scale == null) { - throw new Error("unknown quantitive scale type " + scaleType); + throw new Error("unknown Quantitative scale type " + scaleType); } return scale.range([0, 1]).interpolate(InterpolatedColor.interpolateColors(colors)); }; @@ -4364,7 +4364,7 @@ var Plottable; }; InterpolatedColor.prototype.autoDomain = function () { - // unlike other QuantitiveScales, interpolatedColorScale ignores its domainer + // unlike other QuantitativeScales, interpolatedColorScale ignores its domainer var extents = this._getAllExtents(); if (extents.length > 0) { this._setDomain([d3.min(extents, function (x) { @@ -4419,7 +4419,7 @@ var Plottable; ] }; return InterpolatedColor; - })(Plottable.Abstract.QuantitiveScale); + })(Plottable.Abstract.QuantitativeScale); Scale.InterpolatedColor = InterpolatedColor; })(Plottable.Scale || (Plottable.Scale = {})); var Scale = Plottable.Scale; @@ -4790,7 +4790,7 @@ var Plottable; return (Math.floor(boundingBox.left) <= Math.ceil(tickBox.left) && Math.floor(boundingBox.top) <= Math.ceil(tickBox.top) && Math.floor(tickBox.right) <= Math.ceil(boundingBox.left + _this.availableWidth) && Math.floor(tickBox.bottom) <= Math.ceil(boundingBox.top + _this.availableHeight)); }; - var tickLabels = this._tickLabelContainer.selectAll("." + Abstract.Axis.TICK_LABEL_CLASS); + var tickLabels = this._tickLabelContainer.selectAll("." + Plottable.Abstract.Axis.TICK_LABEL_CLASS); if (tickLabels[0].length === 0) { return; } @@ -4805,7 +4805,7 @@ var Plottable; }; Axis.prototype._hideOverlappingTickLabels = function () { - var visibleTickLabels = this._tickLabelContainer.selectAll("." + Abstract.Axis.TICK_LABEL_CLASS).filter(function (d, i) { + var visibleTickLabels = this._tickLabelContainer.selectAll("." + Plottable.Abstract.Axis.TICK_LABEL_CLASS).filter(function (d, i) { return d3.select(this).style("visibility") === "visible"; }); var lastLabelClientRect; @@ -4824,7 +4824,7 @@ var Plottable; Axis.TICK_MARK_CLASS = "tick-mark"; Axis.TICK_LABEL_CLASS = "tick-label"; return Axis; - })(Abstract.Component); + })(Plottable.Abstract.Component); Abstract.Axis = Axis; })(Plottable.Abstract || (Plottable.Abstract = {})); var Abstract = Plottable.Abstract; @@ -5140,8 +5140,8 @@ var Plottable; * Creates a NumericAxis. * * @constructor - * @param {QuantitiveScale} scale The QuantitiveScale to base the NumericAxis on. - * @param {string} orientation The orientation of the QuantitiveScale (top/bottom/left/right) + * @param {QuantitativeScale} scale The QuantitativeScale to base the NumericAxis on. + * @param {string} orientation The orientation of the QuantitativeScale (top/bottom/left/right) * @param {Formatter} [formatter] A function to format tick labels. */ function Numeric(scale, orientation, formatter) { @@ -5897,8 +5897,8 @@ var Plottable; * Creates a set of Gridlines. * @constructor * - * @param {QuantitiveScale} xScale The scale to base the x gridlines on. Pass null if no gridlines are desired. - * @param {QuantitiveScale} yScale The scale to base the y gridlines on. Pass null if no gridlines are desired. + * @param {QuantitativeScale} xScale The scale to base the x gridlines on. Pass null if no gridlines are desired. + * @param {QuantitativeScale} yScale The scale to base the y gridlines on. Pass null if no gridlines are desired. */ function Gridlines(xScale, yScale) { var _this = this; @@ -6065,7 +6065,7 @@ var Plottable; }; XYPlot.prototype._updateXDomainer = function () { - if (this.xScale instanceof Abstract.QuantitiveScale) { + if (this.xScale instanceof Plottable.Abstract.QuantitativeScale) { var scale = this.xScale; if (!scale._userSetDomainer) { scale.domainer().pad().nice(); @@ -6075,7 +6075,7 @@ var Plottable; }; XYPlot.prototype._updateYDomainer = function () { - if (this.yScale instanceof Abstract.QuantitiveScale) { + if (this.yScale instanceof Plottable.Abstract.QuantitativeScale) { var scale = this.yScale; if (!scale._userSetDomainer) { scale.domainer().pad().nice(); @@ -6084,7 +6084,7 @@ var Plottable; return this; }; return XYPlot; - })(Abstract.Plot); + })(Plottable.Abstract.Plot); Abstract.XYPlot = XYPlot; })(Plottable.Abstract || (Plottable.Abstract = {})); var Abstract = Plottable.Abstract; @@ -6406,7 +6406,7 @@ var Plottable; }; BarPlot.prototype._updateDomainer = function (scale) { - if (scale instanceof Abstract.QuantitiveScale) { + if (scale instanceof Plottable.Abstract.QuantitativeScale) { var qscale = scale; if (!qscale._userSetDomainer) { if (this._baselineValue != null) { @@ -6473,7 +6473,7 @@ var Plottable; BarPlot._BarAlignmentToFactor = {}; return BarPlot; - })(Abstract.XYPlot); + })(Plottable.Abstract.XYPlot); Abstract.BarPlot = BarPlot; })(Plottable.Abstract || (Plottable.Abstract = {})); var Abstract = Plottable.Abstract; @@ -6497,7 +6497,7 @@ var Plottable; * @constructor * @param {IDataset} dataset The dataset to render. * @param {Scale} xScale The x scale to use. - * @param {QuantitiveScale} yScale The y scale to use. + * @param {QuantitativeScale} yScale The y scale to use. */ function VerticalBar(dataset, xScale, yScale) { _super.call(this, dataset, xScale, yScale); @@ -6532,7 +6532,7 @@ var Plottable; * * @constructor * @param {IDataset} dataset The dataset to render. - * @param {QuantitiveScale} xScale The x scale to use. + * @param {QuantitativeScale} xScale The x scale to use. * @param {Scale} yScale The y scale to use. */ function HorizontalBar(dataset, xScale, yScale) { @@ -6751,7 +6751,7 @@ var Plottable; this._applyAnimatedAttributes(this.areaPath, "area", attrToProjector); }; return Area; - })(Plot.Line); + })(Plottable.Plot.Line); Plot.Area = Area; })(Plottable.Plot || (Plottable.Plot = {})); var Plot = Plottable.Plot; @@ -6857,7 +6857,7 @@ var Plottable; }).attr(attrToProjector); }; return IterativeDelay; - })(Animator.Default); + })(Plottable.Animator.Default); Animator.IterativeDelay = IterativeDelay; })(Plottable.Animator || (Plottable.Animator = {})); var Animator = Plottable.Animator; @@ -7124,8 +7124,8 @@ var Plottable; * * @constructor * @param {Component} componentToListenTo The component to listen for interactions on. - * @param {QuantitiveScale} xScale The X scale to update on panning/zooming. - * @param {QuantitiveScale} yScale The Y scale to update on panning/zooming. + * @param {QuantitativeScale} xScale The X scale to update on panning/zooming. + * @param {QuantitativeScale} yScale The Y scale to update on panning/zooming. */ function PanZoom(componentToListenTo, xScale, yScale) { var _this = this; @@ -7361,7 +7361,7 @@ var Plottable; }; DragBox.CLASS_DRAG_BOX = "drag-box"; return DragBox; - })(Interaction.Drag); + })(Plottable.Interaction.Drag); Interaction.DragBox = DragBox; })(Plottable.Interaction || (Plottable.Interaction = {})); var Interaction = Plottable.Interaction; @@ -7402,7 +7402,7 @@ var Plottable; return this; }; return XDragBox; - })(Interaction.DragBox); + })(Plottable.Interaction.DragBox); Interaction.XDragBox = XDragBox; })(Plottable.Interaction || (Plottable.Interaction = {})); var Interaction = Plottable.Interaction; @@ -7440,7 +7440,7 @@ var Plottable; this.callbackToCall(pixelArea); }; return XYDragBox; - })(Interaction.DragBox); + })(Plottable.Interaction.DragBox); Interaction.XYDragBox = XYDragBox; })(Plottable.Interaction || (Plottable.Interaction = {})); var Interaction = Plottable.Interaction; @@ -7481,7 +7481,7 @@ var Plottable; return this; }; return YDragBox; - })(Interaction.DragBox); + })(Plottable.Interaction.DragBox); Interaction.YDragBox = YDragBox; })(Plottable.Interaction || (Plottable.Interaction = {})); var Interaction = Plottable.Interaction; diff --git a/src/components/gridlines.ts b/src/components/gridlines.ts index 2d0590eb0c..2fed09964d 100644 --- a/src/components/gridlines.ts +++ b/src/components/gridlines.ts @@ -3,8 +3,8 @@ module Plottable { export module Component { export class Gridlines extends Abstract.Component { - private xScale: Abstract.QuantitiveScale; - private yScale: Abstract.QuantitiveScale; + private xScale: Abstract.QuantitativeScale; + private yScale: Abstract.QuantitativeScale; private xLinesContainer: D3.Selection; private yLinesContainer: D3.Selection; @@ -12,10 +12,10 @@ export module Component { * Creates a set of Gridlines. * @constructor * - * @param {QuantitiveScale} xScale The scale to base the x gridlines on. Pass null if no gridlines are desired. - * @param {QuantitiveScale} yScale The scale to base the y gridlines on. Pass null if no gridlines are desired. + * @param {QuantitativeScale} xScale The scale to base the x gridlines on. Pass null if no gridlines are desired. + * @param {QuantitativeScale} yScale The scale to base the y gridlines on. Pass null if no gridlines are desired. */ - constructor(xScale: Abstract.QuantitiveScale, yScale: Abstract.QuantitiveScale) { + constructor(xScale: Abstract.QuantitativeScale, yScale: Abstract.QuantitativeScale) { super(); if (xScale == null && yScale == null) {throw new Error("Gridlines must have at least one scale");} this.classed("gridlines", true); diff --git a/src/components/numericAxis.ts b/src/components/numericAxis.ts index 6bc4b4e3cf..32ea5f617d 100644 --- a/src/components/numericAxis.ts +++ b/src/components/numericAxis.ts @@ -3,7 +3,7 @@ module Plottable { export module Axis { export class Numeric extends Abstract.Axis { - public _scale: Abstract.QuantitiveScale; + public _scale: Abstract.QuantitativeScale; private tickLabelPositioning = "center"; // Whether or not first/last tick label will still be displayed even if // the label is cut off. @@ -14,11 +14,11 @@ export module Axis { * Creates a NumericAxis. * * @constructor - * @param {QuantitiveScale} scale The QuantitiveScale to base the NumericAxis on. - * @param {string} orientation The orientation of the QuantitiveScale (top/bottom/left/right) + * @param {QuantitativeScale} scale The QuantitativeScale to base the NumericAxis on. + * @param {string} orientation The orientation of the QuantitativeScale (top/bottom/left/right) * @param {Formatter} [formatter] A function to format tick labels. */ - constructor(scale: Abstract.QuantitiveScale, orientation: string, formatter?: any) { + constructor(scale: Abstract.QuantitativeScale, orientation: string, formatter?: any) { super(scale, orientation, formatter); } diff --git a/src/components/plots/abstractBarPlot.ts b/src/components/plots/abstractBarPlot.ts index 7fcc456311..53be2ad6ea 100644 --- a/src/components/plots/abstractBarPlot.ts +++ b/src/components/plots/abstractBarPlot.ts @@ -184,8 +184,8 @@ export module Abstract { } public _updateDomainer(scale: Scale) { - if (scale instanceof Abstract.QuantitiveScale) { - var qscale = scale; + if (scale instanceof Abstract.QuantitativeScale) { + var qscale = scale; if (!qscale._userSetDomainer) { if (this._baselineValue != null) { qscale.domainer() diff --git a/src/components/plots/areaPlot.ts b/src/components/plots/areaPlot.ts index 8659df311c..3a2155b73b 100644 --- a/src/components/plots/areaPlot.ts +++ b/src/components/plots/areaPlot.ts @@ -41,7 +41,7 @@ export module Plot { public _updateYDomainer(): Area { super._updateYDomainer(); - var scale = this.yScale; + var scale = this.yScale; var y0Projector = this._projectors["y0"]; var y0Accessor = y0Projector != null ? y0Projector.accessor : null; diff --git a/src/components/plots/horizontalBarPlot.ts b/src/components/plots/horizontalBarPlot.ts index 2c9f27fd91..5dc4aba6d7 100644 --- a/src/components/plots/horizontalBarPlot.ts +++ b/src/components/plots/horizontalBarPlot.ts @@ -10,10 +10,10 @@ export module Plot { * * @constructor * @param {IDataset} dataset The dataset to render. - * @param {QuantitiveScale} xScale The x scale to use. + * @param {QuantitativeScale} xScale The x scale to use. * @param {Scale} yScale The y scale to use. */ - constructor(dataset: any, xScale: Abstract.QuantitiveScale, yScale: Abstract.Scale) { + constructor(dataset: any, xScale: Abstract.QuantitativeScale, yScale: Abstract.Scale) { super(dataset, xScale, yScale); } diff --git a/src/components/plots/verticalBarPlot.ts b/src/components/plots/verticalBarPlot.ts index d60c700da1..5348793cf6 100644 --- a/src/components/plots/verticalBarPlot.ts +++ b/src/components/plots/verticalBarPlot.ts @@ -11,9 +11,9 @@ export module Plot { * @constructor * @param {IDataset} dataset The dataset to render. * @param {Scale} xScale The x scale to use. - * @param {QuantitiveScale} yScale The y scale to use. + * @param {QuantitativeScale} yScale The y scale to use. */ - constructor(dataset: any, xScale: Abstract.Scale, yScale: Abstract.QuantitiveScale) { + constructor(dataset: any, xScale: Abstract.Scale, yScale: Abstract.QuantitativeScale) { super(dataset, xScale, yScale); } diff --git a/src/components/plots/xyPlot.ts b/src/components/plots/xyPlot.ts index d74a549faf..0ad3582853 100644 --- a/src/components/plots/xyPlot.ts +++ b/src/components/plots/xyPlot.ts @@ -48,8 +48,8 @@ export module Abstract { } public _updateXDomainer(): XYPlot { - if (this.xScale instanceof QuantitiveScale) { - var scale = this.xScale; + if (this.xScale instanceof QuantitativeScale) { + var scale = this.xScale; if (!scale._userSetDomainer) { scale.domainer().pad().nice(); } @@ -58,8 +58,8 @@ export module Abstract { } public _updateYDomainer(): XYPlot { - if (this.yScale instanceof QuantitiveScale) { - var scale = this.yScale; + if (this.yScale instanceof QuantitativeScale) { + var scale = this.yScale; if (!scale._userSetDomainer) { scale.domainer().pad().nice(); } diff --git a/src/core/domainer.ts b/src/core/domainer.ts index 0a33b9083e..be425c9c0f 100644 --- a/src/core/domainer.ts +++ b/src/core/domainer.ts @@ -33,13 +33,13 @@ module Plottable { /** * @param {any[][]} extents The list of extents to be reduced to a single * extent. - * @param {Abstract.QuantitiveScale} scale + * @param {Abstract.QuantitativeScale} scale * Since nice() must do different things depending on Linear, Log, * or Time scale, the scale must be passed in for nice() to work. * @return {any[]} The domain, as a merging of all exents, as a [min, max] * pair. */ - public computeDomain(extents: any[][], scale: Abstract.QuantitiveScale): any[] { + public computeDomain(extents: any[][], scale: Abstract.QuantitativeScale): any[] { var domain: any[]; if (this.combineExtents != null) { domain = this.combineExtents(extents); @@ -170,7 +170,7 @@ module Plottable { } } - private padDomain(scale: Abstract.QuantitiveScale, domain: any[]): any[] { + private padDomain(scale: Abstract.QuantitativeScale, domain: any[]): any[] { var min = domain[0]; var max = domain[1]; if (min === max && this.padProportion > 0.0) { @@ -200,7 +200,7 @@ module Plottable { return [newMin, newMax]; } - private niceDomain(scale: Abstract.QuantitiveScale, domain: any[]): any[] { + private niceDomain(scale: Abstract.QuantitativeScale, domain: any[]): any[] { if (this.doNice) { return scale._niceDomain(domain, this.niceCount); } else { diff --git a/src/interactions/drag/dragInteraction.ts b/src/interactions/drag/dragInteraction.ts index 56aeab97ea..9eb30693c5 100644 --- a/src/interactions/drag/dragInteraction.ts +++ b/src/interactions/drag/dragInteraction.ts @@ -75,7 +75,7 @@ export module Interaction { return this; } - public setupZoomCallback(xScale?: Abstract.QuantitiveScale, yScale?: Abstract.QuantitiveScale) { + public setupZoomCallback(xScale?: Abstract.QuantitativeScale, yScale?: Abstract.QuantitativeScale) { var xDomainOriginal = xScale != null ? xScale.domain() : null; var yDomainOriginal = yScale != null ? yScale.domain() : null; var resetOnNextClick = false; diff --git a/src/interactions/panZoomInteraction.ts b/src/interactions/panZoomInteraction.ts index 54d7f7d58e..fbef4ee0ed 100644 --- a/src/interactions/panZoomInteraction.ts +++ b/src/interactions/panZoomInteraction.ts @@ -4,18 +4,18 @@ module Plottable { export module Interaction { export class PanZoom extends Abstract.Interaction { private zoom: D3.Behavior.Zoom; - public xScale: Abstract.QuantitiveScale; - public yScale: Abstract.QuantitiveScale; + public xScale: Abstract.QuantitativeScale; + public yScale: Abstract.QuantitativeScale; /** * Creates a PanZoomInteraction. * * @constructor * @param {Component} componentToListenTo The component to listen for interactions on. - * @param {QuantitiveScale} xScale The X scale to update on panning/zooming. - * @param {QuantitiveScale} yScale The Y scale to update on panning/zooming. + * @param {QuantitativeScale} xScale The X scale to update on panning/zooming. + * @param {QuantitativeScale} yScale The Y scale to update on panning/zooming. */ - constructor(componentToListenTo: Abstract.Component, xScale: Abstract.QuantitiveScale, yScale: Abstract.QuantitiveScale) { + constructor(componentToListenTo: Abstract.Component, xScale: Abstract.QuantitativeScale, yScale: Abstract.QuantitativeScale) { super(componentToListenTo); if (xScale == null || yScale == null) {throw new Error("panZoomInteractions require an xScale and yScale");} this.xScale = xScale; diff --git a/src/reference.ts b/src/reference.ts index 8588f1103a..bb81efe091 100644 --- a/src/reference.ts +++ b/src/reference.ts @@ -34,7 +34,7 @@ /// /// -/// +/// /// /// /// diff --git a/src/scales/interpolatedColorScale.ts b/src/scales/interpolatedColorScale.ts index 00c0bf1c89..d2f9a2251e 100644 --- a/src/scales/interpolatedColorScale.ts +++ b/src/scales/interpolatedColorScale.ts @@ -6,7 +6,7 @@ export module Scale { [key: string]: string[]; }; - export class InterpolatedColor extends Abstract.QuantitiveScale { + export class InterpolatedColor extends Abstract.QuantitativeScale { private static COLOR_SCALES: ColorGroups = { reds : [ "#FFFFFF", // white @@ -58,7 +58,7 @@ export module Scale { * values in hex ("#FFFFFF") or keywords ("white"). * @param {string} scaleType a string representing the underlying scale * type (linear/log/sqrt/pow) - * @returns a quantitive d3 scale. + * @returns a Quantitative d3 scale. */ private static getD3InterpolatedScale(colors: string[], scaleType: string): D3.Scale.QuantitiveScale { var scale: D3.Scale.QuantitiveScale; @@ -77,7 +77,7 @@ export module Scale { break; } if (scale == null){ - throw new Error("unknown quantitive scale type " + scaleType); + throw new Error("unknown Quantitative scale type " + scaleType); } return scale .range([0, 1]) @@ -200,7 +200,7 @@ export module Scale { } public autoDomain() { - // unlike other QuantitiveScales, interpolatedColorScale ignores its domainer + // unlike other QuantitativeScales, interpolatedColorScale ignores its domainer var extents = this._getAllExtents(); if (extents.length > 0) { this._setDomain([d3.min(extents, (x) => x[0]), d3.max(extents, (x) => x[1])]); diff --git a/src/scales/linearScale.ts b/src/scales/linearScale.ts index ad1f1b010b..7d2dd332f7 100644 --- a/src/scales/linearScale.ts +++ b/src/scales/linearScale.ts @@ -2,7 +2,7 @@ module Plottable { export module Scale { - export class Linear extends Abstract.QuantitiveScale { + export class Linear extends Abstract.QuantitativeScale { /** * Creates a new LinearScale. diff --git a/src/scales/logScale.ts b/src/scales/logScale.ts index 0c5751571a..31477ad6d8 100644 --- a/src/scales/logScale.ts +++ b/src/scales/logScale.ts @@ -2,7 +2,7 @@ module Plottable { export module Scale { - export class Log extends Abstract.QuantitiveScale { + export class Log extends Abstract.QuantitativeScale { /** * Creates a new Scale.Log. diff --git a/src/scales/modifiedLogScale.ts b/src/scales/modifiedLogScale.ts index 087d445035..ac9c1b1e56 100644 --- a/src/scales/modifiedLogScale.ts +++ b/src/scales/modifiedLogScale.ts @@ -2,7 +2,7 @@ module Plottable { export module Scale { - export class ModifiedLog extends Abstract.QuantitiveScale { + export class ModifiedLog extends Abstract.QuantitativeScale { private base: number; private pivot: number; private untransformedDomain: number[]; diff --git a/src/scales/quantitiveScale.ts b/src/scales/quantitativeScale.ts similarity index 74% rename from src/scales/quantitiveScale.ts rename to src/scales/quantitativeScale.ts index 3aa48f9e60..bf4da51ae9 100644 --- a/src/scales/quantitiveScale.ts +++ b/src/scales/quantitativeScale.ts @@ -2,7 +2,7 @@ module Plottable { export module Abstract { - export class QuantitiveScale extends Scale { + export class QuantitativeScale extends Scale { public _d3Scale: D3.Scale.QuantitiveScale; public _lastRequestedTickCount = 10; public _PADDING_FOR_IDENTICAL_DOMAIN = 1; @@ -10,10 +10,10 @@ export module Abstract { private _domainer: Domainer = new Domainer(); /** - * Creates a new QuantitiveScale. + * Creates a new QuantitativeScale. * * @constructor - * @param {D3.Scale.QuantitiveScale} scale The D3 QuantitiveScale backing the QuantitiveScale. + * @param {D3.Scale.QuantitiveScale} scale The D3 QuantitativeScale backing the QuantitativeScale. */ constructor(scale: D3.Scale.QuantitiveScale) { super(scale); @@ -34,16 +34,16 @@ export module Abstract { } /** - * Creates a copy of the QuantitiveScale with the same domain and range but without any registered listeners. + * Creates a copy of the QuantitativeScale with the same domain and range but without any registered listeners. * - * @returns {QuantitiveScale} A copy of the calling QuantitiveScale. + * @returns {QuantitativeScale} A copy of the calling QuantitativeScale. */ - public copy(): QuantitiveScale { - return new QuantitiveScale(this._d3Scale.copy()); + public copy(): QuantitativeScale { + return new QuantitativeScale(this._d3Scale.copy()); } public domain(): any[]; - public domain(values: any[]): QuantitiveScale; + public domain(values: any[]): QuantitativeScale; public domain(values?: any[]): any { return super.domain(values); // need to override type sig to enable method chaining :/ } @@ -51,20 +51,20 @@ export module Abstract { public _setDomain(values: any[]) { var isNaNOrInfinity = (x: any) => x !== x || x === Infinity || x === -Infinity; if (isNaNOrInfinity(values[0]) || isNaNOrInfinity(values[1])) { - Util.Methods.warn("Warning: QuantitiveScales cannot take NaN or Infinity as a domain value. Ignoring."); + Util.Methods.warn("Warning: QuantitativeScales cannot take NaN or Infinity as a domain value. Ignoring."); return; } super._setDomain(values); } /** - * Sets or gets the QuantitiveScale's output interpolator + * Sets or gets the QuantitativeScale's output interpolator * * @param {D3.Transition.Interpolate} [factory] The output interpolator to use. - * @returns {D3.Transition.Interpolate|QuantitiveScale} The current output interpolator, or the calling QuantitiveScale. + * @returns {D3.Transition.Interpolate|QuantitativeScale} The current output interpolator, or the calling QuantitativeScale. */ public interpolate(): D3.Transition.Interpolate; - public interpolate(factory: D3.Transition.Interpolate): QuantitiveScale; + public interpolate(factory: D3.Transition.Interpolate): QuantitativeScale; public interpolate(factory?: D3.Transition.Interpolate): any { if (factory == null) { return this._d3Scale.interpolate(); @@ -74,7 +74,7 @@ export module Abstract { } /** - * Sets the range of the QuantitiveScale and sets the interpolator to d3.interpolateRound. + * Sets the range of the QuantitativeScale and sets the interpolator to d3.interpolateRound. * * @param {number[]} values The new range value for the range. */ @@ -84,18 +84,18 @@ export module Abstract { } /** - * Gets the clamp status of the QuantitiveScale (whether to cut off values outside the ouput range). + * Gets the clamp status of the QuantitativeScale (whether to cut off values outside the ouput range). * * @returns {boolean} The current clamp status. */ public clamp(): boolean; /** - * Sets the clamp status of the QuantitiveScale (whether to cut off values outside the ouput range). + * Sets the clamp status of the QuantitativeScale (whether to cut off values outside the ouput range). * - * @param {boolean} clamp Whether or not to clamp the QuantitiveScale. - * @returns {QuantitiveScale} The calling QuantitiveScale. + * @param {boolean} clamp Whether or not to clamp the QuantitativeScale. + * @returns {QuantitativeScale} The calling QuantitativeScale. */ - public clamp(clamp: boolean): QuantitiveScale; + public clamp(clamp: boolean): QuantitativeScale; public clamp(clamp?: boolean): any { if (clamp == null) { return this._d3Scale.clamp(); @@ -140,7 +140,7 @@ export module Abstract { * Retrieve a Domainer of a scale. A Domainer is responsible for combining * multiple extents into a single domain. * - * @return {QuantitiveScale} The scale's current domainer. + * @return {QuantitativeScale} The scale's current domainer. */ public domainer(): Domainer; /** @@ -152,9 +152,9 @@ export module Abstract { * includes 0, etc., will be the responsability of the new domainer. * * @param {Domainer} domainer The domainer to be set. - * @return {QuantitiveScale} The calling scale. + * @return {QuantitativeScale} The calling scale. */ - public domainer(domainer: Domainer): QuantitiveScale; + public domainer(domainer: Domainer): QuantitativeScale; public domainer(domainer?: Domainer): any { if (domainer == null) { return this._domainer; diff --git a/src/scales/timeScale.ts b/src/scales/timeScale.ts index 03b0779d75..8d8e49ac5e 100644 --- a/src/scales/timeScale.ts +++ b/src/scales/timeScale.ts @@ -2,7 +2,7 @@ module Plottable { export module Scale { - export class Time extends Abstract.QuantitiveScale { + export class Time extends Abstract.QuantitativeScale { public _PADDING_FOR_IDENTICAL_DOMAIN = 1000 * 60 * 60 * 24; /** @@ -14,7 +14,7 @@ export module Scale { constructor(); constructor(scale: D3.Scale.LinearScale); constructor(scale?: any) { - // need to cast since d3 time scales do not descend from quantitive scales + // need to cast since d3 time scales do not descend from Quantitative scales super(scale == null ? (d3.time.scale()) : scale); } diff --git a/test/interactions/interactionTests.ts b/test/interactions/interactionTests.ts index 07380a9185..440a349074 100644 --- a/test/interactions/interactionTests.ts +++ b/test/interactions/interactionTests.ts @@ -83,8 +83,8 @@ describe("Interactions", () => { var svgHeight = 400; var svg: D3.Selection; var dataset: Plottable.DataSource; - var xScale: Plottable.Abstract.QuantitiveScale; - var yScale: Plottable.Abstract.QuantitiveScale; + var xScale: Plottable.Abstract.QuantitativeScale; + var yScale: Plottable.Abstract.QuantitativeScale; var renderer: Plottable.Abstract.XYPlot; var interaction: Plottable.Interaction.XYDragBox; @@ -162,8 +162,8 @@ describe("Interactions", () => { var svgHeight = 400; var svg: D3.Selection; var dataset: Plottable.DataSource; - var xScale: Plottable.Abstract.QuantitiveScale; - var yScale: Plottable.Abstract.QuantitiveScale; + var xScale: Plottable.Abstract.QuantitativeScale; + var yScale: Plottable.Abstract.QuantitativeScale; var renderer: Plottable.Abstract.XYPlot; var interaction: Plottable.Interaction.XYDragBox; diff --git a/test/scales/scaleTests.ts b/test/scales/scaleTests.ts index d29a29887f..1c4a5639e0 100644 --- a/test/scales/scaleTests.ts +++ b/test/scales/scaleTests.ts @@ -129,7 +129,7 @@ describe("Scales", () => { }); }); - describe("Quantitive Scales", () => { + describe("Quantitative Scales", () => { it("autorange defaults to [0, 1] if no perspectives set", () => { var scale = new Plottable.Scale.Linear(); scale.autoDomain(); diff --git a/test/tests.js b/test/tests.js index 5922ab1937..903717ec16 100644 --- a/test/tests.js +++ b/test/tests.js @@ -3685,7 +3685,7 @@ describe("Scales", function () { }); }); - describe("Quantitive Scales", function () { + describe("Quantitative Scales", function () { it("autorange defaults to [0, 1] if no perspectives set", function () { var scale = new Plottable.Scale.Linear(); scale.autoDomain();