@kepler.gl/charts 3.3.0-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,67 @@
1
+ import { SortType } from './constants';
2
+ import { ChartableDataset, ChartBin, ChartAxis, HeatmapCell, PivotTableResult } from './types';
3
+ /**
4
+ * Format chart values for display. Prefer compact SI suffixes for large
5
+ * magnitudes so Big Number (and other chart labels) never fall back to
6
+ * scientific notation like `7.67e+5`.
7
+ */
8
+ export declare function formatNumber(n: number): string;
9
+ export declare function getChartIndexes(dataset: ChartableDataset, applyFilters: boolean): number[];
10
+ export declare function colorAt(index: number): string;
11
+ export declare function rgbToCss(rgb?: [number, number, number]): string;
12
+ declare function toKey(value: unknown): string;
13
+ /** Display label for a bin key; numeric histogram keys decode to compact ranges. */
14
+ export declare function displayBinKey(key: string): string;
15
+ export declare function groupIndexes(indexes: number[], dataset: ChartableDataset, axis: ChartAxis | undefined, numBins?: number): {
16
+ groups: Map<string, number[]>;
17
+ filterValues: Map<string, Array<string | number | boolean>>;
18
+ };
19
+ export declare function buildGroupedBins({ dataset, applyFilters, indexes: indexesOverride, binAxis, valueAxis, groupByAxis, numGroups, groupOthers, sort, color, colors, truncate }: {
20
+ dataset: ChartableDataset;
21
+ applyFilters: boolean;
22
+ indexes?: number[];
23
+ binAxis?: ChartAxis;
24
+ valueAxis?: ChartAxis;
25
+ groupByAxis?: ChartAxis;
26
+ numGroups?: number;
27
+ groupOthers?: boolean;
28
+ sort?: SortType;
29
+ /** Single color applied to every bin. */
30
+ color?: string;
31
+ /** Palette used to color bins by category when `color` is not set. */
32
+ colors?: string[];
33
+ /** When false, keep every bin (used for numeric/time domain bins). */
34
+ truncate?: boolean;
35
+ }): ChartBin[];
36
+ export declare function buildBigNumber({ dataset, applyFilters, axis }: {
37
+ dataset: ChartableDataset;
38
+ applyFilters: boolean;
39
+ axis?: ChartAxis;
40
+ }): {
41
+ value: number;
42
+ count: number;
43
+ };
44
+ export declare function buildHeatmapCells({ dataset, applyFilters, xAxis, yAxis, valueAxis, numGroups }: {
45
+ dataset: ChartableDataset;
46
+ applyFilters: boolean;
47
+ xAxis?: ChartAxis;
48
+ yAxis?: ChartAxis;
49
+ valueAxis?: ChartAxis;
50
+ numGroups?: number;
51
+ }): HeatmapCell[];
52
+ export declare function buildPivotTable({ dataset, applyFilters, xAxis, yAxis, valueAxis, numGroups }: {
53
+ dataset: ChartableDataset;
54
+ applyFilters: boolean;
55
+ xAxis?: ChartAxis;
56
+ yAxis?: ChartAxis;
57
+ valueAxis?: ChartAxis;
58
+ numGroups?: number;
59
+ }): PivotTableResult;
60
+ export declare function buildTimeSeries({ dataset, indexes, xAxis, yAxis, interval }: {
61
+ dataset: ChartableDataset;
62
+ indexes: number[];
63
+ xAxis?: ChartAxis;
64
+ yAxis?: ChartAxis;
65
+ interval?: string;
66
+ }): ChartBin[];
67
+ export { toKey };
@@ -0,0 +1,27 @@
1
+ import { ChartType, LayerChartType } from './constants';
2
+ import { ChartConfig, DatasetChartConfig, LayerChartConfig, ChartableDataset } from './types';
3
+ export declare function createBigNumberChart(props?: Partial<DatasetChartConfig>): DatasetChartConfig;
4
+ export declare function createBarChart(props?: Partial<DatasetChartConfig>): DatasetChartConfig;
5
+ export declare function createHorizontalBarChart(props?: Partial<DatasetChartConfig>): DatasetChartConfig;
6
+ export declare function createLineChart(props?: Partial<DatasetChartConfig>): DatasetChartConfig;
7
+ export declare function createHeatmapChart(props?: Partial<DatasetChartConfig>): DatasetChartConfig;
8
+ export declare function createPivotTableChart(props?: Partial<DatasetChartConfig>): DatasetChartConfig;
9
+ export declare function createLayerChart(layerId: string, layerChartType: LayerChartType, props?: Partial<LayerChartConfig>): LayerChartConfig;
10
+ export declare function createChart(args: {
11
+ type: ChartType | LayerChartType;
12
+ dataId?: string | null;
13
+ dataset?: ChartableDataset;
14
+ layerId?: string;
15
+ options?: {
16
+ activateConfig?: boolean;
17
+ };
18
+ }): ChartConfig | null;
19
+ export declare function serializeCharts(charts: ChartConfig[]): ChartConfig[];
20
+ /**
21
+ * Rebuild field-bearing axes for a new dataset (or layer) so stale names like
22
+ * `Join_Count` are not looked up row-by-row on a table that does not have them.
23
+ */
24
+ export declare function propsForChartDatasetChange(chart: ChartConfig, dataset: ChartableDataset | null | undefined, next: {
25
+ dataId?: string | null;
26
+ layerId?: string;
27
+ }): Partial<ChartConfig>;
@@ -0,0 +1,56 @@
1
+ import React from 'react';
2
+ import { ChartBin, HeatmapCell, PivotTableResult } from './types';
3
+ import { ChartViewData } from './compute';
4
+ declare const ChartWrap: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
5
+ declare const EmptyState: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
6
+ type ClickHandler = (key: string, extra?: {
7
+ filterValue?: Array<string | number | boolean>;
8
+ filterValueY?: Array<string | number | boolean>;
9
+ x?: string;
10
+ y?: string;
11
+ }) => void;
12
+ export declare function BigNumberView({ value, caption, formattedValue, showCaption, onToggleCaption, captionToggleIcon, captionToggleLabel }: {
13
+ value: number;
14
+ caption?: string;
15
+ formattedValue?: string;
16
+ showCaption?: boolean;
17
+ onToggleCaption?: () => void;
18
+ captionToggleIcon?: React.ReactNode;
19
+ captionToggleLabel?: string;
20
+ }): React.ReactElement;
21
+ export declare function BarChartView({ bins, horizontal, selectedKey, onSelect }: {
22
+ bins: ChartBin[];
23
+ horizontal?: boolean;
24
+ selectedKey?: string;
25
+ onSelect?: ClickHandler;
26
+ }): React.ReactElement;
27
+ export declare function LineChartView({ bins, xLabel, yLabel, selectedKey, onSelect }: {
28
+ bins: ChartBin[];
29
+ xLabel?: string;
30
+ yLabel?: string;
31
+ selectedKey?: string;
32
+ onSelect?: ClickHandler;
33
+ }): React.ReactElement;
34
+ export declare function HeatmapView({ cells, colors, xLabel, yLabel, selectedKey, onSelect }: {
35
+ cells: HeatmapCell[];
36
+ colors?: string[];
37
+ xLabel?: string;
38
+ yLabel?: string;
39
+ selectedKey?: string;
40
+ onSelect?: ClickHandler;
41
+ }): React.ReactElement;
42
+ export declare function PivotTableView({ table, xLabel, yLabel }: {
43
+ table: PivotTableResult;
44
+ xLabel?: string;
45
+ yLabel?: string;
46
+ }): React.ReactElement;
47
+ export declare function ChartRenderer({ data, selectedKey, onSelect, showCaption, onToggleCaption, captionToggleIcon, captionToggleLabel }: {
48
+ data: ChartViewData;
49
+ selectedKey?: string;
50
+ onSelect?: ClickHandler;
51
+ showCaption?: boolean;
52
+ onToggleCaption?: () => void;
53
+ captionToggleIcon?: React.ReactNode;
54
+ captionToggleLabel?: string;
55
+ }): React.ReactElement;
56
+ export { EmptyState, ChartWrap };