Skip to content

Commit

Permalink
Rename QuantitiveScale to QuantitativeScale, in accordance with commo…
Browse files Browse the repository at this point in the history
…n usage of the english language

Close #711
  • Loading branch information
teamdandelion committed Jul 28, 2014
1 parent d527597 commit 3d8be60
Show file tree
Hide file tree
Showing 23 changed files with 204 additions and 204 deletions.
24 changes: 12 additions & 12 deletions examples/component_example_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -111,16 +111,16 @@ 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);
}

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]);
Expand All @@ -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]);
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand Down Expand Up @@ -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]);
Expand All @@ -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]);
Expand Down
86 changes: 43 additions & 43 deletions plottable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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);
/**
Expand All @@ -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.
*
Expand All @@ -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;
/**
Expand All @@ -1363,17 +1363,17 @@ 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;
}
}
}


declare module Plottable {
module Scale {
class Linear extends Abstract.QuantitiveScale {
class Linear extends Abstract.QuantitativeScale {
/**
* Creates a new LinearScale.
*
Expand All @@ -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.
*
Expand All @@ -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.
*
Expand Down Expand Up @@ -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.
*
Expand All @@ -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.
*
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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);
}
}
}
Expand All @@ -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);
}
}
}
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -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;
}
}
}
Expand Down
Loading

0 comments on commit 3d8be60

Please sign in to comment.