@carto/airship-bridge
Version:
Airship bridge to other libs (CARTO VL, CARTO.js)
38 lines (37 loc) • 1.33 kB
TypeScript
import { LegendEntry, VLCategoricalHistogram, VLNumericalHistogram } from '../../../../types';
/**
* Converts a numerical VL Histogram data to Airship's Histogram format.
*
* Has no support for `color` for now.
*
* @export
* @param {VLNumericalHistogram} data Histogram data in VL format
* @returns {any[]}
*/
export declare function numerical(data: VLNumericalHistogram): any[];
export declare function date(data: VLNumericalHistogram): any[];
/**
* Converts a categorical VL Histogram to Airship's Histogram widget format.
*
* The second argument is used to provide custom colors for the widget.
*
* @export
* @param {VLCategoricalHistogram} data Histogram data in VL format
* @param {LegendEntry[]} [colors] VL Legend data, which maps values to colors.
* @returns {any[]}
*/
export declare function categorical(data: VLCategoricalHistogram, colors?: LegendEntry[]): any[];
/**
* Looks for a color in an array of VL Legend Data and converts it into a hex string.
*
* @export
* @param {string} category
* @param {LegendEntry[]} colors
* @returns {(string | undefined)}
*/
export declare function findColorForCategory(category: string, colors: LegendEntry[]): string | undefined;
declare const _default: {
numerical: typeof numerical;
categorical: typeof categorical;
};
export default _default;