@kepler.gl/table 3.0.0-alpha.0

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,142 @@
1
+ import { RGBColor, Field, FieldPair, FieldDomain, Filter, ProtoDataset, FilterRecord, FilterDatasetOpt } from '@kepler.gl/types';
2
+ import { Layer } from '@kepler.gl/layers';
3
+ import { DataContainerInterface } from '@kepler.gl/utils';
4
+ export declare type GpuFilter = {
5
+ filterRange: number[][];
6
+ filterValueUpdateTriggers: any;
7
+ filterValueAccessor: (dc: DataContainerInterface) => (getIndex?: (any: any) => number, getData?: (dc_: DataContainerInterface, d: any, fieldIndex: number) => any) => (d: any) => number;
8
+ };
9
+ export declare function maybeToDate(isTime: boolean, fieldIdx: number, format: string, dc: DataContainerInterface, d: {
10
+ index: number;
11
+ }): any;
12
+ declare class KeplerTable {
13
+ readonly id: string;
14
+ type?: string;
15
+ label: string;
16
+ color: RGBColor;
17
+ fields: Field[];
18
+ dataContainer: DataContainerInterface;
19
+ allIndexes: number[];
20
+ filteredIndex: number[];
21
+ filteredIdxCPU?: number[];
22
+ filteredIndexForDomain: number[];
23
+ fieldPairs: FieldPair[];
24
+ gpuFilter: GpuFilter;
25
+ filterRecord?: FilterRecord;
26
+ filterRecordCPU?: FilterRecord;
27
+ changedFilters?: any;
28
+ sortColumn?: {
29
+ [key: string]: string;
30
+ };
31
+ sortOrder?: number[] | null;
32
+ pinnedColumns?: string[];
33
+ supportedFilterTypes?: string[] | null;
34
+ disableDataOperation?: boolean;
35
+ metadata: object;
36
+ constructor({ info, data, color, metadata, supportedFilterTypes, disableDataOperation }: {
37
+ info?: ProtoDataset['info'];
38
+ data: ProtoDataset['data'];
39
+ color: RGBColor;
40
+ metadata?: ProtoDataset['metadata'];
41
+ supportedFilterTypes?: ProtoDataset['supportedFilterTypes'];
42
+ disableDataOperation?: ProtoDataset['disableDataOperation'];
43
+ });
44
+ get length(): number;
45
+ /**
46
+ * Get field
47
+ * @param columnName
48
+ */
49
+ getColumnField(columnName: string): Field | undefined;
50
+ /**
51
+ * Get fieldIdx
52
+ * @param columnName
53
+ */
54
+ getColumnFieldIdx(columnName: string): number;
55
+ /**
56
+ * Get the value of a cell
57
+ */
58
+ getValue(columnName: string, rowIdx: number): any;
59
+ /**
60
+ * Updates existing field with a new object
61
+ * @param fieldIdx
62
+ * @param newField
63
+ */
64
+ updateColumnField(fieldIdx: number, newField: Field): void;
65
+ /**
66
+ * Update dataset color by custom color
67
+ * @param newColor
68
+ */
69
+ updateTableColor(newColor: RGBColor): void;
70
+ /**
71
+ * Save filterProps to field and retrieve it
72
+ * @param columnName
73
+ */
74
+ getColumnFilterProps(columnName: string): Field['filterProps'] | null | undefined;
75
+ /**
76
+ * Apply filters to dataset, return the filtered dataset with updated `gpuFilter`, `filterRecord`, `filteredIndex`, `filteredIndexForDomain`
77
+ * @param filters
78
+ * @param layers
79
+ * @param opt
80
+ */
81
+ filterTable(filters: Filter[], layers: Layer[], opt?: FilterDatasetOpt): KeplerTable;
82
+ /**
83
+ * Apply filters to a dataset all on CPU, assign to `filteredIdxCPU`, `filterRecordCPU`
84
+ * @param filters
85
+ * @param layers
86
+ */
87
+ filterTableCPU(filters: Filter[], layers: Layer[]): KeplerTable;
88
+ /**
89
+ * Calculate field domain based on field type and data
90
+ * for Filter
91
+ */
92
+ getColumnFilterDomain(field: Field): FieldDomain;
93
+ /**
94
+ * Get the domain of this column based on scale type
95
+ */
96
+ getColumnLayerDomain(field: Field, scaleType: string): number[] | string[] | [number, number] | null;
97
+ /**
98
+ * Get a sample of rows to calculate layer boundaries
99
+ */
100
+ /**
101
+ * Parse cell value based on column type and return a string representation
102
+ * Value the field value, type the field type
103
+ */
104
+ /**
105
+ * Assert whether field exist
106
+ * @param fieldName
107
+ * @param condition
108
+ */
109
+ _assetField(fieldName: string, condition: any): void;
110
+ }
111
+ export declare type Datasets = {
112
+ [key: string]: KeplerTable;
113
+ };
114
+ /**
115
+ * Find point fields pairs from fields
116
+ *
117
+ * @param fields
118
+ * @returns found point fields
119
+ */
120
+ export declare function findPointFieldPairs(fields: Field[]): FieldPair[];
121
+ /**
122
+ *
123
+ * @param dataset
124
+ * @param column
125
+ * @param mode
126
+ * @type
127
+ */
128
+ export declare function sortDatasetByColumn(dataset: KeplerTable, column: string, mode?: string): KeplerTable;
129
+ export declare function pinTableColumns(dataset: KeplerTable, column: string): KeplerTable;
130
+ export declare function copyTable(original: KeplerTable): KeplerTable;
131
+ /**
132
+ * @type
133
+ * @returns
134
+ */
135
+ export declare function copyTableAndUpdate(original: KeplerTable, options?: Partial<KeplerTable>): KeplerTable;
136
+ export declare function getFieldValueAccessor<F extends {
137
+ type?: Field['type'];
138
+ format?: Field['format'];
139
+ }>(f: F, i: number, dc: DataContainerInterface): (d: {
140
+ index: number;
141
+ }) => any;
142
+ export default KeplerTable;