@datawheel/data-explorer 0.3.1 → 0.3.3

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/main.d.ts ADDED
@@ -0,0 +1,1098 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { MRT_TableInstance, MRT_ColumnDef, MRT_PaginationState, MRT_TableOptions } from 'mantine-react-table';
3
+ import { TranslationContextProps } from '@datawheel/use-translation';
4
+ import { CSSObject } from '@mantine/core';
5
+ import { StepType, TourProps } from '@reactour/tour';
6
+ import * as _reduxjs_toolkit from '@reduxjs/toolkit';
7
+ import { StateFromReducersMapObject, ThunkAction, Action } from '@reduxjs/toolkit';
8
+ import * as redux from 'redux';
9
+
10
+ declare enum Aggregator {
11
+ AVERAGE = "Average",
12
+ COUNT = "Count",
13
+ MAX = "Max",
14
+ MEDIAN = "Median",
15
+ MIN = "Min",
16
+ MODE = "Mode",
17
+ SUM = "Sum",
18
+ BASICGROUPEDMEDIAN = "BasicGroupedMedian",
19
+ CALCULATEDMOE = "CalculatedMoe",
20
+ QUANTILE = "Quantile",
21
+ REPLICATEWEIGHTMOE = "ReplicateWeightMoe",
22
+ WEIGHTEDAVERAGE = "WeightedAverage",
23
+ WEIGHTEDAVERAGEMOE = "WeightedAverageMoe",
24
+ WEIGHTEDSUM = "WeightedSum",
25
+ DISTINCTCOUNT = "DistinctCount"
26
+ }
27
+ declare enum Comparison {
28
+ "!=" = "neq",
29
+ "<" = "lt",
30
+ "<=" = "lte",
31
+ "<>" = "neq",
32
+ "=" = "eq",
33
+ ">" = "gt",
34
+ ">=" = "gte",
35
+ eq = "eq",
36
+ EQ = "eq",
37
+ gt = "gt",
38
+ GT = "gt",
39
+ gte = "gte",
40
+ GTE = "gte",
41
+ lt = "lt",
42
+ LT = "lt",
43
+ lte = "lte",
44
+ LTE = "lte",
45
+ NEQ = "neq",
46
+ neq = "neq"
47
+ }
48
+ declare enum DimensionType {
49
+ GEO = "geo",
50
+ STANDARD = "standard",
51
+ TIME = "time"
52
+ }
53
+ declare enum Format {
54
+ csv = "csv",
55
+ jsonrecords = "jsonrecords",
56
+ parquet = "parquet",
57
+ tsv = "tsv",
58
+ xlsx = "xlsx"
59
+ }
60
+
61
+ type Annotations = Record<string, string | undefined>;
62
+ interface TesseractDataRequest {
63
+ cube: string;
64
+ /**
65
+ * @example LevelName,LevelName,LevelName
66
+ */
67
+ drilldowns: string;
68
+ /**
69
+ * @example Measure,Measure,Measure
70
+ */
71
+ measures: string;
72
+ /**
73
+ * @example Level:key,key,key;Level:key,key,key
74
+ */
75
+ exclude?: string;
76
+ /**
77
+ * @example Measure.gt.10000.and.lt.60000,Measure.lt.100000
78
+ */
79
+ filters?: string;
80
+ /**
81
+ * @example Level:key,key,key;Level:key,key,key
82
+ */
83
+ include?: string;
84
+ /**
85
+ * A single number is limit; a pair of numbers are limit, offset.
86
+ * @example 2,5
87
+ */
88
+ limit?: string;
89
+ /**
90
+ * @example es
91
+ */
92
+ locale?: string;
93
+ /**
94
+ * A boolean enables parents for all levels in the request.
95
+ * You can also pick specific Levels from the drilldown list.
96
+ * @example true
97
+ * @example Level,Level
98
+ */
99
+ parents?: boolean | string;
100
+ /**
101
+ * @example Property,Property
102
+ */
103
+ properties?: string;
104
+ /**
105
+ * A boolean sets rankings for all measures in descending order.
106
+ * If setting measure names, orden can be set with or without a leading minus.
107
+ * @example true
108
+ * @example Measure,-Measure
109
+ */
110
+ ranking?: boolean | string;
111
+ /**
112
+ * @example Measure.asc
113
+ * @example Property.desc
114
+ */
115
+ sort?: string;
116
+ /**
117
+ * Determines if the request should return the full cardinality of available
118
+ * options, even if their associated value is null.
119
+ * @default true
120
+ */
121
+ sparse?: boolean;
122
+ /**
123
+ * @example month.latest.6
124
+ * @example Level.oldest
125
+ */
126
+ time?: string;
127
+ /**
128
+ * Slices the resulting items to only the highest/lowest N items by the value
129
+ * of Measure, for all the subgroups signaled by the Level parameters.
130
+ * @example 10.Level.Measure.asc
131
+ * @example 3.Level,Level.Measure.desc
132
+ */
133
+ top?: string;
134
+ /**
135
+ * Calculates the growth in Measure for each Level using one of these methods:
136
+ * - fixed: Calculates growth against a fixed member key from Level
137
+ * - period: Calculates growth comparing a time point with its previous N point
138
+ * @example Level.Measure.fixed.201804
139
+ * @example Level.Measure.period.3
140
+ */
141
+ growth?: string;
142
+ }
143
+ interface TesseractMembersRequest {
144
+ cube: string;
145
+ level: string;
146
+ limit?: string;
147
+ locale?: string;
148
+ parents?: boolean;
149
+ search?: string;
150
+ }
151
+ interface TesseractMembersResponse {
152
+ /** Name of the relevant level */
153
+ name: string;
154
+ /** Public localized name of the relevant level */
155
+ caption: string;
156
+ dimensionType: DimensionType;
157
+ dimension: string;
158
+ hierarchy: string;
159
+ /** Depth of the level in its Hierarchy */
160
+ depth: number;
161
+ /** Metadata for the level */
162
+ annotations: Annotations;
163
+ /** Child Properties from this level */
164
+ properties: TesseractProperty[];
165
+ /** Data type of each column in the members array */
166
+ dtypes: {
167
+ [K in keyof TesseractMember]: string;
168
+ };
169
+ /** The actual list of members for the level */
170
+ members: TesseractMember[];
171
+ }
172
+ interface TesseractStatus {
173
+ module: string;
174
+ version: string;
175
+ debug: false | Record<string, string>;
176
+ extras: Record<string, string>;
177
+ }
178
+ interface TesseractSchema {
179
+ name: string;
180
+ locales: string[];
181
+ default_locale: string;
182
+ annotations: Annotations;
183
+ cubes: TesseractCube[];
184
+ }
185
+ interface TesseractCube {
186
+ name: string;
187
+ caption: string;
188
+ annotations: Annotations;
189
+ dimensions: TesseractDimension[];
190
+ measures: TesseractMeasure[];
191
+ }
192
+ interface TesseractMeasure {
193
+ name: string;
194
+ caption: string;
195
+ annotations: Annotations;
196
+ aggregator: Aggregator;
197
+ attached: TesseractMeasure[];
198
+ }
199
+ interface TesseractDimension {
200
+ name: string;
201
+ caption: string;
202
+ annotations: Annotations;
203
+ type: DimensionType;
204
+ hierarchies: TesseractHierarchy[];
205
+ default_hierarchy: string;
206
+ }
207
+ interface TesseractHierarchy {
208
+ name: string;
209
+ caption: string;
210
+ annotations: Annotations;
211
+ levels: TesseractLevel[];
212
+ }
213
+ interface TesseractLevel {
214
+ name: string;
215
+ caption: string;
216
+ annotations: Annotations;
217
+ depth: number;
218
+ properties: TesseractProperty[];
219
+ }
220
+ interface TesseractProperty {
221
+ name: string;
222
+ caption: string;
223
+ annotations: Annotations;
224
+ type: string;
225
+ }
226
+ interface TesseractMember {
227
+ /** The unique ID for this member */
228
+ key: string | number;
229
+ /** The localized label for this member */
230
+ caption?: string;
231
+ /** A list of direct ancestor members, one per level above this one */
232
+ ancestor?: TesseractMember[];
233
+ }
234
+
235
+ interface ComplexityStatus {
236
+ module: string;
237
+ version: string;
238
+ debug: false | Record<string, string>;
239
+ extras: Record<string, string>;
240
+ }
241
+ interface CommonRequest {
242
+ alias?: Record<string, string>;
243
+ filter?: Record<string, string>;
244
+ locale?: string;
245
+ }
246
+ interface RcaRequest extends CommonRequest {
247
+ cube: string;
248
+ activity: string;
249
+ location: string;
250
+ measure: string;
251
+ cuts?: Record<string, string>;
252
+ parents?: boolean;
253
+ threshold?: string[];
254
+ }
255
+ interface ComplexityRequest extends RcaRequest {
256
+ ascending?: boolean;
257
+ cutoff?: number;
258
+ iterations?: number;
259
+ rank?: boolean;
260
+ }
261
+ interface RelatednessRequest extends RcaRequest {
262
+ ascending?: boolean;
263
+ cutoff?: number;
264
+ rank?: boolean;
265
+ }
266
+ interface OpportunityRequest extends RcaRequest {
267
+ ascending?: boolean;
268
+ cutoff?: number;
269
+ rank?: boolean;
270
+ }
271
+ interface GiniRequest extends RcaRequest {
272
+ gini_cube: string;
273
+ gini_location: string;
274
+ gini_measure: string;
275
+ ascending?: boolean;
276
+ cutoff?: number;
277
+ rank?: boolean;
278
+ }
279
+ interface EmissionsRequest extends RcaRequest {
280
+ emissions_cube: string;
281
+ emissions_location: string;
282
+ emissions_measure: string;
283
+ ascending?: boolean;
284
+ cutoff?: number;
285
+ rank?: boolean;
286
+ }
287
+
288
+ declare class ComplexityModuleClient {
289
+ baseURL: string;
290
+ requestConfig: RequestInit;
291
+ constructor(baseURL?: string, config?: RequestInit);
292
+ fetchStatus(params: {
293
+ signal?: AbortSignal;
294
+ }): Promise<ComplexityStatus>;
295
+ fetchSchema(params: {
296
+ locale?: string;
297
+ signal?: AbortSignal;
298
+ }): Promise<TesseractSchema>;
299
+ fetchCube(params: {
300
+ cube: string;
301
+ locale?: string;
302
+ signal?: AbortSignal;
303
+ }): Promise<TesseractCube>;
304
+ fetchData(type: "rca", params: {
305
+ request: RcaRequest;
306
+ format: Format;
307
+ signal?: AbortSignal;
308
+ }): any;
309
+ fetchData(type: "eci", params: {
310
+ request: ComplexityRequest;
311
+ format: Format;
312
+ signal?: AbortSignal;
313
+ }): any;
314
+ fetchData(type: "pci", params: {
315
+ request: ComplexityRequest;
316
+ format: Format;
317
+ signal?: AbortSignal;
318
+ }): any;
319
+ fetchData(type: "relatedness", params: {
320
+ request: RelatednessRequest;
321
+ format: Format;
322
+ signal?: AbortSignal;
323
+ }): any;
324
+ fetchData(type: "opportunity_gain", params: {
325
+ request: OpportunityRequest;
326
+ format: Format;
327
+ signal?: AbortSignal;
328
+ }): any;
329
+ fetchData(type: "pgi", params: {
330
+ request: GiniRequest;
331
+ format: Format;
332
+ signal?: AbortSignal;
333
+ }): any;
334
+ fetchData(type: "peii", params: {
335
+ request: EmissionsRequest;
336
+ format: Format;
337
+ signal?: AbortSignal;
338
+ }): any;
339
+ }
340
+
341
+ declare class TesseractModuleClient {
342
+ baseURL: string;
343
+ requestConfig: RequestInit;
344
+ constructor(baseURL?: string, config?: RequestInit);
345
+ fetchStatus(params: {
346
+ signal?: AbortSignal;
347
+ }): Promise<TesseractStatus>;
348
+ fetchSchema(params: {
349
+ locale?: string;
350
+ signal?: AbortSignal;
351
+ }): Promise<TesseractSchema>;
352
+ fetchCube(params: {
353
+ cube: string;
354
+ locale?: string;
355
+ signal?: AbortSignal;
356
+ }): Promise<TesseractCube>;
357
+ fetchData(params: {
358
+ request: TesseractDataRequest;
359
+ format: `${Format}`;
360
+ signal?: AbortSignal;
361
+ }): Promise<Response>;
362
+ fetchMembers(params: {
363
+ request: TesseractMembersRequest;
364
+ signal?: AbortSignal;
365
+ }): Promise<TesseractMembersResponse>;
366
+ }
367
+
368
+ interface QueryItem {
369
+ created: string;
370
+ isDirty: boolean;
371
+ key: string;
372
+ label: string;
373
+ panel: string | null;
374
+ params: QueryParams;
375
+ result: QueryResult;
376
+ }
377
+ interface QueryParams {
378
+ booleans: Record<string, undefined | boolean>;
379
+ cube: string;
380
+ cuts: Record<string, CutItem>;
381
+ drilldowns: Record<string, DrilldownItem>;
382
+ filters: Record<string, FilterItem>;
383
+ locale: string | undefined;
384
+ measures: Record<string, MeasureItem>;
385
+ isPreview: boolean;
386
+ pagiLimit: number;
387
+ pagiOffset: number;
388
+ sortDir: "asc" | "desc";
389
+ sortKey: string | undefined;
390
+ }
391
+ interface QueryResult<D = Record<string, unknown>> {
392
+ data: D[];
393
+ page: {
394
+ limit: number;
395
+ offset: number;
396
+ total: number;
397
+ };
398
+ types: Record<string, AnyResultColumn>;
399
+ headers?: Record<string, string>;
400
+ status: number;
401
+ url: string;
402
+ }
403
+ interface ResultEntityType {
404
+ level: TesseractLevel;
405
+ property: TesseractProperty;
406
+ measure: TesseractMeasure;
407
+ }
408
+ interface ResultColumn<T extends keyof ResultEntityType> {
409
+ label: string;
410
+ localeLabel: string;
411
+ isId: boolean;
412
+ entity: ResultEntityType[T];
413
+ entityType: T;
414
+ valueType: "boolean" | "number" | "string";
415
+ range?: [number, number];
416
+ }
417
+ type AnyResultColumn = ResultColumn<"level"> | ResultColumn<"measure"> | ResultColumn<"property">;
418
+ interface QueryParamsItem {
419
+ active: boolean;
420
+ readonly key: string;
421
+ }
422
+ interface CutItem extends QueryParamsItem {
423
+ dimension: string;
424
+ hierarchy: string;
425
+ level: string;
426
+ members: string[];
427
+ }
428
+ interface DrilldownItem extends QueryParamsItem {
429
+ captionProperty: string;
430
+ dimension: string;
431
+ hierarchy: string;
432
+ level: string;
433
+ properties: PropertyItem[];
434
+ members: {
435
+ key: string | number;
436
+ caption?: string;
437
+ }[];
438
+ }
439
+ interface FilterItem extends QueryParamsItem {
440
+ measure: string;
441
+ conditionOne: [`${Comparison}`, string, number];
442
+ conditionTwo?: [`${Comparison}`, string, number];
443
+ joint: "and" | "or";
444
+ }
445
+ interface MeasureItem extends QueryParamsItem {
446
+ name: string;
447
+ caption?: string;
448
+ }
449
+ interface PropertyItem extends QueryParamsItem {
450
+ level: string;
451
+ name: string;
452
+ }
453
+
454
+ interface FileDescriptor {
455
+ content: Blob | string;
456
+ extension: string;
457
+ name: string;
458
+ }
459
+ type Formatter = (value: number | null, locale?: string) => string;
460
+ interface PanelDescriptor {
461
+ key: string;
462
+ label: string;
463
+ component: React.ComponentType<ViewProps>;
464
+ }
465
+ interface ViewProps<TData extends Record<string, any> = Record<string, string | number>> {
466
+ className?: string;
467
+ cube: TesseractCube;
468
+ panelKey: string | null;
469
+ params: QueryParams;
470
+ result: QueryResult<TData>;
471
+ table?: MRT_TableInstance<TData & Record<string, any>>;
472
+ isError?: boolean;
473
+ isLoading?: boolean;
474
+ data?: Record<string, string | number>[];
475
+ columns?: MRT_ColumnDef<TData>[];
476
+ pagination?: MRT_PaginationState;
477
+ setPagination?: React.Dispatch<React.SetStateAction<MRT_PaginationState>>;
478
+ }
479
+
480
+ /** */
481
+ declare function DebugView(props: ViewProps): React.JSX.Element;
482
+
483
+ declare const defaultTranslation: {
484
+ action_copy: string;
485
+ action_copy_done: string;
486
+ action_download: string;
487
+ action_open: string;
488
+ action_reload: string;
489
+ sidebar: {
490
+ dataset: string;
491
+ };
492
+ comparison: {
493
+ BT: string;
494
+ EQ: string;
495
+ GT: string;
496
+ GTE: string;
497
+ LT: string;
498
+ LTE: string;
499
+ NEQ: string;
500
+ };
501
+ debug_view: {
502
+ tab_label: string;
503
+ httpheaders: string;
504
+ jssource_prefix: string;
505
+ jssource_suffix: string;
506
+ url_aggregate: string;
507
+ url_logiclayer: string;
508
+ };
509
+ direction: {
510
+ ASC: string;
511
+ DESC: string;
512
+ };
513
+ formats: {
514
+ csv: string;
515
+ json: string;
516
+ tsv: string;
517
+ parquet: string;
518
+ jsonrecords: string;
519
+ xlsx: string;
520
+ };
521
+ loading: {
522
+ title: string;
523
+ message_heavyquery: string;
524
+ message_default: string;
525
+ };
526
+ params: {
527
+ add_metadata: string;
528
+ action_clear: string;
529
+ action_clear_description: string;
530
+ action_execute: string;
531
+ add_columns: string;
532
+ column_title: string;
533
+ current_endpoint: string;
534
+ dimmenu_abbrjoint: string;
535
+ dimmenu_dimension: string;
536
+ dimmenu_hierarchy: string;
537
+ dimmenu_level: string;
538
+ filter_mode: string;
539
+ filter_by: string;
540
+ error_no_cut_selected_detail: string;
541
+ error_no_cut_selected_title: string;
542
+ error_no_dimension_selected_detail: string;
543
+ error_no_dimension_selected_title: string;
544
+ error_fetchmembers_detail: string;
545
+ error_fetchmembers_title: string;
546
+ label_amount: string;
547
+ label_boolean_debug: string;
548
+ label_boolean_distinct: string;
549
+ label_boolean_exclude_default_members: string;
550
+ label_boolean_full_results: string;
551
+ label_boolean_nonempty: string;
552
+ label_boolean_parents: string;
553
+ label_boolean_sparse: string;
554
+ label_clear: string;
555
+ label_cube: string;
556
+ label_cuts_filterby_id: string;
557
+ label_cuts_filterby_name: string;
558
+ label_cuts_filterby_any: string;
559
+ label_fullscreen: string;
560
+ label_locale: string;
561
+ label_search: string;
562
+ label_no_results: string;
563
+ label_dataset: string;
564
+ label_localeoption: string;
565
+ label_measure: string;
566
+ label_pagination_limit: string;
567
+ label_pagination_offset: string;
568
+ label_sorting_key: string;
569
+ label_sorting_order: string;
570
+ label_source: string;
571
+ label_subtopic: string;
572
+ label_table: string;
573
+ label_timelevel: string;
574
+ label_topic: string;
575
+ search_placeholder: string;
576
+ tag_cuts_plural: string;
577
+ tag_cuts: string;
578
+ tag_drilldowns_abbrjoint: string;
579
+ tag_drilldowns: string;
580
+ title_area_cuts: string;
581
+ title_area_drilldowns: string;
582
+ title_area_filters: string;
583
+ title_area_measures: string;
584
+ title_area_options: string;
585
+ title_area_pagination: string;
586
+ title_area_sorting: string;
587
+ title_caption: string;
588
+ title_downloaddata: string;
589
+ title_members: string;
590
+ title_properties: string;
591
+ tooltip_area_cuts: string;
592
+ tooltip_area_drilldowns: string;
593
+ tooltip_area_filters: string;
594
+ tooltip_area_measures: string;
595
+ tooltip_area_options: string;
596
+ };
597
+ pivot_view: {
598
+ tab_label: string;
599
+ error_missingparams: string;
600
+ error_onedimension: string;
601
+ error_internal: string;
602
+ error_internal_detail: string;
603
+ label_ddcolumn: string;
604
+ label_ddcolumnprop: string;
605
+ label_ddrow: string;
606
+ label_ddrowprop: string;
607
+ label_formatter: string;
608
+ label_valmeasure: string;
609
+ loading_details: string;
610
+ loading_title: string;
611
+ title_download: string;
612
+ title_params: string;
613
+ warning: string;
614
+ warning_notsummeasure: string;
615
+ warning_propertypivot: string;
616
+ warning_sumdimensions: string;
617
+ };
618
+ placeholders: {
619
+ incomplete: string;
620
+ unselected: string;
621
+ none: string;
622
+ };
623
+ previewMode: {
624
+ btn_get_all: string;
625
+ btn_get_preview: string;
626
+ description_full: string;
627
+ description_preview: string;
628
+ title_full: string;
629
+ title_preview: string;
630
+ };
631
+ queries: {
632
+ action_create: string;
633
+ action_parse: string;
634
+ error_not_query: string;
635
+ error_no_drilldowns: string;
636
+ error_no_measures: string;
637
+ error_one_hierarchy_per_dimension: string;
638
+ error_one_cut_per_dimension: string;
639
+ column_title: string;
640
+ unset_parameters: string;
641
+ };
642
+ results: {
643
+ error_execquery_detail: string;
644
+ error_disconnected_title: string;
645
+ error_serveroffline_title: string;
646
+ error_serveroffline_detail: string;
647
+ error_emptyresult_title: string;
648
+ error_emptyresult_detail: string;
649
+ count_rows: string;
650
+ count_rows_plural: string;
651
+ };
652
+ selectlevel_placeholder: string;
653
+ selectmeasure_placeholder: string;
654
+ selecttimelevel_placeholder: string;
655
+ table_view: {
656
+ tab_label: string;
657
+ numeral_format: string;
658
+ sort_asc: string;
659
+ sort_desc: string;
660
+ };
661
+ tour: {
662
+ controls: {
663
+ prev: string;
664
+ next: string;
665
+ help: string;
666
+ };
667
+ steps: {
668
+ welcome: {
669
+ title: string;
670
+ text1: string;
671
+ text2: string;
672
+ };
673
+ locale: {
674
+ title: string;
675
+ text1: string;
676
+ text2: string;
677
+ };
678
+ dataset: {
679
+ title: string;
680
+ text1: string;
681
+ text2: string;
682
+ };
683
+ search: {
684
+ title: string;
685
+ text1: string;
686
+ text2: string;
687
+ };
688
+ table: {
689
+ title: string;
690
+ text1: string;
691
+ text2: string;
692
+ };
693
+ columns: {
694
+ title: string;
695
+ text1: string;
696
+ text2: string;
697
+ };
698
+ filters: {
699
+ title: string;
700
+ text1: string;
701
+ text2: string;
702
+ };
703
+ download: {
704
+ title: string;
705
+ text1: string;
706
+ };
707
+ api: {
708
+ title: string;
709
+ text1: string;
710
+ };
711
+ vizbuilderTab: {
712
+ title: string;
713
+ text1: string;
714
+ };
715
+ last: {
716
+ title: string;
717
+ text: string;
718
+ button: string;
719
+ };
720
+ };
721
+ };
722
+ transfer_input: {
723
+ count_hidden: string;
724
+ count_hidden_plural: string;
725
+ search_placeholder: string;
726
+ select_all: string;
727
+ unselect_all: string;
728
+ select_filtered: string;
729
+ unselect_filtered: string;
730
+ selected_items: string;
731
+ unselected_items: string;
732
+ };
733
+ vizbuilder: {
734
+ action_close: string;
735
+ action_enlarge: string;
736
+ action_fileissue: string;
737
+ action_retry: string;
738
+ aggregator: {
739
+ average: string;
740
+ max: string;
741
+ min: string;
742
+ };
743
+ chart_labels: {
744
+ ci: string;
745
+ moe: string;
746
+ source: string;
747
+ collection: string;
748
+ };
749
+ error: {
750
+ detail: string;
751
+ message: string;
752
+ title: string;
753
+ };
754
+ list: {
755
+ join: string;
756
+ suffix: string;
757
+ prefix: string;
758
+ };
759
+ title: {
760
+ series: string;
761
+ series_members: string;
762
+ main: string;
763
+ main_over_period: string;
764
+ main_on_period: string;
765
+ total: string;
766
+ };
767
+ transient: {
768
+ title_loading: string;
769
+ title_empty: string;
770
+ description_empty: string;
771
+ };
772
+ };
773
+ };
774
+ type TranslationDict = typeof defaultTranslation;
775
+ declare const useTranslation: any;
776
+ declare const TranslationConsumer: any;
777
+
778
+ interface ExplorerStepType extends StepType {
779
+ actionBefore?: () => void;
780
+ }
781
+ type TourConfig = {
782
+ extraSteps?: ExplorerStepType[];
783
+ introImage?: React.ReactNode;
784
+ tourProps?: Partial<TourProps>;
785
+ };
786
+ interface TourStepsPropsType {
787
+ title: string;
788
+ texts: string[] | string;
789
+ }
790
+
791
+ interface ToolBarButtonProps {
792
+ icon: ReactNode;
793
+ label?: string;
794
+ onClick?: () => void;
795
+ }
796
+ interface ToolbarConfigType {
797
+ buttons: ToolBarButtonProps[];
798
+ showLabels: Boolean;
799
+ }
800
+ declare function ToolbarButton({ icon, label, onClick }: ToolBarButtonProps): React.JSX.Element;
801
+
802
+ type Pagination = {
803
+ rowsLimits: number[];
804
+ defaultLimit: Pagination["rowsLimits"][number];
805
+ };
806
+ /**
807
+ * Main DataExplorer component
808
+ * This components wraps the interface components in the needed Providers,
809
+ * and pass the other properties to them.
810
+ */
811
+ declare function ExplorerComponent<Locale extends string>(props: {
812
+ measuresActive?: number;
813
+ pagination?: Pagination;
814
+ /**
815
+ * The main server endpoint.
816
+ */
817
+ serverURL: string;
818
+ /**
819
+ * Additional request parameters for all requests against the server.
820
+ * Uses the same format used by the second parameter of the fetch API.
821
+ */
822
+ serverConfig?: RequestInit;
823
+ /**
824
+ * The locale to use when retrieving the schema from the server the first time.
825
+ * If not set, the server will use the default locale set in its configuration.
826
+ */
827
+ defaultDataLocale?: string;
828
+ /**
829
+ * Defines the default cube that will be opened when the component first loads.
830
+ * @default undefined
831
+ */
832
+ defaultCube?: string | undefined;
833
+ /**
834
+ * Specifies which property should be used to filter elements in the member
835
+ * selection control of the Cuts parameter area.
836
+ * @default "id"
837
+ */
838
+ defaultMembersFilter?: "id" | "name" | "any";
839
+ /**
840
+ * Defines the parameter panel which will be opened when the component first loads.
841
+ * Available options are `measures`, `drilldowns`, `cuts`, and `options`.
842
+ * @default "measures"
843
+ */
844
+ defaultOpenParams?: "measures" | "drilldowns" | "cuts" | "options";
845
+ /**
846
+ * The locale to use in the Explorer component UI.
847
+ * This value is passed to the Translation utility and controls the language
848
+ * for the labels throughout the user interface. Must be equal to one of the
849
+ * keys in the object provided to the `translations` property.
850
+ * @default "en"
851
+ */
852
+ locale?: Locale;
853
+ /**
854
+ * Defines an index of formatter functions available to the measures shown
855
+ * in the app, besides a limited list of default ones. The key used comes
856
+ * from `measure.annotations.units_of_measurement`, if present.
857
+ */
858
+ formatters?: Record<string, Formatter>;
859
+ /**
860
+ * Defines an alternative height for the component structure.
861
+ * @default "100vh"
862
+ */
863
+ height?: CSSObject["height"];
864
+ /**
865
+ * The list of tabs to offer to the user to render the results.
866
+ * Must be an array of objects with the following properties:
867
+ * - `key`: a string to distinguish each panel, will be used in the URL params
868
+ * - `label`: a string used as the title for the panel in the tab bar.
869
+ * It will be passed through the internal translation function, so can be
870
+ * localized via the `translations` property or used directly as is.
871
+ * - `component`: a non-hydrated React Component.
872
+ * This will be passed the needed properties according to the specification.
873
+ * Rendering the panel supports the use of `React.lazy` to defer the load of
874
+ * heavy dependencies.
875
+ */
876
+ panels?: PanelDescriptor[];
877
+ /**
878
+ * A component that is rendered to display the default "splash screen";
879
+ * the screen that is shown in the results panel when there is no query,
880
+ * or a query has been dirtied.
881
+ */
882
+ splash?: React.ComponentType<{
883
+ translation: TranslationContextProps;
884
+ }>;
885
+ toolbarConfig?: Partial<ToolbarConfigType>;
886
+ /**
887
+ * Tour configuration
888
+ */
889
+ tourConfig?: Partial<TourConfig>;
890
+ /**
891
+ * The Translation labels to use in the UI.
892
+ */
893
+ translations?: Record<Locale, TranslationDict>;
894
+ /**
895
+ * Determines whether Explorer should be rendered within a MantineProvider
896
+ * @default true
897
+ */
898
+ withinMantineProvider?: boolean;
899
+ /**
900
+ * Determines whether Explorer should be rendered within a Redux Provider,
901
+ * encapsulating its state, and making easier to install.
902
+ * @default false
903
+ */
904
+ withinReduxProvider?: boolean;
905
+ /**
906
+ * Enables multiple queries mode.
907
+ * This adds a column where the user can quickly switch between queries,
908
+ * like tabs in a browser.
909
+ * @default false
910
+ */
911
+ withMultiQuery?: boolean;
912
+ /**
913
+ * Enables browser permalink synchronization.
914
+ * @default false
915
+ */
916
+ withPermalink?: boolean;
917
+ }): React.JSX.Element;
918
+ declare namespace ExplorerComponent {
919
+ var displayName: string;
920
+ }
921
+
922
+ /** */
923
+ declare function PivotView<TData extends Record<string, unknown>>(props: {} & ViewProps<TData> & MRT_TableOptions<TData>): React.JSX.Element;
924
+
925
+ type TData = Record<string, any> & Record<string, string | number>;
926
+ type TableView = {
927
+ table: MRT_TableInstance<TData>;
928
+ getColumn(id: string): AnyResultColumn | undefined;
929
+ columns: AnyResultColumn[];
930
+ } & ViewProps;
931
+ declare function TableView({ table, result, isError, isLoading, data, pagination, setPagination }: TableView): React.JSX.Element;
932
+ declare namespace TableView {
933
+ var displayName: string;
934
+ }
935
+
936
+ declare const reducerMap: {
937
+ explorerLoading: redux.Reducer<LoadingState>;
938
+ explorerQueries: redux.Reducer<QueriesState>;
939
+ explorerServer: redux.Reducer<ServerState>;
940
+ };
941
+ declare const reducer: redux.Reducer<redux.CombinedState<{
942
+ explorerLoading: LoadingState;
943
+ explorerQueries: QueriesState;
944
+ explorerServer: ServerState;
945
+ }>, redux.AnyAction>;
946
+ /**
947
+ * Inyects the Client dependency to the thunk's extra argument.
948
+ */
949
+ declare function thunkExtraArg(): {
950
+ tesseract: TesseractModuleClient;
951
+ complexity: ComplexityModuleClient;
952
+ previewLimit: number;
953
+ };
954
+ type ExplorerThunkArg = ReturnType<typeof thunkExtraArg>;
955
+ type ExplorerState = StateFromReducersMapObject<typeof reducerMap>;
956
+ type ExplorerThunk<ReturnType = void> = ThunkAction<ReturnType, ExplorerState, ExplorerThunkArg, Action<string>>;
957
+
958
+ declare const LOADINGSTATUS: {
959
+ readonly FETCHING: "FETCHING";
960
+ readonly SUCCESS: "SUCCESS";
961
+ readonly FAILURE: "FAILURE";
962
+ };
963
+ type LoadingStatus = typeof LOADINGSTATUS[keyof (typeof LOADINGSTATUS)];
964
+ interface LoadingMessage {
965
+ type: string;
966
+ [params: string]: string;
967
+ }
968
+ interface LoadingState {
969
+ error: string | null;
970
+ loading: boolean;
971
+ message?: LoadingMessage;
972
+ status: LoadingStatus;
973
+ trigger: string | null;
974
+ }
975
+
976
+ interface QueriesState {
977
+ current: string;
978
+ itemMap: Record<string, QueryItem>;
979
+ }
980
+
981
+ interface ServerState {
982
+ cubeMap: Record<string, TesseractCube>;
983
+ locale: string;
984
+ localeOptions: string[];
985
+ online: boolean | undefined;
986
+ url: string;
987
+ }
988
+
989
+ type ExplorerActionMap = typeof actions;
990
+ declare const actions: {
991
+ willDownloadQuery(format: `${Format}`): ExplorerThunk<Promise<FileDescriptor>>;
992
+ willExecuteQuery(params?: {
993
+ limit?: number;
994
+ offset?: number;
995
+ }): ExplorerThunk<Promise<void>>;
996
+ willFetchQuery(params?: {
997
+ limit?: number;
998
+ offset?: number;
999
+ }): ExplorerThunk<Promise<QueryResult>>;
1000
+ willFetchMembers(level: string, localeStr?: string, cubeName?: string): ExplorerThunk<Promise<TesseractMembersResponse>>;
1001
+ willHydrateParams(suggestedCube?: string): ExplorerThunk<Promise<void>>;
1002
+ willParseQueryUrl(url: string | URL): ExplorerThunk<Promise<void>>;
1003
+ willReloadCubes(params?: {
1004
+ locale: {
1005
+ code: string;
1006
+ };
1007
+ }): ExplorerThunk<Promise<{
1008
+ [k: string]: TesseractCube;
1009
+ }>>;
1010
+ willRequestQuery(): ExplorerThunk<Promise<void>>;
1011
+ willSetCube(cubeName: string, measuresActive?: number, locale?: string): ExplorerThunk<Promise<void>>;
1012
+ willReloadCube({ locale }: {
1013
+ locale: {
1014
+ code: string;
1015
+ };
1016
+ }): ExplorerThunk<Promise<void>>;
1017
+ willSetupClient(baseURL: string, defaultLocale?: string, requestConfig?: RequestInit): ExplorerThunk<Promise<{
1018
+ [k: string]: TesseractCube;
1019
+ }>>;
1020
+ resetQueries: _reduxjs_toolkit.ActionCreatorWithPayload<Record<string, any>, "explorerQueries/resetQueries">;
1021
+ removeQuery: _reduxjs_toolkit.ActionCreatorWithPayload<string, "explorerQueries/removeQuery">;
1022
+ selectQuery: _reduxjs_toolkit.ActionCreatorWithPayload<string, "explorerQueries/selectQuery">;
1023
+ updateQuery: _reduxjs_toolkit.ActionCreatorWithPayload<QueryItem, "explorerQueries/updateQuery">;
1024
+ switchPanel: _reduxjs_toolkit.ActionCreatorWithPayload<string | null, "explorerQueries/switchPanel">;
1025
+ removeCut: _reduxjs_toolkit.ActionCreatorWithPayload<string, "explorerQueries/removeCut">;
1026
+ removeDrilldown: _reduxjs_toolkit.ActionCreatorWithPayload<string, "explorerQueries/removeDrilldown">;
1027
+ removeMeasure: _reduxjs_toolkit.ActionCreatorWithPayload<string, "explorerQueries/removeMeasure">;
1028
+ removeFilter: _reduxjs_toolkit.ActionCreatorWithPayload<string, "explorerQueries/removeFilter">;
1029
+ resetAllParams: _reduxjs_toolkit.ActionCreatorWithPayload<Partial<QueryParams>, "explorerQueries/resetAllParams">;
1030
+ resetCuts: _reduxjs_toolkit.ActionCreatorWithPayload<Record<string, CutItem>, "explorerQueries/resetCuts">;
1031
+ resetDrilldowns: _reduxjs_toolkit.ActionCreatorWithPayload<Record<string, DrilldownItem>, "explorerQueries/resetDrilldowns">;
1032
+ resetFilters: _reduxjs_toolkit.ActionCreatorWithPayload<Record<string, FilterItem>, "explorerQueries/resetFilters">;
1033
+ resetMeasures: _reduxjs_toolkit.ActionCreatorWithPayload<Record<string, MeasureItem>, "explorerQueries/resetMeasures">;
1034
+ updateIsPreview: _reduxjs_toolkit.ActionCreatorWithOptionalPayload<boolean | undefined, "explorerQueries/updateIsPreview">;
1035
+ updateBoolean: _reduxjs_toolkit.ActionCreatorWithPayload<{
1036
+ key: string;
1037
+ value?: boolean;
1038
+ }, "explorerQueries/updateBoolean">;
1039
+ updateCube: _reduxjs_toolkit.ActionCreatorWithPayload<{
1040
+ cube: string;
1041
+ measures: Record<string, MeasureItem>;
1042
+ drilldowns: Record<string, DrilldownItem>;
1043
+ }, "explorerQueries/updateCube">;
1044
+ updateCut: _reduxjs_toolkit.ActionCreatorWithPayload<CutItem, "explorerQueries/updateCut">;
1045
+ updateDrilldown: _reduxjs_toolkit.ActionCreatorWithPayload<DrilldownItem, "explorerQueries/updateDrilldown">;
1046
+ updateFilter: _reduxjs_toolkit.ActionCreatorWithPayload<FilterItem, "explorerQueries/updateFilter">;
1047
+ updateLocale: _reduxjs_toolkit.ActionCreatorWithPayload<string, "explorerQueries/updateLocale">;
1048
+ updateMeasure: _reduxjs_toolkit.ActionCreatorWithPayload<MeasureItem, "explorerQueries/updateMeasure">;
1049
+ updatePagination: _reduxjs_toolkit.ActionCreatorWithPayload<{
1050
+ limit: number;
1051
+ offset: number;
1052
+ }, "explorerQueries/updatePagination">;
1053
+ updateSorting: _reduxjs_toolkit.ActionCreatorWithPayload<{
1054
+ key: string;
1055
+ dir: "asc" | "desc";
1056
+ }, "explorerQueries/updateSorting">;
1057
+ clearSorting: _reduxjs_toolkit.ActionCreatorWithoutPayload<"explorerQueries/clearSorting">;
1058
+ updateResult: _reduxjs_toolkit.ActionCreatorWithPayload<QueryResult<Record<string, unknown>>, "explorerQueries/updateResult">;
1059
+ setLoadingState(status: LoadingStatus, message?: string): {
1060
+ readonly type: "explorerLoading/setLoadingState:FETCHING" | "explorerLoading/setLoadingState:SUCCESS" | "explorerLoading/setLoadingState:FAILURE";
1061
+ readonly payload: string | undefined;
1062
+ };
1063
+ setLoadingMessage: _reduxjs_toolkit.ActionCreatorWithPayload<LoadingMessage, "explorerLoading/setLoadingMessage">;
1064
+ updateServer: _reduxjs_toolkit.ActionCreatorWithPayload<Partial<ServerState>, "explorerServer/updateServer">;
1065
+ resetServer: _reduxjs_toolkit.ActionCreatorWithoutPayload<"explorerServer/resetServer">;
1066
+ };
1067
+
1068
+ type ExplorerBoundActionMap = {
1069
+ [K in keyof ExplorerActionMap]: ExplorerActionMap[K] extends (...args: infer Params) => (...args: any[]) => infer R ? (...args: Params) => R : ExplorerActionMap[K];
1070
+ };
1071
+ interface SettingsContextProps {
1072
+ actions: ExplorerBoundActionMap;
1073
+ defaultMembersFilter: "id" | "name" | "any";
1074
+ formatters: Record<string, Formatter>;
1075
+ previewLimit: number;
1076
+ panels: PanelDescriptor[];
1077
+ paginationConfig: Pagination;
1078
+ measuresActive?: number;
1079
+ toolbarConfig?: ToolbarConfigType;
1080
+ }
1081
+ /**
1082
+ * A wrapper for the Consumer, for use with class components.
1083
+ */
1084
+ declare function SettingsConsumer(props: React.ConsumerProps<SettingsContextProps>): React.JSX.Element;
1085
+ /**
1086
+ * The React hook associated to the settings context.
1087
+ */
1088
+ declare function useSettings(): SettingsContextProps;
1089
+
1090
+ declare function VizbuilderView(props: {
1091
+ cube: TesseractCube;
1092
+ params: QueryParams;
1093
+ result: QueryResult;
1094
+ }): React.JSX.Element;
1095
+
1096
+ declare function TourStep(props: TourStepsPropsType): React.JSX.Element;
1097
+
1098
+ export { DebugView, ExplorerComponent as Explorer, type ExplorerState, type ExplorerStepType, PivotView, SettingsConsumer, TableView, ToolbarButton, TourStep, TranslationConsumer, type TranslationDict, type ViewProps, VizbuilderView, reducer as explorerReducer, thunkExtraArg as explorerThunkExtraArg, defaultTranslation as translationDict, useSettings, useTranslation };