react-semaphor 0.1.209 → 0.1.211
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/chunks/{dashboard-controls-BNTI4r0_.js → dashboard-controls-7KpXzAWL.js} +662 -607
- package/dist/chunks/dashboard-controls-CnDq9Uh_.js +42 -0
- package/dist/chunks/{dashboard-json-BjOqpGbW.js → dashboard-json-dqey5VK0.js} +1 -1
- package/dist/chunks/{dashboard-json-kIoBtmBF.js → dashboard-json-stWvjp2O.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-CO1SwHHD.js → dashboard-summary-settings-dialog-DPEe6XBC.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-BoX18wiA.js → dashboard-summary-settings-dialog-DuxhidK1.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-DG4VLoJF.js → edit-dashboard-visual-CQAk_UsI.js} +3416 -3531
- package/dist/chunks/edit-dashboard-visual-D_XPr8f8.js +164 -0
- package/dist/chunks/editor-action-buttons-CH7W6KdH.js +21 -0
- package/dist/chunks/editor-action-buttons-D34_GSZu.js +404 -0
- package/dist/chunks/{index-D0TdW88i.js → index-BDS2sWhv.js} +26669 -26443
- package/dist/chunks/index-BfiIPyeS.js +1109 -0
- package/dist/chunks/normalize-dashboard-for-dirty-check-D9x96J2F.js +1 -0
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +119 -0
- package/dist/chunks/notification-bell-Cu3qDd9V.js +837 -0
- package/dist/chunks/notification-bell-hijGST9g.js +6 -0
- package/dist/chunks/{resource-management-panel-DS_WEv1x.js → resource-management-panel-BvHqslqC.js} +346 -335
- package/dist/chunks/resource-management-panel-gK3a6OEj.js +6 -0
- package/dist/chunks/{use-role-aware-display-preferences-D8j5_cnK.js → use-role-aware-display-preferences-BlR29aKQ.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-DfihB5pN.js → use-role-aware-display-preferences-a5FH9Y0k.js} +1 -1
- package/dist/chunks/{use-visual-utils-CzcVz3zB.js → use-visual-utils-B11AA2fd.js} +1 -1
- package/dist/chunks/{use-visual-utils-BfLXO_vi.js → use-visual-utils-ptPsQ3nC.js} +23 -23
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +253 -214
- package/dist/shared/index.cjs +1 -0
- package/dist/shared/index.js +6 -0
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/main.d.ts +88 -1
- package/dist/types/shared.d.ts +1762 -0
- package/package.json +6 -1
- package/dist/chunks/dashboard-controls-Dcpx9_an.js +0 -42
- package/dist/chunks/edit-dashboard-visual-B9HuGExj.js +0 -179
- package/dist/chunks/editor-action-buttons-CDTIx_Jc.js +0 -11
- package/dist/chunks/editor-action-buttons-CszdZ4Fw.js +0 -345
- package/dist/chunks/index-DSA80lEg.js +0 -1104
- package/dist/chunks/notification-bell-D2V1-ARa.js +0 -11
- package/dist/chunks/notification-bell-DFiRaeJQ.js +0 -862
- package/dist/chunks/resource-management-panel-BhiWNPcw.js +0 -6
|
@@ -0,0 +1,1762 @@
|
|
|
1
|
+
import { ColumnSizingState } from '@tanstack/react-table';
|
|
2
|
+
import { FontSpec } from 'chart.js';
|
|
3
|
+
|
|
4
|
+
declare type AggregateFunction = 'COUNT' | 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
|
|
5
|
+
|
|
6
|
+
declare type AIContext = {
|
|
7
|
+
selectedEntities: SelectedEntities;
|
|
8
|
+
fileAttachments?: FileAttachment[];
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
declare type AIScopeTable = {
|
|
12
|
+
connectionId: string;
|
|
13
|
+
connectionType: string;
|
|
14
|
+
databaseName: string;
|
|
15
|
+
schemaName: string;
|
|
16
|
+
tableName: string;
|
|
17
|
+
datamodelId: string;
|
|
18
|
+
datamodelName: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
declare type AxisConfig = {
|
|
22
|
+
enabled?: boolean;
|
|
23
|
+
name?: {
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
text?: string;
|
|
26
|
+
/** Font size for the axis title */
|
|
27
|
+
fontSize?: number;
|
|
28
|
+
/** Font weight for the axis title */
|
|
29
|
+
fontWeight?: 'normal' | 'bold';
|
|
30
|
+
};
|
|
31
|
+
position?: 'auto' | 'top' | 'bottom' | 'left' | 'right';
|
|
32
|
+
labels?: {
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
rotation?: 'auto' | 0 | 45 | 90 | -45 | -90;
|
|
35
|
+
};
|
|
36
|
+
formatOptions?: TFormatOptions;
|
|
37
|
+
scale?: {
|
|
38
|
+
min?: number | 'auto';
|
|
39
|
+
max?: number | 'auto';
|
|
40
|
+
stepSize?: number | 'auto';
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
declare interface BaseColumn {
|
|
45
|
+
id: string;
|
|
46
|
+
name: string;
|
|
47
|
+
label?: string;
|
|
48
|
+
type: ColumnType;
|
|
49
|
+
table?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare type BaseCustomCard = {
|
|
53
|
+
cardId: string;
|
|
54
|
+
replaceDefault?: boolean;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
declare type BaseFilter = {
|
|
58
|
+
filterId: TFilter['id'];
|
|
59
|
+
expression?: string;
|
|
60
|
+
name: string;
|
|
61
|
+
valueType: 'string' | 'number' | 'date' | 'boolean';
|
|
62
|
+
connectionType?: 'database' | 'api';
|
|
63
|
+
dataType?: string;
|
|
64
|
+
fieldMeta?: FilterFieldMeta;
|
|
65
|
+
semanticContext?: FilterSemanticContext;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
declare type CacheConfig = {
|
|
69
|
+
ttl: string;
|
|
70
|
+
status: 'on' | 'on-refresh' | 'off';
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Formula metadata for calculated fields (UI-only metadata)
|
|
75
|
+
* This is supplementary data to help the UI display and edit calculated fields.
|
|
76
|
+
* The `expression` field remains the source of truth for the backend.
|
|
77
|
+
*
|
|
78
|
+
* IMPORTANT: This metadata is ALWAYS updated atomically with the expression field.
|
|
79
|
+
* Both are generated together from the same dialog inputs, preventing drift.
|
|
80
|
+
*/
|
|
81
|
+
declare interface CalculatedFieldFormula {
|
|
82
|
+
operation: CalculatedFieldOperation;
|
|
83
|
+
/**
|
|
84
|
+
* Array of full MetricField objects used as inputs to the calculated field.
|
|
85
|
+
*
|
|
86
|
+
* Storing complete Field objects eliminates the need for runtime lookups and ensures:
|
|
87
|
+
* - Table alias resolution works with schema-qualified tables (Issue 1)
|
|
88
|
+
* - All field metadata is available even if the input field isn't selected on the card (Issue 2)
|
|
89
|
+
* - Aggregate functions, filters, and entity info are preserved
|
|
90
|
+
*
|
|
91
|
+
* Each input field contains complete metadata:
|
|
92
|
+
* - name, entityId, entityName, qualifiedEntityName (for table qualification)
|
|
93
|
+
* - aggregate (for proper post-aggregation: SUM(sales) / COUNT(orders))
|
|
94
|
+
* - parameters.filters (for filtered metrics)
|
|
95
|
+
* - dataType and other properties
|
|
96
|
+
*
|
|
97
|
+
* Example: [
|
|
98
|
+
* {name: 'sales', aggregate: 'SUM', entityName: 'sales_data', ...},
|
|
99
|
+
* {name: 'order_id', aggregate: 'COUNT', entityName: 'sales_data', ...}
|
|
100
|
+
* ]
|
|
101
|
+
*/
|
|
102
|
+
inputFields: Array<MetricField | GroupByField>;
|
|
103
|
+
/**
|
|
104
|
+
* Constant value used in scale operations (e.g., multiply by 0.15)
|
|
105
|
+
* Only applicable for 'scale' operation type
|
|
106
|
+
*/
|
|
107
|
+
constant?: number;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Operations supported for calculated fields
|
|
112
|
+
*/
|
|
113
|
+
declare type CalculatedFieldOperation = 'sum' | 'difference' | 'product' | 'ratio' | 'change' | 'percentage' | 'scale' | 'custom';
|
|
114
|
+
|
|
115
|
+
declare interface CardConfig {
|
|
116
|
+
groupByColumns?: GroupByField[];
|
|
117
|
+
metricColumns?: MetricField[];
|
|
118
|
+
pivotByColumns?: PivotByField[];
|
|
119
|
+
sortByColumns?: SortByField[];
|
|
120
|
+
detailColumns?: DetailField[];
|
|
121
|
+
/** Preserves non-detail config when switching to detail tables. */
|
|
122
|
+
detailTableBackup?: DetailTableBackupConfig;
|
|
123
|
+
filters?: FilterGroup;
|
|
124
|
+
joinPlan?: JoinPlan;
|
|
125
|
+
rowLimit?: number;
|
|
126
|
+
/**
|
|
127
|
+
* One or more hierarchies that define drillable paths through dimensions.
|
|
128
|
+
*/
|
|
129
|
+
drillHierarchies?: DrillHierarchy[];
|
|
130
|
+
/**
|
|
131
|
+
* Optional list of dimensions allowed for dynamic drill-down across this card.
|
|
132
|
+
* Used only when drill steps contain `mode: 'dynamicDrill'` or `type: 'dynamic'`.
|
|
133
|
+
*/
|
|
134
|
+
allowedDrillTargets?: Field[];
|
|
135
|
+
/**
|
|
136
|
+
* NOT UOptional preload settings for inline drill previews
|
|
137
|
+
*/
|
|
138
|
+
inlineDrillPreview?: {
|
|
139
|
+
enabled: boolean;
|
|
140
|
+
limit: number;
|
|
141
|
+
mode: 'lazy' | 'preloaded';
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Configuration for on-click dashboard filters triggered by this card.
|
|
145
|
+
*/
|
|
146
|
+
clickFilterInteractions?: ClickFilterInteraction[];
|
|
147
|
+
comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
|
|
148
|
+
targetValue?: number;
|
|
149
|
+
showComparisonInLegend?: boolean;
|
|
150
|
+
showTrendline?: boolean;
|
|
151
|
+
trendlineWindow?: number;
|
|
152
|
+
trendlineGranularity?: 'day' | 'week' | 'month';
|
|
153
|
+
summary?: {
|
|
154
|
+
enabled?: boolean;
|
|
155
|
+
showOnCard?: boolean;
|
|
156
|
+
includeInDashboardSummary?: boolean;
|
|
157
|
+
breakdownDimensions?: GroupByField[];
|
|
158
|
+
anomalyEnabled?: boolean;
|
|
159
|
+
};
|
|
160
|
+
rowAggregates?: Array<{
|
|
161
|
+
label?: string;
|
|
162
|
+
function: AggregateFunction;
|
|
163
|
+
groupLevel: string | 'ALL';
|
|
164
|
+
}>;
|
|
165
|
+
columnAggregates?: Array<{
|
|
166
|
+
label?: string;
|
|
167
|
+
function: AggregateFunction;
|
|
168
|
+
pivotLevel: string | 'ALL';
|
|
169
|
+
}>;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
declare interface CardInteractionConfig {
|
|
173
|
+
/**
|
|
174
|
+
* V2: Unified interactions array.
|
|
175
|
+
* Each interaction includes a trigger that specifies what element must be clicked.
|
|
176
|
+
*/
|
|
177
|
+
interactions?: PersistedInteraction[];
|
|
178
|
+
allowedDrillTargets?: Field[];
|
|
179
|
+
drillHierarchies?: DrillHierarchy[];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
declare type CardWithContent = BaseCustomCard & {
|
|
183
|
+
content: React.FC<{
|
|
184
|
+
card: TCard;
|
|
185
|
+
}>;
|
|
186
|
+
footer?: React.FC<{
|
|
187
|
+
card: TCard;
|
|
188
|
+
}>;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
declare type CardWithFooter = BaseCustomCard & {
|
|
192
|
+
content?: React.FC<{
|
|
193
|
+
card: TCard;
|
|
194
|
+
}>;
|
|
195
|
+
footer: React.FC<{
|
|
196
|
+
card: TCard;
|
|
197
|
+
}>;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
declare interface ClickFilterInteraction {
|
|
201
|
+
mode: 'clickFilter';
|
|
202
|
+
/**
|
|
203
|
+
* What element must be clicked to trigger this interaction.
|
|
204
|
+
* Determines both the matching logic and the filtering behavior.
|
|
205
|
+
*
|
|
206
|
+
* @migration Optional during migration. Will be required in V2.
|
|
207
|
+
* Old configs without trigger will apply to any click (legacy behavior).
|
|
208
|
+
*/
|
|
209
|
+
trigger?: InteractionTrigger;
|
|
210
|
+
/**
|
|
211
|
+
* Fields from the chart element that should be used as filters.
|
|
212
|
+
* e.g., [region, ship_mode] from a stacked bar chart
|
|
213
|
+
*/
|
|
214
|
+
filterFields: Field[];
|
|
215
|
+
/**
|
|
216
|
+
* Should this card visually highlight when clicked?
|
|
217
|
+
*/
|
|
218
|
+
highlightSelf?: boolean;
|
|
219
|
+
/**
|
|
220
|
+
* Cards this filter applies to (inclusive).
|
|
221
|
+
* If omitted and `excludeCardIds` is also omitted → applies to all cards except self.
|
|
222
|
+
*/
|
|
223
|
+
applyToCardIds?: string[];
|
|
224
|
+
/**
|
|
225
|
+
* Cards to explicitly exclude from receiving this filter.
|
|
226
|
+
* Takes effect only if `applyToCardIds` is undefined (acts as override).
|
|
227
|
+
*/
|
|
228
|
+
excludeCardIds?: string[];
|
|
229
|
+
/**
|
|
230
|
+
* Optional UI label or tooltip.
|
|
231
|
+
*/
|
|
232
|
+
label?: string;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
declare type ColorConfig = {
|
|
236
|
+
segments: Record<string, string>;
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
declare type ColorRange = {
|
|
240
|
+
start: number;
|
|
241
|
+
end: number;
|
|
242
|
+
color: string;
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
declare interface ColorRange_2 {
|
|
246
|
+
min: number;
|
|
247
|
+
max: number;
|
|
248
|
+
color: string;
|
|
249
|
+
applyTo: 'cell' | 'row';
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
declare interface ColumnSettings {
|
|
253
|
+
type: 'none' | 'text' | 'number' | 'date' | 'badge' | 'link' | 'progress';
|
|
254
|
+
textAlign: 'left' | 'center' | 'right';
|
|
255
|
+
width: number;
|
|
256
|
+
minWidth?: number;
|
|
257
|
+
maxWidth?: number;
|
|
258
|
+
textOverflow?: 'ellipsis' | 'wrap' | 'clip';
|
|
259
|
+
textWrap: 'wrap' | 'nowrap';
|
|
260
|
+
numberFormat: {
|
|
261
|
+
style: 'decimal' | 'currency' | 'percent';
|
|
262
|
+
currency: string;
|
|
263
|
+
locale: string;
|
|
264
|
+
minimumFractionDigits: number;
|
|
265
|
+
maximumFractionDigits: number;
|
|
266
|
+
showDataBar: boolean;
|
|
267
|
+
dataBarColor: string;
|
|
268
|
+
dataBarMinValue?: number;
|
|
269
|
+
dataBarMaxValue?: number;
|
|
270
|
+
};
|
|
271
|
+
dateFormat: {
|
|
272
|
+
format: string;
|
|
273
|
+
useCustomFormat: boolean;
|
|
274
|
+
customFormat: string;
|
|
275
|
+
useRelativeTime: boolean;
|
|
276
|
+
timezone?: string;
|
|
277
|
+
sourceTimezone?: string;
|
|
278
|
+
};
|
|
279
|
+
linkFormat: LinkFormat;
|
|
280
|
+
colorRanges: ColorRange_2[];
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
declare type ColumnSettingsMap = Record<string, ColumnSettings>;
|
|
284
|
+
|
|
285
|
+
declare type ColumnType = 'string' | 'number' | 'date';
|
|
286
|
+
|
|
287
|
+
declare type ConnectionType = 'GoogleSheets' | 'FileUpload' | 'MySQL' | 'MSSQL' | 'PostgreSQL' | 'BigQuery' | 'Redshift' | 'Snowflake' | 'S3' | 'clickhouse' | 'S3Tables' | 'API' | 'none';
|
|
288
|
+
|
|
289
|
+
declare type CustomCard = CardWithContent | CardWithFooter;
|
|
290
|
+
|
|
291
|
+
declare interface DatabaseEntityReference {
|
|
292
|
+
connectionId: string;
|
|
293
|
+
connectionType: ConnectionType;
|
|
294
|
+
type: EntityType;
|
|
295
|
+
dbObjectType?: string;
|
|
296
|
+
dialect?: Dialect;
|
|
297
|
+
database?: string;
|
|
298
|
+
schema?: string;
|
|
299
|
+
name: string;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
declare type DatabaseEntityType = 'table' | 'view' | 'materialized view';
|
|
303
|
+
|
|
304
|
+
declare interface DataModelEntityReference extends DatabaseEntityReference {
|
|
305
|
+
type: 'model';
|
|
306
|
+
id: string;
|
|
307
|
+
label: string;
|
|
308
|
+
description: string;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
declare interface DataSource {
|
|
312
|
+
connectionId: string;
|
|
313
|
+
semanticDomainId?: string;
|
|
314
|
+
connectionType: string;
|
|
315
|
+
mode: 'database' | 'upload' | 'url' | 'semanticDomain';
|
|
316
|
+
dbSelection?: {
|
|
317
|
+
database: string;
|
|
318
|
+
schema: string;
|
|
319
|
+
entityType: DatabaseEntityType;
|
|
320
|
+
};
|
|
321
|
+
selectedEntities: SelectedEntities;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
declare const DATE_FORMAT_VALUES: readonly ["MM-DD-YYYY", "YYYY-MM-DD", "MM/DD/YYYY", "DD/MM/YYYY", "MMMM DD, YYYY", "MMM DD, YYYY", "DD MMM YYYY", "YYYY-MM-DD HH:mm", "YYYY-MM-DD HH:mm:ss", "YYYY-MM-DD HH:mm Z", "YYYY-MM-DD HH:mm:ss Z", "Week of MMM DD, YYYY", "Week of MMMM DD, YYYY", "YYYY-WW", "MMM YYYY", "MMMM YYYY", "YYYY-MM", "MM/YYYY", "YYYY MMM", "Q1 YYYY", "YYYY Q1", "1st Quarter YYYY", "YYYY-Q1", "Quarter 1, YYYY", "YYYY", "YY", "custom"];
|
|
325
|
+
|
|
326
|
+
declare type DateFormatValue = (typeof DATE_FORMAT_VALUES)[number];
|
|
327
|
+
|
|
328
|
+
declare type DateOptions = {
|
|
329
|
+
locale: string;
|
|
330
|
+
format: string;
|
|
331
|
+
options: Intl.DateTimeFormatOptions;
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
declare type DateSelectionMode = 'range' | 'months';
|
|
335
|
+
|
|
336
|
+
declare type DateUnit = 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Field configuration for detail table columns.
|
|
340
|
+
* Unlike GroupByField, DetailField does not support aggregation or granularity.
|
|
341
|
+
* Columns are selected and displayed as-is from the database.
|
|
342
|
+
*/
|
|
343
|
+
declare interface DetailField extends Omit<Field, 'role' | 'granularity'> {
|
|
344
|
+
role: 'detail';
|
|
345
|
+
dateFormat?: DateFormatValue;
|
|
346
|
+
customFormat?: string;
|
|
347
|
+
/**
|
|
348
|
+
* Optional SQL expression for calculated detail fields.
|
|
349
|
+
*/
|
|
350
|
+
expression?: string;
|
|
351
|
+
/**
|
|
352
|
+
* Formula metadata for calculated fields (used for token qualification).
|
|
353
|
+
*/
|
|
354
|
+
calculatedFormula?: CalculatedFieldFormula;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
declare interface DetailTableBackupConfig {
|
|
358
|
+
groupByColumns?: GroupByField[];
|
|
359
|
+
metricColumns?: MetricField[];
|
|
360
|
+
pivotByColumns?: PivotByField[];
|
|
361
|
+
sortByColumns?: SortByField[];
|
|
362
|
+
rowAggregates?: Array<{
|
|
363
|
+
label?: string;
|
|
364
|
+
function: AggregateFunction;
|
|
365
|
+
groupLevel: string | 'ALL';
|
|
366
|
+
}>;
|
|
367
|
+
columnAggregates?: Array<{
|
|
368
|
+
label?: string;
|
|
369
|
+
function: AggregateFunction;
|
|
370
|
+
pivotLevel: string | 'ALL';
|
|
371
|
+
}>;
|
|
372
|
+
comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb' | 'mssql';
|
|
376
|
+
|
|
377
|
+
declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
|
|
378
|
+
|
|
379
|
+
declare interface DrillDownInteraction {
|
|
380
|
+
mode: 'drillDown';
|
|
381
|
+
/**
|
|
382
|
+
* What element must be clicked to trigger this drill-down.
|
|
383
|
+
* Optional during configuration, but must be defined before execution.
|
|
384
|
+
*/
|
|
385
|
+
trigger?: InteractionTrigger;
|
|
386
|
+
filterFields: Field[];
|
|
387
|
+
hierarchyId?: string;
|
|
388
|
+
label?: string;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
declare interface DrillHierarchy {
|
|
392
|
+
id: string;
|
|
393
|
+
label?: string;
|
|
394
|
+
type: 'static' | 'date';
|
|
395
|
+
steps: DrillHierarchyStep[];
|
|
396
|
+
default?: boolean;
|
|
397
|
+
baseField?: Field;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
declare interface DrillHierarchyStep {
|
|
401
|
+
field: Field;
|
|
402
|
+
mode: 'drillDown';
|
|
403
|
+
preferredChartType?: TChartType;
|
|
404
|
+
breadcrumbLabelTemplate?: string;
|
|
405
|
+
retainFilters?: boolean;
|
|
406
|
+
label?: string;
|
|
407
|
+
linkedInsightId?: string;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
declare interface DrillThroughInteraction {
|
|
411
|
+
mode: 'drillThrough';
|
|
412
|
+
/**
|
|
413
|
+
* What element must be clicked to trigger this drill-through.
|
|
414
|
+
* @migration Optional during migration. Will be required in V2.
|
|
415
|
+
*/
|
|
416
|
+
trigger?: InteractionTrigger;
|
|
417
|
+
filterFields: Field[];
|
|
418
|
+
targetDashboardId: string;
|
|
419
|
+
/**
|
|
420
|
+
* How to pass context to the target dashboard
|
|
421
|
+
* @default 'interactionFilters'
|
|
422
|
+
*/
|
|
423
|
+
contextMode?: 'interactionFilters' | 'full' | 'none';
|
|
424
|
+
label?: string;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
declare interface DrillToDetailInteraction {
|
|
428
|
+
mode: 'drillToDetail';
|
|
429
|
+
/**
|
|
430
|
+
* What element must be clicked to trigger this drill to detail.
|
|
431
|
+
* @migration Optional during migration. Will be required in V2.
|
|
432
|
+
*/
|
|
433
|
+
trigger?: InteractionTrigger;
|
|
434
|
+
filterFields: Field[];
|
|
435
|
+
detailFields?: Field[];
|
|
436
|
+
sortBy?: SortByField[];
|
|
437
|
+
limit?: number;
|
|
438
|
+
detailTitle?: string;
|
|
439
|
+
/**
|
|
440
|
+
* Target insight ID to navigate to
|
|
441
|
+
*/
|
|
442
|
+
targetInsightId?: string;
|
|
443
|
+
/**
|
|
444
|
+
* How to pass context to the target insight
|
|
445
|
+
* @default 'interactionFilters'
|
|
446
|
+
*/
|
|
447
|
+
contextMode?: 'interactionFilters' | 'full' | 'none';
|
|
448
|
+
/**
|
|
449
|
+
* How to display the insight
|
|
450
|
+
* @default 'modal'
|
|
451
|
+
*/
|
|
452
|
+
displayMode?: 'modal' | 'replace-card';
|
|
453
|
+
label?: string;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
declare interface DrillToURLInteraction {
|
|
457
|
+
mode: 'drillToURL';
|
|
458
|
+
/**
|
|
459
|
+
* What element must be clicked to trigger this URL drill.
|
|
460
|
+
*/
|
|
461
|
+
trigger?: InteractionTrigger;
|
|
462
|
+
filterFields: Field[];
|
|
463
|
+
/**
|
|
464
|
+
* URL template with placeholders (e.g., 'https://example.com/product/{{product_id}}')
|
|
465
|
+
*/
|
|
466
|
+
urlTemplate: string;
|
|
467
|
+
/**
|
|
468
|
+
* List of parameters used in the URL template
|
|
469
|
+
*/
|
|
470
|
+
parameters: URLParameter[];
|
|
471
|
+
/**
|
|
472
|
+
* Whether to URL-encode parameter values
|
|
473
|
+
* @default true
|
|
474
|
+
*/
|
|
475
|
+
encodeParameters?: boolean;
|
|
476
|
+
/**
|
|
477
|
+
* Custom label for this interaction in the menu
|
|
478
|
+
*/
|
|
479
|
+
label?: string;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
declare interface DrillUpInteraction {
|
|
483
|
+
mode: 'drillUp';
|
|
484
|
+
/**
|
|
485
|
+
* What element must be clicked to trigger this drill-up.
|
|
486
|
+
* For synthetic drill-up interactions, this is inherited from the original drill-down.
|
|
487
|
+
*/
|
|
488
|
+
trigger?: InteractionTrigger;
|
|
489
|
+
/**
|
|
490
|
+
* The hierarchy ID to reference for display purposes.
|
|
491
|
+
* Used to show the parent level name in the interaction menu.
|
|
492
|
+
*/
|
|
493
|
+
hierarchyId?: string;
|
|
494
|
+
label?: string;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
declare interface DynamicDrillInteraction {
|
|
498
|
+
mode: 'dynamicDrill';
|
|
499
|
+
/**
|
|
500
|
+
* What element must be clicked to trigger this dynamic drill menu.
|
|
501
|
+
* When this trigger fires, user sees a menu of available fields to explore.
|
|
502
|
+
*/
|
|
503
|
+
trigger?: InteractionTrigger;
|
|
504
|
+
/**
|
|
505
|
+
* List of fields available for dynamic exploration.
|
|
506
|
+
* User can choose which field to drill into at runtime.
|
|
507
|
+
* Only drillable fields (string, boolean types) should be included.
|
|
508
|
+
*/
|
|
509
|
+
availableFields: Field[];
|
|
510
|
+
/**
|
|
511
|
+
* Optional label for the menu item.
|
|
512
|
+
* Defaults to "Explore Fields" if not specified.
|
|
513
|
+
*/
|
|
514
|
+
label?: string;
|
|
515
|
+
/* Excluded from this release type: drillField */
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
declare type EmailSettings = {
|
|
519
|
+
companyName: string;
|
|
520
|
+
dashboardUrl: string;
|
|
521
|
+
supportEmail: string;
|
|
522
|
+
senderTitle: string;
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
declare type EntityType = 'table' | 'view' | 'materialized view' | 'model' | 'file' | 'dataset' | 'url' | 'upload';
|
|
526
|
+
|
|
527
|
+
declare interface Field {
|
|
528
|
+
/**
|
|
529
|
+
* Unique identifier for this field instance (for joins, UI state, etc.).
|
|
530
|
+
* Should be unique within the context of the query or data model.
|
|
531
|
+
* Example: 'orders.customer_id', 'expr_12345', etc.
|
|
532
|
+
*/
|
|
533
|
+
id: string;
|
|
534
|
+
/**
|
|
535
|
+
* The physical/source column name in the database or data source.
|
|
536
|
+
* Used for mapping to the underlying data model and SQL generation (unless overridden by expression).
|
|
537
|
+
*/
|
|
538
|
+
name: string;
|
|
539
|
+
/**
|
|
540
|
+
* Human-friendly, localizable display name for the UI (table headers, chart axes, etc.).
|
|
541
|
+
*/
|
|
542
|
+
label: string;
|
|
543
|
+
/**
|
|
544
|
+
* Unique, stable, machine-friendly reference name for SQL (AS alias), exports, and scripting.
|
|
545
|
+
* If not provided, should be auto-generated from label or name.
|
|
546
|
+
*/
|
|
547
|
+
alias?: string;
|
|
548
|
+
qualifiedFieldName: string;
|
|
549
|
+
dataType: string;
|
|
550
|
+
description?: string;
|
|
551
|
+
qualifiedEntityName?: string;
|
|
552
|
+
dateFormat?: DateFormatValue;
|
|
553
|
+
customFormat?: string;
|
|
554
|
+
granularity?: TimeGranularity;
|
|
555
|
+
entityId: string;
|
|
556
|
+
entityName: string;
|
|
557
|
+
entityType: EntityType;
|
|
558
|
+
role?: 'groupby' | 'metric' | 'sortby' | 'pivotby' | 'detail';
|
|
559
|
+
fieldScope?: FieldScope;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
declare type FieldScope = 'card' | 'dashboard' | 'domain';
|
|
563
|
+
|
|
564
|
+
declare type FileAttachment = {
|
|
565
|
+
id: string;
|
|
566
|
+
name: string;
|
|
567
|
+
size: number;
|
|
568
|
+
type: string;
|
|
569
|
+
data?: string;
|
|
570
|
+
url?: string;
|
|
571
|
+
preview?: string;
|
|
572
|
+
uploadProgress?: number;
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
declare interface FileEntityReference extends DatabaseEntityReference {
|
|
576
|
+
id: string;
|
|
577
|
+
type: 'file' | 'url' | 'upload';
|
|
578
|
+
label: string;
|
|
579
|
+
description: string;
|
|
580
|
+
originalName: string;
|
|
581
|
+
file?: File;
|
|
582
|
+
url?: string;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
declare interface FilterByColumn extends BaseColumn {
|
|
586
|
+
role: 'filter';
|
|
587
|
+
operators?: string[];
|
|
588
|
+
mode?: 'include' | 'exclude';
|
|
589
|
+
sql?: string;
|
|
590
|
+
fetchValues?: boolean;
|
|
591
|
+
fetchLimit?: number;
|
|
592
|
+
valueSource?: 'distinct' | 'static' | 'range';
|
|
593
|
+
staticValues?: string[];
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
declare interface FilterCondition {
|
|
597
|
+
id: string;
|
|
598
|
+
field: Field;
|
|
599
|
+
operator: Operator;
|
|
600
|
+
value: FilterValue;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Display mode for individual filters
|
|
605
|
+
* - 'canvas': Filter displayed as a draggable card on the dashboard canvas
|
|
606
|
+
* - 'toolbar': Filter displayed in the compact toolbar
|
|
607
|
+
* - 'inherit': Use the dashboard's filterLayout.displayMode setting (default)
|
|
608
|
+
*/
|
|
609
|
+
declare type FilterDisplayMode = 'canvas' | 'toolbar' | 'inherit';
|
|
610
|
+
|
|
611
|
+
declare type FilterFieldMeta = Pick<Field, 'name' | 'qualifiedFieldName'> & Partial<Pick<Field, 'qualifiedEntityName' | 'entityId' | 'dataType' | 'role'>> & {
|
|
612
|
+
entityName?: Field['entityName'];
|
|
613
|
+
entityType?: string;
|
|
614
|
+
expression?: string;
|
|
615
|
+
calculatedFormula?: CalculatedFieldFormula;
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
declare type FilterForBetween = BaseFilter & {
|
|
619
|
+
operation: 'between' | 'not between';
|
|
620
|
+
values: [number, number];
|
|
621
|
+
};
|
|
622
|
+
|
|
623
|
+
declare type FilterForCompare = BaseFilter & {
|
|
624
|
+
operation: '>' | '<' | '>=' | '<=';
|
|
625
|
+
values: [number];
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
declare type FilterForDate = BaseFilter & {
|
|
629
|
+
operation: 'between' | 'not between';
|
|
630
|
+
values: [Date, Date];
|
|
631
|
+
relativeMeta?: RelativeDateFilter;
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
declare type FilterForEqual = BaseFilter & {
|
|
635
|
+
operation: '=' | '!=' | 'is null' | 'is not null';
|
|
636
|
+
values: [string | number];
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
declare type FilterForIn = BaseFilter & {
|
|
640
|
+
operation: 'in' | 'not in';
|
|
641
|
+
values: (string | number)[];
|
|
642
|
+
};
|
|
643
|
+
|
|
644
|
+
declare type FilterForString = BaseFilter & {
|
|
645
|
+
operation: 'like' | 'not like';
|
|
646
|
+
values: [string];
|
|
647
|
+
};
|
|
648
|
+
|
|
649
|
+
declare interface FilterGroup {
|
|
650
|
+
id: string;
|
|
651
|
+
logicalOperator: LogicalOperator;
|
|
652
|
+
negate: boolean;
|
|
653
|
+
conditions: FilterCondition[];
|
|
654
|
+
groups: FilterGroup[];
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Filter layout settings for controlling how dashboard filters are displayed
|
|
659
|
+
*/
|
|
660
|
+
declare type FilterLayoutSettings = {
|
|
661
|
+
/**
|
|
662
|
+
* Display mode for filters
|
|
663
|
+
* - 'canvas': Filters displayed as draggable/resizable cards on the dashboard canvas (default)
|
|
664
|
+
* - 'toolbar': Filters displayed in a compact horizontal toolbar below dashboard controls
|
|
665
|
+
*/
|
|
666
|
+
displayMode?: 'canvas' | 'toolbar';
|
|
667
|
+
/**
|
|
668
|
+
* Whether the toolbar should wrap filters to multiple lines
|
|
669
|
+
* - false: Horizontal scroll when filters overflow (default)
|
|
670
|
+
* - true: Wrap to multiple lines
|
|
671
|
+
*/
|
|
672
|
+
toolbarWrap?: boolean;
|
|
673
|
+
/**
|
|
674
|
+
* Whether to show a download button in the filter toolbar
|
|
675
|
+
* Useful when embedding Dashboard component without Surfboard's controls
|
|
676
|
+
*/
|
|
677
|
+
showDownloadButton?: boolean;
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
declare type FilterLocation = 'dashboard' | 'frame' | 'sheet' | undefined;
|
|
681
|
+
|
|
682
|
+
declare type FilterOnClick = {
|
|
683
|
+
expression?: string;
|
|
684
|
+
columnIndex: number;
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
declare type FilterSemanticContext = {
|
|
688
|
+
semanticDomainId?: string;
|
|
689
|
+
selectedEntities?: unknown[];
|
|
690
|
+
connectionId?: string;
|
|
691
|
+
connectionType?: string;
|
|
692
|
+
};
|
|
693
|
+
|
|
694
|
+
declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
|
|
695
|
+
|
|
696
|
+
declare type Granularity = 'day' | 'week' | 'month' | 'year';
|
|
697
|
+
|
|
698
|
+
declare interface GroupByColumn extends BaseColumn {
|
|
699
|
+
role: 'groupby';
|
|
700
|
+
granularity?: Granularity;
|
|
701
|
+
format?: string;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
declare interface GroupByField extends Field {
|
|
705
|
+
role: 'groupby';
|
|
706
|
+
granularity?: 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
707
|
+
/**
|
|
708
|
+
* Optional SQL expression for grouping (e.g., DATE_TRUNC('month', order_date)).
|
|
709
|
+
* If present, used in SELECT and GROUP BY instead of just the column name.
|
|
710
|
+
*/
|
|
711
|
+
expression?: string;
|
|
712
|
+
timeDrillPath?: TimeDrillStep[];
|
|
713
|
+
calculatedFormula?: CalculatedFieldFormula;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
declare type HtmlOptions = {
|
|
717
|
+
html: string;
|
|
718
|
+
};
|
|
719
|
+
|
|
720
|
+
declare interface InlineDrillInteraction {
|
|
721
|
+
mode: 'inlineDrill';
|
|
722
|
+
/**
|
|
723
|
+
* What element must be clicked to trigger this inline drill.
|
|
724
|
+
* @migration Optional during migration. Will be required in V2.
|
|
725
|
+
*/
|
|
726
|
+
trigger?: InteractionTrigger;
|
|
727
|
+
filterFields: Field[];
|
|
728
|
+
/**
|
|
729
|
+
* When to fetch the detailed data
|
|
730
|
+
* @default 'lazy'
|
|
731
|
+
*/
|
|
732
|
+
fetchMode?: 'lazy' | 'preloaded';
|
|
733
|
+
/**
|
|
734
|
+
* Maximum number of records to show (0 for unlimited)
|
|
735
|
+
* @default 100
|
|
736
|
+
*/
|
|
737
|
+
inlineLimit?: number;
|
|
738
|
+
/**
|
|
739
|
+
* How to display the detailed records
|
|
740
|
+
* @default 'table'
|
|
741
|
+
*/
|
|
742
|
+
displayMode?: 'table' | 'list' | 'cards';
|
|
743
|
+
/**
|
|
744
|
+
* Whether to show records in a modal overlay
|
|
745
|
+
* @default false
|
|
746
|
+
*/
|
|
747
|
+
showInModal?: boolean;
|
|
748
|
+
/**
|
|
749
|
+
* Whether to allow exporting the detailed records
|
|
750
|
+
* @default true
|
|
751
|
+
*/
|
|
752
|
+
allowExport?: boolean;
|
|
753
|
+
label?: string;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* Unified Interaction type (V2)
|
|
758
|
+
* Combines all interaction types into a single union for the new interactions array.
|
|
759
|
+
*/
|
|
760
|
+
declare type Interaction = ClickFilterInteraction | DrillDownInteraction | DrillThroughInteraction | DrillToDetailInteraction | DrillToURLInteraction | InlineDrillInteraction | DrillUpInteraction | DynamicDrillInteraction;
|
|
761
|
+
|
|
762
|
+
declare interface InteractionTargetOverride {
|
|
763
|
+
applyToCardIds?: string[] | null;
|
|
764
|
+
excludeCardIds?: string[] | null;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Defines what element must be clicked to trigger an interaction.
|
|
769
|
+
*
|
|
770
|
+
* The `type` determines filtering behavior:
|
|
771
|
+
* - 'metric': Captures intersection of ALL dimensions (e.g., country='USA' AND state='CA')
|
|
772
|
+
* - 'attribute': Captures ONLY the clicked dimension (e.g., country='USA')
|
|
773
|
+
*
|
|
774
|
+
* Note: `trigger.type` is different from `field.type`:
|
|
775
|
+
* - trigger.type = filtering behavior ('metric' | 'attribute')
|
|
776
|
+
* - field.type = data type ('dimension' | 'metric' | 'measure')
|
|
777
|
+
*/
|
|
778
|
+
declare interface InteractionTrigger {
|
|
779
|
+
/**
|
|
780
|
+
* Determines filtering behavior when this trigger fires:
|
|
781
|
+
* - 'metric': Capture intersection of all dimensions
|
|
782
|
+
* - 'attribute': Capture only this specific dimension
|
|
783
|
+
*/
|
|
784
|
+
type: 'metric' | 'attribute';
|
|
785
|
+
/**
|
|
786
|
+
* The field (metric or attribute) that must be clicked.
|
|
787
|
+
* For multi-series charts: Use the specific metric Field with unique ID
|
|
788
|
+
* (e.g., Field with id='count_of_orders')
|
|
789
|
+
*/
|
|
790
|
+
field: Field;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
declare interface Join {
|
|
794
|
+
id: string;
|
|
795
|
+
source: DatabaseEntityReference;
|
|
796
|
+
target: DatabaseEntityReference;
|
|
797
|
+
joinType: 'INNER' | 'LEFT' | 'RIGHT' | 'FULL';
|
|
798
|
+
joinKeyGroups: JoinKeyGroup[];
|
|
799
|
+
sequence: number;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
declare interface JoinKey {
|
|
803
|
+
id?: string;
|
|
804
|
+
source: Field;
|
|
805
|
+
target: Field;
|
|
806
|
+
operator: string;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
declare interface JoinKeyGroup {
|
|
810
|
+
id: string;
|
|
811
|
+
operator: string;
|
|
812
|
+
keys: JoinKey[];
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
declare interface JoinPlan {
|
|
816
|
+
baseEntity: DatabaseEntityReference;
|
|
817
|
+
joins: Join[];
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
declare interface LinkFormat {
|
|
821
|
+
urlTemplate: string;
|
|
822
|
+
labelType: 'value' | 'static' | 'column';
|
|
823
|
+
staticLabel?: string;
|
|
824
|
+
labelColumn?: string;
|
|
825
|
+
openInNewTab: boolean;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
declare type LogicalOperator = 'AND' | 'OR';
|
|
829
|
+
|
|
830
|
+
declare interface MetricColumn extends BaseColumn {
|
|
831
|
+
role: 'metric';
|
|
832
|
+
aggregate: AggregateFunction;
|
|
833
|
+
aliasTemplate?: string;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
declare interface MetricField extends Field {
|
|
837
|
+
role: 'metric';
|
|
838
|
+
aggregate?: AggregateFunction;
|
|
839
|
+
/**
|
|
840
|
+
* Optional SQL expression for the metric (e.g., ship_date - order_date).
|
|
841
|
+
* If present, used as aggregate(expression) instead of aggregate(name).
|
|
842
|
+
*/
|
|
843
|
+
expression?: string;
|
|
844
|
+
/**
|
|
845
|
+
* Optional parameters for future extensibility (e.g., window functions).
|
|
846
|
+
* * Example:
|
|
847
|
+
* {
|
|
848
|
+
aggregate: "SUM",
|
|
849
|
+
name: "sales",
|
|
850
|
+
parameters: {
|
|
851
|
+
window: "PARTITION BY region ORDER BY date ROWS BETWEEN 1 PRECEDING AND CURRENT ROW"
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
{
|
|
856
|
+
aggregate: "COUNT",
|
|
857
|
+
name: "order_id",
|
|
858
|
+
parameters: {
|
|
859
|
+
filter: "status = 'Active'"
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
*/
|
|
863
|
+
parameters?: {
|
|
864
|
+
filters?: FilterGroup;
|
|
865
|
+
};
|
|
866
|
+
aliasTemplate?: string;
|
|
867
|
+
valueAliases?: Record<string, string>;
|
|
868
|
+
/**
|
|
869
|
+
* Formula metadata for calculated fields (UI-only metadata)
|
|
870
|
+
* This is supplementary data to help the UI display and edit calculated fields.
|
|
871
|
+
* The `expression` field remains the source of truth for the backend.
|
|
872
|
+
*
|
|
873
|
+
* IMPORTANT: This metadata is ALWAYS updated atomically with the expression field.
|
|
874
|
+
* Both are generated together from the same dialog inputs, preventing drift.
|
|
875
|
+
*/
|
|
876
|
+
calculatedFormula?: CalculatedFieldFormula;
|
|
877
|
+
comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'start_vs_end' | 'target';
|
|
878
|
+
comparisonDisplay?: 'column' | 'inline' | 'hover';
|
|
879
|
+
targetValue?: number;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
declare type NoneOptions = {};
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* Normalizes dashboard layout objects into a canonical structure:
|
|
886
|
+
* - strips transient react-grid-layout runtime fields
|
|
887
|
+
* - sorts layout arrays deterministically
|
|
888
|
+
* - keeps all breakpoints so md/xs-only edits still register as dirty
|
|
889
|
+
*/
|
|
890
|
+
export declare function normalizeDashboardForDirtyCheck(dashboard: TDashboard | null): TDashboard | null;
|
|
891
|
+
|
|
892
|
+
declare type NumberAxisFormat = {
|
|
893
|
+
decimalPlaces?: number;
|
|
894
|
+
suffix?: string;
|
|
895
|
+
currency?: string;
|
|
896
|
+
locale?: string;
|
|
897
|
+
};
|
|
898
|
+
|
|
899
|
+
declare type NumberOptions = {
|
|
900
|
+
locale: string;
|
|
901
|
+
currency?: string;
|
|
902
|
+
options: Intl.NumberFormatOptions;
|
|
903
|
+
colorRanges?: ColorRange[];
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
declare type OldFilterValue = string | number | null | (string | number)[] | RangeValue;
|
|
907
|
+
|
|
908
|
+
declare type Operation = '=' | '>' | '<' | '>=' | '<=' | '!=' | 'in' | 'not in' | 'like' | 'not like' | 'between' | 'not between' | 'is null' | 'is not null';
|
|
909
|
+
|
|
910
|
+
declare type Operator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'startsWith' | 'endsWith' | 'in' | 'not in' | 'between' | 'not between' | 'isNull' | 'isNotNull';
|
|
911
|
+
|
|
912
|
+
declare type OptionsMap = {
|
|
913
|
+
number: NumberOptions;
|
|
914
|
+
string: StringOptions;
|
|
915
|
+
date: DateOptions;
|
|
916
|
+
html: HtmlOptions;
|
|
917
|
+
none: NoneOptions;
|
|
918
|
+
};
|
|
919
|
+
|
|
920
|
+
declare interface OrderBy {
|
|
921
|
+
columnId: string;
|
|
922
|
+
direction: 'asc' | 'desc';
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* Pagination configuration for table queries
|
|
927
|
+
*/
|
|
928
|
+
declare interface PaginationConfig {
|
|
929
|
+
page: number;
|
|
930
|
+
pageSize: number;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
declare type PersistedInteraction = Interaction & {
|
|
934
|
+
id?: string;
|
|
935
|
+
};
|
|
936
|
+
|
|
937
|
+
declare interface PivotByField extends Field {
|
|
938
|
+
role: 'pivotby';
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
declare interface QueryConfig {
|
|
942
|
+
groupByColumns?: GroupByColumn[];
|
|
943
|
+
pivotColumns?: GroupByColumn[];
|
|
944
|
+
metricColumns?: MetricColumn[];
|
|
945
|
+
filterColumns?: FilterByColumn[];
|
|
946
|
+
filters?: QueryFilter[];
|
|
947
|
+
limit?: number;
|
|
948
|
+
orderBy?: OrderBy[];
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
declare type QueryFilter = {
|
|
952
|
+
filterColumnName: string;
|
|
953
|
+
filterValue: OldFilterValue;
|
|
954
|
+
};
|
|
955
|
+
|
|
956
|
+
declare type RangeValue = {
|
|
957
|
+
gte?: string | number;
|
|
958
|
+
lte?: string | number;
|
|
959
|
+
lt?: string | number;
|
|
960
|
+
gt?: string | number;
|
|
961
|
+
};
|
|
962
|
+
|
|
963
|
+
declare type RelativeDateFilter = {
|
|
964
|
+
mode: 'last';
|
|
965
|
+
n: number;
|
|
966
|
+
unit: DateUnit;
|
|
967
|
+
complete?: boolean;
|
|
968
|
+
} | {
|
|
969
|
+
mode: 'this';
|
|
970
|
+
unit: DateUnit;
|
|
971
|
+
toDate?: boolean;
|
|
972
|
+
} | {
|
|
973
|
+
mode: 'previous';
|
|
974
|
+
unit: DateUnit;
|
|
975
|
+
} | {
|
|
976
|
+
mode: 'between';
|
|
977
|
+
unit: DateUnit;
|
|
978
|
+
from: number;
|
|
979
|
+
to: number;
|
|
980
|
+
};
|
|
981
|
+
|
|
982
|
+
declare type SelectedEntities = DatabaseEntityReference[] | DataModelEntityReference[] | FileEntityReference[];
|
|
983
|
+
|
|
984
|
+
/**
|
|
985
|
+
* Stable serializer for dashboard dirty checks.
|
|
986
|
+
* This consolidates normalization + serialization into one call site, so
|
|
987
|
+
* callers can avoid separate pre-normalization state objects.
|
|
988
|
+
*/
|
|
989
|
+
export declare function serializeDashboardForDirtyCheck(dashboard: TDashboard | null): string;
|
|
990
|
+
|
|
991
|
+
declare interface SortByField extends Field {
|
|
992
|
+
role: 'sortby';
|
|
993
|
+
direction: 'asc' | 'desc';
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
declare type StateSerializer<T> = (value: T) => string;
|
|
997
|
+
|
|
998
|
+
declare type StringOptions = {
|
|
999
|
+
maxLength?: number;
|
|
1000
|
+
};
|
|
1001
|
+
|
|
1002
|
+
/**
|
|
1003
|
+
* Style propeerites for the dashboard
|
|
1004
|
+
*/
|
|
1005
|
+
declare type StyleProps = {
|
|
1006
|
+
/** Theme for dashboard background */
|
|
1007
|
+
canvasTheme?: 'clear' | 'muted' | string;
|
|
1008
|
+
/** css class for `dashboard-panel` */
|
|
1009
|
+
dashboardPanel?: string;
|
|
1010
|
+
/** css class for `dashboard-tabs-container` */
|
|
1011
|
+
dashboardTabsContainer?: string;
|
|
1012
|
+
/** css class for `dashboard-card` */
|
|
1013
|
+
/** css class for `dashboard-card-container` */
|
|
1014
|
+
dashboardCardContainer?: string;
|
|
1015
|
+
dashboardCard?: string;
|
|
1016
|
+
/** grid-layout config */
|
|
1017
|
+
/**
|
|
1018
|
+
* Border radius for the control inputs such as filter input, tabs, date picker, etc.
|
|
1019
|
+
*/
|
|
1020
|
+
controlInputRadius?: number;
|
|
1021
|
+
/**
|
|
1022
|
+
* Border radius for the cards
|
|
1023
|
+
*/
|
|
1024
|
+
cardBorderRadius?: number;
|
|
1025
|
+
gridLayout?: {
|
|
1026
|
+
/** css class for `react-grid-layout` */
|
|
1027
|
+
className?: string;
|
|
1028
|
+
margin?: [number, number];
|
|
1029
|
+
};
|
|
1030
|
+
/** chart config */
|
|
1031
|
+
chart?: {
|
|
1032
|
+
/** chart font config */
|
|
1033
|
+
font?: Partial<FontSpec>;
|
|
1034
|
+
dataset?: any;
|
|
1035
|
+
/** chart options */
|
|
1036
|
+
options?: any;
|
|
1037
|
+
};
|
|
1038
|
+
table?: {
|
|
1039
|
+
tableHeaderColor?: string;
|
|
1040
|
+
};
|
|
1041
|
+
};
|
|
1042
|
+
|
|
1043
|
+
declare type TablePreferences = {
|
|
1044
|
+
columnSettingsMap?: ColumnSettingsMap;
|
|
1045
|
+
selectColumnVisible?: boolean;
|
|
1046
|
+
columnVisibility?: Record<string, boolean>;
|
|
1047
|
+
columnSizing?: ColumnSizingState;
|
|
1048
|
+
pageSize?: number;
|
|
1049
|
+
enableDevModePagination?: boolean;
|
|
1050
|
+
forceClientPagination?: boolean;
|
|
1051
|
+
};
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* Target column configuration for multi-field filters.
|
|
1055
|
+
* Allows a single filter to target multiple columns from the SAME table,
|
|
1056
|
+
* with users selecting which column to filter at runtime.
|
|
1057
|
+
*
|
|
1058
|
+
* Note: Cross-table filtering is not supported. All target columns must
|
|
1059
|
+
* be from the same table as the filter's primary table. For cross-table
|
|
1060
|
+
* date filtering, create separate filters or use a shared date dimension.
|
|
1061
|
+
*/
|
|
1062
|
+
declare type TargetColumn = {
|
|
1063
|
+
/** Column name (e.g., "shipping_date") - must be from the filter's table */
|
|
1064
|
+
column: string;
|
|
1065
|
+
/** Display label shown in the dropdown (e.g., "Shipping Date") */
|
|
1066
|
+
label: string;
|
|
1067
|
+
};
|
|
1068
|
+
|
|
1069
|
+
/** Global bar style configuration */
|
|
1070
|
+
declare type TBarStyleConfig = {
|
|
1071
|
+
/** Default border radius for all bars - 0-20 pixels */
|
|
1072
|
+
borderRadius?: number;
|
|
1073
|
+
/** Default border width for all bars - 0-5 pixels */
|
|
1074
|
+
borderWidth?: number;
|
|
1075
|
+
/** Default bar width as percentage of category width (0.1-1.0) */
|
|
1076
|
+
barPercentage?: number;
|
|
1077
|
+
/** Default category width as percentage of available space (0.1-1.0) */
|
|
1078
|
+
categoryPercentage?: number;
|
|
1079
|
+
};
|
|
1080
|
+
|
|
1081
|
+
declare type TBaseQuery = {
|
|
1082
|
+
id: string;
|
|
1083
|
+
name: string;
|
|
1084
|
+
connectionId: string;
|
|
1085
|
+
sql: string;
|
|
1086
|
+
context?: string;
|
|
1087
|
+
description?: string;
|
|
1088
|
+
};
|
|
1089
|
+
|
|
1090
|
+
declare type TBubbleScatterConfig = {
|
|
1091
|
+
/**
|
|
1092
|
+
* Explicit key for X-axis metric. Falls back to auto-detection.
|
|
1093
|
+
*/
|
|
1094
|
+
xMetricKey?: string;
|
|
1095
|
+
/**
|
|
1096
|
+
* Explicit key for Y-axis metric. Falls back to auto-detection.
|
|
1097
|
+
*/
|
|
1098
|
+
yMetricKey?: string;
|
|
1099
|
+
/**
|
|
1100
|
+
* Explicit key for radius metric (bubble only). Falls back to auto-detection.
|
|
1101
|
+
*/
|
|
1102
|
+
radiusMetricKey?: string;
|
|
1103
|
+
/**
|
|
1104
|
+
* Key for point labels (first dimension).
|
|
1105
|
+
*/
|
|
1106
|
+
labelKey?: string;
|
|
1107
|
+
/**
|
|
1108
|
+
* Whether to group points into series. Defaults to auto-detect in card config mode.
|
|
1109
|
+
*/
|
|
1110
|
+
enableGrouping?: boolean;
|
|
1111
|
+
/**
|
|
1112
|
+
* Key for series grouping. Can be any data type (string, number, date).
|
|
1113
|
+
*/
|
|
1114
|
+
groupKey?: string;
|
|
1115
|
+
/**
|
|
1116
|
+
* Scaling mode for bubble radius.
|
|
1117
|
+
*/
|
|
1118
|
+
radiusScale?: 'linear' | 'sqrt' | 'fixed';
|
|
1119
|
+
/**
|
|
1120
|
+
* Fixed radius value when radiusScale is 'fixed' or for scatter charts.
|
|
1121
|
+
*/
|
|
1122
|
+
fixedRadius?: number;
|
|
1123
|
+
/**
|
|
1124
|
+
* Minimum radius for bubble scaling.
|
|
1125
|
+
*/
|
|
1126
|
+
minRadius?: number;
|
|
1127
|
+
/**
|
|
1128
|
+
* Maximum radius for bubble scaling.
|
|
1129
|
+
*/
|
|
1130
|
+
maxRadius?: number;
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1133
|
+
declare type TBulletConfig = {
|
|
1134
|
+
/**
|
|
1135
|
+
* Orientation of the bullet chart. Defaults to horizontal.
|
|
1136
|
+
*/
|
|
1137
|
+
orientation?: 'horizontal' | 'vertical';
|
|
1138
|
+
/**
|
|
1139
|
+
* Explicit metric key to use for target markers. Falls back to the next metric column.
|
|
1140
|
+
*/
|
|
1141
|
+
targetMetricKey?: string;
|
|
1142
|
+
/**
|
|
1143
|
+
* Optional comparative metric (e.g., previous period).
|
|
1144
|
+
*/
|
|
1145
|
+
comparativeMetricKey?: string;
|
|
1146
|
+
/**
|
|
1147
|
+
* When true, disables automatic comparative assignment even if a metric exists.
|
|
1148
|
+
*/
|
|
1149
|
+
disableAutoComparative?: boolean;
|
|
1150
|
+
/**
|
|
1151
|
+
* Mapping of qualitative range names to column keys.
|
|
1152
|
+
*/
|
|
1153
|
+
rangeKeys?: TBulletRangeKeys;
|
|
1154
|
+
/**
|
|
1155
|
+
* Static range values if columns are not provided.
|
|
1156
|
+
*/
|
|
1157
|
+
ranges?: TBulletRangeValues;
|
|
1158
|
+
/**
|
|
1159
|
+
* Global target value if a column is not provided.
|
|
1160
|
+
*/
|
|
1161
|
+
targetValue?: number;
|
|
1162
|
+
/**
|
|
1163
|
+
* Show numeric labels on the actual bar. Default true.
|
|
1164
|
+
*/
|
|
1165
|
+
showValueLabels?: boolean;
|
|
1166
|
+
/**
|
|
1167
|
+
* Treat provided range values as percentages (0-1) when true.
|
|
1168
|
+
*/
|
|
1169
|
+
rangesArePercentages?: boolean;
|
|
1170
|
+
/**
|
|
1171
|
+
* Whether qualitative ranges should be rendered.
|
|
1172
|
+
*/
|
|
1173
|
+
showRanges?: boolean;
|
|
1174
|
+
/**
|
|
1175
|
+
* Display labels for qualitative ranges.
|
|
1176
|
+
*/
|
|
1177
|
+
rangeLabels?: TBulletRangeLabelOverrides;
|
|
1178
|
+
};
|
|
1179
|
+
|
|
1180
|
+
declare type TBulletRangeKeys = Partial<Record<TBulletRangeLabels, string>>;
|
|
1181
|
+
|
|
1182
|
+
declare type TBulletRangeLabelOverrides = Partial<Record<TBulletRangeLabels, string>>;
|
|
1183
|
+
|
|
1184
|
+
declare type TBulletRangeLabels = 'poor' | 'satisfactory' | 'good';
|
|
1185
|
+
|
|
1186
|
+
declare type TBulletRangeValues = Partial<Record<TBulletRangeLabels, number>>;
|
|
1187
|
+
|
|
1188
|
+
declare type TCard = {
|
|
1189
|
+
id: string;
|
|
1190
|
+
title: string;
|
|
1191
|
+
tabTitle?: string;
|
|
1192
|
+
displayTab?: boolean;
|
|
1193
|
+
description?: string;
|
|
1194
|
+
info?: string;
|
|
1195
|
+
connectionId?: string;
|
|
1196
|
+
datamodelId?: string;
|
|
1197
|
+
type: TChartType;
|
|
1198
|
+
sql?: string;
|
|
1199
|
+
python?: string;
|
|
1200
|
+
dataSource?: DataSource;
|
|
1201
|
+
config?: CardConfig;
|
|
1202
|
+
interactionConfig?: CardInteractionConfig;
|
|
1203
|
+
linkedSourceCardId?: string;
|
|
1204
|
+
linkedInteractionTargetOverrides?: Record<string, InteractionTargetOverride>;
|
|
1205
|
+
paginationConfig?: PaginationConfig;
|
|
1206
|
+
queryConfig?: QueryConfig;
|
|
1207
|
+
customCfg?: any;
|
|
1208
|
+
preferences?: TCardPreferences;
|
|
1209
|
+
customCardPreferences?: TCustomCardPreferences;
|
|
1210
|
+
lastSelectedDatabase?: string;
|
|
1211
|
+
lastSelectedDatamodelId?: string;
|
|
1212
|
+
lastSelectedSchema?: string;
|
|
1213
|
+
lastSelectedTable?: string;
|
|
1214
|
+
refreshInterval?: string;
|
|
1215
|
+
/**
|
|
1216
|
+
* Card-specific display preferences that override dashboard-level preferences.
|
|
1217
|
+
* If not specified, the card will use the dashboard's display preferences.
|
|
1218
|
+
*/
|
|
1219
|
+
displayPreferences?: VisualDisplayPreferences;
|
|
1220
|
+
/**
|
|
1221
|
+
* Inline filter definitions for this card.
|
|
1222
|
+
* Configured by editors via the visual editor settings.
|
|
1223
|
+
*/
|
|
1224
|
+
inlineFilters?: TInlineFilter[];
|
|
1225
|
+
};
|
|
1226
|
+
|
|
1227
|
+
declare type TCardPreferences = {
|
|
1228
|
+
onClickFilter?: FilterOnClick[];
|
|
1229
|
+
filterOnClick?: boolean;
|
|
1230
|
+
filterOnClickField?: string;
|
|
1231
|
+
filterOnClickColumnIndex?: number;
|
|
1232
|
+
sortChart?: 'asc' | 'desc' | 'none';
|
|
1233
|
+
formatNumber?: {
|
|
1234
|
+
decimalPlaces?: number;
|
|
1235
|
+
currency?: string;
|
|
1236
|
+
locale?: string;
|
|
1237
|
+
suffix?: string;
|
|
1238
|
+
enabled?: boolean | string;
|
|
1239
|
+
colorRanges?: ColorRange[];
|
|
1240
|
+
};
|
|
1241
|
+
numberAxisFormat?: NumberAxisFormat;
|
|
1242
|
+
datasetOptions?: TDatasetOptions[];
|
|
1243
|
+
chartOptions?: TChartOptions;
|
|
1244
|
+
columnSettings?: TColumnSetting<DisplayDataType>[];
|
|
1245
|
+
colorConfig?: ColorConfig;
|
|
1246
|
+
xAxisConfig?: AxisConfig;
|
|
1247
|
+
yAxisConfig?: AxisConfig;
|
|
1248
|
+
secondaryYAxisConfig?: AxisConfig;
|
|
1249
|
+
dataLabelsConfig?: TDataLabelsConfig;
|
|
1250
|
+
bulletConfig?: TBulletConfig;
|
|
1251
|
+
heatmapConfig?: THeatmapConfig;
|
|
1252
|
+
bubbleScatterConfig?: TBubbleScatterConfig;
|
|
1253
|
+
funnelConfig?: TFunnelConfig;
|
|
1254
|
+
/** Global line/point style defaults for line and area charts */
|
|
1255
|
+
lineStyleConfig?: {
|
|
1256
|
+
lineStyle?: TLineStyle;
|
|
1257
|
+
pointRadius?: number;
|
|
1258
|
+
pointStyle?: TPointStyle;
|
|
1259
|
+
};
|
|
1260
|
+
/** Global bar style defaults for bar charts */
|
|
1261
|
+
barStyleConfig?: TBarStyleConfig;
|
|
1262
|
+
tablePrefs?: TablePreferences;
|
|
1263
|
+
allowDownload?: boolean;
|
|
1264
|
+
customVisualCode?: string;
|
|
1265
|
+
textVisualOptions?: {
|
|
1266
|
+
isDynamicText?: boolean;
|
|
1267
|
+
};
|
|
1268
|
+
mapVisualOptions?: {
|
|
1269
|
+
topoJsonUrl?: string;
|
|
1270
|
+
objectKey?: string;
|
|
1271
|
+
outlineKey?: string;
|
|
1272
|
+
customTopoJsonUrl?: string;
|
|
1273
|
+
projection?: string;
|
|
1274
|
+
projectionScale?: number;
|
|
1275
|
+
projectionOffset?: [number, number];
|
|
1276
|
+
colorScale?: string;
|
|
1277
|
+
};
|
|
1278
|
+
kpiVisualOptions?: {
|
|
1279
|
+
lowerIsBetter?: boolean;
|
|
1280
|
+
countryLogoId?: string;
|
|
1281
|
+
valueAlignment?: 'left' | 'center';
|
|
1282
|
+
formatOptions?: TFormatOptions;
|
|
1283
|
+
metricComparison?: {
|
|
1284
|
+
enabled?: boolean;
|
|
1285
|
+
calculationType?: 'difference' | 'change' | 'change_difference' | 'ratio';
|
|
1286
|
+
formatOptions?: TFormatOptions;
|
|
1287
|
+
showArrow?: boolean;
|
|
1288
|
+
showColor?: boolean;
|
|
1289
|
+
conditionalLabel?: boolean;
|
|
1290
|
+
labelName?: string;
|
|
1291
|
+
position?: 'left' | 'right' | 'top';
|
|
1292
|
+
conditionalLabels?: {
|
|
1293
|
+
increase?: string;
|
|
1294
|
+
decrease?: string;
|
|
1295
|
+
noChange?: string;
|
|
1296
|
+
};
|
|
1297
|
+
colorConfig?: {
|
|
1298
|
+
increase?: 'green' | 'red' | 'neutral' | string;
|
|
1299
|
+
decrease?: 'green' | 'red' | 'neutral' | string;
|
|
1300
|
+
noChange?: 'green' | 'red' | 'neutral' | string;
|
|
1301
|
+
};
|
|
1302
|
+
};
|
|
1303
|
+
};
|
|
1304
|
+
tableVisualOptions?: {
|
|
1305
|
+
metricComparison?: {
|
|
1306
|
+
calculatedAs?: 'difference' | 'change' | 'change_difference' | 'ratio';
|
|
1307
|
+
indicatorStyle?: 'arrow_badge' | 'arrow' | 'badge' | 'none';
|
|
1308
|
+
formatOptions?: TFormatOptions;
|
|
1309
|
+
colors?: {
|
|
1310
|
+
increase?: 'green' | 'red' | 'neutral' | string;
|
|
1311
|
+
decrease?: 'green' | 'red' | 'neutral' | string;
|
|
1312
|
+
neutral?: 'green' | 'red' | 'neutral' | string;
|
|
1313
|
+
};
|
|
1314
|
+
lowerIsBetter?: boolean;
|
|
1315
|
+
};
|
|
1316
|
+
};
|
|
1317
|
+
pivotTableOptions?: {
|
|
1318
|
+
showRowTotals?: boolean;
|
|
1319
|
+
showColumnTotals?: boolean;
|
|
1320
|
+
showGrandTotal?: boolean;
|
|
1321
|
+
sortRowsBy?: 'label' | 'total' | 'metric';
|
|
1322
|
+
sortColumnsBy?: 'label' | 'total' | 'metric';
|
|
1323
|
+
};
|
|
1324
|
+
displayOptions?: {
|
|
1325
|
+
showFilterInfo?: boolean;
|
|
1326
|
+
showCardToolbar?: boolean;
|
|
1327
|
+
showChrome?: boolean;
|
|
1328
|
+
allowScroll?: boolean;
|
|
1329
|
+
showInlineFilterBar?: boolean;
|
|
1330
|
+
};
|
|
1331
|
+
};
|
|
1332
|
+
|
|
1333
|
+
declare type TChartOptions = {
|
|
1334
|
+
type?: TChartType;
|
|
1335
|
+
scales?: {
|
|
1336
|
+
y?: {
|
|
1337
|
+
type?: 'linear' | 'logarithmic';
|
|
1338
|
+
min?: number;
|
|
1339
|
+
max?: number;
|
|
1340
|
+
ticks?: {
|
|
1341
|
+
stepSize?: number;
|
|
1342
|
+
};
|
|
1343
|
+
grid?: {
|
|
1344
|
+
display?: boolean;
|
|
1345
|
+
};
|
|
1346
|
+
};
|
|
1347
|
+
x?: {
|
|
1348
|
+
type?: 'linear' | 'logarithmic';
|
|
1349
|
+
min?: number;
|
|
1350
|
+
max?: number;
|
|
1351
|
+
ticks?: {
|
|
1352
|
+
stepSize?: number;
|
|
1353
|
+
};
|
|
1354
|
+
grid?: {
|
|
1355
|
+
display?: boolean;
|
|
1356
|
+
};
|
|
1357
|
+
};
|
|
1358
|
+
};
|
|
1359
|
+
indexAxis?: 'x' | 'y' | undefined;
|
|
1360
|
+
plugins?: {
|
|
1361
|
+
legend?: TLegendOptions;
|
|
1362
|
+
datalabels?: {
|
|
1363
|
+
anchor?: string;
|
|
1364
|
+
};
|
|
1365
|
+
};
|
|
1366
|
+
treemapColorMode?: 'branch' | 'category';
|
|
1367
|
+
};
|
|
1368
|
+
|
|
1369
|
+
declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'area' | 'stackedArea' | 'combo' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'detailTable' | 'tableBuilder' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'bullet' | 'heatmap' | 'treemap' | 'custom';
|
|
1370
|
+
|
|
1371
|
+
declare type TColumnSetting<T extends DisplayDataType> = {
|
|
1372
|
+
columnIdx: number;
|
|
1373
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
1374
|
+
width?: number;
|
|
1375
|
+
type: T;
|
|
1376
|
+
options: OptionsMap[T];
|
|
1377
|
+
};
|
|
1378
|
+
|
|
1379
|
+
declare type TCustomCardPreferences = {
|
|
1380
|
+
showCardHeader?: boolean;
|
|
1381
|
+
url?: string;
|
|
1382
|
+
componentName?: string;
|
|
1383
|
+
icon?: string;
|
|
1384
|
+
pluginChartType?: string;
|
|
1385
|
+
type?: 'iframe' | 'component';
|
|
1386
|
+
visualType?: 'single' | 'multiple';
|
|
1387
|
+
minInputs?: number;
|
|
1388
|
+
maxInputs?: number;
|
|
1389
|
+
slotIndex?: number;
|
|
1390
|
+
settings?: any;
|
|
1391
|
+
slotSettings?: any;
|
|
1392
|
+
/** @deprecated Use position-based data collection. Kept for legacy dashboard support. */
|
|
1393
|
+
dataInputCardIds?: {
|
|
1394
|
+
[key: number]: {
|
|
1395
|
+
cardId: string;
|
|
1396
|
+
};
|
|
1397
|
+
};
|
|
1398
|
+
};
|
|
1399
|
+
|
|
1400
|
+
declare type TCustomFilterPreferences = {
|
|
1401
|
+
url: string;
|
|
1402
|
+
componentName: string;
|
|
1403
|
+
pluginFilterType?: string;
|
|
1404
|
+
icon?: string;
|
|
1405
|
+
settings?: Record<string, string | number | boolean>;
|
|
1406
|
+
};
|
|
1407
|
+
|
|
1408
|
+
declare type TDashboard = {
|
|
1409
|
+
id: string;
|
|
1410
|
+
title?: string;
|
|
1411
|
+
aiContext?: AIContext;
|
|
1412
|
+
summary?: {
|
|
1413
|
+
enabled?: boolean;
|
|
1414
|
+
position?: 'top' | 'bottom';
|
|
1415
|
+
maxItems?: number;
|
|
1416
|
+
};
|
|
1417
|
+
description?: string;
|
|
1418
|
+
sheets?: TSheet[];
|
|
1419
|
+
style?: TStyle;
|
|
1420
|
+
filters?: TFilter[];
|
|
1421
|
+
customCards?: CustomCard[];
|
|
1422
|
+
baseQueries?: TBaseQuery[];
|
|
1423
|
+
aiScopeTables?: AIScopeTable[];
|
|
1424
|
+
globalStyle?: TStyle;
|
|
1425
|
+
globalCacheConfig?: CacheConfig;
|
|
1426
|
+
emailSettings?: EmailSettings;
|
|
1427
|
+
defaultFilterValues?: TFilterValue[];
|
|
1428
|
+
filterLayout?: FilterLayoutSettings;
|
|
1429
|
+
};
|
|
1430
|
+
|
|
1431
|
+
declare type TDataLabelsConfig = {
|
|
1432
|
+
enabled?: boolean;
|
|
1433
|
+
position?: 'center' | 'top' | 'bottom' | 'left' | 'right' | 'auto' | 'custom';
|
|
1434
|
+
anchor?: 'center' | 'start' | 'end';
|
|
1435
|
+
align?: 'center' | 'start' | 'end' | 'top' | 'bottom' | number;
|
|
1436
|
+
display?: 'auto' | boolean;
|
|
1437
|
+
format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'none';
|
|
1438
|
+
formatOptions?: TFormatOptions;
|
|
1439
|
+
font?: {
|
|
1440
|
+
size?: number;
|
|
1441
|
+
weight?: 'normal' | 'bold';
|
|
1442
|
+
};
|
|
1443
|
+
color?: 'auto' | string;
|
|
1444
|
+
clamp?: boolean;
|
|
1445
|
+
clip?: boolean;
|
|
1446
|
+
rotation?: number;
|
|
1447
|
+
showTotal?: boolean;
|
|
1448
|
+
offset?: number;
|
|
1449
|
+
};
|
|
1450
|
+
|
|
1451
|
+
declare type TDatasetOptions = {
|
|
1452
|
+
idx: number;
|
|
1453
|
+
type?: 'bar' | 'line';
|
|
1454
|
+
fill?: string | number;
|
|
1455
|
+
/** Y-axis assignment for combo charts: 'y' (primary/left) or 'y2' (secondary/right) */
|
|
1456
|
+
yAxisId?: 'y' | 'y2';
|
|
1457
|
+
/** Per-series data labels configuration - uses full TDataLabelsConfig for feature parity */
|
|
1458
|
+
dataLabels?: TDataLabelsConfig;
|
|
1459
|
+
/** Point radius (size) for line/area charts - 0 hides points */
|
|
1460
|
+
pointRadius?: number;
|
|
1461
|
+
/** Point shape style for line/area charts */
|
|
1462
|
+
pointStyle?: TPointStyle;
|
|
1463
|
+
/** Point radius on hover - defaults to pointRadius + 2 */
|
|
1464
|
+
pointHoverRadius?: number;
|
|
1465
|
+
/** Line dash style for line/area charts */
|
|
1466
|
+
lineStyle?: TLineStyle;
|
|
1467
|
+
/** Border radius (rounded corners) for bar charts - 0-20 pixels */
|
|
1468
|
+
borderRadius?: number;
|
|
1469
|
+
/** Border width for bar charts - 0-5 pixels */
|
|
1470
|
+
barBorderWidth?: number;
|
|
1471
|
+
/** Bar width as percentage of category width (0.1-1.0) */
|
|
1472
|
+
barPercentage?: number;
|
|
1473
|
+
/** Category width as percentage of available space (0.1-1.0) */
|
|
1474
|
+
categoryPercentage?: number;
|
|
1475
|
+
/** @deprecated Use dataLabels instead */
|
|
1476
|
+
datalabels?: {
|
|
1477
|
+
display?: boolean;
|
|
1478
|
+
align?: string;
|
|
1479
|
+
anchor?: string;
|
|
1480
|
+
clamp?: boolean;
|
|
1481
|
+
color?: string;
|
|
1482
|
+
};
|
|
1483
|
+
};
|
|
1484
|
+
|
|
1485
|
+
declare type TFilter = {
|
|
1486
|
+
type?: 'single' | 'multiple';
|
|
1487
|
+
uiType?: 'radio' | 'dropdown' | 'tabs';
|
|
1488
|
+
dateSelectionMode?: DateSelectionMode;
|
|
1489
|
+
defaultValues?: (string | number)[];
|
|
1490
|
+
defaultDateFilter?: RelativeDateFilter;
|
|
1491
|
+
sheetId?: string;
|
|
1492
|
+
location?: FilterLocation;
|
|
1493
|
+
hide?: boolean;
|
|
1494
|
+
id: string;
|
|
1495
|
+
connectionId: string;
|
|
1496
|
+
title: string;
|
|
1497
|
+
column: string;
|
|
1498
|
+
dataType: string;
|
|
1499
|
+
table?: string;
|
|
1500
|
+
database?: string;
|
|
1501
|
+
qualifiedTableName?: string;
|
|
1502
|
+
sql: string;
|
|
1503
|
+
operation: Operation;
|
|
1504
|
+
fieldMeta?: FilterFieldMeta;
|
|
1505
|
+
semanticContext?: FilterSemanticContext;
|
|
1506
|
+
/**
|
|
1507
|
+
* Multi-field filter support: When set, provides multiple column options.
|
|
1508
|
+
* The first column becomes the default. Users can select which column
|
|
1509
|
+
* to filter at runtime via a dropdown in the date picker.
|
|
1510
|
+
* If not set, the single `column` field is used (backward compatible).
|
|
1511
|
+
*/
|
|
1512
|
+
targetColumns?: TargetColumn[];
|
|
1513
|
+
searchMode?: 'text' | 'numeric' | 'auto';
|
|
1514
|
+
applyToSheetIds?: string[];
|
|
1515
|
+
excludeSheetIds?: string[];
|
|
1516
|
+
applyToCardIds?: string[];
|
|
1517
|
+
excludeCardIds?: string[];
|
|
1518
|
+
customFilterPreferences?: TCustomFilterPreferences;
|
|
1519
|
+
/** Whether to show the label above the filter (default: true) */
|
|
1520
|
+
showLabel?: boolean;
|
|
1521
|
+
/**
|
|
1522
|
+
* Width in pixels when displayed in toolbar mode.
|
|
1523
|
+
* Defaults vary by filter type (160px for dropdowns, 220px for date ranges, etc.)
|
|
1524
|
+
*/
|
|
1525
|
+
toolbarWidth?: number;
|
|
1526
|
+
/**
|
|
1527
|
+
* Display mode for this filter
|
|
1528
|
+
* - 'canvas': Always show as draggable card on canvas
|
|
1529
|
+
* - 'toolbar': Always show in toolbar
|
|
1530
|
+
* - 'inherit': Use dashboard's filterLayout.displayMode setting (default)
|
|
1531
|
+
*/
|
|
1532
|
+
displayMode?: FilterDisplayMode;
|
|
1533
|
+
};
|
|
1534
|
+
|
|
1535
|
+
declare type TFilterValue = FilterForString | FilterForEqual | FilterForCompare | FilterForBetween | FilterForIn | FilterForDate;
|
|
1536
|
+
|
|
1537
|
+
declare type TFormatOptions = {
|
|
1538
|
+
type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date';
|
|
1539
|
+
decimalPlaces?: number;
|
|
1540
|
+
currency?: string;
|
|
1541
|
+
locale?: string;
|
|
1542
|
+
prefix?: string;
|
|
1543
|
+
suffix?: string;
|
|
1544
|
+
useSuffix?: boolean;
|
|
1545
|
+
negativeInParentheses?: boolean;
|
|
1546
|
+
multiplyBy?: number;
|
|
1547
|
+
dateFormat?: string;
|
|
1548
|
+
};
|
|
1549
|
+
|
|
1550
|
+
declare type TFrame = {
|
|
1551
|
+
id: string;
|
|
1552
|
+
visualId?: string;
|
|
1553
|
+
filterId?: string;
|
|
1554
|
+
cards: TCard[];
|
|
1555
|
+
activeCardId: string;
|
|
1556
|
+
calculatedFields?: Field[];
|
|
1557
|
+
};
|
|
1558
|
+
|
|
1559
|
+
declare type TFunnelConfig = {
|
|
1560
|
+
/**
|
|
1561
|
+
* How to calculate percentage in tooltips and data labels.
|
|
1562
|
+
* - 'percentOfTotal': Each stage shows % of total sum (default/current behavior)
|
|
1563
|
+
* - 'percentOfFirst': First stage = 100%, others relative to first
|
|
1564
|
+
*/
|
|
1565
|
+
percentMode?: TFunnelPercentMode;
|
|
1566
|
+
/**
|
|
1567
|
+
* Controls how much funnel segments narrow based on their values.
|
|
1568
|
+
* - 0: No shrink (all segments same width)
|
|
1569
|
+
* - 1: Full shrink (segments narrow proportionally to values, default)
|
|
1570
|
+
* Lower values prevent segments from becoming too narrow for labels.
|
|
1571
|
+
*/
|
|
1572
|
+
shrinkFraction?: number;
|
|
1573
|
+
/**
|
|
1574
|
+
* Hide labels for segments smaller than this percentage of total.
|
|
1575
|
+
* - 0: Show all labels (default)
|
|
1576
|
+
* - 10: Hide labels for segments < 10% of total
|
|
1577
|
+
* Range: 0-25
|
|
1578
|
+
*/
|
|
1579
|
+
labelThreshold?: number;
|
|
1580
|
+
};
|
|
1581
|
+
|
|
1582
|
+
/**
|
|
1583
|
+
* Tooltip/data label percentage calculation mode for funnel charts.
|
|
1584
|
+
* - 'percentOfTotal': Percentage relative to sum of all values (default)
|
|
1585
|
+
* - 'percentOfFirst': Percentage relative to the first stage value (first stage = 100%)
|
|
1586
|
+
*/
|
|
1587
|
+
declare type TFunnelPercentMode = 'percentOfTotal' | 'percentOfFirst';
|
|
1588
|
+
|
|
1589
|
+
declare type THeatmapConfig = {
|
|
1590
|
+
colorMode?: 'continuous' | 'stepped';
|
|
1591
|
+
steps?: number;
|
|
1592
|
+
colorRange?: [string, string];
|
|
1593
|
+
colorPalette?: 'blue' | 'green' | 'purple' | 'orange' | 'custom';
|
|
1594
|
+
showLegend?: boolean;
|
|
1595
|
+
legendPosition?: 'top' | 'bottom' | 'left' | 'right';
|
|
1596
|
+
showDataLabels?: boolean;
|
|
1597
|
+
nullFillColor?: string;
|
|
1598
|
+
fillMissingCells?: boolean;
|
|
1599
|
+
xAxisBuckets?: string[];
|
|
1600
|
+
yAxisBuckets?: string[];
|
|
1601
|
+
};
|
|
1602
|
+
|
|
1603
|
+
declare interface TimeDrillStep {
|
|
1604
|
+
granularity: TimeGranularity;
|
|
1605
|
+
next?: TimeGranularity;
|
|
1606
|
+
comparison?: 'previous_year' | 'previous_period';
|
|
1607
|
+
rollingWindow?: number;
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1610
|
+
declare type TimeGranularity = 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
1611
|
+
|
|
1612
|
+
/**
|
|
1613
|
+
* Inline filter definition stored on a card.
|
|
1614
|
+
* Inline filters appear on the right-hand side of the card header,
|
|
1615
|
+
* allowing ad-hoc data exploration without affecting other cards.
|
|
1616
|
+
*/
|
|
1617
|
+
declare type TInlineFilter = {
|
|
1618
|
+
id: string;
|
|
1619
|
+
column: string;
|
|
1620
|
+
title: string;
|
|
1621
|
+
dataType: string;
|
|
1622
|
+
table: string;
|
|
1623
|
+
database: string;
|
|
1624
|
+
connectionId: string;
|
|
1625
|
+
operation: Operation;
|
|
1626
|
+
sql: string;
|
|
1627
|
+
fieldMeta?: FilterFieldMeta;
|
|
1628
|
+
semanticContext?: FilterSemanticContext;
|
|
1629
|
+
/** Selection type: 'single' allows one value, 'multiple' allows many */
|
|
1630
|
+
type?: 'single' | 'multiple';
|
|
1631
|
+
/** UI component for single-select filters */
|
|
1632
|
+
uiType?: 'radio' | 'dropdown' | 'tabs';
|
|
1633
|
+
/** Date picker type: 'range' for full calendar, 'months' for month picker */
|
|
1634
|
+
dateSelectionMode?: DateSelectionMode;
|
|
1635
|
+
/** Default values applied when the dashboard first loads */
|
|
1636
|
+
defaultValues?: (string | number)[];
|
|
1637
|
+
/** Default relative date filter (e.g., "Last 7 days") applied on dashboard load */
|
|
1638
|
+
defaultDateFilter?: RelativeDateFilter;
|
|
1639
|
+
/** Search mode for numeric filters: 'text' treats as text, 'numeric' enables operators (>, <, =) */
|
|
1640
|
+
searchMode?: 'text' | 'numeric' | 'auto';
|
|
1641
|
+
/** Custom filter UI from a plugin */
|
|
1642
|
+
customFilterPreferences?: TCustomFilterPreferences;
|
|
1643
|
+
/** Width of the inline filter in pixels (default: 250) */
|
|
1644
|
+
width?: number;
|
|
1645
|
+
/** Whether to show the label above the filter (default: true) */
|
|
1646
|
+
showLabel?: boolean;
|
|
1647
|
+
};
|
|
1648
|
+
|
|
1649
|
+
declare type TLegendOptions = {
|
|
1650
|
+
display?: boolean;
|
|
1651
|
+
position?: 'top' | 'left' | 'bottom' | 'right';
|
|
1652
|
+
align?: 'start' | 'center' | 'end';
|
|
1653
|
+
labels?: {
|
|
1654
|
+
generateLabels?: (chart: any) => any[];
|
|
1655
|
+
[key: string]: any;
|
|
1656
|
+
};
|
|
1657
|
+
};
|
|
1658
|
+
|
|
1659
|
+
/** Line dash style options */
|
|
1660
|
+
declare type TLineStyle = 'solid' | 'dashed' | 'dotted' | 'dash-dot';
|
|
1661
|
+
|
|
1662
|
+
/** Point style options supported by Chart.js */
|
|
1663
|
+
declare type TPointStyle = 'circle' | 'cross' | 'crossRot' | 'dash' | 'line' | 'rect' | 'rectRounded' | 'rectRot' | 'star' | 'triangle';
|
|
1664
|
+
|
|
1665
|
+
declare type TSheet = {
|
|
1666
|
+
id: string;
|
|
1667
|
+
title?: string;
|
|
1668
|
+
description?: string;
|
|
1669
|
+
layout?: ReactGridLayout.Layout[];
|
|
1670
|
+
layouts?: ReactGridLayout.Layouts;
|
|
1671
|
+
cards?: TCard[];
|
|
1672
|
+
frames?: TFrame[];
|
|
1673
|
+
};
|
|
1674
|
+
|
|
1675
|
+
/**
|
|
1676
|
+
* Style for the dashboard
|
|
1677
|
+
*/
|
|
1678
|
+
declare type TStyle = {
|
|
1679
|
+
default: StyleProps;
|
|
1680
|
+
dark?: StyleProps;
|
|
1681
|
+
};
|
|
1682
|
+
|
|
1683
|
+
/**
|
|
1684
|
+
* URL Parameter for drill-to-URL interpolation
|
|
1685
|
+
* Represents a placeholder in the URL template (e.g., {{product_id}})
|
|
1686
|
+
*/
|
|
1687
|
+
declare interface URLParameter {
|
|
1688
|
+
/**
|
|
1689
|
+
* Unique identifier for the parameter (e.g., 'product_id', 'card_id')
|
|
1690
|
+
* Used in template as {{id}}
|
|
1691
|
+
*/
|
|
1692
|
+
id: string;
|
|
1693
|
+
/**
|
|
1694
|
+
* Display label for the parameter
|
|
1695
|
+
*/
|
|
1696
|
+
label: string;
|
|
1697
|
+
/**
|
|
1698
|
+
* Category of the parameter
|
|
1699
|
+
* - attribute: From card dimensions/attributes (e.g., product name, region)
|
|
1700
|
+
* - identifier: System values (card_id, frame_id, sheet_id)
|
|
1701
|
+
*/
|
|
1702
|
+
category: 'attribute' | 'identifier';
|
|
1703
|
+
/**
|
|
1704
|
+
* For attribute parameters: the complete field object
|
|
1705
|
+
* Provides access to all field properties (name, qualifiedFieldName, dataType, etc.)
|
|
1706
|
+
*/
|
|
1707
|
+
field?: Field;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
/**
|
|
1711
|
+
* Efficiently checks if current state differs from pristine state
|
|
1712
|
+
* using debouncing and requestIdleCallback to avoid blocking the main thread.
|
|
1713
|
+
*
|
|
1714
|
+
* @param currentState - The current state to compare
|
|
1715
|
+
* @param pristineState - The original state to compare against (null if not tracking)
|
|
1716
|
+
* @param debounceMs - Milliseconds to wait after last change (default: 300)
|
|
1717
|
+
* @param idleTimeout - Max ms to wait for idle time (default: 1000)
|
|
1718
|
+
* @returns Object with isDirty boolean and resetDirty function to immediately clear dirty state
|
|
1719
|
+
*/
|
|
1720
|
+
export declare function useDebouncedDirtyCheck<T>(currentState: T, pristineState: T | null, debounceMs?: number, idleTimeout?: number, serializeState?: StateSerializer<T>): {
|
|
1721
|
+
isDirty: boolean;
|
|
1722
|
+
isDirtyPending: boolean;
|
|
1723
|
+
resetDirty: () => void;
|
|
1724
|
+
};
|
|
1725
|
+
|
|
1726
|
+
/**
|
|
1727
|
+
* Display mode for visual components - controls which UI elements are shown
|
|
1728
|
+
*/
|
|
1729
|
+
declare type VisualDisplayMode = 'full' | 'print' | 'table-print';
|
|
1730
|
+
|
|
1731
|
+
/**
|
|
1732
|
+
* Display preferences for controlling visual component rendering
|
|
1733
|
+
*/
|
|
1734
|
+
declare type VisualDisplayPreferences = {
|
|
1735
|
+
/**
|
|
1736
|
+
* Predefined display mode
|
|
1737
|
+
* - 'full': All UI elements (default)
|
|
1738
|
+
* - 'print': Optimized for printing (shows title and description, hides interactive elements)
|
|
1739
|
+
* - 'table-print': Table-specific print mode (title only, no pagination/toolbar)
|
|
1740
|
+
*/
|
|
1741
|
+
mode?: VisualDisplayMode;
|
|
1742
|
+
/**
|
|
1743
|
+
* Override specific UI elements visibility
|
|
1744
|
+
* These overrides take precedence over the mode presets
|
|
1745
|
+
*/
|
|
1746
|
+
overrides?: {
|
|
1747
|
+
showHeader?: boolean;
|
|
1748
|
+
showTitle?: boolean;
|
|
1749
|
+
showDescription?: boolean;
|
|
1750
|
+
showTabs?: boolean;
|
|
1751
|
+
showFooter?: boolean;
|
|
1752
|
+
showFilters?: boolean;
|
|
1753
|
+
showBreadcrumbs?: boolean;
|
|
1754
|
+
showRefreshIndicator?: boolean;
|
|
1755
|
+
showFilterInfo?: boolean;
|
|
1756
|
+
showPagination?: boolean;
|
|
1757
|
+
showTableToolbar?: boolean;
|
|
1758
|
+
showColumnSettings?: boolean;
|
|
1759
|
+
};
|
|
1760
|
+
};
|
|
1761
|
+
|
|
1762
|
+
export { }
|