/** * Copyright 2014-present Palantir Technologies * @license MIT */ import { Dataset } from "../core/dataset"; import { IAccessor, IRangeProjector, Point } from "../core/interfaces"; import { Scale } from "../scales/scale"; import * as Utils from "../utils"; import { ITransformableAccessorScaleBinding } from "./commons"; import { Plot } from "./plot"; export declare class XYPlot extends Plot { protected static _X_KEY: string; protected static _Y_KEY: string; private _autoAdjustXScaleDomain; private _autoAdjustYScaleDomain; private _adjustYDomainOnChangeFromXCallback; private _adjustXDomainOnChangeFromYCallback; private _deferredRendering; private _deferredRenderer; /** * An XYPlot is a Plot that displays data along two primary directions, X and Y. * * @constructor * @param {Scale} xScale The x scale to use. * @param {Scale} yScale The y scale to use. */ constructor(); render(): this; /** * Returns the whether or not the rendering is deferred for performance boost. * * @return {boolean} The deferred rendering option */ deferredRendering(): boolean; /** * Sets / unsets the deferred rendering option Activating this option improves * the performance of plot interaction (pan / zoom) by performing lazy * renders, only after the interaction has stopped. Because re-rendering is no * longer performed during the interaction, the zooming might experience a * small resolution degradation, before the lazy re-render is performed. * * This option is intended for cases where performance is an issue. */ deferredRendering(deferredRendering: boolean): this; /** * Gets the TransformableAccessorScaleBinding for X. */ x(): ITransformableAccessorScaleBinding; /** * Sets X to a constant number or the result of an Accessor. * * @param {number|Accessor} x * @returns {XYPlot} The calling XYPlot. */ x(x: number | IAccessor): this; /** * Sets X to a scaled constant value or scaled result of an Accessor. * The provided Scale will account for the values when autoDomain()-ing. * * @param {X|Accessor} x * @param {Scale} xScale * @returns {XYPlot} The calling XYPlot. */ x(x: X | IAccessor, xScale: Scale, postScale?: IRangeProjector): this; /** * Gets the AccessorScaleBinding for Y. */ y(): ITransformableAccessorScaleBinding; /** * Sets Y to a constant number or the result of an Accessor. * * @param {number|Accessor} y * @returns {XYPlot} The calling XYPlot. */ y(y: number | IAccessor): this; /** * Sets Y to a scaled constant value or scaled result of an Accessor. * The provided Scale will account for the values when autoDomain()-ing. * * @param {Y|Accessor} y * @param {Scale} yScale * @returns {XYPlot} The calling XYPlot. */ y(y: Y | IAccessor, yScale: Scale, postScale?: IRangeProjector): this; protected _filterForProperty(property: string): IAccessor; private _makeFilterByProperty(property); private _applyDeferredRenderingTransform; protected _uninstallScaleForKey(scale: Scale, key: string): void; protected _installScaleForKey(scale: Scale, key: string): void; destroy(): this; /** * Gets the automatic domain adjustment mode for visible points. */ autorangeMode(): string; /** * Sets the automatic domain adjustment mode for visible points to operate against the X Scale, Y Scale, or neither. * If "x" or "y" is specified the adjustment is immediately performed. * * @param {string} autorangeMode One of "x"/"y"/"none". * "x" will adjust the x Scale in relation to changes in the y domain. * "y" will adjust the y Scale in relation to changes in the x domain. * "none" means neither Scale will change automatically. * @returns {XYPlot} The calling XYPlot. */ autorangeMode(autorangeMode: string): this; computeLayout(origin?: Point, availableWidth?: number, availableHeight?: number): this; private _updateXExtentsAndAutodomain(); private _updateYExtentsAndAutodomain(); /** * Adjusts the domains of both X and Y scales to show all data. * This call does not override the autorange() behavior. * * @returns {XYPlot} The calling XYPlot. */ showAllData(): this; private _adjustYDomainOnChangeFromX(); private _adjustXDomainOnChangeFromY(); protected _projectorsReady(): boolean; protected _pixelPoint(datum: any, index: number, dataset: Dataset): Point; protected _getDataToDraw(): Utils.Map; }