@dlh.io/bideux 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +90 -0
- package/dist/all.d.ts +14 -0
- package/dist/all.js +15 -0
- package/dist/all.js.map +1 -0
- package/dist/chunk-62IQGXLW.js +11470 -0
- package/dist/chunk-62IQGXLW.js.map +1 -0
- package/dist/chunk-75CRTQK7.js +315 -0
- package/dist/chunk-75CRTQK7.js.map +1 -0
- package/dist/chunk-FVO6E22Z.js +225 -0
- package/dist/chunk-FVO6E22Z.js.map +1 -0
- package/dist/chunk-GRITOB4M.js +337 -0
- package/dist/chunk-GRITOB4M.js.map +1 -0
- package/dist/chunk-HPFHIZWO.js +40 -0
- package/dist/chunk-HPFHIZWO.js.map +1 -0
- package/dist/chunk-IMNUQGHE.js +2864 -0
- package/dist/chunk-IMNUQGHE.js.map +1 -0
- package/dist/chunk-LHD445PJ.js +571 -0
- package/dist/chunk-LHD445PJ.js.map +1 -0
- package/dist/chunk-LPLBBHOW.js +386 -0
- package/dist/chunk-LPLBBHOW.js.map +1 -0
- package/dist/chunk-NGM5R3LW.js +881 -0
- package/dist/chunk-NGM5R3LW.js.map +1 -0
- package/dist/chunk-OMPR32AR.js +1320 -0
- package/dist/chunk-OMPR32AR.js.map +1 -0
- package/dist/chunk-QDQ5VVTC.js +255 -0
- package/dist/chunk-QDQ5VVTC.js.map +1 -0
- package/dist/chunk-RRWZKNDZ.js +1004 -0
- package/dist/chunk-RRWZKNDZ.js.map +1 -0
- package/dist/chunk-SRWIBMEB.js +178 -0
- package/dist/chunk-SRWIBMEB.js.map +1 -0
- package/dist/element/chunk-AOKCBPMV.js +1646 -0
- package/dist/element/chunk-AOKCBPMV.js.map +1 -0
- package/dist/element/chunk-B67SYRQP.js +281 -0
- package/dist/element/chunk-B67SYRQP.js.map +1 -0
- package/dist/element/chunk-FNRVFA2C.js +55 -0
- package/dist/element/chunk-FNRVFA2C.js.map +1 -0
- package/dist/element/chunk-G3C722QP.js +4707 -0
- package/dist/element/chunk-G3C722QP.js.map +1 -0
- package/dist/element/chunk-H5IFOSQP.js +346 -0
- package/dist/element/chunk-H5IFOSQP.js.map +1 -0
- package/dist/element/chunk-LXR3CLCN.js +30 -0
- package/dist/element/chunk-LXR3CLCN.js.map +1 -0
- package/dist/element/chunk-TFV4CJR4.js +183 -0
- package/dist/element/chunk-TFV4CJR4.js.map +1 -0
- package/dist/element/chunk-TXSK3CIN.js +859 -0
- package/dist/element/chunk-TXSK3CIN.js.map +1 -0
- package/dist/element/chunk-WDTTBY3S.js +45 -0
- package/dist/element/chunk-WDTTBY3S.js.map +1 -0
- package/dist/element/chunk-ZI3RYCAR.js +233 -0
- package/dist/element/chunk-ZI3RYCAR.js.map +1 -0
- package/dist/element/element.d.ts +3044 -0
- package/dist/element/element.js +146554 -0
- package/dist/element/element.js.map +1 -0
- package/dist/element/revo-grid.entry-7FHEBN3O.js +4817 -0
- package/dist/element/revo-grid.entry-7FHEBN3O.js.map +1 -0
- package/dist/element/revogr-attribution_7.entry-LSOFVZRA.js +1328 -0
- package/dist/element/revogr-attribution_7.entry-LSOFVZRA.js.map +1 -0
- package/dist/element/revogr-clipboard_3.entry-V74UIBPJ.js +494 -0
- package/dist/element/revogr-clipboard_3.entry-V74UIBPJ.js.map +1 -0
- package/dist/element/revogr-data_4.entry-2UBOKTFN.js +1041 -0
- package/dist/element/revogr-data_4.entry-2UBOKTFN.js.map +1 -0
- package/dist/element/revogr-filter-panel.entry-B24PLQU4.js +552 -0
- package/dist/element/revogr-filter-panel.entry-B24PLQU4.js.map +1 -0
- package/dist/index.d.ts +1041 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/react.d.ts +1915 -0
- package/dist/react.js +14 -0
- package/dist/react.js.map +1 -0
- package/dist/renderers/echarts.d.ts +44 -0
- package/dist/renderers/echarts.js +6 -0
- package/dist/renderers/echarts.js.map +1 -0
- package/dist/renderers/index.d.ts +48 -0
- package/dist/renderers/index.js +12 -0
- package/dist/renderers/index.js.map +1 -0
- package/dist/renderers/revogrid.d.ts +76 -0
- package/dist/renderers/revogrid.js +6 -0
- package/dist/renderers/revogrid.js.map +1 -0
- package/dist/renderers/tabulator.d.ts +37 -0
- package/dist/renderers/tabulator.js +6 -0
- package/dist/renderers/tabulator.js.map +1 -0
- package/dist/result-table-CPls-277.d.ts +1885 -0
- package/dist/schema/dashboard.schema.json +4374 -0
- package/dist/schema/semantic-model.schema.json +1200 -0
- package/dist/schema/widget.schema.json +1793 -0
- package/dist/styles.css +156 -0
- package/dist/theme.css +1789 -0
- package/dist/types-CHFSsU_X.d.ts +1007 -0
- package/package.json +119 -0
|
@@ -0,0 +1,1885 @@
|
|
|
1
|
+
import { Document } from 'yaml';
|
|
2
|
+
import { aw as WidgetSpec$1, av as WidgetResult } from './types-CHFSsU_X.js';
|
|
3
|
+
|
|
4
|
+
type Kind = "dashboard";
|
|
5
|
+
type Author = string | null;
|
|
6
|
+
type Description = string;
|
|
7
|
+
type Backgroundcolor = string | null;
|
|
8
|
+
type Border = string | boolean | null;
|
|
9
|
+
type Borderradius = string | number | null;
|
|
10
|
+
type Color = string | null;
|
|
11
|
+
type Fontsize = string | number | null;
|
|
12
|
+
type Fontweight = string | number | null;
|
|
13
|
+
type Padding = string | number | null;
|
|
14
|
+
type Textalign = ("left" | "center" | "right" | "justify") | null;
|
|
15
|
+
type Title = string | LabelBlock | null;
|
|
16
|
+
type Icon = string | null;
|
|
17
|
+
type Position = ("top" | "bottom" | "left" | "right") | null;
|
|
18
|
+
type Text = string | null;
|
|
19
|
+
type Tooltip = string | null;
|
|
20
|
+
type Verticalalign = ("top" | "middle" | "bottom") | null;
|
|
21
|
+
type Visible = boolean | null;
|
|
22
|
+
type Id = string;
|
|
23
|
+
type Name = string;
|
|
24
|
+
type AllowEmbed = boolean;
|
|
25
|
+
type Owner = string | null;
|
|
26
|
+
type Public = boolean;
|
|
27
|
+
type Roles = string[];
|
|
28
|
+
type Scope = "org" | "project" | "dashboard" | "widget";
|
|
29
|
+
type Status = "draft" | "published" | "archived";
|
|
30
|
+
type Tags = string[];
|
|
31
|
+
type Version = string;
|
|
32
|
+
type Tags1 = string[];
|
|
33
|
+
type Version1 = string;
|
|
34
|
+
type Enabled = boolean;
|
|
35
|
+
type Icon1 = string;
|
|
36
|
+
type Showinembed = boolean;
|
|
37
|
+
type Showinlayout = boolean;
|
|
38
|
+
type Showinpreview = boolean;
|
|
39
|
+
type Ttlseconds = number | null;
|
|
40
|
+
type Datamodelid = string | null;
|
|
41
|
+
type Background = string | null;
|
|
42
|
+
type Collapsible = boolean | null;
|
|
43
|
+
type Defaultcollapsed = boolean | null;
|
|
44
|
+
type Disablecollapse = boolean | null;
|
|
45
|
+
type Gap = string | number | null;
|
|
46
|
+
type Buttonspan = number | null;
|
|
47
|
+
type Columns = number | null;
|
|
48
|
+
type Datespan = number | null;
|
|
49
|
+
type Gap1 = string | number | null;
|
|
50
|
+
type Maxcolumnwidth = number | null;
|
|
51
|
+
type Mincolumnwidth = number | null;
|
|
52
|
+
type Mode = "auto" | "grid" | "flex";
|
|
53
|
+
type Padding1 = string | number | null;
|
|
54
|
+
type Radiospan = number | null;
|
|
55
|
+
type Selectspan = number | null;
|
|
56
|
+
type Padding2 = string | number | null;
|
|
57
|
+
type Position1 = "top" | "left";
|
|
58
|
+
type Width = string | number | null;
|
|
59
|
+
type Background1 = string | null;
|
|
60
|
+
type Height = string | number | null;
|
|
61
|
+
type Padding3 = string | number | null;
|
|
62
|
+
type Textalign1 = ("left" | "center" | "right" | "justify") | null;
|
|
63
|
+
type Verticalalign1 = ("top" | "middle" | "bottom") | null;
|
|
64
|
+
type Visible1 = boolean | null;
|
|
65
|
+
type Widgets = WidgetSpec[] | null;
|
|
66
|
+
type Kind1 = "widget";
|
|
67
|
+
type Field = string;
|
|
68
|
+
type Operator = "eq" | "in" | "gt" | "lt" | "gte" | "lte" | "contains" | "date" | "between";
|
|
69
|
+
type Param = string | null;
|
|
70
|
+
type Target = string;
|
|
71
|
+
type Bindings = FilterBinding[];
|
|
72
|
+
type Component = "echarts" | "kpi" | "filter" | "select" | "table" | "tabulator" | "pivot_table" | "text" | "image" | "markdown";
|
|
73
|
+
type Data = KpiDataSource | StaticDataSource | DemoDataSource | SqlDataSource | DatasetDataSource | QueryDataSource;
|
|
74
|
+
type DataModelId = string | null;
|
|
75
|
+
type Kind2 = "kpi";
|
|
76
|
+
type Kpi = string;
|
|
77
|
+
type Labelcolumn = string | null;
|
|
78
|
+
type JsonValue = unknown;
|
|
79
|
+
type Valuecolumn = string | null;
|
|
80
|
+
type Columns1 = string[] | null;
|
|
81
|
+
type Kind3 = "static";
|
|
82
|
+
type Label = string;
|
|
83
|
+
type Options = StaticOption[];
|
|
84
|
+
type Rows = {
|
|
85
|
+
[k: string]: JsonValue;
|
|
86
|
+
}[];
|
|
87
|
+
type Columns2 = string[] | null;
|
|
88
|
+
type Dataset = string | null;
|
|
89
|
+
type Kind4 = "demo";
|
|
90
|
+
type Rows1 = number;
|
|
91
|
+
type Seed = number;
|
|
92
|
+
type DataModelId1 = string | null;
|
|
93
|
+
type FilterField = string | null;
|
|
94
|
+
type Kind5 = "sql";
|
|
95
|
+
type Query = string;
|
|
96
|
+
type Columns3 = string[] | null;
|
|
97
|
+
type DataModelId2 = string | null;
|
|
98
|
+
type Dataset1 = string;
|
|
99
|
+
type Dimensions = string[] | null;
|
|
100
|
+
type Field1 = string;
|
|
101
|
+
type FilterId = string;
|
|
102
|
+
type Operator1 = "eq" | "in" | "gt" | "lt" | "gte" | "lte" | "contains" | "date" | "between";
|
|
103
|
+
type Param1 = string | null;
|
|
104
|
+
type Filters = IncomingFilter[];
|
|
105
|
+
type Kind6 = "dataset";
|
|
106
|
+
type Metrics = string[] | null;
|
|
107
|
+
type DataModelId3 = string | null;
|
|
108
|
+
type Kind7 = "query";
|
|
109
|
+
type Query1 = string;
|
|
110
|
+
type Background2 = string | null;
|
|
111
|
+
type Border1 = string | boolean | null;
|
|
112
|
+
type Borderradius1 = string | number | null;
|
|
113
|
+
type Echarts = {
|
|
114
|
+
[k: string]: JsonValue;
|
|
115
|
+
} | null;
|
|
116
|
+
type Filter = {
|
|
117
|
+
[k: string]: JsonValue;
|
|
118
|
+
} | null;
|
|
119
|
+
type Image = {
|
|
120
|
+
[k: string]: JsonValue;
|
|
121
|
+
} | null;
|
|
122
|
+
type Kpi1 = {
|
|
123
|
+
[k: string]: JsonValue;
|
|
124
|
+
} | null;
|
|
125
|
+
type Margin = string | number | null;
|
|
126
|
+
type Markdown = {
|
|
127
|
+
[k: string]: JsonValue;
|
|
128
|
+
} | null;
|
|
129
|
+
type Padding4 = string | number | null;
|
|
130
|
+
type PivotTable = {
|
|
131
|
+
[k: string]: JsonValue;
|
|
132
|
+
} | null;
|
|
133
|
+
type Select = {
|
|
134
|
+
[k: string]: JsonValue;
|
|
135
|
+
} | null;
|
|
136
|
+
type Shadow = string | boolean | null;
|
|
137
|
+
type Table = {
|
|
138
|
+
[k: string]: JsonValue;
|
|
139
|
+
} | null;
|
|
140
|
+
type Tabulator = {
|
|
141
|
+
[k: string]: JsonValue;
|
|
142
|
+
} | null;
|
|
143
|
+
type Text1 = {
|
|
144
|
+
[k: string]: JsonValue;
|
|
145
|
+
} | null;
|
|
146
|
+
type Filters1 = IncomingFilter[];
|
|
147
|
+
type Id1 = string;
|
|
148
|
+
type Label1 = string | null;
|
|
149
|
+
type OpenIn = "modal" | "same" | "new" | "detail";
|
|
150
|
+
type PassFilters = boolean;
|
|
151
|
+
type PassSelection = boolean;
|
|
152
|
+
type Target1 = string;
|
|
153
|
+
type TargetType = "dashboard" | "url" | "filter" | "dimension";
|
|
154
|
+
type Type = "drilldown" | "set_filter" | "navigate";
|
|
155
|
+
type Field2 = string | null;
|
|
156
|
+
type Kind8 = "event" | "filter" | "literal";
|
|
157
|
+
type Target2 = string;
|
|
158
|
+
type TargetType1 = "filter" | "dimension";
|
|
159
|
+
type VariableMappings = InteractionVariableMapping[];
|
|
160
|
+
type Interactions = WidgetInteraction[];
|
|
161
|
+
type H = number;
|
|
162
|
+
type Isbounded = boolean | null;
|
|
163
|
+
type Isdraggable = boolean | null;
|
|
164
|
+
type Isresizable = boolean | null;
|
|
165
|
+
type Maxh = number | null;
|
|
166
|
+
type Maxw = number | null;
|
|
167
|
+
type Minh = number | null;
|
|
168
|
+
type Minw = number | null;
|
|
169
|
+
type Resizehandles = string[] | null;
|
|
170
|
+
type H1 = number;
|
|
171
|
+
type Isbounded1 = boolean | null;
|
|
172
|
+
type Isdraggable1 = boolean | null;
|
|
173
|
+
type Isresizable1 = boolean | null;
|
|
174
|
+
type Maxh1 = number | null;
|
|
175
|
+
type Maxw1 = number | null;
|
|
176
|
+
type Minh1 = number | null;
|
|
177
|
+
type Minw1 = number | null;
|
|
178
|
+
type Resizehandles1 = string[] | null;
|
|
179
|
+
type W = number;
|
|
180
|
+
type X = number;
|
|
181
|
+
type Y = number;
|
|
182
|
+
type Unplaced = boolean | null;
|
|
183
|
+
type W1 = number;
|
|
184
|
+
type X1 = number;
|
|
185
|
+
type Y1 = number;
|
|
186
|
+
type Category = string | null;
|
|
187
|
+
type Date = string | null;
|
|
188
|
+
type Delta = string | null;
|
|
189
|
+
type Label2 = string | null;
|
|
190
|
+
type Series = string | null;
|
|
191
|
+
type SeriesName = string | null;
|
|
192
|
+
type Value = string | null;
|
|
193
|
+
type X2 = string | null;
|
|
194
|
+
type Y2 = string | null;
|
|
195
|
+
type Version2 = string;
|
|
196
|
+
type Allowoverlap = boolean | null;
|
|
197
|
+
type Compacttype = ("vertical" | "horizontal") | null;
|
|
198
|
+
type Containerpadding = number[] | null;
|
|
199
|
+
type Draggablecancel = string | null;
|
|
200
|
+
type Draggablehandle = string | null;
|
|
201
|
+
type Isbounded2 = boolean | null;
|
|
202
|
+
type Maxlayoutwidth = ("mobile" | "tablet" | "desktop" | "wide") | null;
|
|
203
|
+
type Maxrows = number | null;
|
|
204
|
+
type Preventcollision = boolean | null;
|
|
205
|
+
type Resizehandles2 = string[] | null;
|
|
206
|
+
type Snap = boolean | null;
|
|
207
|
+
type Squarecells = boolean | null;
|
|
208
|
+
type Backgroundcolor1 = string | null;
|
|
209
|
+
type Fitmode = "fit_to_width" | "fit_to_page";
|
|
210
|
+
type Orientation = "auto" | "portrait" | "landscape";
|
|
211
|
+
type Pagesize = "a4" | "letter";
|
|
212
|
+
type Scale = "contain" | "cover";
|
|
213
|
+
type Background3 = string | null;
|
|
214
|
+
type Border2 = string | boolean | null;
|
|
215
|
+
type Borderradius2 = string | number | null;
|
|
216
|
+
type Margin1 = string | number | null;
|
|
217
|
+
type Padding5 = string | number | null;
|
|
218
|
+
type Shadow1 = string | boolean | null;
|
|
219
|
+
type AiContext = {
|
|
220
|
+
[k: string]: JsonValue;
|
|
221
|
+
} | string | null;
|
|
222
|
+
type CustomExtensions = {
|
|
223
|
+
[k: string]: JsonValue;
|
|
224
|
+
}[] | null;
|
|
225
|
+
/**
|
|
226
|
+
* Host data-store identifier holding credentials, database, and schema. Omit to use the host's default active store.
|
|
227
|
+
*/
|
|
228
|
+
type DataModelId4 = string | null;
|
|
229
|
+
/**
|
|
230
|
+
* Store used by datasets that do not name one.
|
|
231
|
+
*/
|
|
232
|
+
type Default = boolean;
|
|
233
|
+
type Description1 = string | null;
|
|
234
|
+
/**
|
|
235
|
+
* Id datasets use to point at this store, for example ops_dw.
|
|
236
|
+
*/
|
|
237
|
+
type Id2 = string;
|
|
238
|
+
type Name1 = string | null;
|
|
239
|
+
/**
|
|
240
|
+
* Warehouse vendor, for example snowflake, databricks or postgres.
|
|
241
|
+
*/
|
|
242
|
+
type Vendor = string | null;
|
|
243
|
+
type DataStores = DataStore[];
|
|
244
|
+
type AiContext1 = {
|
|
245
|
+
[k: string]: JsonValue;
|
|
246
|
+
} | string | null;
|
|
247
|
+
type Enabled1 = boolean;
|
|
248
|
+
type TtlSeconds = number | null;
|
|
249
|
+
type TtlSeconds1 = number | null;
|
|
250
|
+
type CustomExtensions1 = {
|
|
251
|
+
[k: string]: JsonValue;
|
|
252
|
+
}[] | null;
|
|
253
|
+
/**
|
|
254
|
+
* Id of the data store in this model's data_stores list. Omit to use the model's default store.
|
|
255
|
+
*/
|
|
256
|
+
type DataStoreId = string | null;
|
|
257
|
+
type DataStoreIds = string[] | null;
|
|
258
|
+
type DataModelId5 = string | null;
|
|
259
|
+
/**
|
|
260
|
+
* Id of the data store in this model's data_stores list. Omit to use the model's default store.
|
|
261
|
+
*/
|
|
262
|
+
type DataStoreId1 = string | null;
|
|
263
|
+
type DataStoreIds1 = string[] | null;
|
|
264
|
+
type Description2 = string | null;
|
|
265
|
+
type AiContext2 = {
|
|
266
|
+
[k: string]: JsonValue;
|
|
267
|
+
} | string | null;
|
|
268
|
+
/**
|
|
269
|
+
* Warehouse column this dimension reads. Defaults to the id.
|
|
270
|
+
*/
|
|
271
|
+
type Column = string | null;
|
|
272
|
+
type CustomExtensions2 = {
|
|
273
|
+
[k: string]: JsonValue;
|
|
274
|
+
}[] | null;
|
|
275
|
+
type Description3 = string | null;
|
|
276
|
+
/**
|
|
277
|
+
* SQL expression to use instead of a plain column.
|
|
278
|
+
*/
|
|
279
|
+
type Expression = string | Expression1 | null;
|
|
280
|
+
type Default1 = string | null;
|
|
281
|
+
type Dialect = string;
|
|
282
|
+
type Expression2 = string;
|
|
283
|
+
type Dialects = ExpressionDialect[];
|
|
284
|
+
type Format = string | null;
|
|
285
|
+
type Group = string | null;
|
|
286
|
+
type Hidden = boolean | null;
|
|
287
|
+
/**
|
|
288
|
+
* Id widgets use to group or filter by, for example business_date.
|
|
289
|
+
*/
|
|
290
|
+
type Id3 = string;
|
|
291
|
+
type IsTime = boolean | null;
|
|
292
|
+
type Label3 = string | null;
|
|
293
|
+
type Name2 = string | null;
|
|
294
|
+
type Type1 = "string" | "number" | "date" | "time" | "boolean";
|
|
295
|
+
/**
|
|
296
|
+
* Columns widgets can group or filter by.
|
|
297
|
+
*/
|
|
298
|
+
type Dimensions1 = Dimension[];
|
|
299
|
+
/**
|
|
300
|
+
* Columns widgets can group or filter by.
|
|
301
|
+
*/
|
|
302
|
+
type Dimensions2 = Dimension[];
|
|
303
|
+
/**
|
|
304
|
+
* Column carrying the location key. Without it a location-scoped user cannot query this dataset.
|
|
305
|
+
*/
|
|
306
|
+
type FilterField1 = string | null;
|
|
307
|
+
type FilterParam = string;
|
|
308
|
+
/**
|
|
309
|
+
* Table or view the rows come from, for example {mart_schema}.RPT_DAILY_SALES_SUMMARY.
|
|
310
|
+
*/
|
|
311
|
+
type From = string | null;
|
|
312
|
+
type GroupBy = string[] | null;
|
|
313
|
+
/**
|
|
314
|
+
* Id widgets use to ask for this dataset, for example daily_sales.
|
|
315
|
+
*/
|
|
316
|
+
type Id4 = string;
|
|
317
|
+
type Kpi2 = string | null;
|
|
318
|
+
type Enabled2 = boolean;
|
|
319
|
+
type Grain = string[];
|
|
320
|
+
type Metrics1 = string[];
|
|
321
|
+
type Source = string | null;
|
|
322
|
+
type Join = "left" | "inner";
|
|
323
|
+
type JoinColumns = string[];
|
|
324
|
+
type MaxRows = number;
|
|
325
|
+
/**
|
|
326
|
+
* @maxItems 3
|
|
327
|
+
*/
|
|
328
|
+
type Parts = [] | [MeshPart] | [MeshPart, MeshPart] | [MeshPart, MeshPart, MeshPart];
|
|
329
|
+
type Dataset3 = string;
|
|
330
|
+
type AiContext3 = {
|
|
331
|
+
[k: string]: JsonValue;
|
|
332
|
+
} | string | null;
|
|
333
|
+
type CustomExtensions3 = {
|
|
334
|
+
[k: string]: JsonValue;
|
|
335
|
+
}[] | null;
|
|
336
|
+
type Dependencies = string[] | null;
|
|
337
|
+
type Description4 = string | null;
|
|
338
|
+
/**
|
|
339
|
+
* SQL aggregate such as SUM(NET_SALES), or an expression over other metrics such as labor_cost / net_sales.
|
|
340
|
+
*/
|
|
341
|
+
type Expression3 = string | Expression1;
|
|
342
|
+
type Filter1 = string | null;
|
|
343
|
+
type Format1 = string | null;
|
|
344
|
+
type Group1 = string | null;
|
|
345
|
+
type Hidden1 = boolean | null;
|
|
346
|
+
/**
|
|
347
|
+
* Id widgets use to ask for this metric, for example net_sales.
|
|
348
|
+
*/
|
|
349
|
+
type Id5 = string;
|
|
350
|
+
type Label4 = string | null;
|
|
351
|
+
type Name3 = string | null;
|
|
352
|
+
/**
|
|
353
|
+
* sql sends the expression to the warehouse; formula computes it from other metrics after the query.
|
|
354
|
+
*/
|
|
355
|
+
type Type2 = "sql" | "formula";
|
|
356
|
+
/**
|
|
357
|
+
* Aggregations valid on this dataset's source.
|
|
358
|
+
*/
|
|
359
|
+
type Metrics2 = Metric[];
|
|
360
|
+
/**
|
|
361
|
+
* Label shown to users. Defaults to the id.
|
|
362
|
+
*/
|
|
363
|
+
type Name4 = string | null;
|
|
364
|
+
type PrimaryKey = string[] | null;
|
|
365
|
+
/**
|
|
366
|
+
* SQL to run when source_type is query.
|
|
367
|
+
*/
|
|
368
|
+
type Query2 = string | null;
|
|
369
|
+
type AiContext4 = {
|
|
370
|
+
[k: string]: JsonValue;
|
|
371
|
+
} | string | null;
|
|
372
|
+
type CustomExtensions4 = {
|
|
373
|
+
[k: string]: JsonValue;
|
|
374
|
+
}[] | null;
|
|
375
|
+
/**
|
|
376
|
+
* Id of the dataset on the left of the join.
|
|
377
|
+
*/
|
|
378
|
+
type From1 = string;
|
|
379
|
+
/**
|
|
380
|
+
* Join columns on the from dataset.
|
|
381
|
+
*/
|
|
382
|
+
type FromColumns = string[];
|
|
383
|
+
/**
|
|
384
|
+
* Name of the join, for example sales_to_labor.
|
|
385
|
+
*/
|
|
386
|
+
type Name5 = string;
|
|
387
|
+
/**
|
|
388
|
+
* Cardinality. one_to_many and many_to_many can fan out and double-count.
|
|
389
|
+
*/
|
|
390
|
+
type Relationship1 = ("one_to_one" | "many_to_one" | "one_to_many" | "many_to_many") | null;
|
|
391
|
+
/**
|
|
392
|
+
* Id of the dataset on the right of the join.
|
|
393
|
+
*/
|
|
394
|
+
type To = string;
|
|
395
|
+
/**
|
|
396
|
+
* Join columns on the to dataset, positionally matched to from_columns.
|
|
397
|
+
*/
|
|
398
|
+
type ToColumns = string[];
|
|
399
|
+
type Relationships = Relationship[];
|
|
400
|
+
/**
|
|
401
|
+
* Table or view the rows come from, for example {mart_schema}.RPT_DAILY_SALES_SUMMARY.
|
|
402
|
+
*/
|
|
403
|
+
type From2 = string | null;
|
|
404
|
+
/**
|
|
405
|
+
* table or view reads source; query runs the query field; mesh combines datasets from different data stores.
|
|
406
|
+
*/
|
|
407
|
+
type SourceType = ("table" | "view" | "query" | "mesh") | null;
|
|
408
|
+
type UniqueKeys = string[][] | null;
|
|
409
|
+
type Datasets = Dataset2[];
|
|
410
|
+
type Metrics3 = Metric[];
|
|
411
|
+
type ModelRefs = string[];
|
|
412
|
+
type Queries = {
|
|
413
|
+
[k: string]: NamedQuery;
|
|
414
|
+
} | null;
|
|
415
|
+
type DataModelId6 = string | null;
|
|
416
|
+
type Dimensions3 = string[] | null;
|
|
417
|
+
type File = string | null;
|
|
418
|
+
type FilterField2 = string | null;
|
|
419
|
+
type Filters2 = {
|
|
420
|
+
[k: string]: JsonValue;
|
|
421
|
+
}[] | null;
|
|
422
|
+
type Limit = number | null;
|
|
423
|
+
type Metrics4 = string[] | null;
|
|
424
|
+
type Model = string | null;
|
|
425
|
+
type Segments = string[] | null;
|
|
426
|
+
type Sort = {
|
|
427
|
+
[k: string]: JsonValue;
|
|
428
|
+
}[] | null;
|
|
429
|
+
type Sql = string | null;
|
|
430
|
+
type Relationships1 = Relationship[];
|
|
431
|
+
type Cols = number;
|
|
432
|
+
type Containerpadding1 = number[] | null;
|
|
433
|
+
type Margin2 = number[];
|
|
434
|
+
type RowHeight = number;
|
|
435
|
+
type SemanticModelRef = string | null;
|
|
436
|
+
type SemanticModel = SemanticModel1[] | null;
|
|
437
|
+
/**
|
|
438
|
+
* Business context available to host authoring tools, including synonyms.
|
|
439
|
+
*/
|
|
440
|
+
type AiContext5 = {
|
|
441
|
+
[k: string]: JsonValue;
|
|
442
|
+
} | string | null;
|
|
443
|
+
type CustomExtensions5 = {
|
|
444
|
+
[k: string]: JsonValue;
|
|
445
|
+
}[] | null;
|
|
446
|
+
/**
|
|
447
|
+
* Warehouse connections datasets may read from.
|
|
448
|
+
*
|
|
449
|
+
* @maxItems 3
|
|
450
|
+
*/
|
|
451
|
+
type DataStores1 = [] | [DataStore] | [DataStore, DataStore] | [DataStore, DataStore, DataStore];
|
|
452
|
+
/**
|
|
453
|
+
* Reusable sources of rows widgets can ask for.
|
|
454
|
+
*/
|
|
455
|
+
type Datasets1 = Dataset2[];
|
|
456
|
+
type Description5 = string | null;
|
|
457
|
+
type Kind9 = "semantic_model";
|
|
458
|
+
/**
|
|
459
|
+
* Metrics usable across datasets, including formulas spanning a join.
|
|
460
|
+
*/
|
|
461
|
+
type Metrics5 = Metric[];
|
|
462
|
+
/**
|
|
463
|
+
* Model name. Dashboards reference the tenant model as default.
|
|
464
|
+
*/
|
|
465
|
+
type Name6 = string;
|
|
466
|
+
/**
|
|
467
|
+
* Joins between datasets, so one widget can mix their fields.
|
|
468
|
+
*/
|
|
469
|
+
type Relationships2 = Relationship[];
|
|
470
|
+
type SemanticModelRef1 = string | null;
|
|
471
|
+
type SemanticModel2 = SemanticModel1[] | null;
|
|
472
|
+
type Default2 = boolean;
|
|
473
|
+
type Id6 = string;
|
|
474
|
+
type Label5 = string;
|
|
475
|
+
type Ref = string;
|
|
476
|
+
type Widgets1 = (WidgetRef | WidgetSpec | string)[];
|
|
477
|
+
type Tabs = DashboardTab[];
|
|
478
|
+
type Version3 = string;
|
|
479
|
+
/**
|
|
480
|
+
* Top-level dashboard manifest.
|
|
481
|
+
*/
|
|
482
|
+
interface DashboardSpec {
|
|
483
|
+
kind?: Kind;
|
|
484
|
+
metadata: Metadata;
|
|
485
|
+
spec: DashboardSpecInner;
|
|
486
|
+
version?: Version3;
|
|
487
|
+
[k: string]: unknown;
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Common metadata for dashboards and widgets.
|
|
491
|
+
*/
|
|
492
|
+
interface Metadata {
|
|
493
|
+
author?: Author;
|
|
494
|
+
description?: Description;
|
|
495
|
+
header?: WidgetHeader | null;
|
|
496
|
+
id: Id;
|
|
497
|
+
name: Name;
|
|
498
|
+
platform?: PlatformAttributes;
|
|
499
|
+
tags?: Tags1;
|
|
500
|
+
version?: Version1;
|
|
501
|
+
[k: string]: unknown;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Object-level header/title configuration for any widget.
|
|
505
|
+
*/
|
|
506
|
+
interface WidgetHeader {
|
|
507
|
+
backgroundColor?: Backgroundcolor;
|
|
508
|
+
border?: Border;
|
|
509
|
+
borderRadius?: Borderradius;
|
|
510
|
+
color?: Color;
|
|
511
|
+
fontSize?: Fontsize;
|
|
512
|
+
fontWeight?: Fontweight;
|
|
513
|
+
padding?: Padding;
|
|
514
|
+
textAlign?: Textalign;
|
|
515
|
+
title?: Title;
|
|
516
|
+
verticalAlign?: Verticalalign;
|
|
517
|
+
visible?: Visible;
|
|
518
|
+
[k: string]: unknown;
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* A rich label with optional tooltip and icon.
|
|
522
|
+
*/
|
|
523
|
+
interface LabelBlock {
|
|
524
|
+
icon?: Icon;
|
|
525
|
+
position?: Position;
|
|
526
|
+
text?: Text;
|
|
527
|
+
tooltip?: Tooltip;
|
|
528
|
+
[k: string]: unknown;
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Cross-cutting platform attributes attached to every dashboard object.
|
|
532
|
+
*
|
|
533
|
+
* These attributes control the relationship of the object to the platform,
|
|
534
|
+
* the dashboard, the user, and security. They are intentionally generic so
|
|
535
|
+
* the spec can grow into the larger enterprise BI project.
|
|
536
|
+
*/
|
|
537
|
+
interface PlatformAttributes {
|
|
538
|
+
allow_embed?: AllowEmbed;
|
|
539
|
+
owner?: Owner;
|
|
540
|
+
public?: Public;
|
|
541
|
+
roles?: Roles;
|
|
542
|
+
scope?: Scope;
|
|
543
|
+
status?: Status;
|
|
544
|
+
tags?: Tags;
|
|
545
|
+
version?: Version;
|
|
546
|
+
[k: string]: unknown;
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Inner spec body of a dashboard.
|
|
550
|
+
*/
|
|
551
|
+
interface DashboardSpecInner {
|
|
552
|
+
config?: DashboardConfig | null;
|
|
553
|
+
data_stores?: DataStores;
|
|
554
|
+
datasets?: Datasets;
|
|
555
|
+
metrics?: Metrics3;
|
|
556
|
+
model_refs?: ModelRefs;
|
|
557
|
+
queries?: Queries;
|
|
558
|
+
relationships?: Relationships1;
|
|
559
|
+
responsive?: DashboardResponsiveConfig;
|
|
560
|
+
semanticModelRef?: SemanticModelRef;
|
|
561
|
+
semantic_model?: SemanticModel;
|
|
562
|
+
semantic_model_ref?: SemanticModelRef1;
|
|
563
|
+
semantic_models?: SemanticModel2;
|
|
564
|
+
tabs?: Tabs;
|
|
565
|
+
[k: string]: unknown;
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Dashboard-level configuration overrides.
|
|
569
|
+
*/
|
|
570
|
+
interface DashboardConfig {
|
|
571
|
+
cache?: DashboardCacheConfig | null;
|
|
572
|
+
dataModelId?: Datamodelid;
|
|
573
|
+
filterPanel?: DashboardFilterPanelConfig | null;
|
|
574
|
+
footer?: DashboardSectionConfig | null;
|
|
575
|
+
grid?: DashboardGridConfig | null;
|
|
576
|
+
header?: DashboardSectionConfig | null;
|
|
577
|
+
print?: DashboardPrintConfig | null;
|
|
578
|
+
widgetDefaults?: WidgetDefaults | null;
|
|
579
|
+
[k: string]: unknown;
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Dashboard-level cache configuration.
|
|
583
|
+
*/
|
|
584
|
+
interface DashboardCacheConfig {
|
|
585
|
+
enabled?: Enabled;
|
|
586
|
+
icon?: Icon1;
|
|
587
|
+
showInEmbed?: Showinembed;
|
|
588
|
+
showInLayout?: Showinlayout;
|
|
589
|
+
showInPreview?: Showinpreview;
|
|
590
|
+
ttlSeconds?: Ttlseconds;
|
|
591
|
+
[k: string]: unknown;
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Configuration for the dashboard filter panel.
|
|
595
|
+
*/
|
|
596
|
+
interface DashboardFilterPanelConfig {
|
|
597
|
+
background?: Background;
|
|
598
|
+
collapsible?: Collapsible;
|
|
599
|
+
defaultCollapsed?: Defaultcollapsed;
|
|
600
|
+
disableCollapse?: Disablecollapse;
|
|
601
|
+
gap?: Gap;
|
|
602
|
+
layout?: FilterLayout | null;
|
|
603
|
+
padding?: Padding2;
|
|
604
|
+
position?: Position1;
|
|
605
|
+
width?: Width;
|
|
606
|
+
[k: string]: unknown;
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Algorithmic or manual layout for the filter panel.
|
|
610
|
+
*/
|
|
611
|
+
interface FilterLayout {
|
|
612
|
+
buttonSpan?: Buttonspan;
|
|
613
|
+
columns?: Columns;
|
|
614
|
+
dateSpan?: Datespan;
|
|
615
|
+
gap?: Gap1;
|
|
616
|
+
maxColumnWidth?: Maxcolumnwidth;
|
|
617
|
+
minColumnWidth?: Mincolumnwidth;
|
|
618
|
+
mode?: Mode;
|
|
619
|
+
padding?: Padding1;
|
|
620
|
+
radioSpan?: Radiospan;
|
|
621
|
+
selectSpan?: Selectspan;
|
|
622
|
+
[k: string]: unknown;
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Configuration for header/footer sections.
|
|
626
|
+
*/
|
|
627
|
+
interface DashboardSectionConfig {
|
|
628
|
+
background?: Background1;
|
|
629
|
+
height?: Height;
|
|
630
|
+
padding?: Padding3;
|
|
631
|
+
textAlign?: Textalign1;
|
|
632
|
+
verticalAlign?: Verticalalign1;
|
|
633
|
+
visible?: Visible1;
|
|
634
|
+
widgets?: Widgets;
|
|
635
|
+
[k: string]: unknown;
|
|
636
|
+
}
|
|
637
|
+
/**
|
|
638
|
+
* Specification for a single widget/object.
|
|
639
|
+
*/
|
|
640
|
+
interface WidgetSpec {
|
|
641
|
+
kind?: Kind1;
|
|
642
|
+
metadata: Metadata;
|
|
643
|
+
spec: WidgetSpecInner;
|
|
644
|
+
version?: Version2;
|
|
645
|
+
[k: string]: unknown;
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Inner spec body of a widget.
|
|
649
|
+
*/
|
|
650
|
+
interface WidgetSpecInner {
|
|
651
|
+
bindings?: Bindings;
|
|
652
|
+
component?: Component;
|
|
653
|
+
data?: Data;
|
|
654
|
+
display?: WidgetDisplay;
|
|
655
|
+
filters?: Filters1;
|
|
656
|
+
interactions?: Interactions;
|
|
657
|
+
layout?: WidgetLayout;
|
|
658
|
+
mappings?: FieldMapping;
|
|
659
|
+
[k: string]: unknown;
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* How a filter widget is wired to a target widget.
|
|
663
|
+
*/
|
|
664
|
+
interface FilterBinding {
|
|
665
|
+
field: Field;
|
|
666
|
+
operator?: Operator;
|
|
667
|
+
param?: Param;
|
|
668
|
+
target?: Target;
|
|
669
|
+
[k: string]: unknown;
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
672
|
+
* Run a KPI from the catalog.
|
|
673
|
+
*/
|
|
674
|
+
interface KpiDataSource {
|
|
675
|
+
data_model_id?: DataModelId;
|
|
676
|
+
kind?: Kind2;
|
|
677
|
+
kpi: Kpi;
|
|
678
|
+
labelColumn?: Labelcolumn;
|
|
679
|
+
params?: Params;
|
|
680
|
+
valueColumn?: Valuecolumn;
|
|
681
|
+
[k: string]: unknown;
|
|
682
|
+
}
|
|
683
|
+
interface Params {
|
|
684
|
+
[k: string]: JsonValue;
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* Static data supplied inline in the spec.
|
|
688
|
+
*/
|
|
689
|
+
interface StaticDataSource {
|
|
690
|
+
columns?: Columns1;
|
|
691
|
+
default_value?: {
|
|
692
|
+
[k: string]: unknown;
|
|
693
|
+
};
|
|
694
|
+
kind?: Kind3;
|
|
695
|
+
options?: Options;
|
|
696
|
+
rows?: Rows;
|
|
697
|
+
[k: string]: unknown;
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* A single option for a static select or filter.
|
|
701
|
+
*/
|
|
702
|
+
interface StaticOption {
|
|
703
|
+
label: Label;
|
|
704
|
+
value: JsonValue;
|
|
705
|
+
[k: string]: unknown;
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* Deterministic generated data for testing and previews.
|
|
709
|
+
*/
|
|
710
|
+
interface DemoDataSource {
|
|
711
|
+
columns?: Columns2;
|
|
712
|
+
dataset?: Dataset;
|
|
713
|
+
kind?: Kind4;
|
|
714
|
+
rows?: Rows1;
|
|
715
|
+
seed?: Seed;
|
|
716
|
+
[k: string]: unknown;
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Run an arbitrary SQL query against the configured data store.
|
|
720
|
+
*/
|
|
721
|
+
interface SqlDataSource {
|
|
722
|
+
data_model_id?: DataModelId1;
|
|
723
|
+
filter_field?: FilterField;
|
|
724
|
+
kind?: Kind5;
|
|
725
|
+
params?: Params1;
|
|
726
|
+
query: Query;
|
|
727
|
+
[k: string]: unknown;
|
|
728
|
+
}
|
|
729
|
+
interface Params1 {
|
|
730
|
+
[k: string]: JsonValue;
|
|
731
|
+
}
|
|
732
|
+
/**
|
|
733
|
+
* Reference a reusable Dataset defined in the dashboard manifest.
|
|
734
|
+
*/
|
|
735
|
+
interface DatasetDataSource {
|
|
736
|
+
columns?: Columns3;
|
|
737
|
+
data_model_id?: DataModelId2;
|
|
738
|
+
dataset: Dataset1;
|
|
739
|
+
dimensions?: Dimensions;
|
|
740
|
+
filters?: Filters;
|
|
741
|
+
kind?: Kind6;
|
|
742
|
+
metrics?: Metrics;
|
|
743
|
+
params?: Params2;
|
|
744
|
+
[k: string]: unknown;
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* How a target widget or dataset applies a filter broadcast from the dashboard.
|
|
748
|
+
*/
|
|
749
|
+
interface IncomingFilter {
|
|
750
|
+
field: Field1;
|
|
751
|
+
filter_id: FilterId;
|
|
752
|
+
operator?: Operator1;
|
|
753
|
+
param?: Param1;
|
|
754
|
+
[k: string]: unknown;
|
|
755
|
+
}
|
|
756
|
+
interface Params2 {
|
|
757
|
+
[k: string]: JsonValue;
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* Reference a named query defined in the dashboard manifest.
|
|
761
|
+
*/
|
|
762
|
+
interface QueryDataSource {
|
|
763
|
+
data_model_id?: DataModelId3;
|
|
764
|
+
kind?: Kind7;
|
|
765
|
+
params?: Params3;
|
|
766
|
+
query: Query1;
|
|
767
|
+
[k: string]: unknown;
|
|
768
|
+
}
|
|
769
|
+
interface Params3 {
|
|
770
|
+
[k: string]: JsonValue;
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* Display-specific configuration.
|
|
774
|
+
*/
|
|
775
|
+
interface WidgetDisplay {
|
|
776
|
+
background?: Background2;
|
|
777
|
+
border?: Border1;
|
|
778
|
+
borderRadius?: Borderradius1;
|
|
779
|
+
echarts?: Echarts;
|
|
780
|
+
filter?: Filter;
|
|
781
|
+
image?: Image;
|
|
782
|
+
kpi?: Kpi1;
|
|
783
|
+
margin?: Margin;
|
|
784
|
+
markdown?: Markdown;
|
|
785
|
+
padding?: Padding4;
|
|
786
|
+
pivot_table?: PivotTable;
|
|
787
|
+
select?: Select;
|
|
788
|
+
shadow?: Shadow;
|
|
789
|
+
table?: Table;
|
|
790
|
+
tabulator?: Tabulator;
|
|
791
|
+
text?: Text1;
|
|
792
|
+
[k: string]: unknown;
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* A user-driven interaction on a widget.
|
|
796
|
+
*/
|
|
797
|
+
interface WidgetInteraction {
|
|
798
|
+
id: Id1;
|
|
799
|
+
label?: Label1;
|
|
800
|
+
open_in?: OpenIn;
|
|
801
|
+
pass_filters?: PassFilters;
|
|
802
|
+
pass_selection?: PassSelection;
|
|
803
|
+
target: Target1;
|
|
804
|
+
target_type?: TargetType;
|
|
805
|
+
type: Type;
|
|
806
|
+
variable_mappings?: VariableMappings;
|
|
807
|
+
[k: string]: unknown;
|
|
808
|
+
}
|
|
809
|
+
/**
|
|
810
|
+
* Map a source value (event, filter, or literal) to a target filter/variable.
|
|
811
|
+
*/
|
|
812
|
+
interface InteractionVariableMapping {
|
|
813
|
+
source?: InteractionVariableSource;
|
|
814
|
+
target: Target2;
|
|
815
|
+
target_type?: TargetType1;
|
|
816
|
+
[k: string]: unknown;
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* Source of a value for an interaction variable mapping.
|
|
820
|
+
*/
|
|
821
|
+
interface InteractionVariableSource {
|
|
822
|
+
field?: Field2;
|
|
823
|
+
kind?: Kind8;
|
|
824
|
+
value?: unknown;
|
|
825
|
+
[k: string]: unknown;
|
|
826
|
+
}
|
|
827
|
+
/**
|
|
828
|
+
* Layout configuration for a widget.
|
|
829
|
+
*/
|
|
830
|
+
interface WidgetLayout {
|
|
831
|
+
h?: H;
|
|
832
|
+
isBounded?: Isbounded;
|
|
833
|
+
isDraggable?: Isdraggable;
|
|
834
|
+
isResizable?: Isresizable;
|
|
835
|
+
maxH?: Maxh;
|
|
836
|
+
maxW?: Maxw;
|
|
837
|
+
minH?: Minh;
|
|
838
|
+
minW?: Minw;
|
|
839
|
+
resizeHandles?: Resizehandles;
|
|
840
|
+
responsive?: ResponsiveLayout;
|
|
841
|
+
unplaced?: Unplaced;
|
|
842
|
+
w?: W1;
|
|
843
|
+
x?: X1;
|
|
844
|
+
y?: Y1;
|
|
845
|
+
[k: string]: unknown;
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* Responsive overrides for a layout item.
|
|
849
|
+
*/
|
|
850
|
+
interface ResponsiveLayout {
|
|
851
|
+
desktop?: LayoutItem$1 | null;
|
|
852
|
+
mobile?: LayoutItem$1 | null;
|
|
853
|
+
tablet?: LayoutItem$1 | null;
|
|
854
|
+
wide?: LayoutItem$1 | null;
|
|
855
|
+
[k: string]: unknown;
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* A single position/size entry in a responsive grid.
|
|
859
|
+
*/
|
|
860
|
+
interface LayoutItem$1 {
|
|
861
|
+
h?: H1;
|
|
862
|
+
isBounded?: Isbounded1;
|
|
863
|
+
isDraggable?: Isdraggable1;
|
|
864
|
+
isResizable?: Isresizable1;
|
|
865
|
+
maxH?: Maxh1;
|
|
866
|
+
maxW?: Maxw1;
|
|
867
|
+
minH?: Minh1;
|
|
868
|
+
minW?: Minw1;
|
|
869
|
+
resizeHandles?: Resizehandles1;
|
|
870
|
+
w?: W;
|
|
871
|
+
x?: X;
|
|
872
|
+
y?: Y;
|
|
873
|
+
[k: string]: unknown;
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* Map widget fields to columns in the data source.
|
|
877
|
+
*/
|
|
878
|
+
interface FieldMapping {
|
|
879
|
+
category?: Category;
|
|
880
|
+
date?: Date;
|
|
881
|
+
delta?: Delta;
|
|
882
|
+
label?: Label2;
|
|
883
|
+
series?: Series;
|
|
884
|
+
series_name?: SeriesName;
|
|
885
|
+
value?: Value;
|
|
886
|
+
x?: X2;
|
|
887
|
+
y?: Y2;
|
|
888
|
+
[k: string]: unknown;
|
|
889
|
+
}
|
|
890
|
+
/**
|
|
891
|
+
* Core react-grid-layout behavior for the dashboard.
|
|
892
|
+
*/
|
|
893
|
+
interface DashboardGridConfig {
|
|
894
|
+
allowOverlap?: Allowoverlap;
|
|
895
|
+
compactType?: Compacttype;
|
|
896
|
+
containerPadding?: Containerpadding;
|
|
897
|
+
draggableCancel?: Draggablecancel;
|
|
898
|
+
draggableHandle?: Draggablehandle;
|
|
899
|
+
isBounded?: Isbounded2;
|
|
900
|
+
maxLayoutWidth?: Maxlayoutwidth;
|
|
901
|
+
maxRows?: Maxrows;
|
|
902
|
+
preventCollision?: Preventcollision;
|
|
903
|
+
resizeHandles?: Resizehandles2;
|
|
904
|
+
snap?: Snap;
|
|
905
|
+
squareCells?: Squarecells;
|
|
906
|
+
[k: string]: unknown;
|
|
907
|
+
}
|
|
908
|
+
/**
|
|
909
|
+
* Print/export settings for the dashboard.
|
|
910
|
+
*/
|
|
911
|
+
interface DashboardPrintConfig {
|
|
912
|
+
backgroundColor?: Backgroundcolor1;
|
|
913
|
+
fitMode?: Fitmode;
|
|
914
|
+
orientation?: Orientation;
|
|
915
|
+
pageSize?: Pagesize;
|
|
916
|
+
scale?: Scale;
|
|
917
|
+
[k: string]: unknown;
|
|
918
|
+
}
|
|
919
|
+
/**
|
|
920
|
+
* Dashboard-level defaults for widget appearance.
|
|
921
|
+
*/
|
|
922
|
+
interface WidgetDefaults {
|
|
923
|
+
echarts?: WidgetTheme | null;
|
|
924
|
+
filter?: WidgetTheme | null;
|
|
925
|
+
global?: WidgetTheme | null;
|
|
926
|
+
image?: WidgetTheme | null;
|
|
927
|
+
kpi?: WidgetTheme | null;
|
|
928
|
+
markdown?: WidgetTheme | null;
|
|
929
|
+
pivot_table?: WidgetTheme | null;
|
|
930
|
+
select?: WidgetTheme | null;
|
|
931
|
+
table?: WidgetTheme | null;
|
|
932
|
+
tabulator?: WidgetTheme | null;
|
|
933
|
+
text?: WidgetTheme | null;
|
|
934
|
+
[k: string]: unknown;
|
|
935
|
+
}
|
|
936
|
+
/**
|
|
937
|
+
* Reusable theme settings for a widget or a default widget group.
|
|
938
|
+
*/
|
|
939
|
+
interface WidgetTheme {
|
|
940
|
+
background?: Background3;
|
|
941
|
+
border?: Border2;
|
|
942
|
+
borderRadius?: Borderradius2;
|
|
943
|
+
margin?: Margin1;
|
|
944
|
+
padding?: Padding5;
|
|
945
|
+
shadow?: Shadow1;
|
|
946
|
+
[k: string]: unknown;
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* A data-store (warehouse) connection referenced by datasets.
|
|
950
|
+
*/
|
|
951
|
+
interface DataStore {
|
|
952
|
+
ai_context?: AiContext;
|
|
953
|
+
custom_extensions?: CustomExtensions;
|
|
954
|
+
data_model_id?: DataModelId4;
|
|
955
|
+
default?: Default;
|
|
956
|
+
description?: Description1;
|
|
957
|
+
id: Id2;
|
|
958
|
+
name?: Name1;
|
|
959
|
+
vendor?: Vendor;
|
|
960
|
+
[k: string]: unknown;
|
|
961
|
+
}
|
|
962
|
+
/**
|
|
963
|
+
* A reusable semantic dataset: schema/table, dimensions, and metrics.
|
|
964
|
+
*/
|
|
965
|
+
interface Dataset2 {
|
|
966
|
+
ai_context?: AiContext1;
|
|
967
|
+
cache?: DatasetCacheConfig | null;
|
|
968
|
+
custom_extensions?: CustomExtensions1;
|
|
969
|
+
dataStoreId?: DataStoreId;
|
|
970
|
+
dataStoreIds?: DataStoreIds;
|
|
971
|
+
data_model_id?: DataModelId5;
|
|
972
|
+
data_store_id?: DataStoreId1;
|
|
973
|
+
data_store_ids?: DataStoreIds1;
|
|
974
|
+
description?: Description2;
|
|
975
|
+
dimensions?: Dimensions1;
|
|
976
|
+
fields?: Dimensions2;
|
|
977
|
+
filter_field?: FilterField1;
|
|
978
|
+
filter_param?: FilterParam;
|
|
979
|
+
from?: From;
|
|
980
|
+
group_by?: GroupBy;
|
|
981
|
+
id: Id4;
|
|
982
|
+
kpi?: Kpi2;
|
|
983
|
+
materialization?: DatasetMaterialization | null;
|
|
984
|
+
mesh?: MeshPlan | null;
|
|
985
|
+
metrics?: Metrics2;
|
|
986
|
+
name?: Name4;
|
|
987
|
+
params?: Params4;
|
|
988
|
+
primary_key?: PrimaryKey;
|
|
989
|
+
query?: Query2;
|
|
990
|
+
relationships?: Relationships;
|
|
991
|
+
source?: From2;
|
|
992
|
+
source_type?: SourceType;
|
|
993
|
+
unique_keys?: UniqueKeys;
|
|
994
|
+
[k: string]: unknown;
|
|
995
|
+
}
|
|
996
|
+
/**
|
|
997
|
+
* How long a dataset's warehouse results may be reused.
|
|
998
|
+
*/
|
|
999
|
+
interface DatasetCacheConfig {
|
|
1000
|
+
enabled?: Enabled1;
|
|
1001
|
+
ttlSeconds?: TtlSeconds;
|
|
1002
|
+
ttl_seconds?: TtlSeconds1;
|
|
1003
|
+
[k: string]: unknown;
|
|
1004
|
+
}
|
|
1005
|
+
/**
|
|
1006
|
+
* A dimension (attribute) inside a Dataset.
|
|
1007
|
+
*/
|
|
1008
|
+
interface Dimension {
|
|
1009
|
+
ai_context?: AiContext2;
|
|
1010
|
+
column?: Column;
|
|
1011
|
+
custom_extensions?: CustomExtensions2;
|
|
1012
|
+
description?: Description3;
|
|
1013
|
+
expression?: Expression;
|
|
1014
|
+
format?: Format;
|
|
1015
|
+
group?: Group;
|
|
1016
|
+
hidden?: Hidden;
|
|
1017
|
+
id: Id3;
|
|
1018
|
+
is_time?: IsTime;
|
|
1019
|
+
label?: Label3;
|
|
1020
|
+
name?: Name2;
|
|
1021
|
+
type?: Type1;
|
|
1022
|
+
[k: string]: unknown;
|
|
1023
|
+
}
|
|
1024
|
+
/**
|
|
1025
|
+
* OSI-style multi-dialect expression block.
|
|
1026
|
+
*
|
|
1027
|
+
* ``dialects`` lists SQL or expression variants per warehouse. ``default`` is
|
|
1028
|
+
* available for row-level formulas or fallback SQL.
|
|
1029
|
+
*/
|
|
1030
|
+
interface Expression1 {
|
|
1031
|
+
default?: Default1;
|
|
1032
|
+
dialects?: Dialects;
|
|
1033
|
+
[k: string]: unknown;
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* A single dialect expression for a field or metric.
|
|
1037
|
+
*/
|
|
1038
|
+
interface ExpressionDialect {
|
|
1039
|
+
dialect: Dialect;
|
|
1040
|
+
expression: Expression2;
|
|
1041
|
+
[k: string]: unknown;
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* A pre-aggregated rollup the engine may read instead of the base source.
|
|
1045
|
+
*
|
|
1046
|
+
* ``grain`` lists the dimensions the rollup is aggregated to and ``metrics``
|
|
1047
|
+
* the measures it carries. A widget selection covered by both is answered from
|
|
1048
|
+
* ``source``; anything wider falls back to the dataset's own source, so the
|
|
1049
|
+
* rollup is an optimisation and never changes what a widget can ask for.
|
|
1050
|
+
*/
|
|
1051
|
+
interface DatasetMaterialization {
|
|
1052
|
+
enabled?: Enabled2;
|
|
1053
|
+
grain?: Grain;
|
|
1054
|
+
metrics?: Metrics1;
|
|
1055
|
+
source?: Source;
|
|
1056
|
+
[k: string]: unknown;
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* How a mesh dataset stitches datasets from different data stores together.
|
|
1060
|
+
*/
|
|
1061
|
+
interface MeshPlan {
|
|
1062
|
+
join?: Join;
|
|
1063
|
+
join_columns?: JoinColumns;
|
|
1064
|
+
max_rows?: MaxRows;
|
|
1065
|
+
parts?: Parts;
|
|
1066
|
+
[k: string]: unknown;
|
|
1067
|
+
}
|
|
1068
|
+
/**
|
|
1069
|
+
* One dataset taking part in a mesh dataset.
|
|
1070
|
+
*/
|
|
1071
|
+
interface MeshPart {
|
|
1072
|
+
dataset: Dataset3;
|
|
1073
|
+
[k: string]: unknown;
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* A calculated field or metric inside a Dataset.
|
|
1077
|
+
*/
|
|
1078
|
+
interface Metric {
|
|
1079
|
+
ai_context?: AiContext3;
|
|
1080
|
+
custom_extensions?: CustomExtensions3;
|
|
1081
|
+
dependencies?: Dependencies;
|
|
1082
|
+
description?: Description4;
|
|
1083
|
+
expression: Expression3;
|
|
1084
|
+
filter?: Filter1;
|
|
1085
|
+
format?: Format1;
|
|
1086
|
+
group?: Group1;
|
|
1087
|
+
hidden?: Hidden1;
|
|
1088
|
+
id: Id5;
|
|
1089
|
+
label?: Label4;
|
|
1090
|
+
name?: Name3;
|
|
1091
|
+
type?: Type2;
|
|
1092
|
+
[k: string]: unknown;
|
|
1093
|
+
}
|
|
1094
|
+
interface Params4 {
|
|
1095
|
+
[k: string]: JsonValue;
|
|
1096
|
+
}
|
|
1097
|
+
/**
|
|
1098
|
+
* A relationship between two datasets (OSI-style join).
|
|
1099
|
+
*/
|
|
1100
|
+
interface Relationship {
|
|
1101
|
+
ai_context?: AiContext4;
|
|
1102
|
+
custom_extensions?: CustomExtensions4;
|
|
1103
|
+
from: From1;
|
|
1104
|
+
from_columns?: FromColumns;
|
|
1105
|
+
name: Name5;
|
|
1106
|
+
relationship?: Relationship1;
|
|
1107
|
+
to: To;
|
|
1108
|
+
to_columns?: ToColumns;
|
|
1109
|
+
[k: string]: unknown;
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* A reusable named query referenced by widgets.
|
|
1113
|
+
*/
|
|
1114
|
+
interface NamedQuery {
|
|
1115
|
+
data_model_id?: DataModelId6;
|
|
1116
|
+
dimensions?: Dimensions3;
|
|
1117
|
+
file?: File;
|
|
1118
|
+
filter_field?: FilterField2;
|
|
1119
|
+
filters?: Filters2;
|
|
1120
|
+
limit?: Limit;
|
|
1121
|
+
metrics?: Metrics4;
|
|
1122
|
+
model?: Model;
|
|
1123
|
+
params?: Params5;
|
|
1124
|
+
segments?: Segments;
|
|
1125
|
+
sort?: Sort;
|
|
1126
|
+
sql?: Sql;
|
|
1127
|
+
[k: string]: unknown;
|
|
1128
|
+
}
|
|
1129
|
+
interface Params5 {
|
|
1130
|
+
[k: string]: JsonValue;
|
|
1131
|
+
}
|
|
1132
|
+
/**
|
|
1133
|
+
* Top-level responsive grid configuration.
|
|
1134
|
+
*/
|
|
1135
|
+
interface DashboardResponsiveConfig {
|
|
1136
|
+
desktop?: BreakpointConfig;
|
|
1137
|
+
mobile?: BreakpointConfig;
|
|
1138
|
+
tablet?: BreakpointConfig;
|
|
1139
|
+
wide?: BreakpointConfig;
|
|
1140
|
+
[k: string]: unknown;
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* Responsive breakpoint configuration for the dashboard grid.
|
|
1144
|
+
*/
|
|
1145
|
+
interface BreakpointConfig {
|
|
1146
|
+
cols?: Cols;
|
|
1147
|
+
containerPadding?: Containerpadding1;
|
|
1148
|
+
margin?: Margin2;
|
|
1149
|
+
row_height?: RowHeight;
|
|
1150
|
+
[k: string]: unknown;
|
|
1151
|
+
}
|
|
1152
|
+
/**
|
|
1153
|
+
* An OSI semantic model block (data stores, datasets, relationships, metrics).
|
|
1154
|
+
*/
|
|
1155
|
+
interface SemanticModel1 {
|
|
1156
|
+
ai_context?: AiContext5;
|
|
1157
|
+
custom_extensions?: CustomExtensions5;
|
|
1158
|
+
data_stores?: DataStores1;
|
|
1159
|
+
datasets?: Datasets1;
|
|
1160
|
+
description?: Description5;
|
|
1161
|
+
kind?: Kind9;
|
|
1162
|
+
metrics?: Metrics5;
|
|
1163
|
+
name: Name6;
|
|
1164
|
+
relationships?: Relationships2;
|
|
1165
|
+
[k: string]: unknown;
|
|
1166
|
+
}
|
|
1167
|
+
/**
|
|
1168
|
+
* A tab/page inside a dashboard.
|
|
1169
|
+
*/
|
|
1170
|
+
interface DashboardTab {
|
|
1171
|
+
default?: Default2;
|
|
1172
|
+
id: Id6;
|
|
1173
|
+
label: Label5;
|
|
1174
|
+
widgets?: Widgets1;
|
|
1175
|
+
[k: string]: unknown;
|
|
1176
|
+
}
|
|
1177
|
+
/**
|
|
1178
|
+
* A reference to a separate widget YAML file.
|
|
1179
|
+
*/
|
|
1180
|
+
interface WidgetRef {
|
|
1181
|
+
ref: Ref;
|
|
1182
|
+
[k: string]: unknown;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
type Breakpoint = "mobile" | "tablet" | "desktop" | "wide";
|
|
1186
|
+
type ResizeHandle = "s" | "w" | "e" | "n" | "sw" | "nw" | "se" | "ne";
|
|
1187
|
+
interface LayoutItem {
|
|
1188
|
+
i: string;
|
|
1189
|
+
x: number;
|
|
1190
|
+
y: number;
|
|
1191
|
+
w: number;
|
|
1192
|
+
h: number;
|
|
1193
|
+
minW?: number;
|
|
1194
|
+
maxW?: number;
|
|
1195
|
+
minH?: number;
|
|
1196
|
+
maxH?: number;
|
|
1197
|
+
isBounded?: boolean;
|
|
1198
|
+
isDraggable?: boolean;
|
|
1199
|
+
isResizable?: boolean;
|
|
1200
|
+
resizeHandles?: ResizeHandle[];
|
|
1201
|
+
}
|
|
1202
|
+
type ResponsiveLayouts = Record<string, LayoutItem[] | null | undefined>;
|
|
1203
|
+
type PivotExpandEntry = number | {
|
|
1204
|
+
rows?: number;
|
|
1205
|
+
columns?: number;
|
|
1206
|
+
};
|
|
1207
|
+
interface DashboardPivotInfo {
|
|
1208
|
+
id: string;
|
|
1209
|
+
name: string;
|
|
1210
|
+
row_levels: number;
|
|
1211
|
+
column_levels: number;
|
|
1212
|
+
default_expand: number | null;
|
|
1213
|
+
default_expand_columns: number | null;
|
|
1214
|
+
}
|
|
1215
|
+
interface PivotOpenLevels {
|
|
1216
|
+
rows: number | null;
|
|
1217
|
+
columns: number | null;
|
|
1218
|
+
}
|
|
1219
|
+
type ReadPivotOpenLevels = (widgetId: string) => PivotOpenLevels | null | undefined;
|
|
1220
|
+
interface DashboardModelMetricDiagnostic {
|
|
1221
|
+
metric: Record<string, unknown>;
|
|
1222
|
+
dialect: string;
|
|
1223
|
+
resolved_expression: string;
|
|
1224
|
+
dependencies: string[];
|
|
1225
|
+
dataset_ids?: string[];
|
|
1226
|
+
sample_query: string | null;
|
|
1227
|
+
issues: string[];
|
|
1228
|
+
}
|
|
1229
|
+
interface DashboardModelDataStoreDiagnostic {
|
|
1230
|
+
id: string;
|
|
1231
|
+
name: string | null;
|
|
1232
|
+
vendor: string | null;
|
|
1233
|
+
data_model_id: string | null;
|
|
1234
|
+
default: boolean;
|
|
1235
|
+
dialect: string;
|
|
1236
|
+
dataset_ids: string[];
|
|
1237
|
+
issues: string[];
|
|
1238
|
+
notes?: string[];
|
|
1239
|
+
}
|
|
1240
|
+
interface DashboardModelDatasetDiagnostic {
|
|
1241
|
+
id: string;
|
|
1242
|
+
name: string | null;
|
|
1243
|
+
data_store_id: string | null;
|
|
1244
|
+
resolved_data_store_id: string | null;
|
|
1245
|
+
data_model_id: string | null;
|
|
1246
|
+
source_type: string | null;
|
|
1247
|
+
source: string | null;
|
|
1248
|
+
dialect: string;
|
|
1249
|
+
dimension_ids: string[];
|
|
1250
|
+
metric_ids: string[];
|
|
1251
|
+
filter_field: string | null;
|
|
1252
|
+
sample_sql: string | null;
|
|
1253
|
+
issues: string[];
|
|
1254
|
+
}
|
|
1255
|
+
interface DashboardModelRelationshipDiagnostic {
|
|
1256
|
+
name: string;
|
|
1257
|
+
from: string;
|
|
1258
|
+
to: string;
|
|
1259
|
+
from_columns: string[];
|
|
1260
|
+
to_columns: string[];
|
|
1261
|
+
relationship: string | null;
|
|
1262
|
+
issues: string[];
|
|
1263
|
+
}
|
|
1264
|
+
interface DashboardModelAiGrounding {
|
|
1265
|
+
dataset_count: number;
|
|
1266
|
+
metric_count: number;
|
|
1267
|
+
preview: string;
|
|
1268
|
+
}
|
|
1269
|
+
interface DashboardModelDiagnostics {
|
|
1270
|
+
model: {
|
|
1271
|
+
name: string;
|
|
1272
|
+
description: string | null;
|
|
1273
|
+
dialect: string;
|
|
1274
|
+
issues: string[];
|
|
1275
|
+
};
|
|
1276
|
+
data_stores: DashboardModelDataStoreDiagnostic[];
|
|
1277
|
+
datasets: DashboardModelDatasetDiagnostic[];
|
|
1278
|
+
relationships: DashboardModelRelationshipDiagnostic[];
|
|
1279
|
+
metrics: DashboardModelMetricDiagnostic[];
|
|
1280
|
+
/** Present only where the host grounds an assistant on the model. */
|
|
1281
|
+
ai_grounding?: DashboardModelAiGrounding;
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* Read and edit the semantic model as a YAML document, not as an object.
|
|
1286
|
+
*
|
|
1287
|
+
* The Builder is a second way to edit one text, never a second source of truth.
|
|
1288
|
+
* So every edit here goes through the `yaml` Document API and touches only the
|
|
1289
|
+
* keys it is responsible for: comments, key order, quoting style and anything
|
|
1290
|
+
* the Builder does not understand (mesh plans, `ai_context`, custom renderers)
|
|
1291
|
+
* survive an edit untouched. That is what makes the Builder | YAML toggle safe
|
|
1292
|
+
* in both directions.
|
|
1293
|
+
*/
|
|
1294
|
+
|
|
1295
|
+
/** A data store as the Builder presents it: no UUID typed by hand. */
|
|
1296
|
+
interface BuilderDataStore {
|
|
1297
|
+
id: string;
|
|
1298
|
+
name: string | null;
|
|
1299
|
+
vendor: string | null;
|
|
1300
|
+
/** Host connection identifier, written from a dropdown choice. */
|
|
1301
|
+
dataModelId: string | null;
|
|
1302
|
+
isDefault: boolean;
|
|
1303
|
+
}
|
|
1304
|
+
type BuilderDimensionType = "string" | "number" | "date" | "time" | "boolean";
|
|
1305
|
+
interface BuilderDimension {
|
|
1306
|
+
id: string;
|
|
1307
|
+
column: string | null;
|
|
1308
|
+
type: BuilderDimensionType;
|
|
1309
|
+
isTime: boolean;
|
|
1310
|
+
}
|
|
1311
|
+
interface BuilderMetric {
|
|
1312
|
+
id: string;
|
|
1313
|
+
label: string | null;
|
|
1314
|
+
/** SQL such as `SUM(NET_SALES)`, whether typed or built from a dropdown. */
|
|
1315
|
+
expression: string;
|
|
1316
|
+
type: "sql" | "formula";
|
|
1317
|
+
}
|
|
1318
|
+
interface BuilderRollup {
|
|
1319
|
+
source: string | null;
|
|
1320
|
+
grain: string[];
|
|
1321
|
+
metrics: string[];
|
|
1322
|
+
}
|
|
1323
|
+
interface BuilderDataset {
|
|
1324
|
+
id: string;
|
|
1325
|
+
name: string | null;
|
|
1326
|
+
dataStoreId: string | null;
|
|
1327
|
+
source: string | null;
|
|
1328
|
+
sourceType: string | null;
|
|
1329
|
+
/** The column carrying the location key, which scoping needs. */
|
|
1330
|
+
filterField: string | null;
|
|
1331
|
+
dimensions: BuilderDimension[];
|
|
1332
|
+
metrics: BuilderMetric[];
|
|
1333
|
+
rollup: BuilderRollup | null;
|
|
1334
|
+
/**
|
|
1335
|
+
* Keys the Builder has no editor for. Non-empty means the dataset is shown
|
|
1336
|
+
* read-only rather than being silently flattened on the next edit.
|
|
1337
|
+
*/
|
|
1338
|
+
unsupportedKeys: string[];
|
|
1339
|
+
}
|
|
1340
|
+
type BuilderCardinality = "one_to_one" | "many_to_one" | "one_to_many" | "many_to_many";
|
|
1341
|
+
/** A join between two datasets, as a pair of dataset ids and column pairs. */
|
|
1342
|
+
interface BuilderRelationship {
|
|
1343
|
+
name: string;
|
|
1344
|
+
from: string | null;
|
|
1345
|
+
to: string | null;
|
|
1346
|
+
/** Positionally matched with `toColumns`, which is how the engine reads them. */
|
|
1347
|
+
fromColumns: string[];
|
|
1348
|
+
toColumns: string[];
|
|
1349
|
+
cardinality: BuilderCardinality | null;
|
|
1350
|
+
unsupportedKeys: string[];
|
|
1351
|
+
}
|
|
1352
|
+
/** A metric declared on the model rather than inside one dataset. */
|
|
1353
|
+
interface BuilderModelMetric {
|
|
1354
|
+
id: string;
|
|
1355
|
+
label: string | null;
|
|
1356
|
+
description: string | null;
|
|
1357
|
+
expression: string;
|
|
1358
|
+
type: "sql" | "formula";
|
|
1359
|
+
format: string | null;
|
|
1360
|
+
unsupportedKeys: string[];
|
|
1361
|
+
}
|
|
1362
|
+
interface ModelParseError {
|
|
1363
|
+
message: string;
|
|
1364
|
+
line: number;
|
|
1365
|
+
}
|
|
1366
|
+
declare const AGGREGATIONS: readonly ["SUM", "AVG", "MIN", "MAX", "COUNT"];
|
|
1367
|
+
type Aggregation = (typeof AGGREGATIONS)[number];
|
|
1368
|
+
/** Types a warehouse column maps onto, so dimensions do not need typing by hand. */
|
|
1369
|
+
declare function dimensionTypeFor(warehouseType: string): BuilderDimensionType;
|
|
1370
|
+
/** `SUM(NET_SALES)` for a dropdown choice. */
|
|
1371
|
+
declare function aggregationExpression(aggregation: Aggregation, column: string): string;
|
|
1372
|
+
/**
|
|
1373
|
+
* The aggregation and column behind a metric, when it is a plain one.
|
|
1374
|
+
*
|
|
1375
|
+
* Anything else (a ratio, a CASE, a window) returns null, and the Builder shows
|
|
1376
|
+
* the raw expression instead of pretending a dropdown describes it.
|
|
1377
|
+
*/
|
|
1378
|
+
declare function parseAggregation(expression: string): {
|
|
1379
|
+
aggregation: Aggregation;
|
|
1380
|
+
column: string;
|
|
1381
|
+
} | null;
|
|
1382
|
+
/** The model as an editable document, or where its syntax error is. */
|
|
1383
|
+
declare function parseModelDocument(specYaml: string): {
|
|
1384
|
+
doc: Document | null;
|
|
1385
|
+
error: ModelParseError | null;
|
|
1386
|
+
};
|
|
1387
|
+
declare function readDataStores(doc: Document): BuilderDataStore[];
|
|
1388
|
+
/** The keys that really do stop the Builder editing this thing safely. */
|
|
1389
|
+
declare function blockingKeys(keys: string[]): string[];
|
|
1390
|
+
/** The keys kept as they are, which the Builder only needs to mention. */
|
|
1391
|
+
declare function preservedKeys(keys: string[]): string[];
|
|
1392
|
+
declare function readDatasets(doc: Document): BuilderDataset[];
|
|
1393
|
+
declare function readRelationships(doc: Document): BuilderRelationship[];
|
|
1394
|
+
declare function readModelMetrics(doc: Document): BuilderModelMetric[];
|
|
1395
|
+
/** The document back as text, byte for byte apart from the edits made. */
|
|
1396
|
+
declare function modelText(doc: Document): string;
|
|
1397
|
+
/**
|
|
1398
|
+
* Write a data store, creating it when the id is new.
|
|
1399
|
+
*
|
|
1400
|
+
* `dataModelId` comes from the connection dropdown, so the operator picks
|
|
1401
|
+
* "Restaurant Ops DW" and the UUID contract in the YAML is unchanged.
|
|
1402
|
+
*/
|
|
1403
|
+
declare function upsertDataStore(specYaml: string, store: BuilderDataStore, originalId?: string): string;
|
|
1404
|
+
declare function removeDataStore(specYaml: string, id: string): string;
|
|
1405
|
+
/**
|
|
1406
|
+
* Write a dataset, creating it when the id is new.
|
|
1407
|
+
*
|
|
1408
|
+
* Only the keys the dataset editor owns are written. A dataset carrying a mesh
|
|
1409
|
+
* plan or `ai_context` keeps them, because the Builder refuses to edit such a
|
|
1410
|
+
* dataset in the first place rather than dropping what it cannot show.
|
|
1411
|
+
*/
|
|
1412
|
+
declare function upsertDataset(specYaml: string, dataset: BuilderDataset, originalId?: string): string;
|
|
1413
|
+
declare function removeDataset(specYaml: string, id: string): string;
|
|
1414
|
+
/**
|
|
1415
|
+
* Write a relationship, creating it when the name is new.
|
|
1416
|
+
*
|
|
1417
|
+
* `from_columns` and `to_columns` are written as block sequences in the order
|
|
1418
|
+
* the panel shows them, because the engine pairs them positionally.
|
|
1419
|
+
*/
|
|
1420
|
+
declare function upsertRelationship(specYaml: string, relationship: BuilderRelationship, originalName?: string): string;
|
|
1421
|
+
declare function removeRelationship(specYaml: string, name: string): string;
|
|
1422
|
+
/** Write a model level metric, creating it when the id is new. */
|
|
1423
|
+
declare function upsertModelMetric(specYaml: string, metric: BuilderModelMetric, originalId?: string): string;
|
|
1424
|
+
declare function removeModelMetric(specYaml: string, id: string): string;
|
|
1425
|
+
/** One side of a ratio: an aggregate over a column of a named dataset. */
|
|
1426
|
+
interface RatioSide {
|
|
1427
|
+
dataset: string;
|
|
1428
|
+
aggregation: Aggregation;
|
|
1429
|
+
column: string;
|
|
1430
|
+
}
|
|
1431
|
+
/**
|
|
1432
|
+
* The SQL for "labor cost as a share of net sales".
|
|
1433
|
+
*
|
|
1434
|
+
* Columns are qualified with the dataset id, which is the alias the engine gives
|
|
1435
|
+
* each dataset in the join, and the denominator is wrapped in NULLIF so a day
|
|
1436
|
+
* with no sales is null rather than a division error.
|
|
1437
|
+
*
|
|
1438
|
+
* The result is always a share, never percentage points: `format: percent`
|
|
1439
|
+
* multiplies by 100 when the number is drawn, so scaling it here as well is how
|
|
1440
|
+
* a labor percent of 13.3% was printed as 1,333%.
|
|
1441
|
+
*/
|
|
1442
|
+
declare function ratioExpression(numerator: RatioSide, denominator: RatioSide): string;
|
|
1443
|
+
/** The two sides behind a ratio, when the expression is one this wrote. */
|
|
1444
|
+
declare function parseRatioExpression(expression: string): {
|
|
1445
|
+
numerator: RatioSide;
|
|
1446
|
+
denominator: RatioSide;
|
|
1447
|
+
/** True when the expression ends in `* 100`, written before or by hand. */
|
|
1448
|
+
scaledBy100: boolean;
|
|
1449
|
+
} | null;
|
|
1450
|
+
/**
|
|
1451
|
+
* True when a metric would print a hundred times too large.
|
|
1452
|
+
*
|
|
1453
|
+
* `format: percent` turns a share into a percentage, so an expression that has
|
|
1454
|
+
* already multiplied by 100 is scaled twice.
|
|
1455
|
+
*/
|
|
1456
|
+
declare function isDoubleScaledPercent(expression: string, format: string | null | undefined): boolean;
|
|
1457
|
+
/** The YAML for one dataset, so a panel can show the text it produces. */
|
|
1458
|
+
declare function datasetFragment(specYaml: string, id: string): string;
|
|
1459
|
+
/** The YAML for one data store, for the same reason. */
|
|
1460
|
+
declare function dataStoreFragment(specYaml: string, id: string): string;
|
|
1461
|
+
/** The YAML for one relationship, keyed by name rather than id. */
|
|
1462
|
+
declare function relationshipFragment(specYaml: string, name: string): string;
|
|
1463
|
+
/** The YAML for one model level metric. */
|
|
1464
|
+
declare function modelMetricFragment(specYaml: string, id: string): string;
|
|
1465
|
+
/** Rows the rail needs: the model's shape at a glance, without parsing twice. */
|
|
1466
|
+
interface ModelOutline {
|
|
1467
|
+
dataStores: BuilderDataStore[];
|
|
1468
|
+
datasets: BuilderDataset[];
|
|
1469
|
+
relationships: BuilderRelationship[];
|
|
1470
|
+
modelMetrics: BuilderModelMetric[];
|
|
1471
|
+
error: ModelParseError | null;
|
|
1472
|
+
}
|
|
1473
|
+
declare function readModelOutline(specYaml: string): ModelOutline;
|
|
1474
|
+
|
|
1475
|
+
/**
|
|
1476
|
+
* Put semantic model problems on the line that causes them.
|
|
1477
|
+
*
|
|
1478
|
+
* Diagnostics come back keyed by object id ("dataset daily_sales: ..."), which
|
|
1479
|
+
* leaves the reader to find `daily_sales` in a few hundred lines of YAML by eye.
|
|
1480
|
+
* These helpers locate the node that declares each id and turn the issues into
|
|
1481
|
+
* editor markers, so a problem is underlined where it lives.
|
|
1482
|
+
*/
|
|
1483
|
+
|
|
1484
|
+
type ModelMarkerSeverity = "error" | "warning" | "info";
|
|
1485
|
+
interface ModelMarker {
|
|
1486
|
+
/** 1-based, as common code editors count. */
|
|
1487
|
+
startLineNumber: number;
|
|
1488
|
+
startColumn: number;
|
|
1489
|
+
endLineNumber: number;
|
|
1490
|
+
endColumn: number;
|
|
1491
|
+
message: string;
|
|
1492
|
+
severity: ModelMarkerSeverity;
|
|
1493
|
+
}
|
|
1494
|
+
/** Where a collection entry is declared, 1-based. */
|
|
1495
|
+
interface NodePosition {
|
|
1496
|
+
line: number;
|
|
1497
|
+
column: number;
|
|
1498
|
+
endLine: number;
|
|
1499
|
+
endColumn: number;
|
|
1500
|
+
}
|
|
1501
|
+
/**
|
|
1502
|
+
* Line of every `id` (or `name`, for relationships) under each top-level
|
|
1503
|
+
* collection, keyed as `datasets:daily_sales`.
|
|
1504
|
+
*/
|
|
1505
|
+
declare function indexModelYaml(specYaml: string): Map<string, NodePosition>;
|
|
1506
|
+
/** Syntax errors from the YAML parser itself, so a typo marks instantly. */
|
|
1507
|
+
declare function yamlSyntaxMarkers(specYaml: string): ModelMarker[];
|
|
1508
|
+
/**
|
|
1509
|
+
* Markers for one validation response, placed on the declaring line.
|
|
1510
|
+
*
|
|
1511
|
+
* Issues are errors, data store notes are informational: a store with no
|
|
1512
|
+
* `data_model_id` resolves to the organisation's default and is not a problem.
|
|
1513
|
+
*/
|
|
1514
|
+
declare function diagnosticsToMarkers(specYaml: string, diagnostics: DashboardModelDiagnostics): ModelMarker[];
|
|
1515
|
+
/** How many of a validation response's findings are real problems. */
|
|
1516
|
+
declare function countModelIssues(diagnostics: DashboardModelDiagnostics): number;
|
|
1517
|
+
|
|
1518
|
+
/**
|
|
1519
|
+
* Read and edit a widget as a YAML document, not as an object.
|
|
1520
|
+
*
|
|
1521
|
+
* Same contract as the semantic model Builder: the widget Builder is a second
|
|
1522
|
+
* way to edit one text, never a second source of truth. Every edit goes through
|
|
1523
|
+
* the `yaml` Document API and touches only the keys the Builder owns, so
|
|
1524
|
+
* comments, interactions, bindings, drilldowns and every ECharts option the
|
|
1525
|
+
* Builder has no control for survive an edit untouched.
|
|
1526
|
+
*/
|
|
1527
|
+
|
|
1528
|
+
/** Components the Builder has a form for. Anything else stays YAML only. */
|
|
1529
|
+
declare const BUILDER_COMPONENTS: readonly ["echarts", "table", "tabulator", "pivot_table", "kpi"];
|
|
1530
|
+
type BuilderComponent = (typeof BUILDER_COMPONENTS)[number];
|
|
1531
|
+
/** Every component a widget can be, so the Builder can switch to any of them. */
|
|
1532
|
+
declare const ALL_COMPONENTS: readonly ["echarts", "table", "tabulator", "pivot_table", "kpi", "text", "markdown", "image", "filter"];
|
|
1533
|
+
declare function isBuilderComponent(component: string): component is BuilderComponent;
|
|
1534
|
+
/** Chart shapes the renderer draws from a category and a value column. */
|
|
1535
|
+
declare const CHART_TYPES: readonly ["line", "bar", "area", "pie", "scatter"];
|
|
1536
|
+
type ChartType = (typeof CHART_TYPES)[number];
|
|
1537
|
+
/** One named line or bar, pointing at a column the query returns. */
|
|
1538
|
+
interface BuilderSeries {
|
|
1539
|
+
name: string | null;
|
|
1540
|
+
field: string;
|
|
1541
|
+
}
|
|
1542
|
+
/** Which column each part of the widget reads. */
|
|
1543
|
+
interface BuilderMappings {
|
|
1544
|
+
x: string | null;
|
|
1545
|
+
category: string | null;
|
|
1546
|
+
value: string | null;
|
|
1547
|
+
series: string | null;
|
|
1548
|
+
/** The column a KPI compares its number against. */
|
|
1549
|
+
delta: string | null;
|
|
1550
|
+
}
|
|
1551
|
+
/** How a KPI prints the change between its number and its comparison column. */
|
|
1552
|
+
declare const DELTA_FORMATS: readonly ["percent", "number", "currency"];
|
|
1553
|
+
type DeltaFormat = (typeof DELTA_FORMATS)[number];
|
|
1554
|
+
/** How a number is printed on a card. */
|
|
1555
|
+
declare const NUMBER_FORMATS: readonly ["number", "currency", "percent"];
|
|
1556
|
+
type NumberFormat = (typeof NUMBER_FORMATS)[number];
|
|
1557
|
+
/** Which way rows are ordered before they are drawn. */
|
|
1558
|
+
declare const SORT_ORDERS: readonly ["none", "asc", "desc"];
|
|
1559
|
+
type SortOrder = (typeof SORT_ORDERS)[number];
|
|
1560
|
+
/**
|
|
1561
|
+
* How the widget reads, as opposed to what it reads.
|
|
1562
|
+
*
|
|
1563
|
+
* One flat block covering every component, because an author switching a KPI
|
|
1564
|
+
* to a table should not lose the wording they set. Only the keys that belong
|
|
1565
|
+
* to the current component are written, so the YAML never carries a table page
|
|
1566
|
+
* size on a chart.
|
|
1567
|
+
*/
|
|
1568
|
+
interface BuilderAppearance {
|
|
1569
|
+
/** Single number: how the figure is printed. */
|
|
1570
|
+
format: NumberFormat;
|
|
1571
|
+
/** Printed before the number, for example a currency symbol. */
|
|
1572
|
+
prefix: string | null;
|
|
1573
|
+
/** Printed after the number, for example hrs or pp. */
|
|
1574
|
+
suffix: string | null;
|
|
1575
|
+
/** Shorten large numbers, so 1240000 reads 1.24M. */
|
|
1576
|
+
compact: boolean;
|
|
1577
|
+
/** Fixed decimal places, or null for the format's own default. */
|
|
1578
|
+
decimals: number | null;
|
|
1579
|
+
/** Whether the caption sits above or below the figure. */
|
|
1580
|
+
labelPosition: "top" | "bottom";
|
|
1581
|
+
/** Chart: whether the legend is drawn. */
|
|
1582
|
+
showLegend: boolean;
|
|
1583
|
+
/** Chart: lay a bar chart on its side, which suits long category names. */
|
|
1584
|
+
horizontal: boolean;
|
|
1585
|
+
/** Chart: sort the points along the axis before drawing them. */
|
|
1586
|
+
sortOrder: SortOrder;
|
|
1587
|
+
/** Table: rows per page, or null to show them all. */
|
|
1588
|
+
pageSize: number | null;
|
|
1589
|
+
/** Table: whether a viewer can sort by clicking a heading. */
|
|
1590
|
+
sortable: boolean;
|
|
1591
|
+
/** Advanced table: collect rows under a heading per value of this column. */
|
|
1592
|
+
groupBy: string | null;
|
|
1593
|
+
}
|
|
1594
|
+
/** How a pivot table totals one column of figures. */
|
|
1595
|
+
declare const PIVOT_AGGREGATIONS: readonly ["sum", "avg", "min", "max", "count", "count_distinct"];
|
|
1596
|
+
type PivotAggregation = (typeof PIVOT_AGGREGATIONS)[number];
|
|
1597
|
+
/** Whether the rows under a group carry a line of their own. */
|
|
1598
|
+
declare const PIVOT_SUBTOTALS: readonly ["collapsed", "expanded", "none"];
|
|
1599
|
+
type PivotSubtotals = (typeof PIVOT_SUBTOTALS)[number];
|
|
1600
|
+
/** Which way an ordering reads. */
|
|
1601
|
+
declare const PIVOT_DIRECTIONS: readonly ["asc", "desc"];
|
|
1602
|
+
type PivotDirection = (typeof PIVOT_DIRECTIONS)[number];
|
|
1603
|
+
/** One figure a pivot table computes at every intersection. */
|
|
1604
|
+
interface BuilderPivotMeasure {
|
|
1605
|
+
field: string;
|
|
1606
|
+
agg: PivotAggregation;
|
|
1607
|
+
/** What the column is called, or null to use the metric's own label. */
|
|
1608
|
+
label: string | null;
|
|
1609
|
+
format: NumberFormat | null;
|
|
1610
|
+
decimals: number | null;
|
|
1611
|
+
}
|
|
1612
|
+
/**
|
|
1613
|
+
* How the cross-tab is laid out.
|
|
1614
|
+
*
|
|
1615
|
+
* Rows and columns name dataset dimensions, measures name metrics, and the rest
|
|
1616
|
+
* is how the grid reads. The engine computes it, so every one of these travels
|
|
1617
|
+
* into the workbook and the deck a schedule delivers as well as the screen.
|
|
1618
|
+
*/
|
|
1619
|
+
interface BuilderPivot {
|
|
1620
|
+
rows: string[];
|
|
1621
|
+
columns: string[];
|
|
1622
|
+
measures: BuilderPivotMeasure[];
|
|
1623
|
+
/** A line per row group, totalling the columns across it. */
|
|
1624
|
+
rowTotals: boolean;
|
|
1625
|
+
/** A total column beside the columns a dimension generated. */
|
|
1626
|
+
columnTotals: boolean;
|
|
1627
|
+
/** The one line at the foot totalling everything. */
|
|
1628
|
+
grandTotal: boolean;
|
|
1629
|
+
subtotals: PivotSubtotals;
|
|
1630
|
+
/** What an intersection with no rows behind it prints. */
|
|
1631
|
+
emptyValue: string | null;
|
|
1632
|
+
/** The measure whose cells are shaded, or null for no shading. */
|
|
1633
|
+
heatmap: string | null;
|
|
1634
|
+
/**
|
|
1635
|
+
* How many row levels start open when the widget is photographed for a PNG
|
|
1636
|
+
* or PDF delivery, or null to open the rows the way subtotals says. A
|
|
1637
|
+
* picture only carries the rows that are open, while the workbook and the
|
|
1638
|
+
* deck always carry the whole cross-tab.
|
|
1639
|
+
*/
|
|
1640
|
+
snapshotExpand: number | null;
|
|
1641
|
+
/**
|
|
1642
|
+
* How many column levels start open when the widget is photographed for a
|
|
1643
|
+
* PNG or PDF delivery, or null to open every column. A spanning header past
|
|
1644
|
+
* this level is folded to its own total column in the picture.
|
|
1645
|
+
*/
|
|
1646
|
+
snapshotExpandColumns: number | null;
|
|
1647
|
+
/** The measure the rows are ordered by, or null to order by their labels. */
|
|
1648
|
+
sortMeasure: string | null;
|
|
1649
|
+
/** Which way that ordering reads, or null for biggest or A first. */
|
|
1650
|
+
sortDirection: PivotDirection | null;
|
|
1651
|
+
/** How many row groups are drawn before the rest becomes one line, or null. */
|
|
1652
|
+
topRows: number | null;
|
|
1653
|
+
/** The measure that decides the biggest rows, or null for the sort measure. */
|
|
1654
|
+
topRowsMeasure: string | null;
|
|
1655
|
+
/** Whether the rows left out are carried in an Other line. */
|
|
1656
|
+
topRowsOther: boolean;
|
|
1657
|
+
/** How many row groups are kept, or null for the engine's own cap. */
|
|
1658
|
+
rowGroupLimit: number | null;
|
|
1659
|
+
/** How many generated columns are kept, or null for the engine's own cap. */
|
|
1660
|
+
columnLimit: number | null;
|
|
1661
|
+
/**
|
|
1662
|
+
* Whether a reader may rearrange this pivot with the field panel.
|
|
1663
|
+
*
|
|
1664
|
+
* What they arrange lives in their own browser for as long as they look at it,
|
|
1665
|
+
* so this switch decides who may explore, not what anyone else sees: the saved
|
|
1666
|
+
* layout is still what a link, a schedule and every export carry.
|
|
1667
|
+
*/
|
|
1668
|
+
explore: boolean;
|
|
1669
|
+
}
|
|
1670
|
+
interface BuilderWidget {
|
|
1671
|
+
id: string;
|
|
1672
|
+
name: string | null;
|
|
1673
|
+
component: BuilderComponent;
|
|
1674
|
+
chartType: ChartType;
|
|
1675
|
+
/** Percent of the comparison, or the plain difference. */
|
|
1676
|
+
deltaFormat: DeltaFormat;
|
|
1677
|
+
/** `dataset` is the only kind the Builder edits; the rest stay read-only. */
|
|
1678
|
+
dataKind: string;
|
|
1679
|
+
datasetId: string | null;
|
|
1680
|
+
/** Columns asked of the dataset, which are also the keys the rows come back with. */
|
|
1681
|
+
columns: string[];
|
|
1682
|
+
mappings: BuilderMappings;
|
|
1683
|
+
series: BuilderSeries[];
|
|
1684
|
+
appearance: BuilderAppearance;
|
|
1685
|
+
pivot: BuilderPivot;
|
|
1686
|
+
}
|
|
1687
|
+
interface WidgetOutline {
|
|
1688
|
+
widget: BuilderWidget | null;
|
|
1689
|
+
/** Id, title and component, readable even when the rest is YAML only. */
|
|
1690
|
+
identity: {
|
|
1691
|
+
id: string;
|
|
1692
|
+
name: string | null;
|
|
1693
|
+
component: string;
|
|
1694
|
+
};
|
|
1695
|
+
/** Why the Builder will not edit the rest of this widget, when it will not. */
|
|
1696
|
+
readOnlyReason: string | null;
|
|
1697
|
+
error: ModelParseError | null;
|
|
1698
|
+
}
|
|
1699
|
+
/** The widget as the Builder shows it, or why it will not show it. */
|
|
1700
|
+
declare function readWidgetOutline(specYaml: string): WidgetOutline;
|
|
1701
|
+
/**
|
|
1702
|
+
* Write the widget back, keeping every key the Builder does not own.
|
|
1703
|
+
*
|
|
1704
|
+
* The columns list is written as it is chosen, because the keys the rows come
|
|
1705
|
+
* back with are exactly those strings: that is what lets the Builder guarantee
|
|
1706
|
+
* a mapping names a column the query actually returns.
|
|
1707
|
+
*/
|
|
1708
|
+
declare function writeWidget(specYaml: string, widget: BuilderWidget): string;
|
|
1709
|
+
/**
|
|
1710
|
+
* Write only a pivot's layout - rows, columns and how each measure is combined -
|
|
1711
|
+
* into the widget's YAML, keeping everything else exactly as it is.
|
|
1712
|
+
*
|
|
1713
|
+
* This is what "Save this layout to the widget" does: the shelves an editor
|
|
1714
|
+
* arranged become the stored layout, so the dashboard, every link and every
|
|
1715
|
+
* scheduled delivery draw it from now on. A measure that was already configured
|
|
1716
|
+
* keeps its label, format and decimals; one the editor added starts plain.
|
|
1717
|
+
* Totals, sorting, top N, heatmap, captions, interactions and comments are not
|
|
1718
|
+
* the layout's to touch, so they survive byte for byte.
|
|
1719
|
+
*/
|
|
1720
|
+
declare function writePivotLayout(specYaml: string, layout: {
|
|
1721
|
+
rows: string[];
|
|
1722
|
+
columns: string[];
|
|
1723
|
+
measures: {
|
|
1724
|
+
field: string;
|
|
1725
|
+
agg: PivotAggregation;
|
|
1726
|
+
}[];
|
|
1727
|
+
}): string;
|
|
1728
|
+
/** `ly_net_sales` reads as `Ly net sales`, which is what a card should say. */
|
|
1729
|
+
declare function humanizeColumn(column: string): string;
|
|
1730
|
+
/**
|
|
1731
|
+
* Change what the widget is, without touching anything else.
|
|
1732
|
+
*
|
|
1733
|
+
* Switching to a component the Builder has no form for is allowed on purpose:
|
|
1734
|
+
* the author says what they want here and finishes the wording in YAML, rather
|
|
1735
|
+
* than deleting the widget and starting again.
|
|
1736
|
+
*/
|
|
1737
|
+
declare function writeComponent(specYaml: string, component: string): string;
|
|
1738
|
+
/** Rename the widget or change the id the layout references. */
|
|
1739
|
+
declare function writeIdentity(specYaml: string, field: "id" | "name", value: string): string;
|
|
1740
|
+
/** The YAML of the whole widget, for a panel that shows the text it produces. */
|
|
1741
|
+
declare function widgetFragment(specYaml: string): string;
|
|
1742
|
+
|
|
1743
|
+
/**
|
|
1744
|
+
* Checks the widget Builder runs while you click, before anything is saved.
|
|
1745
|
+
*
|
|
1746
|
+
* The failure this exists to kill is the blank chart: rows arrive, the widget
|
|
1747
|
+
* points at a column name the query never returned, and nothing draws. The
|
|
1748
|
+
* Builder only offers columns the chosen dataset can answer, and these checks
|
|
1749
|
+
* catch the rest: no dataset, no columns, a mapping left unset, a series naming
|
|
1750
|
+
* a column that is not selected, or a column from a dataset nothing joins to.
|
|
1751
|
+
*/
|
|
1752
|
+
|
|
1753
|
+
/** One column a widget may ask for, and where it comes from. */
|
|
1754
|
+
interface WidgetColumn {
|
|
1755
|
+
/** What goes in `data.columns`, and the key the row comes back with. */
|
|
1756
|
+
key: string;
|
|
1757
|
+
label: string;
|
|
1758
|
+
kind: "dimension" | "metric";
|
|
1759
|
+
/** Dataset the column belongs to, or null for a model level metric. */
|
|
1760
|
+
dataset: string | null;
|
|
1761
|
+
/** True when reading it forces a join with another dataset. */
|
|
1762
|
+
joined: boolean;
|
|
1763
|
+
}
|
|
1764
|
+
interface SemanticSummary {
|
|
1765
|
+
datasets: BuilderDataset[];
|
|
1766
|
+
relationships: BuilderRelationship[];
|
|
1767
|
+
modelMetrics: BuilderModelMetric[];
|
|
1768
|
+
}
|
|
1769
|
+
/**
|
|
1770
|
+
* Every column a widget on `datasetId` can ask for.
|
|
1771
|
+
*
|
|
1772
|
+
* The base dataset contributes its own dimensions and metrics unqualified; a
|
|
1773
|
+
* dataset the relationships connect to it contributes `other.metric`, which is
|
|
1774
|
+
* the literal key its rows come back with; a model level metric contributes its
|
|
1775
|
+
* id, since the engine resolves it against the join.
|
|
1776
|
+
*/
|
|
1777
|
+
declare function widgetColumns(datasetId: string | null, model: SemanticSummary): WidgetColumn[];
|
|
1778
|
+
/** Columns that hold a number, which is what a chart can plot. */
|
|
1779
|
+
declare function numericColumns(columns: WidgetColumn[]): WidgetColumn[];
|
|
1780
|
+
/** Columns that label a point, which is what an axis or a slice reads. */
|
|
1781
|
+
declare function labelColumns(columns: WidgetColumn[]): WidgetColumn[];
|
|
1782
|
+
/** Where in the widget document a finding belongs, so YAML can underline it. */
|
|
1783
|
+
type WidgetAnchor = {
|
|
1784
|
+
kind: "widget";
|
|
1785
|
+
} | {
|
|
1786
|
+
kind: "id";
|
|
1787
|
+
} | {
|
|
1788
|
+
kind: "dataset";
|
|
1789
|
+
} | {
|
|
1790
|
+
kind: "columns";
|
|
1791
|
+
} | {
|
|
1792
|
+
kind: "column";
|
|
1793
|
+
key: string;
|
|
1794
|
+
} | {
|
|
1795
|
+
kind: "mapping";
|
|
1796
|
+
slot: keyof BuilderWidget["mappings"];
|
|
1797
|
+
} | {
|
|
1798
|
+
kind: "series";
|
|
1799
|
+
index: number;
|
|
1800
|
+
} | {
|
|
1801
|
+
kind: "pivotRows";
|
|
1802
|
+
} | {
|
|
1803
|
+
kind: "pivotColumns";
|
|
1804
|
+
} | {
|
|
1805
|
+
kind: "pivotMeasures";
|
|
1806
|
+
} | {
|
|
1807
|
+
kind: "pivotMeasure";
|
|
1808
|
+
index: number;
|
|
1809
|
+
} | {
|
|
1810
|
+
kind: "pivotHeatmap";
|
|
1811
|
+
} | {
|
|
1812
|
+
kind: "pivotSort";
|
|
1813
|
+
} | {
|
|
1814
|
+
kind: "pivotTopRows";
|
|
1815
|
+
};
|
|
1816
|
+
interface WidgetFinding {
|
|
1817
|
+
message: string;
|
|
1818
|
+
at: WidgetAnchor;
|
|
1819
|
+
}
|
|
1820
|
+
/**
|
|
1821
|
+
* Everything that would make this widget render empty, with where it lives.
|
|
1822
|
+
*
|
|
1823
|
+
* The Builder only needs the wording, but the YAML tab needs to underline the
|
|
1824
|
+
* line that causes each one, which is why the location travels with it.
|
|
1825
|
+
*/
|
|
1826
|
+
declare function widgetFindings(widget: BuilderWidget, model: SemanticSummary): WidgetFinding[];
|
|
1827
|
+
declare function widgetIssues(widget: BuilderWidget, model: SemanticSummary): string[];
|
|
1828
|
+
|
|
1829
|
+
/**
|
|
1830
|
+
* The widget ids a tab holds. A tab may name its widgets by id, by reference,
|
|
1831
|
+
* or inline, so all three shapes collapse to ids here.
|
|
1832
|
+
*/
|
|
1833
|
+
declare function tabWidgetIds(tab: DashboardTab): string[];
|
|
1834
|
+
declare function dashboardTabs(dashboard: DashboardSpec): DashboardTab[];
|
|
1835
|
+
declare function defaultTabId(tabs: DashboardTab[]): string | undefined;
|
|
1836
|
+
|
|
1837
|
+
interface FilterOption {
|
|
1838
|
+
value: unknown;
|
|
1839
|
+
label: string;
|
|
1840
|
+
}
|
|
1841
|
+
type FilterControl = "select" | "multiselect" | "radio" | "date" | "date_range" | "input";
|
|
1842
|
+
interface FilterModel {
|
|
1843
|
+
widgetId: string;
|
|
1844
|
+
label: string;
|
|
1845
|
+
control: FilterControl;
|
|
1846
|
+
options: FilterOption[];
|
|
1847
|
+
placeholder?: string;
|
|
1848
|
+
defaultValue: unknown;
|
|
1849
|
+
panelled: boolean;
|
|
1850
|
+
labelPosition: "top" | "bottom";
|
|
1851
|
+
/** True when the widget's object header replaces the inline label. */
|
|
1852
|
+
showObjectHeader: boolean;
|
|
1853
|
+
radioOrientation: "horizontal" | "vertical";
|
|
1854
|
+
/** Relative expressions offered as one click shortcuts on date controls. */
|
|
1855
|
+
presets: string[];
|
|
1856
|
+
/** Whether a date control shows the calendar trigger next to its input. */
|
|
1857
|
+
showIcon: boolean;
|
|
1858
|
+
}
|
|
1859
|
+
declare function filterOptions(widget: WidgetSpec$1, result: WidgetResult): FilterOption[];
|
|
1860
|
+
declare function describeFilter(value: unknown, options: FilterOption[]): string;
|
|
1861
|
+
/** Free text a date filter accepts in place of a calendar date, e.g. `last 7 days`. */
|
|
1862
|
+
declare function isRelativeDateExpression(value: string): boolean;
|
|
1863
|
+
declare function isIsoDate(value: string): boolean;
|
|
1864
|
+
declare function buildFilterModel(widget: WidgetSpec$1, result?: WidgetResult): FilterModel;
|
|
1865
|
+
|
|
1866
|
+
type LayoutKey = "lg" | "md" | "sm" | "xs" | "xxs";
|
|
1867
|
+
/** The widths the reader switches layouts at, matching the frozen reader. */
|
|
1868
|
+
declare const LAYOUT_BREAKPOINT_WIDTHS: Record<LayoutKey, number>;
|
|
1869
|
+
declare function layoutKeyForWidth(width: number): LayoutKey;
|
|
1870
|
+
declare function resolveResponsive(dashboard: DashboardSpec): Required<Record<"wide" | "desktop" | "tablet" | "mobile", BreakpointConfig>>;
|
|
1871
|
+
|
|
1872
|
+
interface ResultTable {
|
|
1873
|
+
columns: string[];
|
|
1874
|
+
rows: Record<string, unknown>[];
|
|
1875
|
+
}
|
|
1876
|
+
declare function resultRows(result: WidgetResult | undefined): Record<string, unknown>[];
|
|
1877
|
+
declare function resultColumns(result: WidgetResult | undefined, rows: Record<string, unknown>[]): string[];
|
|
1878
|
+
declare function cellText(value: unknown): string;
|
|
1879
|
+
/**
|
|
1880
|
+
* The clipboard copy the reader offers. Styled workbook exports belong to the
|
|
1881
|
+
* export phase and are not reimplemented here.
|
|
1882
|
+
*/
|
|
1883
|
+
declare function formatTableCsv(table: ResultTable): string;
|
|
1884
|
+
|
|
1885
|
+
export { PIVOT_AGGREGATIONS as $, AGGREGATIONS as A, BUILDER_COMPONENTS as B, CHART_TYPES as C, DELTA_FORMATS as D, type DashboardModelDatasetDiagnostic as E, type DashboardModelDiagnostics as F, type DashboardModelMetricDiagnostic as G, type DashboardModelRelationshipDiagnostic as H, type DashboardPivotInfo as I, type DashboardResponsiveConfig as J, type DashboardSectionConfig as K, type DashboardSpec as L, type DashboardTab as M, type DeltaFormat as N, type FilterControl as O, type FilterLayout as P, type FilterModel as Q, type FilterOption as R, LAYOUT_BREAKPOINT_WIDTHS as S, type LayoutItem as T, type LayoutKey as U, type ModelMarker as V, type ModelMarkerSeverity as W, type ModelOutline as X, type ModelParseError as Y, NUMBER_FORMATS as Z, type NumberFormat as _, ALL_COMPONENTS as a, resultRows as a$, PIVOT_DIRECTIONS as a0, PIVOT_SUBTOTALS as a1, type PivotAggregation as a2, type PivotDirection as a3, type PivotExpandEntry as a4, type PivotOpenLevels as a5, type PivotSubtotals as a6, type RatioSide as a7, type ReadPivotOpenLevels as a8, type ResizeHandle as a9, isBuilderComponent as aA, isDoubleScaledPercent as aB, isIsoDate as aC, isRelativeDateExpression as aD, labelColumns as aE, layoutKeyForWidth as aF, modelMetricFragment as aG, modelText as aH, numericColumns as aI, parseAggregation as aJ, parseModelDocument as aK, parseRatioExpression as aL, preservedKeys as aM, ratioExpression as aN, readDataStores as aO, readDatasets as aP, readModelMetrics as aQ, readModelOutline as aR, readRelationships as aS, readWidgetOutline as aT, relationshipFragment as aU, removeDataStore as aV, removeDataset as aW, removeModelMetric as aX, removeRelationship as aY, resolveResponsive as aZ, resultColumns as a_, type ResponsiveLayouts as aa, type ResultTable as ab, SORT_ORDERS as ac, type SemanticSummary as ad, type SortOrder as ae, type WidgetAnchor as af, type WidgetColumn as ag, type WidgetFinding as ah, type WidgetOutline as ai, type WidgetRef as aj, aggregationExpression as ak, blockingKeys as al, buildFilterModel as am, cellText as an, countModelIssues as ao, dashboardTabs as ap, dataStoreFragment as aq, datasetFragment as ar, defaultTabId as as, describeFilter as at, diagnosticsToMarkers as au, dimensionTypeFor as av, filterOptions as aw, formatTableCsv as ax, humanizeColumn as ay, indexModelYaml as az, type Aggregation as b, tabWidgetIds as b0, upsertDataStore as b1, upsertDataset as b2, upsertModelMetric as b3, upsertRelationship as b4, widgetColumns as b5, widgetFindings as b6, widgetFragment as b7, widgetIssues as b8, writeComponent as b9, writeIdentity as ba, writePivotLayout as bb, writeWidget as bc, yamlSyntaxMarkers as bd, type Breakpoint as c, type BreakpointConfig as d, type BuilderAppearance as e, type BuilderCardinality as f, type BuilderComponent as g, type BuilderDataStore as h, type BuilderDataset as i, type BuilderDimension as j, type BuilderDimensionType as k, type BuilderMappings as l, type BuilderMetric as m, type BuilderModelMetric as n, type BuilderPivot as o, type BuilderPivotMeasure as p, type BuilderRelationship as q, type BuilderRollup as r, type BuilderSeries as s, type BuilderWidget as t, type ChartType as u, type DashboardConfig as v, type DashboardFilterPanelConfig as w, type DashboardGridConfig as x, type DashboardModelAiGrounding as y, type DashboardModelDataStoreDiagnostic as z };
|