diff --git a/plottable.d.ts b/plottable.d.ts index a469e939cf..37b4f62c8f 100644 --- a/plottable.d.ts +++ b/plottable.d.ts @@ -2056,7 +2056,7 @@ declare module Plottable.Axes { * @param {boolean} The new text width approximation setting. * @returns {Axes.Numeric} The calling Axes.Numeric. */ - usesTextWidthApproximation(enable: boolean): Axes.Numeric; + usesTextWidthApproximation(enable: boolean): this; private _hideEndTickLabels(); private _hideOverflowingTickLabels(); private _hideOverlappingTickLabels(); @@ -2799,7 +2799,7 @@ declare module Plottable { * @param {number|string|Accessor|Accessor} attrValue * @returns {Plot} The calling Plot. */ - attr(attr: string, attrValue: number | string | Accessor | Accessor): Plot; + attr(attr: string, attrValue: number | string | Accessor | Accessor): this; /** * Sets a particular attribute to a scaled constant value or scaled result of an Accessor. * The provided Scale will account for the attribute values when autoDomain()-ing. @@ -2809,7 +2809,7 @@ declare module Plottable { * @param {Scale} scale The Scale used to scale the attrValue. * @returns {Plot} The calling Plot. */ - attr(attr: string, attrValue: A | Accessor, scale: Scale): Plot; + attr(attr: string, attrValue: A | Accessor, scale: Scale): this; protected _bindProperty(property: string, value: any, scale: Scale): void; private _bindAttr(attr, value, scale); protected _generateAttrToProjector(): AttributeToProjector; @@ -2821,7 +2821,7 @@ declare module Plottable { /** * Enables or disables animation. */ - animated(willAnimate: boolean): Plot; + animated(willAnimate: boolean): this; detach(): this; /** * @returns {Scale[]} A unique array of all scales currently used by the Plot. @@ -2952,7 +2952,7 @@ declare module Plottable.Plots { * @param {number|Accessor} sectorValue * @returns {Pie} The calling Pie Plot. */ - sectorValue(sectorValue: number | Accessor): Plots.Pie; + sectorValue(sectorValue: number | Accessor): this; /** * Sets the sector value to a scaled constant value or scaled result of an Accessor. * The provided Scale will account for the values when autoDomain()-ing. @@ -2961,7 +2961,7 @@ declare module Plottable.Plots { * @param {Scale} scale * @returns {Pie} The calling Pie Plot. */ - sectorValue(sectorValue: S | Accessor, scale: Scale): Plots.Pie; + sectorValue(sectorValue: S | Accessor, scale: Scale): this; /** * Gets the AccessorScaleBinding for the inner radius. */ @@ -2972,7 +2972,7 @@ declare module Plottable.Plots { * @param {number|Accessor} innerRadius * @returns {Pie} The calling Pie Plot. */ - innerRadius(innerRadius: number | Accessor): Plots.Pie; + innerRadius(innerRadius: number | Accessor): any; /** * Sets the inner radius to a scaled constant value or scaled result of an Accessor. * The provided Scale will account for the values when autoDomain()-ing. @@ -2981,7 +2981,7 @@ declare module Plottable.Plots { * @param {Scale} scale * @returns {Pie} The calling Pie Plot. */ - innerRadius(innerRadius: R | Accessor, scale: Scale): Plots.Pie; + innerRadius(innerRadius: R | Accessor, scale: Scale): any; /** * Gets the AccessorScaleBinding for the outer radius. */ @@ -2992,7 +2992,7 @@ declare module Plottable.Plots { * @param {number|Accessor} outerRadius * @returns {Pie} The calling Pie Plot. */ - outerRadius(outerRadius: number | Accessor): Plots.Pie; + outerRadius(outerRadius: number | Accessor): this; /** * Sets the outer radius to a scaled constant value or scaled result of an Accessor. * The provided Scale will account for the values when autoDomain()-ing. @@ -3001,7 +3001,7 @@ declare module Plottable.Plots { * @param {Scale} scale * @returns {Pie} The calling Pie Plot. */ - outerRadius(outerRadius: R | Accessor, scale: Scale): Plots.Pie; + outerRadius(outerRadius: R | Accessor, scale: Scale): this; /** * Get whether slice labels are enabled. * @@ -3327,7 +3327,7 @@ declare module Plottable.Plots { * @param {number|Accessor} size * @returns {Plots.Scatter} The calling Scatter Plot. */ - size(size: number | Accessor): Plots.Scatter; + size(size: number | Accessor): this; /** * Sets the size property to a scaled constant value or scaled result of an Accessor. * The provided Scale will account for the values when autoDomain()-ing. @@ -3336,7 +3336,7 @@ declare module Plottable.Plots { * @param {Scale} scale * @returns {Plots.Scatter} The calling Scatter Plot. */ - size(size: S | Accessor, scale: Scale): Plots.Scatter; + size(size: S | Accessor, scale: Scale): this; /** * Gets the AccessorScaleBinding for the symbol property of the plot. * The symbol property corresponds to how the symbol will be drawn. @@ -3348,7 +3348,7 @@ declare module Plottable.Plots { * @param {Accessor} symbol * @returns {Plots.Scatter} The calling Scatter Plot. */ - symbol(symbol: Accessor): Plots.Scatter; + symbol(symbol: Accessor): this; protected _generateDrawSteps(): Drawers.DrawStep[]; /** * @deprecated As of release v1.1.0, replaced by _entityVisibleOnPlot() @@ -3565,7 +3565,7 @@ declare module Plottable.Plots { * Smooth autoranging is done by making sure lines always exit on the left / right side of the plot * and deactivating the nice domain feature on the scales */ - autorangeSmooth(autorangeSmooth: boolean): Plots.Line; + autorangeSmooth(autorangeSmooth: boolean): this; private _setScaleSnapping(); /** * Gets the interpolation function associated with the plot. @@ -3579,7 +3579,7 @@ declare module Plottable.Plots { * @param {string | points: Array<[number, number]>) => string} interpolator Interpolation function * @return Plots.Line */ - interpolator(interpolator: string | ((points: Array<[number, number]>) => string)): Plots.Line; + interpolator(interpolator: string | ((points: Array<[number, number]>) => string)): this; interpolator(interpolator: "linear"): this; interpolator(interpolator: "linear-closed"): this; interpolator(interpolator: "step"): this; @@ -3600,11 +3600,11 @@ declare module Plottable.Plots { */ downsamplingEnabled(): boolean; /** - * Sets if downsampling is enabled + * Sets if downsampling is enabled * * @returns {Plots.Line} The calling Plots.Line */ - downsamplingEnabled(downsampling: boolean): Plots.Line; + downsamplingEnabled(downsampling: boolean): this; /** * Gets if croppedRendering is enabled * @@ -3616,7 +3616,7 @@ declare module Plottable.Plots { * * @returns {Plots.Line} The calling Plots.Line */ - croppedRenderingEnabled(croppedRendering: boolean): Plots.Line; + croppedRenderingEnabled(croppedRendering: boolean): this; protected _createDrawer(dataset: Dataset): Drawer; protected _extentsForProperty(property: string): any[]; private _getEdgeIntersectionPoints(); @@ -3733,7 +3733,7 @@ declare module Plottable.Plots { * For now, downsampling is always disabled in stacked area plot * @returns {Plots.StackedArea} The calling Plots.StackedArea */ - downsamplingEnabled(downsampling: boolean): Plots.Line; + downsamplingEnabled(downsampling: boolean): this; protected _additionalPaint(): void; protected _updateYScale(): void; protected _onDatasetUpdate(): this; @@ -4642,7 +4642,7 @@ declare module Plottable.Interactions { * * @returns {Interactions.PanZoom} The calling PanZoom Interaction. */ - xScales(xScales: QuantitativeScale[]): Interactions.PanZoom; + xScales(xScales: QuantitativeScale[]): this; /** * Gets the y scales for this PanZoom Interaction. */ @@ -4652,7 +4652,7 @@ declare module Plottable.Interactions { * * @returns {Interactions.PanZoom} The calling PanZoom Interaction. */ - yScales(yScales: QuantitativeScale[]): Interactions.PanZoom; + yScales(yScales: QuantitativeScale[]): this; /** * Adds an x scale to this PanZoom Interaction * @@ -4701,7 +4701,7 @@ declare module Plottable.Interactions { * @param {D} minDomainExtent The minimum domain extent for the scale. * @returns {Interactions.PanZoom} The calling PanZoom Interaction. */ - minDomainExtent(quantitativeScale: QuantitativeScale, minDomainExtent: D): Interactions.PanZoom; + minDomainExtent(quantitativeScale: QuantitativeScale, minDomainExtent: D): this; /** * Gets the maximum domain extent for the scale, specifying the maximum allowable amount * between the ends of the domain. @@ -4722,7 +4722,7 @@ declare module Plottable.Interactions { * @param {D} minDomainExtent The maximum domain extent for the scale. * @returns {Interactions.PanZoom} The calling PanZoom Interaction. */ - maxDomainExtent(quantitativeScale: QuantitativeScale, maxDomainExtent: D): Interactions.PanZoom; + maxDomainExtent(quantitativeScale: QuantitativeScale, maxDomainExtent: D): this; } } declare module Plottable { diff --git a/src/axes/numericAxis.ts b/src/axes/numericAxis.ts index 07f7fba3c4..dcac7157bc 100644 --- a/src/axes/numericAxis.ts +++ b/src/axes/numericAxis.ts @@ -290,7 +290,7 @@ module Plottable.Axes { * @param {boolean} The new text width approximation setting. * @returns {Axes.Numeric} The calling Axes.Numeric. */ - public usesTextWidthApproximation(enable: boolean): Axes.Numeric; + public usesTextWidthApproximation(enable: boolean): this; public usesTextWidthApproximation(enable?: boolean): any { if (enable == null) { return this._usesTextWidthApproximation; diff --git a/src/interactions/panZoomInteraction.ts b/src/interactions/panZoomInteraction.ts index 7ca23e5908..7eca4ef8f2 100644 --- a/src/interactions/panZoomInteraction.ts +++ b/src/interactions/panZoomInteraction.ts @@ -258,7 +258,7 @@ module Plottable.Interactions { * * @returns {Interactions.PanZoom} The calling PanZoom Interaction. */ - public xScales(xScales: QuantitativeScale[]): Interactions.PanZoom; + public xScales(xScales: QuantitativeScale[]): this; public xScales(xScales?: QuantitativeScale[]): any { if (xScales == null) { let scales: QuantitativeScale[] = []; @@ -283,7 +283,7 @@ module Plottable.Interactions { * * @returns {Interactions.PanZoom} The calling PanZoom Interaction. */ - public yScales(yScales: QuantitativeScale[]): Interactions.PanZoom; + public yScales(yScales: QuantitativeScale[]): this; public yScales(yScales?: QuantitativeScale[]): any { if (yScales == null) { let scales: QuantitativeScale[] = []; @@ -367,7 +367,7 @@ module Plottable.Interactions { * @param {D} minDomainExtent The minimum domain extent for the scale. * @returns {Interactions.PanZoom} The calling PanZoom Interaction. */ - public minDomainExtent(quantitativeScale: QuantitativeScale, minDomainExtent: D): Interactions.PanZoom; + public minDomainExtent(quantitativeScale: QuantitativeScale, minDomainExtent: D): this; public minDomainExtent(quantitativeScale: QuantitativeScale, minDomainExtent?: D): any { if (minDomainExtent == null) { return this._minDomainExtents.get(quantitativeScale); @@ -406,7 +406,7 @@ module Plottable.Interactions { * @param {D} minDomainExtent The maximum domain extent for the scale. * @returns {Interactions.PanZoom} The calling PanZoom Interaction. */ - public maxDomainExtent(quantitativeScale: QuantitativeScale, maxDomainExtent: D): Interactions.PanZoom; + public maxDomainExtent(quantitativeScale: QuantitativeScale, maxDomainExtent: D): this; public maxDomainExtent(quantitativeScale: QuantitativeScale, maxDomainExtent?: D): any { if (maxDomainExtent == null) { return this._maxDomainExtents.get(quantitativeScale); diff --git a/src/plots/linePlot.ts b/src/plots/linePlot.ts index 51c22954fb..bf84df9ef4 100644 --- a/src/plots/linePlot.ts +++ b/src/plots/linePlot.ts @@ -83,7 +83,7 @@ module Plottable.Plots { * Smooth autoranging is done by making sure lines always exit on the left / right side of the plot * and deactivating the nice domain feature on the scales */ - public autorangeSmooth(autorangeSmooth: boolean): Plots.Line; + public autorangeSmooth(autorangeSmooth: boolean): this; public autorangeSmooth(autorangeSmooth?: boolean): any { if (autorangeSmooth == null) { return this._autorangeSmooth; @@ -115,7 +115,7 @@ module Plottable.Plots { * @param {string | points: Array<[number, number]>) => string} interpolator Interpolation function * @return Plots.Line */ - public interpolator(interpolator: string | ((points: Array<[number, number]>) => string)): Plots.Line; + public interpolator(interpolator: string | ((points: Array<[number, number]>) => string)): this; public interpolator(interpolator: "linear"): this; public interpolator(interpolator: "linear-closed"): this; public interpolator(interpolator: "step"): this; @@ -144,11 +144,11 @@ module Plottable.Plots { */ public downsamplingEnabled(): boolean; /** - * Sets if downsampling is enabled + * Sets if downsampling is enabled * * @returns {Plots.Line} The calling Plots.Line */ - public downsamplingEnabled(downsampling: boolean): Plots.Line; + public downsamplingEnabled(downsampling: boolean): this; public downsamplingEnabled(downsampling?: boolean): any { if (downsampling == null) { return this._downsamplingEnabled; @@ -168,7 +168,7 @@ module Plottable.Plots { * * @returns {Plots.Line} The calling Plots.Line */ - public croppedRenderingEnabled(croppedRendering: boolean): Plots.Line; + public croppedRenderingEnabled(croppedRendering: boolean): this; public croppedRenderingEnabled(croppedRendering?: boolean): any { if (croppedRendering == null) { return this._croppedRenderingEnabled; diff --git a/src/plots/piePlot.ts b/src/plots/piePlot.ts index 71ffee5a0e..071df24c37 100644 --- a/src/plots/piePlot.ts +++ b/src/plots/piePlot.ts @@ -120,7 +120,7 @@ module Plottable.Plots { * @param {number|Accessor} sectorValue * @returns {Pie} The calling Pie Plot. */ - public sectorValue(sectorValue: number | Accessor): Plots.Pie; + public sectorValue(sectorValue: number | Accessor): this; /** * Sets the sector value to a scaled constant value or scaled result of an Accessor. * The provided Scale will account for the values when autoDomain()-ing. @@ -129,7 +129,7 @@ module Plottable.Plots { * @param {Scale} scale * @returns {Pie} The calling Pie Plot. */ - public sectorValue(sectorValue: S | Accessor, scale: Scale): Plots.Pie; + public sectorValue(sectorValue: S | Accessor, scale: Scale): this; public sectorValue(sectorValue?: number | Accessor | S | Accessor, scale?: Scale): any { if (sectorValue == null) { return this._propertyBindings.get(Pie._SECTOR_VALUE_KEY); @@ -150,7 +150,7 @@ module Plottable.Plots { * @param {number|Accessor} innerRadius * @returns {Pie} The calling Pie Plot. */ - public innerRadius(innerRadius: number | Accessor): Plots.Pie; + public innerRadius(innerRadius: number | Accessor): any; /** * Sets the inner radius to a scaled constant value or scaled result of an Accessor. * The provided Scale will account for the values when autoDomain()-ing. @@ -159,7 +159,7 @@ module Plottable.Plots { * @param {Scale} scale * @returns {Pie} The calling Pie Plot. */ - public innerRadius(innerRadius: R | Accessor, scale: Scale): Plots.Pie; + public innerRadius(innerRadius: R | Accessor, scale: Scale): any; public innerRadius(innerRadius?: number | Accessor | R | Accessor, scale?: Scale): any { if (innerRadius == null) { return this._propertyBindings.get(Pie._INNER_RADIUS_KEY); @@ -179,7 +179,7 @@ module Plottable.Plots { * @param {number|Accessor} outerRadius * @returns {Pie} The calling Pie Plot. */ - public outerRadius(outerRadius: number | Accessor): Plots.Pie; + public outerRadius(outerRadius: number | Accessor): this; /** * Sets the outer radius to a scaled constant value or scaled result of an Accessor. * The provided Scale will account for the values when autoDomain()-ing. @@ -188,7 +188,7 @@ module Plottable.Plots { * @param {Scale} scale * @returns {Pie} The calling Pie Plot. */ - public outerRadius(outerRadius: R | Accessor, scale: Scale): Plots.Pie; + public outerRadius(outerRadius: R | Accessor, scale: Scale): this; public outerRadius(outerRadius?: number | Accessor | R | Accessor, scale?: Scale): any { if (outerRadius == null) { return this._propertyBindings.get(Pie._OUTER_RADIUS_KEY); diff --git a/src/plots/plot.ts b/src/plots/plot.ts index 686fd75536..9924fb9ee8 100644 --- a/src/plots/plot.ts +++ b/src/plots/plot.ts @@ -130,7 +130,7 @@ export class Plot extends Component { * @param {number|string|Accessor|Accessor} attrValue * @returns {Plot} The calling Plot. */ - public attr(attr: string, attrValue: number | string | Accessor | Accessor): Plot; + public attr(attr: string, attrValue: number | string | Accessor | Accessor): this; /** * Sets a particular attribute to a scaled constant value or scaled result of an Accessor. * The provided Scale will account for the attribute values when autoDomain()-ing. @@ -140,7 +140,7 @@ export class Plot extends Component { * @param {Scale} scale The Scale used to scale the attrValue. * @returns {Plot} The calling Plot. */ - public attr(attr: string, attrValue: A | Accessor, scale: Scale): Plot; + public attr(attr: string, attrValue: A | Accessor, scale: Scale): this; public attr(attr: string, attrValue?: number | string | Accessor | Accessor | A | Accessor, scale?: Scale): any { if (attrValue == null) { @@ -214,7 +214,7 @@ export class Plot extends Component { /** * Enables or disables animation. */ - public animated(willAnimate: boolean): Plot; + public animated(willAnimate: boolean): this; public animated(willAnimate?: boolean): any { if (willAnimate == null) { return this._animate; diff --git a/src/plots/scatterPlot.ts b/src/plots/scatterPlot.ts index 24d7891c2a..79380a4d4b 100644 --- a/src/plots/scatterPlot.ts +++ b/src/plots/scatterPlot.ts @@ -38,7 +38,7 @@ module Plottable.Plots { * @param {number|Accessor} size * @returns {Plots.Scatter} The calling Scatter Plot. */ - public size(size: number | Accessor): Plots.Scatter; + public size(size: number | Accessor): this; /** * Sets the size property to a scaled constant value or scaled result of an Accessor. * The provided Scale will account for the values when autoDomain()-ing. @@ -47,7 +47,7 @@ module Plottable.Plots { * @param {Scale} scale * @returns {Plots.Scatter} The calling Scatter Plot. */ - public size(size: S | Accessor, scale: Scale): Plots.Scatter; + public size(size: S | Accessor, scale: Scale): this; public size(size?: number | Accessor | S | Accessor, scale?: Scale): any { if (size == null) { return this._propertyBindings.get(Scatter._SIZE_KEY); @@ -68,7 +68,7 @@ module Plottable.Plots { * @param {Accessor} symbol * @returns {Plots.Scatter} The calling Scatter Plot. */ - public symbol(symbol: Accessor): Plots.Scatter; + public symbol(symbol: Accessor): this; public symbol(symbol?: Accessor): any { if (symbol == null) { return this._propertyBindings.get(Scatter._SYMBOL_KEY); diff --git a/src/plots/stackedAreaPlot.ts b/src/plots/stackedAreaPlot.ts index 428315526d..e12e982865 100644 --- a/src/plots/stackedAreaPlot.ts +++ b/src/plots/stackedAreaPlot.ts @@ -76,7 +76,7 @@ module Plottable.Plots { * For now, downsampling is always disabled in stacked area plot * @returns {Plots.StackedArea} The calling Plots.StackedArea */ - public downsamplingEnabled(downsampling: boolean): Plots.Line; + public downsamplingEnabled(downsampling: boolean): this; public downsamplingEnabled(downsampling?: boolean): any { if (downsampling == null) { return super.downsamplingEnabled();