@carto/airship-bridge
Version:
Airship bridge to other libs (CARTO VL, CARTO.js)
66 lines (65 loc) • 2.23 kB
TypeScript
import { VLAnimation } from '../../types';
/**
* This class is an orchestrator for Time Series widgets. It does not extend BaseFilter because for all intents
* and purposes, we can use a numerical histogram. This class is only responsible of particular Time Series event
* handling with regards to VL.
*
* The provided layer Viz object *must have* a variable called `@animation`
*
* @export
* @class TimeSeries
*/
export declare class TimeSeries {
private _timeSeriesWidget;
private _animation;
private _layer;
private _viz;
private _dataLayer;
private _min;
private _max;
private _carto;
private _columnName;
private _duration;
private _fade;
private _variableName;
private _propertyName;
private _autoplay;
/**
* Creates an instance of TimeSeries.
* @param {*} carto CARTO VL namespace
* @param {*} layer A CARTO VL layer
* @param {any | string} timeSeries An Airship TimeSeries HTML element, or a selector
* @param {() => void} readyCb A callback to be called when we're done configuring internals
* @memberof TimeSeries
*/
constructor(carto: any, layer: any, column: string, timeSeries: any | string, readyCb: () => void, duration: number, fade: [number, number], variableName: string, propertyName: string, autoplay?: boolean);
removeHistogramLayer(): void;
/**
* Set the range of the animation input.
*
* This is called when the time series selection is changed.
*
* @param {[number, number]} range
* @returns
* @memberof TimeSeries
*/
setRange(range: [number, number] | [Date, Date]): void;
readonly variableName: string;
propertyName: string;
setDuration(duration: number): void;
readonly animation: VLAnimation;
restart(): void;
/**
* This method sets up the events to handle animation updates and bind it to the TimeSeries widget:
* - Update the progress
* - Update the progress when user seeks
* - Play / Pause events
*
* @private
* @memberof TimeSeries
*/
private _onLayerLoaded;
private _getAnimationExpression;
private _createDefaultAnimation;
}
export default TimeSeries;