@carto/airship-bridge
Advanced tools
Comparing version 2.0.0-rc.2 to 2.0.0-rc.3
import mitt from 'mitt'; | ||
import { LegendData, LegendEntry } from '../../types'; | ||
/** | ||
@@ -17,3 +18,3 @@ * Base class for all possible CARTO VL Filters to be combined with Airship | ||
protected _mapColors: boolean; | ||
protected _widget: HTMLStencilElement; | ||
protected _widget: any; | ||
private _readOnly; | ||
@@ -20,0 +21,0 @@ private _name; |
@@ -10,3 +10,3 @@ import { BaseFilter } from '../base/BaseFilter'; | ||
export declare class CategoryFilter extends BaseFilter { | ||
protected _widget: HTMLAsCategoryWidgetElement; | ||
protected _widget: any; | ||
private _carto; | ||
@@ -22,3 +22,3 @@ private _selection; | ||
* @param {*} layer CARTO VL layer | ||
* @param {HTMLAsCategoryWidgetElement} widget A Category Widget HTML element | ||
* @param {any | string} widget A Category Widget HTML element or a selector | ||
* @param {string} columnName The column to pull data from | ||
@@ -29,3 +29,3 @@ * @param {*} source CARTO VL source | ||
*/ | ||
constructor(carto: any, layer: any, widget: HTMLAsCategoryWidgetElement | string, columnName: string, source: any, readOnly: boolean, button: HTMLElement | string, expression: object); | ||
constructor(carto: any, layer: any, widget: any | string, columnName: string, source: any, readOnly: boolean, button: HTMLElement | string, expression: object); | ||
setDataLayer(layer: any): void; | ||
@@ -32,0 +32,0 @@ readonly filter: string; |
@@ -31,3 +31,3 @@ var __extends = (this && this.__extends) || (function () { | ||
* @param {*} layer CARTO VL layer | ||
* @param {HTMLAsCategoryWidgetElement} widget A Category Widget HTML element | ||
* @param {any | string} widget A Category Widget HTML element or a selector | ||
* @param {string} columnName The column to pull data from | ||
@@ -34,0 +34,0 @@ * @param {*} source CARTO VL source |
@@ -1,2 +0,1 @@ | ||
import { HistogramSelection } from '../../../../components/src/components/as-histogram-widget/interfaces'; | ||
import { BaseFilter } from '../base/BaseFilter'; | ||
@@ -15,3 +14,3 @@ /** | ||
protected _carto: any; | ||
protected _widget: HTMLAsTimeSeriesWidgetElement | HTMLAsHistogramWidgetElement; | ||
protected _widget: any; | ||
protected _selection: T; | ||
@@ -26,4 +25,3 @@ protected _dataLayer: any; | ||
* @param {*} layer A CARTO VL layer | ||
* @param {(HTMLAsTimeSeriesWidgetElement | HTMLAsHistogramWidgetElement)} histogram | ||
* An Airship Histogram or TimeSeries HTML element | ||
* @param {(any | string)} histogram An Airship Histogram or TimeSeries HTML element, or a selector | ||
* @param {string} columnName The column to pull data from | ||
@@ -35,3 +33,3 @@ * @param {*} source A CARTO VL source | ||
*/ | ||
constructor(type: 'categorical' | 'numerical', carto: any, layer: any, histogram: HTMLAsTimeSeriesWidgetElement | HTMLAsHistogramWidgetElement | string, columnName: string, source: any, readOnly?: boolean, showTotals?: boolean, inputExpression?: object); | ||
constructor(type: 'categorical' | 'numerical', carto: any, layer: any, histogram: any | string, columnName: string, source: any, readOnly?: boolean, showTotals?: boolean, inputExpression?: object); | ||
removeHistogramLayer(): void; | ||
@@ -47,6 +45,6 @@ setDataLayer(layer: any): void; | ||
* @abstract | ||
* @param {CustomEvent<HistogramSelection>} evt A Custom Event with the HistogramSelection | ||
* @param {CustomEvent<any>} evt A Custom Event with the Histogram Selection | ||
* @memberof BaseHistogramFilter | ||
*/ | ||
protected abstract selectionChanged(evt: CustomEvent<HistogramSelection>): any; | ||
protected abstract selectionChanged(evt: CustomEvent<any>): any; | ||
/** | ||
@@ -53,0 +51,0 @@ * Function called right after the Data Layer has been set, allows for each type of histogram filter to |
@@ -32,4 +32,3 @@ var __extends = (this && this.__extends) || (function () { | ||
* @param {*} layer A CARTO VL layer | ||
* @param {(HTMLAsTimeSeriesWidgetElement | HTMLAsHistogramWidgetElement)} histogram | ||
* An Airship Histogram or TimeSeries HTML element | ||
* @param {(any | string)} histogram An Airship Histogram or TimeSeries HTML element, or a selector | ||
* @param {string} columnName The column to pull data from | ||
@@ -36,0 +35,0 @@ * @param {*} source A CARTO VL source |
@@ -1,2 +0,1 @@ | ||
import { HistogramSelection } from '../../../../components/src/components/as-histogram-widget/interfaces'; | ||
import { BaseHistogramFilter } from './BaseHistogramFilter'; | ||
@@ -21,4 +20,3 @@ /** | ||
* @param {*} layer CARTO VL layer | ||
* @param {(HTMLAsHistogramWidgetElement)} histogram | ||
* Airship histogram widget HTML element | ||
* @param {(any | string)} histogram Airship histogram widget HTML element or a selector | ||
* @param {string} columnName The column to pull data from | ||
@@ -30,3 +28,3 @@ * @param {*} source CARTO VL source | ||
*/ | ||
constructor(carto: any, layer: any, histogram: HTMLAsHistogramWidgetElement | string, columnName: string, source: any, readOnly?: boolean, showTotals?: boolean, inputExpression?: object); | ||
constructor(carto: any, layer: any, histogram: any | string, columnName: string, source: any, readOnly?: boolean, showTotals?: boolean, inputExpression?: object); | ||
/** | ||
@@ -50,3 +48,3 @@ * Returns either null or an expression like: `$column in [_selection]` | ||
protected bindDataLayer(): void; | ||
protected selectionChanged(evt: CustomEvent<HistogramSelection>): void; | ||
protected selectionChanged(evt: CustomEvent<any>): void; | ||
} |
@@ -34,4 +34,3 @@ var __extends = (this && this.__extends) || (function () { | ||
* @param {*} layer CARTO VL layer | ||
* @param {(HTMLAsHistogramWidgetElement)} histogram | ||
* Airship histogram widget HTML element | ||
* @param {(any | string)} histogram Airship histogram widget HTML element or a selector | ||
* @param {string} columnName The column to pull data from | ||
@@ -38,0 +37,0 @@ * @param {*} source CARTO VL source |
@@ -1,2 +0,2 @@ | ||
import { HistogramSelection } from '../../../../components/src/components/as-histogram-widget/interfaces'; | ||
import { BucketRange } from '../../types'; | ||
import { BaseHistogramFilter } from './BaseHistogramFilter'; | ||
@@ -29,4 +29,3 @@ /** | ||
* @param {*} layer CARTO VL layer | ||
* @param {(HTMLAsTimeSeriesWidgetElement | HTMLAsHistogramWidgetElement)} histogram | ||
* Airship histogram / time series HTML element | ||
* @param {(any)} histogram Airship histogram / time series HTML element, or a selector | ||
* @param {string} columnName Column to pull data from | ||
@@ -41,3 +40,3 @@ * @param {number} nBuckets Number of buckets | ||
*/ | ||
constructor(carto: any, layer: any, histogram: HTMLAsTimeSeriesWidgetElement | HTMLAsHistogramWidgetElement | string, columnName: string, nBuckets: number, source: any, bucketRanges?: BucketRange[], readOnly?: boolean, showTotals?: boolean, inputExpression?: object); | ||
constructor(carto: any, layer: any, histogram: any | string, columnName: string, nBuckets: number, source: any, bucketRanges?: BucketRange[], readOnly?: boolean, showTotals?: boolean, inputExpression?: object); | ||
/** | ||
@@ -84,4 +83,4 @@ * Returns $column >= selection[0] && $column < selection[1] | ||
protected bindDataLayer(): void; | ||
protected selectionChanged(evt: CustomEvent<HistogramSelection>): void; | ||
protected selectionChanged(evt: CustomEvent<any>): void; | ||
private _bucketArg; | ||
} |
@@ -40,4 +40,3 @@ var __extends = (this && this.__extends) || (function () { | ||
* @param {*} layer CARTO VL layer | ||
* @param {(HTMLAsTimeSeriesWidgetElement | HTMLAsHistogramWidgetElement)} histogram | ||
* Airship histogram / time series HTML element | ||
* @param {(any)} histogram Airship histogram / time series HTML element, or a selector | ||
* @param {string} columnName Column to pull data from | ||
@@ -44,0 +43,0 @@ * @param {number} nBuckets Number of buckets |
@@ -10,3 +10,3 @@ import { BaseFilter } from '../base/BaseFilter'; | ||
export declare class GlobalRangeFilter extends BaseFilter { | ||
protected _widget: HTMLAsRangeSliderElement; | ||
protected _widget: any; | ||
private _carto; | ||
@@ -16,3 +16,3 @@ private _dataLayer; | ||
private _value; | ||
constructor(carto: any, layer: any, widget: HTMLAsRangeSliderElement | string, columnName: string, source: any); | ||
constructor(carto: any, layer: any, widget: any | string, columnName: string, source: any); | ||
setDataLayer(layer: any): void; | ||
@@ -19,0 +19,0 @@ readonly filter: string; |
@@ -0,1 +1,2 @@ | ||
import { VLAnimation } from '../../types'; | ||
/** | ||
@@ -28,7 +29,7 @@ * This class is an orchestrator for Time Series widgets. It does not extend BaseFilter because for all intents | ||
* @param {*} layer A CARTO VL layer | ||
* @param {HTMLAsTimeSeriesWidgetElement} timeSeries An Airship TimeSeries HTML element | ||
* @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: HTMLAsTimeSeriesWidgetElement | string, readyCb: () => void, duration?: number, fade?: [number, number], variableName?: string); | ||
constructor(carto: any, layer: any, column: string, timeSeries: any | string, readyCb: () => void, duration?: number, fade?: [number, number], variableName?: string); | ||
removeHistogramLayer(): void; | ||
@@ -35,0 +36,0 @@ /** |
@@ -17,3 +17,3 @@ import { select } from '../../util/Utils'; | ||
* @param {*} layer A CARTO VL layer | ||
* @param {HTMLAsTimeSeriesWidgetElement} timeSeries An Airship TimeSeries HTML element | ||
* @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 | ||
@@ -20,0 +20,0 @@ * @memberof TimeSeries |
@@ -0,1 +1,2 @@ | ||
import { RGBColor } from '../../types'; | ||
/** | ||
@@ -2,0 +3,0 @@ * Converts VL RGB Colors to hex |
@@ -0,1 +1,2 @@ | ||
import { VLCategoricalHistogram, VLNumericalHistogram } from '../../../../types'; | ||
/** | ||
@@ -2,0 +3,0 @@ * Compares two numerical histograms for equality |
@@ -0,1 +1,2 @@ | ||
import { VLCategoricalHistogram } from '../../../../types'; | ||
/** | ||
@@ -2,0 +3,0 @@ * Converts a VL 'categorical' histogram to the format Airship's category widget requires |
@@ -1,2 +0,2 @@ | ||
import { HistogramData } from '../../../../../../components/src/components/as-histogram-widget/interfaces'; | ||
import { LegendEntry, VLCategoricalHistogram, VLNumericalHistogram } from '../../../../types'; | ||
/** | ||
@@ -9,5 +9,5 @@ * Converts a numerical VL Histogram data to Airship's Histogram format. | ||
* @param {VLNumericalHistogram} data Histogram data in VL format | ||
* @returns {HistogramData[]} | ||
* @returns {any[]} | ||
*/ | ||
export declare function numerical(data: VLNumericalHistogram): HistogramData[]; | ||
export declare function numerical(data: VLNumericalHistogram): any[]; | ||
/** | ||
@@ -21,5 +21,5 @@ * Converts a categorical VL Histogram to Airship's Histogram widget format. | ||
* @param {LegendEntry[]} [colors] VL Legend data, which maps values to colors. | ||
* @returns {HistogramData[]} | ||
* @returns {any[]} | ||
*/ | ||
export declare function categorical(data: VLCategoricalHistogram, colors?: LegendEntry[]): HistogramData[]; | ||
export declare function categorical(data: VLCategoricalHistogram, colors?: LegendEntry[]): any[]; | ||
/** | ||
@@ -26,0 +26,0 @@ * Looks for a color in an array of VL Legend Data and converts it into a hex string. |
@@ -9,3 +9,3 @@ import { toHex } from '../../color'; | ||
* @param {VLNumericalHistogram} data Histogram data in VL format | ||
* @returns {HistogramData[]} | ||
* @returns {any[]} | ||
*/ | ||
@@ -27,3 +27,3 @@ export function numerical(data) { | ||
* @param {LegendEntry[]} [colors] VL Legend data, which maps values to colors. | ||
* @returns {HistogramData[]} | ||
* @returns {any[]} | ||
*/ | ||
@@ -30,0 +30,0 @@ export function categorical(data, colors) { |
@@ -0,1 +1,2 @@ | ||
import { AnimationOptions, CategoricalHistogramOptions, CategoryOptions, NumericalHistogramOptions, VLBridgeOptions } from '../types'; | ||
import { CategoryFilter } from './category/CategoryFilter'; | ||
@@ -46,3 +47,3 @@ import { CategoricalHistogramFilter } from './histogram/CategoricalHistogramFilter'; | ||
* | ||
* @param {(HTMLAsHistogramWidgetElement | HTMLAsTimeSeriesWidgetElement | string)} widget Your widget or a | ||
* @param {(any | string)} widget Your widget or a | ||
* selector to locate it | ||
@@ -54,3 +55,3 @@ * @param {string} column The column you want to pull data from | ||
*/ | ||
numericalHistogram(widget: HTMLAsHistogramWidgetElement | HTMLAsTimeSeriesWidgetElement | string, column: string | { | ||
numericalHistogram(widget: any | string, column: string | { | ||
propertyName: string; | ||
@@ -61,3 +62,3 @@ }, options?: NumericalHistogramOptions): NumericalHistogramFilter; | ||
* | ||
* @param {(HTMLAsHistogramWidgetElement | string)} widget Your widget or a selector to locate it | ||
* @param {(any | string)} widget Your widget or a selector to locate it | ||
* @param {string} column The column to pull data from | ||
@@ -68,3 +69,3 @@ * @param {CategoricalHistogramOptions} [options={}] Options for this particular filter | ||
*/ | ||
categoricalHistogram(widget: HTMLAsHistogramWidgetElement | string, column: string | { | ||
categoricalHistogram(widget: any | string, column: string | { | ||
propertyName: string; | ||
@@ -77,3 +78,3 @@ }, options?: CategoricalHistogramOptions): CategoricalHistogramFilter; | ||
* | ||
* @param {(HTMLAsHistogramWidgetElement | HTMLAsTimeSeriesWidgetElement | string)} widget Your widget or a selector | ||
* @param {(any | string)} widget Your widget or a selector | ||
* @param {string} column The column to pull data from | ||
@@ -84,3 +85,3 @@ * @param {NumericalHistogramOptions} options Options for the Histogram | ||
*/ | ||
histogram(widget: HTMLAsHistogramWidgetElement | HTMLAsTimeSeriesWidgetElement | string, column: string | { | ||
histogram(widget: any | string, column: string | { | ||
propertyName: string; | ||
@@ -94,3 +95,3 @@ }, options?: NumericalHistogramOptions): NumericalHistogramFilter | CategoricalHistogramFilter; | ||
* | ||
* @param {HTMLAsCategoryWidgetElement | string} widget An airship category widget, or a selector | ||
* @param {any | string} widget An airship category widget, or a selector | ||
* @param {string} column Column to pull data from | ||
@@ -101,3 +102,3 @@ * @param {CategoryOptions} [options={}] | ||
*/ | ||
category(widget: HTMLAsCategoryWidgetElement | string, column: string | { | ||
category(widget: any | string, column: string | { | ||
propertyName: string; | ||
@@ -114,3 +115,3 @@ }, options?: CategoryOptions): CategoryFilter; | ||
* | ||
* @param {(HTMLAsTimeSeriesWidgetElement | string)} widget The Time series widget, or a selector | ||
* @param {(any | string)} widget The Time series widget, or a selector | ||
* @param {string} column The string to pull data from it | ||
@@ -120,7 +121,7 @@ * @param {AnimationOptions} [options={}] | ||
*/ | ||
timeSeries(widget: HTMLAsTimeSeriesWidgetElement | string, column: string, options?: AnimationOptions): TimeSeries; | ||
timeSeries(widget: any | string, column: string, options?: AnimationOptions): TimeSeries; | ||
/** | ||
* Creates a global range slider filter. | ||
* | ||
* @param {(HTMLAsRangeSliderElement | string)} widget A range slider widget or a selector | ||
* @param {(any | string)} widget A range slider widget or a selector | ||
* @param {string} column The column to pull data from | ||
@@ -130,3 +131,3 @@ * @returns {GlobalRangeFilter} | ||
*/ | ||
globalRange(widget: HTMLAsRangeSliderElement | string, column: string): GlobalRangeFilter; | ||
globalRange(widget: any | string, column: string): GlobalRangeFilter; | ||
/** | ||
@@ -133,0 +134,0 @@ * Call this method after creating all the different filters you require. |
@@ -57,3 +57,3 @@ import semver from 'semver'; | ||
* | ||
* @param {(HTMLAsHistogramWidgetElement | HTMLAsTimeSeriesWidgetElement | string)} widget Your widget or a | ||
* @param {(any | string)} widget Your widget or a | ||
* selector to locate it | ||
@@ -77,3 +77,3 @@ * @param {string} column The column you want to pull data from | ||
* | ||
* @param {(HTMLAsHistogramWidgetElement | string)} widget Your widget or a selector to locate it | ||
* @param {(any | string)} widget Your widget or a selector to locate it | ||
* @param {string} column The column to pull data from | ||
@@ -98,3 +98,3 @@ * @param {CategoricalHistogramOptions} [options={}] Options for this particular filter | ||
* | ||
* @param {(HTMLAsHistogramWidgetElement | HTMLAsTimeSeriesWidgetElement | string)} widget Your widget or a selector | ||
* @param {(any | string)} widget Your widget or a selector | ||
* @param {string} column The column to pull data from | ||
@@ -120,3 +120,3 @@ * @param {NumericalHistogramOptions} options Options for the Histogram | ||
* | ||
* @param {HTMLAsCategoryWidgetElement | string} widget An airship category widget, or a selector | ||
* @param {any | string} widget An airship category widget, or a selector | ||
* @param {string} column Column to pull data from | ||
@@ -145,3 +145,3 @@ * @param {CategoryOptions} [options={}] | ||
* | ||
* @param {(HTMLAsTimeSeriesWidgetElement | string)} widget The Time series widget, or a selector | ||
* @param {(any | string)} widget The Time series widget, or a selector | ||
* @param {string} column The string to pull data from it | ||
@@ -176,3 +176,3 @@ * @param {AnimationOptions} [options={}] | ||
* | ||
* @param {(HTMLAsRangeSliderElement | string)} widget A range slider widget or a selector | ||
* @param {(any | string)} widget A range slider widget or a selector | ||
* @param {string} column The column to pull data from | ||
@@ -179,0 +179,0 @@ * @returns {GlobalRangeFilter} |
{ | ||
"name": "@carto/airship-bridge", | ||
"version": "2.0.0-rc.2", | ||
"version": "2.0.0-rc.3", | ||
"description": "Airship bridge to other libs (CARTO VL, CARTO.js)", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"test": "echo 'disabled while unreleased'", | ||
"test": "jest", | ||
"test:watch": "jest --watch", | ||
@@ -9,0 +9,0 @@ "lint": "tslint -c tslint.json src/**/*.{ts,tsx}", |
import mitt from 'mitt'; | ||
import { LegendData, LegendEntry } from '../../types'; | ||
@@ -21,3 +22,3 @@ /** | ||
protected _mapColors: boolean; | ||
protected _widget: HTMLStencilElement; | ||
protected _widget: any; | ||
private _readOnly: boolean; | ||
@@ -24,0 +25,0 @@ private _name: string; |
@@ -0,1 +1,2 @@ | ||
import { VLCategoricalHistogram } from '../../types'; | ||
import { select } from '../../util/Utils'; | ||
@@ -14,3 +15,3 @@ import { BaseFilter } from '../base/BaseFilter'; | ||
export class CategoryFilter extends BaseFilter { | ||
protected _widget: HTMLAsCategoryWidgetElement; | ||
protected _widget: any; | ||
private _carto: any; | ||
@@ -27,3 +28,3 @@ private _selection: string[] = []; | ||
* @param {*} layer CARTO VL layer | ||
* @param {HTMLAsCategoryWidgetElement} widget A Category Widget HTML element | ||
* @param {any | string} widget A Category Widget HTML element or a selector | ||
* @param {string} columnName The column to pull data from | ||
@@ -37,3 +38,3 @@ * @param {*} source CARTO VL source | ||
layer: any, | ||
widget: HTMLAsCategoryWidgetElement | string, | ||
widget: any | string, | ||
columnName: string, | ||
@@ -47,3 +48,3 @@ source: any, | ||
this._widget = select(widget) as HTMLAsCategoryWidgetElement; | ||
this._widget = select(widget) as any; | ||
@@ -50,0 +51,0 @@ this._carto = carto; |
@@ -1,2 +0,1 @@ | ||
import { HistogramSelection } from '../../../../components/src/components/as-histogram-widget/interfaces'; | ||
import { select } from '../../util/Utils'; | ||
@@ -17,3 +16,3 @@ import { BaseFilter } from '../base/BaseFilter'; | ||
protected _carto: any; | ||
protected _widget: HTMLAsTimeSeriesWidgetElement | HTMLAsHistogramWidgetElement; | ||
protected _widget: any; | ||
protected _selection: T = null; | ||
@@ -29,4 +28,3 @@ protected _dataLayer: any; | ||
* @param {*} layer A CARTO VL layer | ||
* @param {(HTMLAsTimeSeriesWidgetElement | HTMLAsHistogramWidgetElement)} histogram | ||
* An Airship Histogram or TimeSeries HTML element | ||
* @param {(any | string)} histogram An Airship Histogram or TimeSeries HTML element, or a selector | ||
* @param {string} columnName The column to pull data from | ||
@@ -42,3 +40,3 @@ * @param {*} source A CARTO VL source | ||
layer: any, | ||
histogram: HTMLAsTimeSeriesWidgetElement | HTMLAsHistogramWidgetElement | string, | ||
histogram: any | string, | ||
columnName: string, | ||
@@ -52,3 +50,3 @@ source: any, | ||
this._widget = select(histogram) as HTMLAsHistogramWidgetElement | HTMLAsTimeSeriesWidgetElement; | ||
this._widget = select(histogram); | ||
this._carto = carto; | ||
@@ -90,6 +88,6 @@ this._totals = showTotals; | ||
* @abstract | ||
* @param {CustomEvent<HistogramSelection>} evt A Custom Event with the HistogramSelection | ||
* @param {CustomEvent<any>} evt A Custom Event with the Histogram Selection | ||
* @memberof BaseHistogramFilter | ||
*/ | ||
protected abstract selectionChanged(evt: CustomEvent<HistogramSelection>); | ||
protected abstract selectionChanged(evt: CustomEvent<any>); | ||
@@ -96,0 +94,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { HistogramSelection } from '../../../../components/src/components/as-histogram-widget/interfaces'; | ||
import { VLCategoricalHistogram } from '../../types'; | ||
import { isCategoricalHistogramEqual } from '../utils/comparison/histogram'; | ||
@@ -25,4 +25,3 @@ import * as conversion from '../utils/conversion/histogram'; | ||
* @param {*} layer CARTO VL layer | ||
* @param {(HTMLAsHistogramWidgetElement)} histogram | ||
* Airship histogram widget HTML element | ||
* @param {(any | string)} histogram Airship histogram widget HTML element or a selector | ||
* @param {string} columnName The column to pull data from | ||
@@ -37,3 +36,3 @@ * @param {*} source CARTO VL source | ||
layer: any, | ||
histogram: HTMLAsHistogramWidgetElement | string, | ||
histogram: any | string, | ||
columnName: string, | ||
@@ -119,3 +118,3 @@ source: any, | ||
protected selectionChanged(evt: CustomEvent<HistogramSelection>) { | ||
protected selectionChanged(evt: CustomEvent<any>) { | ||
if (evt.detail === null) { | ||
@@ -122,0 +121,0 @@ this._selection = null; |
@@ -1,2 +0,2 @@ | ||
import { HistogramSelection } from '../../../../components/src/components/as-histogram-widget/interfaces'; | ||
import { BucketRange, VLNumericalHistogram } from '../../types'; | ||
import { isNumericalHistogramEqual } from '../utils/comparison/histogram'; | ||
@@ -33,4 +33,3 @@ import * as conversion from '../utils/conversion/histogram'; | ||
* @param {*} layer CARTO VL layer | ||
* @param {(HTMLAsTimeSeriesWidgetElement | HTMLAsHistogramWidgetElement)} histogram | ||
* Airship histogram / time series HTML element | ||
* @param {(any)} histogram Airship histogram / time series HTML element, or a selector | ||
* @param {string} columnName Column to pull data from | ||
@@ -48,3 +47,3 @@ * @param {number} nBuckets Number of buckets | ||
layer: any, | ||
histogram: HTMLAsTimeSeriesWidgetElement | HTMLAsHistogramWidgetElement | string, | ||
histogram: any | string, | ||
columnName: string, | ||
@@ -174,3 +173,3 @@ nBuckets: number = 20, | ||
protected selectionChanged(evt: CustomEvent<HistogramSelection>) { | ||
protected selectionChanged(evt: CustomEvent<any>) { | ||
if (evt.detail === null) { | ||
@@ -177,0 +176,0 @@ this._selection = null; |
@@ -12,3 +12,3 @@ import { select } from '../../util/Utils'; | ||
export class GlobalRangeFilter extends BaseFilter { | ||
protected _widget: HTMLAsRangeSliderElement; | ||
protected _widget: any; | ||
private _carto: any; | ||
@@ -22,3 +22,3 @@ private _dataLayer: any; | ||
layer: any, | ||
widget: HTMLAsRangeSliderElement | string, | ||
widget: any | string, | ||
columnName: string, | ||
@@ -29,3 +29,3 @@ source: any | ||
this._widget = select(widget) as HTMLAsRangeSliderElement; | ||
this._widget = select(widget) as any; | ||
this._carto = carto; | ||
@@ -32,0 +32,0 @@ |
@@ -18,3 +18,11 @@ import * as mitt from 'mitt'; | ||
variables: { | ||
animation: {} | ||
animation: { | ||
duration: { | ||
value: 10 | ||
}, | ||
input: { | ||
max: 10, | ||
min: 0 | ||
} | ||
} | ||
} | ||
@@ -35,3 +43,3 @@ } | ||
// tslint:disable no-unused-expression | ||
new TimeSeries(layer, widget, mockCb); | ||
new TimeSeries({}, layer, 'column', widget, mockCb); | ||
}; | ||
@@ -48,3 +56,3 @@ | ||
// tslint:disable no-unused-expression | ||
new TimeSeries(layer, widget, mockedCb); | ||
new TimeSeries({}, layer, 'column', widget, mockedCb); | ||
@@ -61,3 +69,3 @@ expect(mockedCb).toHaveBeenCalled(); | ||
// tslint:disable no-unused-expression | ||
new TimeSeries(layer, widget, mockedCb); | ||
new TimeSeries({}, layer, 'column', widget, mockedCb); | ||
@@ -64,0 +72,0 @@ expect(mockedCb).not.toHaveBeenCalled(); |
@@ -0,1 +1,2 @@ | ||
import { VLAnimation, VLViz } from '../../types'; | ||
import { select } from '../../util/Utils'; | ||
@@ -14,3 +15,3 @@ | ||
export class TimeSeries { | ||
private _timeSeries: HTMLAsTimeSeriesWidgetElement; | ||
private _timeSeries: any; | ||
private _animation: VLAnimation; | ||
@@ -32,3 +33,3 @@ private _layer: any; | ||
* @param {*} layer A CARTO VL layer | ||
* @param {HTMLAsTimeSeriesWidgetElement} timeSeries An Airship TimeSeries HTML element | ||
* @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 | ||
@@ -41,3 +42,3 @@ * @memberof TimeSeries | ||
column: string, | ||
timeSeries: HTMLAsTimeSeriesWidgetElement | string, | ||
timeSeries: any | string, | ||
readyCb: () => void, | ||
@@ -49,3 +50,3 @@ duration: number = 10, | ||
this._timeSeries = select(timeSeries) as HTMLAsTimeSeriesWidgetElement; | ||
this._timeSeries = select(timeSeries) as any; | ||
this._layer = layer; | ||
@@ -52,0 +53,0 @@ this._carto = carto; |
@@ -0,1 +1,3 @@ | ||
import { RGBColor } from '../../types'; | ||
/** | ||
@@ -2,0 +4,0 @@ * Converts VL RGB Colors to hex |
@@ -0,1 +1,8 @@ | ||
import { | ||
CategoricalHistogramData, | ||
NumericalHistogramData, | ||
VLCategoricalHistogram, | ||
VLHistogramData, | ||
VLNumericalHistogram } from '../../../../types'; | ||
type Comparer<T> = (first: VLHistogramData<T>, second: VLHistogramData<T>) => boolean; | ||
@@ -2,0 +9,0 @@ |
@@ -0,1 +1,2 @@ | ||
import { VLCategoricalHistogram } from '../../../../types'; | ||
import { findColorForCategory } from '../histogram'; | ||
@@ -2,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { HistogramData } from '../../../../../../components/src/components/as-histogram-widget/interfaces'; | ||
import { LegendEntry, VLCategoricalHistogram, VLNumericalHistogram } from '../../../../types'; | ||
import { toHex } from '../../color'; | ||
@@ -11,5 +11,5 @@ | ||
* @param {VLNumericalHistogram} data Histogram data in VL format | ||
* @returns {HistogramData[]} | ||
* @returns {any[]} | ||
*/ | ||
export function numerical(data: VLNumericalHistogram): HistogramData[] { | ||
export function numerical(data: VLNumericalHistogram): any[] { | ||
return data.value.map((d) => ({ | ||
@@ -30,5 +30,5 @@ end: d.x[1], | ||
* @param {LegendEntry[]} [colors] VL Legend data, which maps values to colors. | ||
* @returns {HistogramData[]} | ||
* @returns {any[]} | ||
*/ | ||
export function categorical(data: VLCategoricalHistogram, colors?: LegendEntry[]): HistogramData[] { | ||
export function categorical(data: VLCategoricalHistogram, colors?: LegendEntry[]): any[] { | ||
return data.value.map((d) => ({ | ||
@@ -35,0 +35,0 @@ category: d.x, |
import semver from 'semver'; | ||
import { | ||
AnimationOptions, | ||
CategoricalHistogramOptions, | ||
CategoryOptions, | ||
NumericalHistogramOptions, | ||
VLBridgeOptions } from '../types'; | ||
import { getColumnName, getExpression } from '../util/Utils'; | ||
@@ -72,3 +78,3 @@ import { BaseFilter } from './base/BaseFilter'; | ||
* | ||
* @param {(HTMLAsHistogramWidgetElement | HTMLAsTimeSeriesWidgetElement | string)} widget Your widget or a | ||
* @param {(any | string)} widget Your widget or a | ||
* selector to locate it | ||
@@ -81,3 +87,3 @@ * @param {string} column The column you want to pull data from | ||
public numericalHistogram( | ||
widget: HTMLAsHistogramWidgetElement | HTMLAsTimeSeriesWidgetElement | string, | ||
widget: any | string, | ||
column: string | { propertyName: string }, | ||
@@ -116,3 +122,3 @@ options: NumericalHistogramOptions = {}): NumericalHistogramFilter { | ||
* | ||
* @param {(HTMLAsHistogramWidgetElement | string)} widget Your widget or a selector to locate it | ||
* @param {(any | string)} widget Your widget or a selector to locate it | ||
* @param {string} column The column to pull data from | ||
@@ -124,3 +130,3 @@ * @param {CategoricalHistogramOptions} [options={}] Options for this particular filter | ||
public categoricalHistogram( | ||
widget: HTMLAsHistogramWidgetElement | string, | ||
widget: any | string, | ||
column: string | { propertyName: string }, | ||
@@ -157,3 +163,3 @@ options: CategoricalHistogramOptions = {}): CategoricalHistogramFilter { | ||
* | ||
* @param {(HTMLAsHistogramWidgetElement | HTMLAsTimeSeriesWidgetElement | string)} widget Your widget or a selector | ||
* @param {(any | string)} widget Your widget or a selector | ||
* @param {string} column The column to pull data from | ||
@@ -165,3 +171,3 @@ * @param {NumericalHistogramOptions} options Options for the Histogram | ||
public histogram( | ||
widget: HTMLAsHistogramWidgetElement | HTMLAsTimeSeriesWidgetElement | string, | ||
widget: any | string, | ||
column: string | { propertyName: string }, | ||
@@ -177,3 +183,3 @@ options: NumericalHistogramOptions = {}): NumericalHistogramFilter | CategoricalHistogramFilter { | ||
if (buckets === undefined && bucketRanges === undefined) { | ||
const histogramWidget = widget as HTMLAsHistogramWidgetElement; | ||
const histogramWidget = widget as any; | ||
return this.categoricalHistogram(histogramWidget, column, { readOnly, totals }); | ||
@@ -191,3 +197,3 @@ } | ||
* | ||
* @param {HTMLAsCategoryWidgetElement | string} widget An airship category widget, or a selector | ||
* @param {any | string} widget An airship category widget, or a selector | ||
* @param {string} column Column to pull data from | ||
@@ -199,3 +205,3 @@ * @param {CategoryOptions} [options={}] | ||
public category( | ||
widget: HTMLAsCategoryWidgetElement | string, | ||
widget: any | string, | ||
column: string | { propertyName: string }, | ||
@@ -236,3 +242,3 @@ options: CategoryOptions = {}) { | ||
* | ||
* @param {(HTMLAsTimeSeriesWidgetElement | string)} widget The Time series widget, or a selector | ||
* @param {(any | string)} widget The Time series widget, or a selector | ||
* @param {string} column The string to pull data from it | ||
@@ -243,3 +249,3 @@ * @param {AnimationOptions} [options={}] | ||
public timeSeries( | ||
widget: HTMLAsTimeSeriesWidgetElement | string, | ||
widget: any | string, | ||
column: string, | ||
@@ -293,3 +299,3 @@ options: AnimationOptions = {}) { | ||
* | ||
* @param {(HTMLAsRangeSliderElement | string)} widget A range slider widget or a selector | ||
* @param {(any | string)} widget A range slider widget or a selector | ||
* @param {string} column The column to pull data from | ||
@@ -299,3 +305,3 @@ * @returns {GlobalRangeFilter} | ||
*/ | ||
public globalRange(widget: HTMLAsRangeSliderElement | string, column: string): GlobalRangeFilter { | ||
public globalRange(widget: any | string, column: string): GlobalRangeFilter { | ||
const range = new GlobalRangeFilter(this._carto, this._layer, widget, column, this._source); | ||
@@ -302,0 +308,0 @@ |
@@ -22,4 +22,3 @@ { | ||
"include": [ | ||
"src", | ||
"../components/src/**/*.d.ts" | ||
"src" | ||
], | ||
@@ -26,0 +25,0 @@ "exclude": [ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
319800
4544
65