exploreda 0.0.5
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.
- package/dist/ExplorEda.cjs +11747 -0
- package/dist/ExplorEda.cjs.map +1 -0
- package/dist/ExplorEda.css +4165 -0
- package/dist/ExplorEda.css.map +1 -0
- package/dist/ExplorEda.d.cts +332 -0
- package/dist/ExplorEda.d.ts +332 -0
- package/dist/ExplorEda.js +11707 -0
- package/dist/ExplorEda.js.map +1 -0
- package/package.json +165 -0
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
|
|
4
|
+
interface FilterBase {
|
|
5
|
+
type: string;
|
|
6
|
+
field: string;
|
|
7
|
+
}
|
|
8
|
+
interface ValueFilter extends FilterBase {
|
|
9
|
+
type: "value";
|
|
10
|
+
values: Array<datum$1>;
|
|
11
|
+
}
|
|
12
|
+
interface RangeFilter extends FilterBase {
|
|
13
|
+
type: "range";
|
|
14
|
+
min?: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
}
|
|
17
|
+
interface TextFilter extends FilterBase {
|
|
18
|
+
type: "text";
|
|
19
|
+
operator: "contains" | "equals" | "startsWith" | "endsWith";
|
|
20
|
+
value: string;
|
|
21
|
+
}
|
|
22
|
+
type Filter = ValueFilter | RangeFilter | TextFilter;
|
|
23
|
+
type datum$1 = string | number | boolean | undefined;
|
|
24
|
+
|
|
25
|
+
interface BarChartSettings extends BaseChartSettings {
|
|
26
|
+
type: "bar";
|
|
27
|
+
binCount?: number;
|
|
28
|
+
forceString?: boolean;
|
|
29
|
+
filters: Filter[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface DataTableSettings extends BaseChartSettings {
|
|
33
|
+
type: "data-table";
|
|
34
|
+
columns: Array<{
|
|
35
|
+
id: string;
|
|
36
|
+
field: string;
|
|
37
|
+
width?: number;
|
|
38
|
+
}>;
|
|
39
|
+
pageSize: number;
|
|
40
|
+
currentPage: number;
|
|
41
|
+
sortBy?: string;
|
|
42
|
+
sortDirection: "asc" | "desc";
|
|
43
|
+
filters: Filter[];
|
|
44
|
+
globalSearch: string;
|
|
45
|
+
tableHeight: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface MarkdownSettings extends BaseChartSettings {
|
|
49
|
+
type: "markdown";
|
|
50
|
+
content: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface PivotTableSettings extends BaseChartSettings {
|
|
54
|
+
type: "pivot";
|
|
55
|
+
rowFields: string[];
|
|
56
|
+
columnField: string;
|
|
57
|
+
valueFields: Array<{
|
|
58
|
+
field: string;
|
|
59
|
+
aggregation: "sum" | "count" | "avg" | "min" | "max" | "median" | "mode" | "stddev" | "variance" | "countUnique" | "singleValue";
|
|
60
|
+
formula?: string;
|
|
61
|
+
label?: string;
|
|
62
|
+
}>;
|
|
63
|
+
showTotals: {
|
|
64
|
+
row: boolean;
|
|
65
|
+
column: boolean;
|
|
66
|
+
grand: boolean;
|
|
67
|
+
};
|
|
68
|
+
dateBinning?: {
|
|
69
|
+
field: string;
|
|
70
|
+
type: "day" | "month" | "year";
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
interface ScatterPlotSettings extends BaseChartSettings {
|
|
75
|
+
type: "scatter";
|
|
76
|
+
xField: string;
|
|
77
|
+
yField: string;
|
|
78
|
+
filters: Filter[];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
interface SummaryTableSettings extends BaseChartSettings {
|
|
82
|
+
type: "summary";
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
interface ThreeDScatterSettings extends BaseChartSettings {
|
|
86
|
+
type: "3d-scatter";
|
|
87
|
+
xField: string;
|
|
88
|
+
yField: string;
|
|
89
|
+
zField: string;
|
|
90
|
+
colorField: string | undefined;
|
|
91
|
+
sizeField?: string;
|
|
92
|
+
cameraPosition: THREE.Vector3;
|
|
93
|
+
cameraTarget: THREE.Vector3;
|
|
94
|
+
pointSize: number;
|
|
95
|
+
pointOpacity: number;
|
|
96
|
+
showGrid: boolean;
|
|
97
|
+
showAxes: boolean;
|
|
98
|
+
xAxis: AxisSettings & {
|
|
99
|
+
zoomLevel: number;
|
|
100
|
+
};
|
|
101
|
+
yAxis: AxisSettings & {
|
|
102
|
+
zoomLevel: number;
|
|
103
|
+
};
|
|
104
|
+
zAxis: AxisSettings & {
|
|
105
|
+
zoomLevel: number;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
interface BoxPlotStyleSettings {
|
|
110
|
+
boxFill: string;
|
|
111
|
+
boxStroke: string;
|
|
112
|
+
boxStrokeWidth: number;
|
|
113
|
+
medianStroke: string;
|
|
114
|
+
medianStrokeWidth: number;
|
|
115
|
+
whiskerStroke: string;
|
|
116
|
+
whiskerStrokeWidth: number;
|
|
117
|
+
outlierSize: number;
|
|
118
|
+
outlierStroke: string;
|
|
119
|
+
outlierFill: string;
|
|
120
|
+
}
|
|
121
|
+
interface BoxPlotSettings extends BaseChartSettings {
|
|
122
|
+
type: "boxplot";
|
|
123
|
+
whiskerType: "tukey" | "minmax" | "stdDev";
|
|
124
|
+
showOutliers: boolean;
|
|
125
|
+
violinOverlay: boolean;
|
|
126
|
+
beeSwarmOverlay: boolean;
|
|
127
|
+
styles: BoxPlotStyleSettings;
|
|
128
|
+
filters: Filter[];
|
|
129
|
+
sortBy: "median" | "label";
|
|
130
|
+
violinBandwidth: number;
|
|
131
|
+
autoBandwidth: boolean;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
interface SeriesSettings {
|
|
135
|
+
showPoints: boolean;
|
|
136
|
+
pointSize: number;
|
|
137
|
+
pointOpacity: number;
|
|
138
|
+
lineWidth: number;
|
|
139
|
+
lineOpacity: number;
|
|
140
|
+
lineColor?: string;
|
|
141
|
+
lineStyle: "solid" | "dashed" | "dotted";
|
|
142
|
+
useRightAxis: boolean;
|
|
143
|
+
}
|
|
144
|
+
interface LineChartSettings extends BaseChartSettings {
|
|
145
|
+
type: "line";
|
|
146
|
+
xField: string;
|
|
147
|
+
seriesField: string[];
|
|
148
|
+
seriesSettings: Record<string, SeriesSettings>;
|
|
149
|
+
styles: {
|
|
150
|
+
curveType: "linear" | "monotoneX" | "step";
|
|
151
|
+
};
|
|
152
|
+
showXGrid: boolean;
|
|
153
|
+
showYGrid: boolean;
|
|
154
|
+
showLegend: boolean;
|
|
155
|
+
legendPosition: "top" | "right" | "bottom" | "left";
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
interface ChartLayout {
|
|
159
|
+
x: number;
|
|
160
|
+
y: number;
|
|
161
|
+
w: number;
|
|
162
|
+
h: number;
|
|
163
|
+
}
|
|
164
|
+
interface BaseFacetSettings {
|
|
165
|
+
enabled: boolean;
|
|
166
|
+
type: "grid" | "wrap";
|
|
167
|
+
}
|
|
168
|
+
interface GridFacetSettings extends BaseFacetSettings {
|
|
169
|
+
type: "grid";
|
|
170
|
+
rowVariable: string;
|
|
171
|
+
columnVariable: string;
|
|
172
|
+
}
|
|
173
|
+
interface WrapFacetSettings extends BaseFacetSettings {
|
|
174
|
+
type: "wrap";
|
|
175
|
+
rowVariable: string;
|
|
176
|
+
columnCount: number;
|
|
177
|
+
}
|
|
178
|
+
type FacetSettings = GridFacetSettings | WrapFacetSettings;
|
|
179
|
+
interface AxisSettings {
|
|
180
|
+
title?: string;
|
|
181
|
+
scaleType?: "linear" | "log" | "time" | "band";
|
|
182
|
+
grid?: boolean;
|
|
183
|
+
min?: number;
|
|
184
|
+
max?: number;
|
|
185
|
+
}
|
|
186
|
+
interface MarginSettings {
|
|
187
|
+
top?: number;
|
|
188
|
+
right?: number;
|
|
189
|
+
bottom?: number;
|
|
190
|
+
left?: number;
|
|
191
|
+
}
|
|
192
|
+
interface BaseChartSettings {
|
|
193
|
+
id: string;
|
|
194
|
+
title: string;
|
|
195
|
+
type: string;
|
|
196
|
+
field: string;
|
|
197
|
+
layout: ChartLayout;
|
|
198
|
+
colorScaleId: string | undefined;
|
|
199
|
+
colorField: string | undefined;
|
|
200
|
+
facet: FacetSettings;
|
|
201
|
+
xAxis: AxisSettings;
|
|
202
|
+
yAxis: AxisSettings;
|
|
203
|
+
margin: MarginSettings;
|
|
204
|
+
filters: Filter[];
|
|
205
|
+
xAxisLabel: string;
|
|
206
|
+
yAxisLabel: string;
|
|
207
|
+
xGridLines: number;
|
|
208
|
+
yGridLines: number;
|
|
209
|
+
}
|
|
210
|
+
interface RowChartSettings extends BaseChartSettings {
|
|
211
|
+
type: "row";
|
|
212
|
+
minRowHeight: number;
|
|
213
|
+
maxRowHeight: number;
|
|
214
|
+
}
|
|
215
|
+
type ChartSettings = RowChartSettings | BarChartSettings | ScatterPlotSettings | PivotTableSettings | ThreeDScatterSettings | SummaryTableSettings | DataTableSettings | MarkdownSettings | BoxPlotSettings | LineChartSettings;
|
|
216
|
+
type datum = string | number | boolean | undefined;
|
|
217
|
+
|
|
218
|
+
type AggregationType = "sum" | "count" | "min" | "max" | "average" | "countUnique" | "percentile" | "median" | "stddev" | "variance";
|
|
219
|
+
interface BaseExpression {
|
|
220
|
+
id: string;
|
|
221
|
+
name: string;
|
|
222
|
+
expression: string;
|
|
223
|
+
dependencies: string[];
|
|
224
|
+
rawInput: string;
|
|
225
|
+
}
|
|
226
|
+
interface BasicExpression extends BaseExpression {
|
|
227
|
+
type: "basic";
|
|
228
|
+
left: Expression;
|
|
229
|
+
right: Expression;
|
|
230
|
+
operator: string;
|
|
231
|
+
}
|
|
232
|
+
interface FunctionExpression extends BaseExpression {
|
|
233
|
+
type: "function";
|
|
234
|
+
functionName: string;
|
|
235
|
+
arguments: Expression[];
|
|
236
|
+
functionCategory?: string;
|
|
237
|
+
returnType?: string;
|
|
238
|
+
parameterTypes?: string[];
|
|
239
|
+
}
|
|
240
|
+
interface GroupExpression extends BaseExpression {
|
|
241
|
+
type: "group";
|
|
242
|
+
groupBy: string[];
|
|
243
|
+
aggregation: AggregationType;
|
|
244
|
+
}
|
|
245
|
+
interface RankExpression extends BaseExpression {
|
|
246
|
+
type: "rank";
|
|
247
|
+
rankBy: string[];
|
|
248
|
+
isNormalized: boolean;
|
|
249
|
+
isCumulative: boolean;
|
|
250
|
+
}
|
|
251
|
+
interface AdvancedExpression extends BaseExpression {
|
|
252
|
+
type: "advanced";
|
|
253
|
+
algorithm: "pca" | "tsne" | "umap" | "som";
|
|
254
|
+
parameters?: Record<string, any>;
|
|
255
|
+
regressionType?: "linear" | "polynomial";
|
|
256
|
+
degree?: number;
|
|
257
|
+
predictors?: string[];
|
|
258
|
+
response?: string;
|
|
259
|
+
}
|
|
260
|
+
interface TernaryExpression extends BaseExpression {
|
|
261
|
+
type: "ternary";
|
|
262
|
+
condition: Expression;
|
|
263
|
+
trueBranch: Expression;
|
|
264
|
+
falseBranch: Expression;
|
|
265
|
+
}
|
|
266
|
+
interface UnaryExpression extends BaseExpression {
|
|
267
|
+
type: "unary";
|
|
268
|
+
operand: Expression;
|
|
269
|
+
operator: string;
|
|
270
|
+
}
|
|
271
|
+
interface LiteralExpression extends BaseExpression {
|
|
272
|
+
type: "literal";
|
|
273
|
+
value: any;
|
|
274
|
+
}
|
|
275
|
+
type Expression = BasicExpression | FunctionExpression | GroupExpression | RankExpression | AdvancedExpression | TernaryExpression | UnaryExpression | LiteralExpression;
|
|
276
|
+
|
|
277
|
+
interface CalculationDefinition {
|
|
278
|
+
expression: Expression;
|
|
279
|
+
resultColumnName: string;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
interface BaseColorScale {
|
|
283
|
+
id: string;
|
|
284
|
+
name: string;
|
|
285
|
+
}
|
|
286
|
+
interface NumericalColorScale extends BaseColorScale {
|
|
287
|
+
type: "numerical";
|
|
288
|
+
palette: string;
|
|
289
|
+
min: number;
|
|
290
|
+
max: number;
|
|
291
|
+
}
|
|
292
|
+
interface CategoricalColorScale extends BaseColorScale {
|
|
293
|
+
type: "categorical";
|
|
294
|
+
palette: string[];
|
|
295
|
+
mapping: Map<string, string>;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
interface GridSettings {
|
|
299
|
+
columnCount: number;
|
|
300
|
+
rowHeight: number;
|
|
301
|
+
containerPadding: number;
|
|
302
|
+
showBackgroundMarkers: boolean;
|
|
303
|
+
}
|
|
304
|
+
interface ViewMetadata {
|
|
305
|
+
name: string;
|
|
306
|
+
version: number;
|
|
307
|
+
createdAt: string;
|
|
308
|
+
modifiedAt: string;
|
|
309
|
+
}
|
|
310
|
+
interface SerializedCategoricalColorScale extends Omit<CategoricalColorScale, "mapping"> {
|
|
311
|
+
type: "categorical";
|
|
312
|
+
mapping: [string, string][];
|
|
313
|
+
}
|
|
314
|
+
type SerializedColorScale = NumericalColorScale | SerializedCategoricalColorScale;
|
|
315
|
+
interface SavedDataStructure {
|
|
316
|
+
charts: ChartSettings[];
|
|
317
|
+
calculations: CalculationDefinition[];
|
|
318
|
+
gridSettings: GridSettings;
|
|
319
|
+
metadata: ViewMetadata;
|
|
320
|
+
colorScales: SerializedColorScale[];
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
type DatumObject = {
|
|
324
|
+
[key: string]: datum;
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
declare function ExplorEda({ data, savedData, }: {
|
|
328
|
+
data: DatumObject[];
|
|
329
|
+
savedData: SavedDataStructure | undefined;
|
|
330
|
+
}): react_jsx_runtime.JSX.Element;
|
|
331
|
+
|
|
332
|
+
export { ExplorEda };
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
|
|
4
|
+
interface FilterBase {
|
|
5
|
+
type: string;
|
|
6
|
+
field: string;
|
|
7
|
+
}
|
|
8
|
+
interface ValueFilter extends FilterBase {
|
|
9
|
+
type: "value";
|
|
10
|
+
values: Array<datum$1>;
|
|
11
|
+
}
|
|
12
|
+
interface RangeFilter extends FilterBase {
|
|
13
|
+
type: "range";
|
|
14
|
+
min?: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
}
|
|
17
|
+
interface TextFilter extends FilterBase {
|
|
18
|
+
type: "text";
|
|
19
|
+
operator: "contains" | "equals" | "startsWith" | "endsWith";
|
|
20
|
+
value: string;
|
|
21
|
+
}
|
|
22
|
+
type Filter = ValueFilter | RangeFilter | TextFilter;
|
|
23
|
+
type datum$1 = string | number | boolean | undefined;
|
|
24
|
+
|
|
25
|
+
interface BarChartSettings extends BaseChartSettings {
|
|
26
|
+
type: "bar";
|
|
27
|
+
binCount?: number;
|
|
28
|
+
forceString?: boolean;
|
|
29
|
+
filters: Filter[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface DataTableSettings extends BaseChartSettings {
|
|
33
|
+
type: "data-table";
|
|
34
|
+
columns: Array<{
|
|
35
|
+
id: string;
|
|
36
|
+
field: string;
|
|
37
|
+
width?: number;
|
|
38
|
+
}>;
|
|
39
|
+
pageSize: number;
|
|
40
|
+
currentPage: number;
|
|
41
|
+
sortBy?: string;
|
|
42
|
+
sortDirection: "asc" | "desc";
|
|
43
|
+
filters: Filter[];
|
|
44
|
+
globalSearch: string;
|
|
45
|
+
tableHeight: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface MarkdownSettings extends BaseChartSettings {
|
|
49
|
+
type: "markdown";
|
|
50
|
+
content: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface PivotTableSettings extends BaseChartSettings {
|
|
54
|
+
type: "pivot";
|
|
55
|
+
rowFields: string[];
|
|
56
|
+
columnField: string;
|
|
57
|
+
valueFields: Array<{
|
|
58
|
+
field: string;
|
|
59
|
+
aggregation: "sum" | "count" | "avg" | "min" | "max" | "median" | "mode" | "stddev" | "variance" | "countUnique" | "singleValue";
|
|
60
|
+
formula?: string;
|
|
61
|
+
label?: string;
|
|
62
|
+
}>;
|
|
63
|
+
showTotals: {
|
|
64
|
+
row: boolean;
|
|
65
|
+
column: boolean;
|
|
66
|
+
grand: boolean;
|
|
67
|
+
};
|
|
68
|
+
dateBinning?: {
|
|
69
|
+
field: string;
|
|
70
|
+
type: "day" | "month" | "year";
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
interface ScatterPlotSettings extends BaseChartSettings {
|
|
75
|
+
type: "scatter";
|
|
76
|
+
xField: string;
|
|
77
|
+
yField: string;
|
|
78
|
+
filters: Filter[];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
interface SummaryTableSettings extends BaseChartSettings {
|
|
82
|
+
type: "summary";
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
interface ThreeDScatterSettings extends BaseChartSettings {
|
|
86
|
+
type: "3d-scatter";
|
|
87
|
+
xField: string;
|
|
88
|
+
yField: string;
|
|
89
|
+
zField: string;
|
|
90
|
+
colorField: string | undefined;
|
|
91
|
+
sizeField?: string;
|
|
92
|
+
cameraPosition: THREE.Vector3;
|
|
93
|
+
cameraTarget: THREE.Vector3;
|
|
94
|
+
pointSize: number;
|
|
95
|
+
pointOpacity: number;
|
|
96
|
+
showGrid: boolean;
|
|
97
|
+
showAxes: boolean;
|
|
98
|
+
xAxis: AxisSettings & {
|
|
99
|
+
zoomLevel: number;
|
|
100
|
+
};
|
|
101
|
+
yAxis: AxisSettings & {
|
|
102
|
+
zoomLevel: number;
|
|
103
|
+
};
|
|
104
|
+
zAxis: AxisSettings & {
|
|
105
|
+
zoomLevel: number;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
interface BoxPlotStyleSettings {
|
|
110
|
+
boxFill: string;
|
|
111
|
+
boxStroke: string;
|
|
112
|
+
boxStrokeWidth: number;
|
|
113
|
+
medianStroke: string;
|
|
114
|
+
medianStrokeWidth: number;
|
|
115
|
+
whiskerStroke: string;
|
|
116
|
+
whiskerStrokeWidth: number;
|
|
117
|
+
outlierSize: number;
|
|
118
|
+
outlierStroke: string;
|
|
119
|
+
outlierFill: string;
|
|
120
|
+
}
|
|
121
|
+
interface BoxPlotSettings extends BaseChartSettings {
|
|
122
|
+
type: "boxplot";
|
|
123
|
+
whiskerType: "tukey" | "minmax" | "stdDev";
|
|
124
|
+
showOutliers: boolean;
|
|
125
|
+
violinOverlay: boolean;
|
|
126
|
+
beeSwarmOverlay: boolean;
|
|
127
|
+
styles: BoxPlotStyleSettings;
|
|
128
|
+
filters: Filter[];
|
|
129
|
+
sortBy: "median" | "label";
|
|
130
|
+
violinBandwidth: number;
|
|
131
|
+
autoBandwidth: boolean;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
interface SeriesSettings {
|
|
135
|
+
showPoints: boolean;
|
|
136
|
+
pointSize: number;
|
|
137
|
+
pointOpacity: number;
|
|
138
|
+
lineWidth: number;
|
|
139
|
+
lineOpacity: number;
|
|
140
|
+
lineColor?: string;
|
|
141
|
+
lineStyle: "solid" | "dashed" | "dotted";
|
|
142
|
+
useRightAxis: boolean;
|
|
143
|
+
}
|
|
144
|
+
interface LineChartSettings extends BaseChartSettings {
|
|
145
|
+
type: "line";
|
|
146
|
+
xField: string;
|
|
147
|
+
seriesField: string[];
|
|
148
|
+
seriesSettings: Record<string, SeriesSettings>;
|
|
149
|
+
styles: {
|
|
150
|
+
curveType: "linear" | "monotoneX" | "step";
|
|
151
|
+
};
|
|
152
|
+
showXGrid: boolean;
|
|
153
|
+
showYGrid: boolean;
|
|
154
|
+
showLegend: boolean;
|
|
155
|
+
legendPosition: "top" | "right" | "bottom" | "left";
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
interface ChartLayout {
|
|
159
|
+
x: number;
|
|
160
|
+
y: number;
|
|
161
|
+
w: number;
|
|
162
|
+
h: number;
|
|
163
|
+
}
|
|
164
|
+
interface BaseFacetSettings {
|
|
165
|
+
enabled: boolean;
|
|
166
|
+
type: "grid" | "wrap";
|
|
167
|
+
}
|
|
168
|
+
interface GridFacetSettings extends BaseFacetSettings {
|
|
169
|
+
type: "grid";
|
|
170
|
+
rowVariable: string;
|
|
171
|
+
columnVariable: string;
|
|
172
|
+
}
|
|
173
|
+
interface WrapFacetSettings extends BaseFacetSettings {
|
|
174
|
+
type: "wrap";
|
|
175
|
+
rowVariable: string;
|
|
176
|
+
columnCount: number;
|
|
177
|
+
}
|
|
178
|
+
type FacetSettings = GridFacetSettings | WrapFacetSettings;
|
|
179
|
+
interface AxisSettings {
|
|
180
|
+
title?: string;
|
|
181
|
+
scaleType?: "linear" | "log" | "time" | "band";
|
|
182
|
+
grid?: boolean;
|
|
183
|
+
min?: number;
|
|
184
|
+
max?: number;
|
|
185
|
+
}
|
|
186
|
+
interface MarginSettings {
|
|
187
|
+
top?: number;
|
|
188
|
+
right?: number;
|
|
189
|
+
bottom?: number;
|
|
190
|
+
left?: number;
|
|
191
|
+
}
|
|
192
|
+
interface BaseChartSettings {
|
|
193
|
+
id: string;
|
|
194
|
+
title: string;
|
|
195
|
+
type: string;
|
|
196
|
+
field: string;
|
|
197
|
+
layout: ChartLayout;
|
|
198
|
+
colorScaleId: string | undefined;
|
|
199
|
+
colorField: string | undefined;
|
|
200
|
+
facet: FacetSettings;
|
|
201
|
+
xAxis: AxisSettings;
|
|
202
|
+
yAxis: AxisSettings;
|
|
203
|
+
margin: MarginSettings;
|
|
204
|
+
filters: Filter[];
|
|
205
|
+
xAxisLabel: string;
|
|
206
|
+
yAxisLabel: string;
|
|
207
|
+
xGridLines: number;
|
|
208
|
+
yGridLines: number;
|
|
209
|
+
}
|
|
210
|
+
interface RowChartSettings extends BaseChartSettings {
|
|
211
|
+
type: "row";
|
|
212
|
+
minRowHeight: number;
|
|
213
|
+
maxRowHeight: number;
|
|
214
|
+
}
|
|
215
|
+
type ChartSettings = RowChartSettings | BarChartSettings | ScatterPlotSettings | PivotTableSettings | ThreeDScatterSettings | SummaryTableSettings | DataTableSettings | MarkdownSettings | BoxPlotSettings | LineChartSettings;
|
|
216
|
+
type datum = string | number | boolean | undefined;
|
|
217
|
+
|
|
218
|
+
type AggregationType = "sum" | "count" | "min" | "max" | "average" | "countUnique" | "percentile" | "median" | "stddev" | "variance";
|
|
219
|
+
interface BaseExpression {
|
|
220
|
+
id: string;
|
|
221
|
+
name: string;
|
|
222
|
+
expression: string;
|
|
223
|
+
dependencies: string[];
|
|
224
|
+
rawInput: string;
|
|
225
|
+
}
|
|
226
|
+
interface BasicExpression extends BaseExpression {
|
|
227
|
+
type: "basic";
|
|
228
|
+
left: Expression;
|
|
229
|
+
right: Expression;
|
|
230
|
+
operator: string;
|
|
231
|
+
}
|
|
232
|
+
interface FunctionExpression extends BaseExpression {
|
|
233
|
+
type: "function";
|
|
234
|
+
functionName: string;
|
|
235
|
+
arguments: Expression[];
|
|
236
|
+
functionCategory?: string;
|
|
237
|
+
returnType?: string;
|
|
238
|
+
parameterTypes?: string[];
|
|
239
|
+
}
|
|
240
|
+
interface GroupExpression extends BaseExpression {
|
|
241
|
+
type: "group";
|
|
242
|
+
groupBy: string[];
|
|
243
|
+
aggregation: AggregationType;
|
|
244
|
+
}
|
|
245
|
+
interface RankExpression extends BaseExpression {
|
|
246
|
+
type: "rank";
|
|
247
|
+
rankBy: string[];
|
|
248
|
+
isNormalized: boolean;
|
|
249
|
+
isCumulative: boolean;
|
|
250
|
+
}
|
|
251
|
+
interface AdvancedExpression extends BaseExpression {
|
|
252
|
+
type: "advanced";
|
|
253
|
+
algorithm: "pca" | "tsne" | "umap" | "som";
|
|
254
|
+
parameters?: Record<string, any>;
|
|
255
|
+
regressionType?: "linear" | "polynomial";
|
|
256
|
+
degree?: number;
|
|
257
|
+
predictors?: string[];
|
|
258
|
+
response?: string;
|
|
259
|
+
}
|
|
260
|
+
interface TernaryExpression extends BaseExpression {
|
|
261
|
+
type: "ternary";
|
|
262
|
+
condition: Expression;
|
|
263
|
+
trueBranch: Expression;
|
|
264
|
+
falseBranch: Expression;
|
|
265
|
+
}
|
|
266
|
+
interface UnaryExpression extends BaseExpression {
|
|
267
|
+
type: "unary";
|
|
268
|
+
operand: Expression;
|
|
269
|
+
operator: string;
|
|
270
|
+
}
|
|
271
|
+
interface LiteralExpression extends BaseExpression {
|
|
272
|
+
type: "literal";
|
|
273
|
+
value: any;
|
|
274
|
+
}
|
|
275
|
+
type Expression = BasicExpression | FunctionExpression | GroupExpression | RankExpression | AdvancedExpression | TernaryExpression | UnaryExpression | LiteralExpression;
|
|
276
|
+
|
|
277
|
+
interface CalculationDefinition {
|
|
278
|
+
expression: Expression;
|
|
279
|
+
resultColumnName: string;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
interface BaseColorScale {
|
|
283
|
+
id: string;
|
|
284
|
+
name: string;
|
|
285
|
+
}
|
|
286
|
+
interface NumericalColorScale extends BaseColorScale {
|
|
287
|
+
type: "numerical";
|
|
288
|
+
palette: string;
|
|
289
|
+
min: number;
|
|
290
|
+
max: number;
|
|
291
|
+
}
|
|
292
|
+
interface CategoricalColorScale extends BaseColorScale {
|
|
293
|
+
type: "categorical";
|
|
294
|
+
palette: string[];
|
|
295
|
+
mapping: Map<string, string>;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
interface GridSettings {
|
|
299
|
+
columnCount: number;
|
|
300
|
+
rowHeight: number;
|
|
301
|
+
containerPadding: number;
|
|
302
|
+
showBackgroundMarkers: boolean;
|
|
303
|
+
}
|
|
304
|
+
interface ViewMetadata {
|
|
305
|
+
name: string;
|
|
306
|
+
version: number;
|
|
307
|
+
createdAt: string;
|
|
308
|
+
modifiedAt: string;
|
|
309
|
+
}
|
|
310
|
+
interface SerializedCategoricalColorScale extends Omit<CategoricalColorScale, "mapping"> {
|
|
311
|
+
type: "categorical";
|
|
312
|
+
mapping: [string, string][];
|
|
313
|
+
}
|
|
314
|
+
type SerializedColorScale = NumericalColorScale | SerializedCategoricalColorScale;
|
|
315
|
+
interface SavedDataStructure {
|
|
316
|
+
charts: ChartSettings[];
|
|
317
|
+
calculations: CalculationDefinition[];
|
|
318
|
+
gridSettings: GridSettings;
|
|
319
|
+
metadata: ViewMetadata;
|
|
320
|
+
colorScales: SerializedColorScale[];
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
type DatumObject = {
|
|
324
|
+
[key: string]: datum;
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
declare function ExplorEda({ data, savedData, }: {
|
|
328
|
+
data: DatumObject[];
|
|
329
|
+
savedData: SavedDataStructure | undefined;
|
|
330
|
+
}): react_jsx_runtime.JSX.Element;
|
|
331
|
+
|
|
332
|
+
export { ExplorEda };
|