em-kit 0.0.0-stage → 0.1.1
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 +21 -0
- package/README.md +66 -2
- package/dist/ai.d.ts +1896 -0
- package/dist/ai.js +2699 -0
- package/dist/ai.js.map +1 -0
- package/dist/build.d.ts +120 -0
- package/dist/build.js +56 -0
- package/dist/build.js.map +1 -0
- package/dist/chunks/EditorCard.d-CcLiXQ7c.d.ts +469 -0
- package/dist/chunks/pies.utils-CMMo-SlI.js +7899 -0
- package/dist/chunks/pies.utils-CMMo-SlI.js.map +1 -0
- package/dist/index.d.ts +1376 -0
- package/dist/index.js +8370 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.js +6 -0
- package/package.json +104 -4
package/dist/ai.js
ADDED
|
@@ -0,0 +1,2699 @@
|
|
|
1
|
+
const chartSpecSchema = {
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "ChartSpec",
|
|
4
|
+
"description": "A chart to render. `chart` selects the kind and which other fields apply. A field (`dimension`, `measure`, `measures`, `xAxis`, ...) is a bare row-key string or a { name, ... } object. Options use vertical orientation for every kind: `xAxis`/`xAxisLabel` is the category axis and `yAxisRange*` the value range, even for horizontal variants. Set `granularity` on the chart, never on a field, when the category axis is a time field. `rows` is long format with zone-less ISO time strings.",
|
|
5
|
+
"anyOf": [
|
|
6
|
+
{
|
|
7
|
+
"$ref": "#/$defs/BarSpec"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"$ref": "#/$defs/BarGroupedSpec"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"$ref": "#/$defs/LineSpec"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"$ref": "#/$defs/LineGroupedSpec"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"$ref": "#/$defs/LineWithKpiTabsSpec"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"$ref": "#/$defs/LineComparisonSpec"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"$ref": "#/$defs/LineComparisonWithKpiTabsSpec"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"$ref": "#/$defs/AreaSpec"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"$ref": "#/$defs/BarLineSpec"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"$ref": "#/$defs/PieSpec"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"$ref": "#/$defs/DonutLabelSpec"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"$ref": "#/$defs/ScatterSpec"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"$ref": "#/$defs/BubbleSpec"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"$ref": "#/$defs/KpiSpec"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"$ref": "#/$defs/KpiComparisonSpec"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"$ref": "#/$defs/TableSpec"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"$ref": "#/$defs/HeatMapSpec"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"$ref": "#/$defs/PivotSpec"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"$defs": {
|
|
62
|
+
"AreaSpec": {
|
|
63
|
+
"type": "object",
|
|
64
|
+
"additionalProperties": false,
|
|
65
|
+
"properties": {
|
|
66
|
+
"chart": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"const": "area"
|
|
69
|
+
},
|
|
70
|
+
"xAxis": {
|
|
71
|
+
"$ref": "#/$defs/FieldRef"
|
|
72
|
+
},
|
|
73
|
+
"groupBy": {
|
|
74
|
+
"$ref": "#/$defs/FieldRef",
|
|
75
|
+
"description": "Stacking dimension. Omit for a single-series area."
|
|
76
|
+
},
|
|
77
|
+
"measure": {
|
|
78
|
+
"$ref": "#/$defs/FieldRef"
|
|
79
|
+
},
|
|
80
|
+
"granularity": {
|
|
81
|
+
"$ref": "#/$defs/Granularity"
|
|
82
|
+
},
|
|
83
|
+
"options": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"properties": {
|
|
87
|
+
"showTooltips": {
|
|
88
|
+
"type": "boolean"
|
|
89
|
+
},
|
|
90
|
+
"showValueLabels": {
|
|
91
|
+
"type": "boolean"
|
|
92
|
+
},
|
|
93
|
+
"showLogarithmicScale": {
|
|
94
|
+
"type": "boolean"
|
|
95
|
+
},
|
|
96
|
+
"xAxisLabel": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"description": "Category-axis label (vertical orientation; see header)."
|
|
99
|
+
},
|
|
100
|
+
"yAxisLabel": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"description": "Value-axis label."
|
|
103
|
+
},
|
|
104
|
+
"yAxisRangeMin": {
|
|
105
|
+
"type": "number",
|
|
106
|
+
"description": "Value-axis range."
|
|
107
|
+
},
|
|
108
|
+
"yAxisRangeMax": {
|
|
109
|
+
"type": "number"
|
|
110
|
+
},
|
|
111
|
+
"reverseXAxis": {
|
|
112
|
+
"type": "boolean",
|
|
113
|
+
"description": "Reverse the category order."
|
|
114
|
+
},
|
|
115
|
+
"xAxisMaxItems": {
|
|
116
|
+
"type": "number",
|
|
117
|
+
"description": "Cap on rendered categories."
|
|
118
|
+
},
|
|
119
|
+
"showLegend": {
|
|
120
|
+
"type": "boolean"
|
|
121
|
+
},
|
|
122
|
+
"maxLegendItems": {
|
|
123
|
+
"type": "number"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"title": {
|
|
128
|
+
"type": "string"
|
|
129
|
+
},
|
|
130
|
+
"description": {
|
|
131
|
+
"type": "string"
|
|
132
|
+
},
|
|
133
|
+
"rows": {
|
|
134
|
+
"type": "array",
|
|
135
|
+
"items": {
|
|
136
|
+
"$ref": "#/$defs/SpecRow"
|
|
137
|
+
},
|
|
138
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
139
|
+
},
|
|
140
|
+
"loading": {
|
|
141
|
+
"type": "boolean",
|
|
142
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
143
|
+
},
|
|
144
|
+
"error": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"description": "Render the error state with this message instead of data."
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"required": [
|
|
150
|
+
"chart",
|
|
151
|
+
"measure",
|
|
152
|
+
"xAxis"
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
"BarGroupedSpec": {
|
|
156
|
+
"type": "object",
|
|
157
|
+
"additionalProperties": false,
|
|
158
|
+
"properties": {
|
|
159
|
+
"chart": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"enum": [
|
|
162
|
+
"barGrouped",
|
|
163
|
+
"barGroupedHorizontal",
|
|
164
|
+
"barStacked",
|
|
165
|
+
"barStackedHorizontal"
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
"xAxis": {
|
|
169
|
+
"$ref": "#/$defs/FieldRef",
|
|
170
|
+
"description": "Category axis dimension (renders on y for horizontal variants)."
|
|
171
|
+
},
|
|
172
|
+
"groupBy": {
|
|
173
|
+
"$ref": "#/$defs/FieldRef",
|
|
174
|
+
"description": "Dimension that splits each category into grouped/stacked bars."
|
|
175
|
+
},
|
|
176
|
+
"measure": {
|
|
177
|
+
"$ref": "#/$defs/FieldRef"
|
|
178
|
+
},
|
|
179
|
+
"granularity": {
|
|
180
|
+
"$ref": "#/$defs/Granularity",
|
|
181
|
+
"description": "When `xAxis` is a time field: its bucket size."
|
|
182
|
+
},
|
|
183
|
+
"options": {
|
|
184
|
+
"type": "object",
|
|
185
|
+
"additionalProperties": false,
|
|
186
|
+
"properties": {
|
|
187
|
+
"showTotalLabels": {
|
|
188
|
+
"type": "boolean"
|
|
189
|
+
},
|
|
190
|
+
"showTooltips": {
|
|
191
|
+
"type": "boolean"
|
|
192
|
+
},
|
|
193
|
+
"showValueLabels": {
|
|
194
|
+
"type": "boolean"
|
|
195
|
+
},
|
|
196
|
+
"showLogarithmicScale": {
|
|
197
|
+
"type": "boolean"
|
|
198
|
+
},
|
|
199
|
+
"xAxisLabel": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"description": "Category-axis label (vertical orientation; see header)."
|
|
202
|
+
},
|
|
203
|
+
"yAxisLabel": {
|
|
204
|
+
"type": "string",
|
|
205
|
+
"description": "Value-axis label."
|
|
206
|
+
},
|
|
207
|
+
"yAxisRangeMin": {
|
|
208
|
+
"type": "number",
|
|
209
|
+
"description": "Value-axis range."
|
|
210
|
+
},
|
|
211
|
+
"yAxisRangeMax": {
|
|
212
|
+
"type": "number"
|
|
213
|
+
},
|
|
214
|
+
"reverseXAxis": {
|
|
215
|
+
"type": "boolean",
|
|
216
|
+
"description": "Reverse the category order."
|
|
217
|
+
},
|
|
218
|
+
"xAxisMaxItems": {
|
|
219
|
+
"type": "number",
|
|
220
|
+
"description": "Cap on rendered categories."
|
|
221
|
+
},
|
|
222
|
+
"showLegend": {
|
|
223
|
+
"type": "boolean"
|
|
224
|
+
},
|
|
225
|
+
"maxLegendItems": {
|
|
226
|
+
"type": "number"
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"title": {
|
|
231
|
+
"type": "string"
|
|
232
|
+
},
|
|
233
|
+
"description": {
|
|
234
|
+
"type": "string"
|
|
235
|
+
},
|
|
236
|
+
"rows": {
|
|
237
|
+
"type": "array",
|
|
238
|
+
"items": {
|
|
239
|
+
"$ref": "#/$defs/SpecRow"
|
|
240
|
+
},
|
|
241
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
242
|
+
},
|
|
243
|
+
"loading": {
|
|
244
|
+
"type": "boolean",
|
|
245
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
246
|
+
},
|
|
247
|
+
"error": {
|
|
248
|
+
"type": "string",
|
|
249
|
+
"description": "Render the error state with this message instead of data."
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"required": [
|
|
253
|
+
"chart",
|
|
254
|
+
"groupBy",
|
|
255
|
+
"measure",
|
|
256
|
+
"xAxis"
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
"BarLineSpec": {
|
|
260
|
+
"type": "object",
|
|
261
|
+
"additionalProperties": false,
|
|
262
|
+
"properties": {
|
|
263
|
+
"chart": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"const": "barLine"
|
|
266
|
+
},
|
|
267
|
+
"dimension": {
|
|
268
|
+
"$ref": "#/$defs/FieldRef"
|
|
269
|
+
},
|
|
270
|
+
"barMeasures": {
|
|
271
|
+
"anyOf": [
|
|
272
|
+
{
|
|
273
|
+
"$ref": "#/$defs/FieldRef"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"type": "array",
|
|
277
|
+
"items": {
|
|
278
|
+
"$ref": "#/$defs/FieldRef"
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
],
|
|
282
|
+
"description": "Measures drawn as bars (left axis)."
|
|
283
|
+
},
|
|
284
|
+
"lineMeasures": {
|
|
285
|
+
"anyOf": [
|
|
286
|
+
{
|
|
287
|
+
"$ref": "#/$defs/FieldRef"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"type": "array",
|
|
291
|
+
"items": {
|
|
292
|
+
"$ref": "#/$defs/FieldRef"
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
],
|
|
296
|
+
"description": "Measures drawn as lines (right axis)."
|
|
297
|
+
},
|
|
298
|
+
"granularity": {
|
|
299
|
+
"$ref": "#/$defs/Granularity"
|
|
300
|
+
},
|
|
301
|
+
"options": {
|
|
302
|
+
"type": "object",
|
|
303
|
+
"additionalProperties": false,
|
|
304
|
+
"properties": {
|
|
305
|
+
"showValueLabelsLine": {
|
|
306
|
+
"type": "boolean"
|
|
307
|
+
},
|
|
308
|
+
"yAxisSecondaryLabel": {
|
|
309
|
+
"type": "string",
|
|
310
|
+
"description": "Right (line) axis."
|
|
311
|
+
},
|
|
312
|
+
"yAxisSecondaryMin": {
|
|
313
|
+
"type": "number"
|
|
314
|
+
},
|
|
315
|
+
"yAxisSecondaryMax": {
|
|
316
|
+
"type": "number"
|
|
317
|
+
},
|
|
318
|
+
"showTooltips": {
|
|
319
|
+
"type": "boolean"
|
|
320
|
+
},
|
|
321
|
+
"showValueLabels": {
|
|
322
|
+
"type": "boolean"
|
|
323
|
+
},
|
|
324
|
+
"showLogarithmicScale": {
|
|
325
|
+
"type": "boolean"
|
|
326
|
+
},
|
|
327
|
+
"xAxisLabel": {
|
|
328
|
+
"type": "string",
|
|
329
|
+
"description": "Category-axis label (vertical orientation; see header)."
|
|
330
|
+
},
|
|
331
|
+
"yAxisLabel": {
|
|
332
|
+
"type": "string",
|
|
333
|
+
"description": "Value-axis label."
|
|
334
|
+
},
|
|
335
|
+
"yAxisRangeMin": {
|
|
336
|
+
"type": "number",
|
|
337
|
+
"description": "Value-axis range."
|
|
338
|
+
},
|
|
339
|
+
"yAxisRangeMax": {
|
|
340
|
+
"type": "number"
|
|
341
|
+
},
|
|
342
|
+
"reverseXAxis": {
|
|
343
|
+
"type": "boolean",
|
|
344
|
+
"description": "Reverse the category order."
|
|
345
|
+
},
|
|
346
|
+
"xAxisMaxItems": {
|
|
347
|
+
"type": "number",
|
|
348
|
+
"description": "Cap on rendered categories."
|
|
349
|
+
},
|
|
350
|
+
"showLegend": {
|
|
351
|
+
"type": "boolean"
|
|
352
|
+
},
|
|
353
|
+
"maxLegendItems": {
|
|
354
|
+
"type": "number"
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
"title": {
|
|
359
|
+
"type": "string"
|
|
360
|
+
},
|
|
361
|
+
"description": {
|
|
362
|
+
"type": "string"
|
|
363
|
+
},
|
|
364
|
+
"rows": {
|
|
365
|
+
"type": "array",
|
|
366
|
+
"items": {
|
|
367
|
+
"$ref": "#/$defs/SpecRow"
|
|
368
|
+
},
|
|
369
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
370
|
+
},
|
|
371
|
+
"loading": {
|
|
372
|
+
"type": "boolean",
|
|
373
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
374
|
+
},
|
|
375
|
+
"error": {
|
|
376
|
+
"type": "string",
|
|
377
|
+
"description": "Render the error state with this message instead of data."
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
"required": [
|
|
381
|
+
"barMeasures",
|
|
382
|
+
"chart",
|
|
383
|
+
"dimension"
|
|
384
|
+
]
|
|
385
|
+
},
|
|
386
|
+
"BarSpec": {
|
|
387
|
+
"type": "object",
|
|
388
|
+
"additionalProperties": false,
|
|
389
|
+
"properties": {
|
|
390
|
+
"chart": {
|
|
391
|
+
"type": "string",
|
|
392
|
+
"enum": [
|
|
393
|
+
"bar",
|
|
394
|
+
"barHorizontal"
|
|
395
|
+
]
|
|
396
|
+
},
|
|
397
|
+
"dimension": {
|
|
398
|
+
"$ref": "#/$defs/FieldRef",
|
|
399
|
+
"description": "Category dimension."
|
|
400
|
+
},
|
|
401
|
+
"measures": {
|
|
402
|
+
"anyOf": [
|
|
403
|
+
{
|
|
404
|
+
"$ref": "#/$defs/FieldRef"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"type": "array",
|
|
408
|
+
"items": {
|
|
409
|
+
"$ref": "#/$defs/FieldRef"
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
],
|
|
413
|
+
"description": "One measure per bar series."
|
|
414
|
+
},
|
|
415
|
+
"granularity": {
|
|
416
|
+
"$ref": "#/$defs/Granularity",
|
|
417
|
+
"description": "When `dimension` is a time field: its bucket size."
|
|
418
|
+
},
|
|
419
|
+
"options": {
|
|
420
|
+
"type": "object",
|
|
421
|
+
"additionalProperties": false,
|
|
422
|
+
"properties": {
|
|
423
|
+
"showTooltips": {
|
|
424
|
+
"type": "boolean"
|
|
425
|
+
},
|
|
426
|
+
"showValueLabels": {
|
|
427
|
+
"type": "boolean"
|
|
428
|
+
},
|
|
429
|
+
"showLogarithmicScale": {
|
|
430
|
+
"type": "boolean"
|
|
431
|
+
},
|
|
432
|
+
"xAxisLabel": {
|
|
433
|
+
"type": "string",
|
|
434
|
+
"description": "Category-axis label (vertical orientation; see header)."
|
|
435
|
+
},
|
|
436
|
+
"yAxisLabel": {
|
|
437
|
+
"type": "string",
|
|
438
|
+
"description": "Value-axis label."
|
|
439
|
+
},
|
|
440
|
+
"yAxisRangeMin": {
|
|
441
|
+
"type": "number",
|
|
442
|
+
"description": "Value-axis range."
|
|
443
|
+
},
|
|
444
|
+
"yAxisRangeMax": {
|
|
445
|
+
"type": "number"
|
|
446
|
+
},
|
|
447
|
+
"reverseXAxis": {
|
|
448
|
+
"type": "boolean",
|
|
449
|
+
"description": "Reverse the category order."
|
|
450
|
+
},
|
|
451
|
+
"xAxisMaxItems": {
|
|
452
|
+
"type": "number",
|
|
453
|
+
"description": "Cap on rendered categories."
|
|
454
|
+
},
|
|
455
|
+
"showLegend": {
|
|
456
|
+
"type": "boolean"
|
|
457
|
+
},
|
|
458
|
+
"maxLegendItems": {
|
|
459
|
+
"type": "number"
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
"title": {
|
|
464
|
+
"type": "string"
|
|
465
|
+
},
|
|
466
|
+
"description": {
|
|
467
|
+
"type": "string"
|
|
468
|
+
},
|
|
469
|
+
"rows": {
|
|
470
|
+
"type": "array",
|
|
471
|
+
"items": {
|
|
472
|
+
"$ref": "#/$defs/SpecRow"
|
|
473
|
+
},
|
|
474
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
475
|
+
},
|
|
476
|
+
"loading": {
|
|
477
|
+
"type": "boolean",
|
|
478
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
479
|
+
},
|
|
480
|
+
"error": {
|
|
481
|
+
"type": "string",
|
|
482
|
+
"description": "Render the error state with this message instead of data."
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
"required": [
|
|
486
|
+
"chart",
|
|
487
|
+
"dimension",
|
|
488
|
+
"measures"
|
|
489
|
+
]
|
|
490
|
+
},
|
|
491
|
+
"BubbleSpec": {
|
|
492
|
+
"type": "object",
|
|
493
|
+
"additionalProperties": false,
|
|
494
|
+
"properties": {
|
|
495
|
+
"chart": {
|
|
496
|
+
"type": "string",
|
|
497
|
+
"const": "bubble"
|
|
498
|
+
},
|
|
499
|
+
"xMeasure": {
|
|
500
|
+
"$ref": "#/$defs/FieldRef"
|
|
501
|
+
},
|
|
502
|
+
"yMeasure": {
|
|
503
|
+
"$ref": "#/$defs/FieldRef"
|
|
504
|
+
},
|
|
505
|
+
"bubbleSizeMeasure": {
|
|
506
|
+
"$ref": "#/$defs/FieldRef"
|
|
507
|
+
},
|
|
508
|
+
"pointDimension": {
|
|
509
|
+
"$ref": "#/$defs/FieldRef"
|
|
510
|
+
},
|
|
511
|
+
"groupByDimension": {
|
|
512
|
+
"$ref": "#/$defs/FieldRef"
|
|
513
|
+
},
|
|
514
|
+
"options": {
|
|
515
|
+
"type": "object",
|
|
516
|
+
"additionalProperties": false,
|
|
517
|
+
"properties": {
|
|
518
|
+
"bubbleRadiusMin": {
|
|
519
|
+
"type": "number"
|
|
520
|
+
},
|
|
521
|
+
"bubbleRadiusMax": {
|
|
522
|
+
"type": "number"
|
|
523
|
+
},
|
|
524
|
+
"showTooltips": {
|
|
525
|
+
"type": "boolean"
|
|
526
|
+
},
|
|
527
|
+
"showPointLabels": {
|
|
528
|
+
"type": "boolean",
|
|
529
|
+
"description": "Label each point with its dimension value."
|
|
530
|
+
},
|
|
531
|
+
"showValueLabels": {
|
|
532
|
+
"type": "boolean"
|
|
533
|
+
},
|
|
534
|
+
"showLogarithmicScale": {
|
|
535
|
+
"type": "boolean"
|
|
536
|
+
},
|
|
537
|
+
"xAxisLabel": {
|
|
538
|
+
"type": "string"
|
|
539
|
+
},
|
|
540
|
+
"yAxisLabel": {
|
|
541
|
+
"type": "string"
|
|
542
|
+
},
|
|
543
|
+
"xAxisRangeMin": {
|
|
544
|
+
"type": "number"
|
|
545
|
+
},
|
|
546
|
+
"xAxisRangeMax": {
|
|
547
|
+
"type": "number"
|
|
548
|
+
},
|
|
549
|
+
"yAxisRangeMin": {
|
|
550
|
+
"type": "number"
|
|
551
|
+
},
|
|
552
|
+
"yAxisRangeMax": {
|
|
553
|
+
"type": "number"
|
|
554
|
+
},
|
|
555
|
+
"reverseXAxis": {
|
|
556
|
+
"type": "boolean"
|
|
557
|
+
},
|
|
558
|
+
"pointColor": {
|
|
559
|
+
"type": "string",
|
|
560
|
+
"description": "CSS color for ungrouped points."
|
|
561
|
+
},
|
|
562
|
+
"showLegend": {
|
|
563
|
+
"type": "boolean"
|
|
564
|
+
},
|
|
565
|
+
"maxLegendItems": {
|
|
566
|
+
"type": "number"
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
"title": {
|
|
571
|
+
"type": "string"
|
|
572
|
+
},
|
|
573
|
+
"description": {
|
|
574
|
+
"type": "string"
|
|
575
|
+
},
|
|
576
|
+
"rows": {
|
|
577
|
+
"type": "array",
|
|
578
|
+
"items": {
|
|
579
|
+
"$ref": "#/$defs/SpecRow"
|
|
580
|
+
},
|
|
581
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
582
|
+
},
|
|
583
|
+
"loading": {
|
|
584
|
+
"type": "boolean",
|
|
585
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
586
|
+
},
|
|
587
|
+
"error": {
|
|
588
|
+
"type": "string",
|
|
589
|
+
"description": "Render the error state with this message instead of data."
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
"required": [
|
|
593
|
+
"bubbleSizeMeasure",
|
|
594
|
+
"chart",
|
|
595
|
+
"pointDimension",
|
|
596
|
+
"xMeasure",
|
|
597
|
+
"yMeasure"
|
|
598
|
+
]
|
|
599
|
+
},
|
|
600
|
+
"DateRangeSpec": {
|
|
601
|
+
"type": "object",
|
|
602
|
+
"properties": {
|
|
603
|
+
"from": {
|
|
604
|
+
"type": "string"
|
|
605
|
+
},
|
|
606
|
+
"to": {
|
|
607
|
+
"type": "string"
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
"additionalProperties": false,
|
|
611
|
+
"description": "ISO date strings (`YYYY-MM-DD` or full timestamps), no zone suffix."
|
|
612
|
+
},
|
|
613
|
+
"DonutLabelSpec": {
|
|
614
|
+
"type": "object",
|
|
615
|
+
"additionalProperties": false,
|
|
616
|
+
"properties": {
|
|
617
|
+
"chart": {
|
|
618
|
+
"type": "string",
|
|
619
|
+
"const": "donutLabel"
|
|
620
|
+
},
|
|
621
|
+
"dimension": {
|
|
622
|
+
"$ref": "#/$defs/FieldRef"
|
|
623
|
+
},
|
|
624
|
+
"measure": {
|
|
625
|
+
"$ref": "#/$defs/FieldRef"
|
|
626
|
+
},
|
|
627
|
+
"innerLabel": {
|
|
628
|
+
"type": "object",
|
|
629
|
+
"properties": {
|
|
630
|
+
"text": {
|
|
631
|
+
"type": "string"
|
|
632
|
+
},
|
|
633
|
+
"measure": {
|
|
634
|
+
"$ref": "#/$defs/FieldRef"
|
|
635
|
+
},
|
|
636
|
+
"value": {
|
|
637
|
+
"type": [
|
|
638
|
+
"number",
|
|
639
|
+
"string"
|
|
640
|
+
]
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
"additionalProperties": false,
|
|
644
|
+
"description": "The headline number in the donut's center. Omitted fields are derived: `measure` defaults to the main measure, `value` to the sum of the rows."
|
|
645
|
+
},
|
|
646
|
+
"options": {
|
|
647
|
+
"type": "object",
|
|
648
|
+
"additionalProperties": false,
|
|
649
|
+
"properties": {
|
|
650
|
+
"showTooltips": {
|
|
651
|
+
"type": "boolean"
|
|
652
|
+
},
|
|
653
|
+
"showValueLabels": {
|
|
654
|
+
"type": "boolean"
|
|
655
|
+
},
|
|
656
|
+
"showValueLabelsAsPercentage": {
|
|
657
|
+
"type": "boolean"
|
|
658
|
+
},
|
|
659
|
+
"showLegend": {
|
|
660
|
+
"type": "boolean"
|
|
661
|
+
},
|
|
662
|
+
"maxLegendItems": {
|
|
663
|
+
"type": "number"
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
},
|
|
667
|
+
"title": {
|
|
668
|
+
"type": "string"
|
|
669
|
+
},
|
|
670
|
+
"description": {
|
|
671
|
+
"type": "string"
|
|
672
|
+
},
|
|
673
|
+
"rows": {
|
|
674
|
+
"type": "array",
|
|
675
|
+
"items": {
|
|
676
|
+
"$ref": "#/$defs/SpecRow"
|
|
677
|
+
},
|
|
678
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
679
|
+
},
|
|
680
|
+
"loading": {
|
|
681
|
+
"type": "boolean",
|
|
682
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
683
|
+
},
|
|
684
|
+
"error": {
|
|
685
|
+
"type": "string",
|
|
686
|
+
"description": "Render the error state with this message instead of data."
|
|
687
|
+
}
|
|
688
|
+
},
|
|
689
|
+
"required": [
|
|
690
|
+
"chart",
|
|
691
|
+
"dimension",
|
|
692
|
+
"measure"
|
|
693
|
+
]
|
|
694
|
+
},
|
|
695
|
+
"FieldRef": {
|
|
696
|
+
"anyOf": [
|
|
697
|
+
{
|
|
698
|
+
"type": "string"
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
"$ref": "#/$defs/SpecField"
|
|
702
|
+
}
|
|
703
|
+
],
|
|
704
|
+
"description": "A field is a bare row-key string or a full descriptor."
|
|
705
|
+
},
|
|
706
|
+
"Granularity": {
|
|
707
|
+
"type": "string",
|
|
708
|
+
"enum": [
|
|
709
|
+
"second",
|
|
710
|
+
"minute",
|
|
711
|
+
"hour",
|
|
712
|
+
"day",
|
|
713
|
+
"week",
|
|
714
|
+
"month",
|
|
715
|
+
"quarter",
|
|
716
|
+
"year"
|
|
717
|
+
]
|
|
718
|
+
},
|
|
719
|
+
"HeatMapSpec": {
|
|
720
|
+
"type": "object",
|
|
721
|
+
"additionalProperties": false,
|
|
722
|
+
"properties": {
|
|
723
|
+
"chart": {
|
|
724
|
+
"type": "string",
|
|
725
|
+
"const": "heatmap"
|
|
726
|
+
},
|
|
727
|
+
"rowDimension": {
|
|
728
|
+
"$ref": "#/$defs/FieldRef"
|
|
729
|
+
},
|
|
730
|
+
"columnDimension": {
|
|
731
|
+
"$ref": "#/$defs/FieldRef"
|
|
732
|
+
},
|
|
733
|
+
"measure": {
|
|
734
|
+
"$ref": "#/$defs/FieldRef"
|
|
735
|
+
},
|
|
736
|
+
"options": {
|
|
737
|
+
"type": "object",
|
|
738
|
+
"properties": {
|
|
739
|
+
"showValues": {
|
|
740
|
+
"type": "boolean",
|
|
741
|
+
"description": "Print the measure value in each cell."
|
|
742
|
+
},
|
|
743
|
+
"minColor": {
|
|
744
|
+
"type": "string",
|
|
745
|
+
"description": "CSS colors for the value scale."
|
|
746
|
+
},
|
|
747
|
+
"midColor": {
|
|
748
|
+
"type": "string"
|
|
749
|
+
},
|
|
750
|
+
"maxColor": {
|
|
751
|
+
"type": "string"
|
|
752
|
+
},
|
|
753
|
+
"minThreshold": {
|
|
754
|
+
"type": "string",
|
|
755
|
+
"description": "Values at/below this render as minColor."
|
|
756
|
+
},
|
|
757
|
+
"maxThreshold": {
|
|
758
|
+
"type": "string",
|
|
759
|
+
"description": "Values at/above this render as maxColor."
|
|
760
|
+
},
|
|
761
|
+
"displayNullAs": {
|
|
762
|
+
"type": "string"
|
|
763
|
+
},
|
|
764
|
+
"columnWidth": {
|
|
765
|
+
"type": "number"
|
|
766
|
+
},
|
|
767
|
+
"firstColumnWidth": {
|
|
768
|
+
"type": "number"
|
|
769
|
+
}
|
|
770
|
+
},
|
|
771
|
+
"additionalProperties": false
|
|
772
|
+
},
|
|
773
|
+
"title": {
|
|
774
|
+
"type": "string"
|
|
775
|
+
},
|
|
776
|
+
"description": {
|
|
777
|
+
"type": "string"
|
|
778
|
+
},
|
|
779
|
+
"rows": {
|
|
780
|
+
"type": "array",
|
|
781
|
+
"items": {
|
|
782
|
+
"$ref": "#/$defs/SpecRow"
|
|
783
|
+
},
|
|
784
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
785
|
+
},
|
|
786
|
+
"loading": {
|
|
787
|
+
"type": "boolean",
|
|
788
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
789
|
+
},
|
|
790
|
+
"error": {
|
|
791
|
+
"type": "string",
|
|
792
|
+
"description": "Render the error state with this message instead of data."
|
|
793
|
+
}
|
|
794
|
+
},
|
|
795
|
+
"required": [
|
|
796
|
+
"chart",
|
|
797
|
+
"columnDimension",
|
|
798
|
+
"measure",
|
|
799
|
+
"rowDimension"
|
|
800
|
+
]
|
|
801
|
+
},
|
|
802
|
+
"KpiComparisonSpec": {
|
|
803
|
+
"type": "object",
|
|
804
|
+
"additionalProperties": false,
|
|
805
|
+
"properties": {
|
|
806
|
+
"chart": {
|
|
807
|
+
"type": "string",
|
|
808
|
+
"const": "kpiComparison"
|
|
809
|
+
},
|
|
810
|
+
"measure": {
|
|
811
|
+
"$ref": "#/$defs/FieldRef"
|
|
812
|
+
},
|
|
813
|
+
"value": {
|
|
814
|
+
"type": [
|
|
815
|
+
"number",
|
|
816
|
+
"string"
|
|
817
|
+
],
|
|
818
|
+
"description": "Shortcut for `rows`; see KpiSpec.value."
|
|
819
|
+
},
|
|
820
|
+
"comparisonValue": {
|
|
821
|
+
"type": [
|
|
822
|
+
"number",
|
|
823
|
+
"string"
|
|
824
|
+
],
|
|
825
|
+
"description": "The value compared against. Shortcut for `comparisonRows`."
|
|
826
|
+
},
|
|
827
|
+
"comparisonRows": {
|
|
828
|
+
"type": "array",
|
|
829
|
+
"items": {
|
|
830
|
+
"$ref": "#/$defs/SpecRow"
|
|
831
|
+
},
|
|
832
|
+
"description": "Rows for the comparison period, same shape as `rows`."
|
|
833
|
+
},
|
|
834
|
+
"comparisonLabel": {
|
|
835
|
+
"type": "string",
|
|
836
|
+
"description": "Label for the comparison, e.g. 'Previous period'."
|
|
837
|
+
},
|
|
838
|
+
"dateRange": {
|
|
839
|
+
"$ref": "#/$defs/DateRangeSpec",
|
|
840
|
+
"description": "Period the main value covers."
|
|
841
|
+
},
|
|
842
|
+
"comparisonDateRange": {
|
|
843
|
+
"$ref": "#/$defs/DateRangeSpec",
|
|
844
|
+
"description": "Period the comparison value covers."
|
|
845
|
+
},
|
|
846
|
+
"options": {
|
|
847
|
+
"type": "object",
|
|
848
|
+
"properties": {
|
|
849
|
+
"fontSize": {
|
|
850
|
+
"type": "number"
|
|
851
|
+
},
|
|
852
|
+
"changeFontSize": {
|
|
853
|
+
"type": "number"
|
|
854
|
+
},
|
|
855
|
+
"displayChangeAsPercentage": {
|
|
856
|
+
"type": "boolean"
|
|
857
|
+
},
|
|
858
|
+
"reversePositiveNegativeColors": {
|
|
859
|
+
"type": "boolean",
|
|
860
|
+
"description": "When a decrease is good (costs, churn)."
|
|
861
|
+
},
|
|
862
|
+
"percentageDecimalPlaces": {
|
|
863
|
+
"type": "number"
|
|
864
|
+
},
|
|
865
|
+
"displayNullAs": {
|
|
866
|
+
"type": "string"
|
|
867
|
+
}
|
|
868
|
+
},
|
|
869
|
+
"additionalProperties": false
|
|
870
|
+
},
|
|
871
|
+
"title": {
|
|
872
|
+
"type": "string"
|
|
873
|
+
},
|
|
874
|
+
"description": {
|
|
875
|
+
"type": "string"
|
|
876
|
+
},
|
|
877
|
+
"rows": {
|
|
878
|
+
"type": "array",
|
|
879
|
+
"items": {
|
|
880
|
+
"$ref": "#/$defs/SpecRow"
|
|
881
|
+
},
|
|
882
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
883
|
+
},
|
|
884
|
+
"loading": {
|
|
885
|
+
"type": "boolean",
|
|
886
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
887
|
+
},
|
|
888
|
+
"error": {
|
|
889
|
+
"type": "string",
|
|
890
|
+
"description": "Render the error state with this message instead of data."
|
|
891
|
+
}
|
|
892
|
+
},
|
|
893
|
+
"required": [
|
|
894
|
+
"chart",
|
|
895
|
+
"measure"
|
|
896
|
+
]
|
|
897
|
+
},
|
|
898
|
+
"KpiSpec": {
|
|
899
|
+
"type": "object",
|
|
900
|
+
"additionalProperties": false,
|
|
901
|
+
"properties": {
|
|
902
|
+
"chart": {
|
|
903
|
+
"type": "string",
|
|
904
|
+
"const": "kpi"
|
|
905
|
+
},
|
|
906
|
+
"measure": {
|
|
907
|
+
"$ref": "#/$defs/FieldRef"
|
|
908
|
+
},
|
|
909
|
+
"value": {
|
|
910
|
+
"type": [
|
|
911
|
+
"number",
|
|
912
|
+
"string"
|
|
913
|
+
],
|
|
914
|
+
"description": "Shortcut for `rows: [{ [measure.name]: value }]`. Ignored when `rows` is set."
|
|
915
|
+
},
|
|
916
|
+
"options": {
|
|
917
|
+
"type": "object",
|
|
918
|
+
"properties": {
|
|
919
|
+
"fontSize": {
|
|
920
|
+
"type": "number"
|
|
921
|
+
},
|
|
922
|
+
"displayNullAs": {
|
|
923
|
+
"type": "string"
|
|
924
|
+
}
|
|
925
|
+
},
|
|
926
|
+
"additionalProperties": false
|
|
927
|
+
},
|
|
928
|
+
"title": {
|
|
929
|
+
"type": "string"
|
|
930
|
+
},
|
|
931
|
+
"description": {
|
|
932
|
+
"type": "string"
|
|
933
|
+
},
|
|
934
|
+
"rows": {
|
|
935
|
+
"type": "array",
|
|
936
|
+
"items": {
|
|
937
|
+
"$ref": "#/$defs/SpecRow"
|
|
938
|
+
},
|
|
939
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
940
|
+
},
|
|
941
|
+
"loading": {
|
|
942
|
+
"type": "boolean",
|
|
943
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
944
|
+
},
|
|
945
|
+
"error": {
|
|
946
|
+
"type": "string",
|
|
947
|
+
"description": "Render the error state with this message instead of data."
|
|
948
|
+
}
|
|
949
|
+
},
|
|
950
|
+
"required": [
|
|
951
|
+
"chart",
|
|
952
|
+
"measure"
|
|
953
|
+
]
|
|
954
|
+
},
|
|
955
|
+
"LineComparisonSpec": {
|
|
956
|
+
"type": "object",
|
|
957
|
+
"additionalProperties": false,
|
|
958
|
+
"properties": {
|
|
959
|
+
"chart": {
|
|
960
|
+
"type": "string",
|
|
961
|
+
"const": "lineComparison"
|
|
962
|
+
},
|
|
963
|
+
"xAxis": {
|
|
964
|
+
"$ref": "#/$defs/FieldRef"
|
|
965
|
+
},
|
|
966
|
+
"measures": {
|
|
967
|
+
"anyOf": [
|
|
968
|
+
{
|
|
969
|
+
"$ref": "#/$defs/FieldRef"
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
"type": "array",
|
|
973
|
+
"items": {
|
|
974
|
+
"$ref": "#/$defs/FieldRef"
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
]
|
|
978
|
+
},
|
|
979
|
+
"comparisonRows": {
|
|
980
|
+
"type": "array",
|
|
981
|
+
"items": {
|
|
982
|
+
"$ref": "#/$defs/SpecRow"
|
|
983
|
+
},
|
|
984
|
+
"description": "Rows for the comparison period, same shape as `rows`; aligned by position."
|
|
985
|
+
},
|
|
986
|
+
"comparisonLabel": {
|
|
987
|
+
"type": "string",
|
|
988
|
+
"description": "Label for the comparison, e.g. 'Previous period'."
|
|
989
|
+
},
|
|
990
|
+
"dateRange": {
|
|
991
|
+
"$ref": "#/$defs/DateRangeSpec",
|
|
992
|
+
"description": "Periods covered; derived from each row set's time extent when omitted."
|
|
993
|
+
},
|
|
994
|
+
"comparisonDateRange": {
|
|
995
|
+
"$ref": "#/$defs/DateRangeSpec"
|
|
996
|
+
},
|
|
997
|
+
"granularity": {
|
|
998
|
+
"$ref": "#/$defs/Granularity"
|
|
999
|
+
},
|
|
1000
|
+
"options": {
|
|
1001
|
+
"type": "object",
|
|
1002
|
+
"additionalProperties": false,
|
|
1003
|
+
"properties": {
|
|
1004
|
+
"showComparisonAxis": {
|
|
1005
|
+
"type": "boolean",
|
|
1006
|
+
"description": "Second x-axis showing the comparison period's dates."
|
|
1007
|
+
},
|
|
1008
|
+
"showTooltips": {
|
|
1009
|
+
"type": "boolean"
|
|
1010
|
+
},
|
|
1011
|
+
"showValueLabels": {
|
|
1012
|
+
"type": "boolean"
|
|
1013
|
+
},
|
|
1014
|
+
"showLogarithmicScale": {
|
|
1015
|
+
"type": "boolean"
|
|
1016
|
+
},
|
|
1017
|
+
"xAxisLabel": {
|
|
1018
|
+
"type": "string",
|
|
1019
|
+
"description": "Category-axis label (vertical orientation; see header)."
|
|
1020
|
+
},
|
|
1021
|
+
"yAxisLabel": {
|
|
1022
|
+
"type": "string",
|
|
1023
|
+
"description": "Value-axis label."
|
|
1024
|
+
},
|
|
1025
|
+
"yAxisRangeMin": {
|
|
1026
|
+
"type": "number",
|
|
1027
|
+
"description": "Value-axis range."
|
|
1028
|
+
},
|
|
1029
|
+
"yAxisRangeMax": {
|
|
1030
|
+
"type": "number"
|
|
1031
|
+
},
|
|
1032
|
+
"reverseXAxis": {
|
|
1033
|
+
"type": "boolean",
|
|
1034
|
+
"description": "Reverse the category order."
|
|
1035
|
+
},
|
|
1036
|
+
"xAxisMaxItems": {
|
|
1037
|
+
"type": "number",
|
|
1038
|
+
"description": "Cap on rendered categories."
|
|
1039
|
+
},
|
|
1040
|
+
"showLegend": {
|
|
1041
|
+
"type": "boolean"
|
|
1042
|
+
},
|
|
1043
|
+
"maxLegendItems": {
|
|
1044
|
+
"type": "number"
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
},
|
|
1048
|
+
"title": {
|
|
1049
|
+
"type": "string"
|
|
1050
|
+
},
|
|
1051
|
+
"description": {
|
|
1052
|
+
"type": "string"
|
|
1053
|
+
},
|
|
1054
|
+
"rows": {
|
|
1055
|
+
"type": "array",
|
|
1056
|
+
"items": {
|
|
1057
|
+
"$ref": "#/$defs/SpecRow"
|
|
1058
|
+
},
|
|
1059
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
1060
|
+
},
|
|
1061
|
+
"loading": {
|
|
1062
|
+
"type": "boolean",
|
|
1063
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
1064
|
+
},
|
|
1065
|
+
"error": {
|
|
1066
|
+
"type": "string",
|
|
1067
|
+
"description": "Render the error state with this message instead of data."
|
|
1068
|
+
}
|
|
1069
|
+
},
|
|
1070
|
+
"required": [
|
|
1071
|
+
"chart",
|
|
1072
|
+
"measures",
|
|
1073
|
+
"xAxis"
|
|
1074
|
+
]
|
|
1075
|
+
},
|
|
1076
|
+
"LineComparisonWithKpiTabsSpec": {
|
|
1077
|
+
"type": "object",
|
|
1078
|
+
"additionalProperties": false,
|
|
1079
|
+
"properties": {
|
|
1080
|
+
"chart": {
|
|
1081
|
+
"type": "string",
|
|
1082
|
+
"const": "lineComparisonWithKpiTabs"
|
|
1083
|
+
},
|
|
1084
|
+
"xAxis": {
|
|
1085
|
+
"$ref": "#/$defs/FieldRef"
|
|
1086
|
+
},
|
|
1087
|
+
"measures": {
|
|
1088
|
+
"anyOf": [
|
|
1089
|
+
{
|
|
1090
|
+
"$ref": "#/$defs/FieldRef"
|
|
1091
|
+
},
|
|
1092
|
+
{
|
|
1093
|
+
"type": "array",
|
|
1094
|
+
"items": {
|
|
1095
|
+
"$ref": "#/$defs/FieldRef"
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
]
|
|
1099
|
+
},
|
|
1100
|
+
"comparisonRows": {
|
|
1101
|
+
"type": "array",
|
|
1102
|
+
"items": {
|
|
1103
|
+
"$ref": "#/$defs/SpecRow"
|
|
1104
|
+
}
|
|
1105
|
+
},
|
|
1106
|
+
"kpiRows": {
|
|
1107
|
+
"type": "array",
|
|
1108
|
+
"items": {
|
|
1109
|
+
"$ref": "#/$defs/SpecRow"
|
|
1110
|
+
},
|
|
1111
|
+
"description": "See LineWithKpiTabsSpec.kpiRows; derived from `rows` when omitted."
|
|
1112
|
+
},
|
|
1113
|
+
"kpiComparisonRows": {
|
|
1114
|
+
"type": "array",
|
|
1115
|
+
"items": {
|
|
1116
|
+
"$ref": "#/$defs/SpecRow"
|
|
1117
|
+
},
|
|
1118
|
+
"description": "Headline numbers for the comparison period; derived from `comparisonRows`."
|
|
1119
|
+
},
|
|
1120
|
+
"comparisonLabel": {
|
|
1121
|
+
"type": "string"
|
|
1122
|
+
},
|
|
1123
|
+
"dateRange": {
|
|
1124
|
+
"$ref": "#/$defs/DateRangeSpec"
|
|
1125
|
+
},
|
|
1126
|
+
"comparisonDateRange": {
|
|
1127
|
+
"$ref": "#/$defs/DateRangeSpec"
|
|
1128
|
+
},
|
|
1129
|
+
"granularity": {
|
|
1130
|
+
"$ref": "#/$defs/Granularity"
|
|
1131
|
+
},
|
|
1132
|
+
"options": {
|
|
1133
|
+
"type": "object",
|
|
1134
|
+
"additionalProperties": false,
|
|
1135
|
+
"properties": {
|
|
1136
|
+
"showComparisonAxis": {
|
|
1137
|
+
"type": "boolean"
|
|
1138
|
+
},
|
|
1139
|
+
"showTooltips": {
|
|
1140
|
+
"type": "boolean"
|
|
1141
|
+
},
|
|
1142
|
+
"showValueLabels": {
|
|
1143
|
+
"type": "boolean"
|
|
1144
|
+
},
|
|
1145
|
+
"showLogarithmicScale": {
|
|
1146
|
+
"type": "boolean"
|
|
1147
|
+
},
|
|
1148
|
+
"xAxisLabel": {
|
|
1149
|
+
"type": "string",
|
|
1150
|
+
"description": "Category-axis label (vertical orientation; see header)."
|
|
1151
|
+
},
|
|
1152
|
+
"yAxisLabel": {
|
|
1153
|
+
"type": "string",
|
|
1154
|
+
"description": "Value-axis label."
|
|
1155
|
+
},
|
|
1156
|
+
"yAxisRangeMin": {
|
|
1157
|
+
"type": "number",
|
|
1158
|
+
"description": "Value-axis range."
|
|
1159
|
+
},
|
|
1160
|
+
"yAxisRangeMax": {
|
|
1161
|
+
"type": "number"
|
|
1162
|
+
},
|
|
1163
|
+
"reverseXAxis": {
|
|
1164
|
+
"type": "boolean",
|
|
1165
|
+
"description": "Reverse the category order."
|
|
1166
|
+
},
|
|
1167
|
+
"xAxisMaxItems": {
|
|
1168
|
+
"type": "number",
|
|
1169
|
+
"description": "Cap on rendered categories."
|
|
1170
|
+
},
|
|
1171
|
+
"showLegend": {
|
|
1172
|
+
"type": "boolean"
|
|
1173
|
+
},
|
|
1174
|
+
"maxLegendItems": {
|
|
1175
|
+
"type": "number"
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
},
|
|
1179
|
+
"title": {
|
|
1180
|
+
"type": "string"
|
|
1181
|
+
},
|
|
1182
|
+
"description": {
|
|
1183
|
+
"type": "string"
|
|
1184
|
+
},
|
|
1185
|
+
"rows": {
|
|
1186
|
+
"type": "array",
|
|
1187
|
+
"items": {
|
|
1188
|
+
"$ref": "#/$defs/SpecRow"
|
|
1189
|
+
},
|
|
1190
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
1191
|
+
},
|
|
1192
|
+
"loading": {
|
|
1193
|
+
"type": "boolean",
|
|
1194
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
1195
|
+
},
|
|
1196
|
+
"error": {
|
|
1197
|
+
"type": "string",
|
|
1198
|
+
"description": "Render the error state with this message instead of data."
|
|
1199
|
+
}
|
|
1200
|
+
},
|
|
1201
|
+
"required": [
|
|
1202
|
+
"chart",
|
|
1203
|
+
"measures",
|
|
1204
|
+
"xAxis"
|
|
1205
|
+
]
|
|
1206
|
+
},
|
|
1207
|
+
"LineGroupedSpec": {
|
|
1208
|
+
"type": "object",
|
|
1209
|
+
"additionalProperties": false,
|
|
1210
|
+
"properties": {
|
|
1211
|
+
"chart": {
|
|
1212
|
+
"type": "string",
|
|
1213
|
+
"const": "lineGrouped"
|
|
1214
|
+
},
|
|
1215
|
+
"xAxis": {
|
|
1216
|
+
"$ref": "#/$defs/FieldRef"
|
|
1217
|
+
},
|
|
1218
|
+
"groupBy": {
|
|
1219
|
+
"$ref": "#/$defs/FieldRef",
|
|
1220
|
+
"description": "Dimension that splits the measure into one line per value."
|
|
1221
|
+
},
|
|
1222
|
+
"measure": {
|
|
1223
|
+
"$ref": "#/$defs/FieldRef"
|
|
1224
|
+
},
|
|
1225
|
+
"granularity": {
|
|
1226
|
+
"$ref": "#/$defs/Granularity"
|
|
1227
|
+
},
|
|
1228
|
+
"options": {
|
|
1229
|
+
"type": "object",
|
|
1230
|
+
"additionalProperties": false,
|
|
1231
|
+
"properties": {
|
|
1232
|
+
"showTooltips": {
|
|
1233
|
+
"type": "boolean"
|
|
1234
|
+
},
|
|
1235
|
+
"showValueLabels": {
|
|
1236
|
+
"type": "boolean"
|
|
1237
|
+
},
|
|
1238
|
+
"showLogarithmicScale": {
|
|
1239
|
+
"type": "boolean"
|
|
1240
|
+
},
|
|
1241
|
+
"xAxisLabel": {
|
|
1242
|
+
"type": "string",
|
|
1243
|
+
"description": "Category-axis label (vertical orientation; see header)."
|
|
1244
|
+
},
|
|
1245
|
+
"yAxisLabel": {
|
|
1246
|
+
"type": "string",
|
|
1247
|
+
"description": "Value-axis label."
|
|
1248
|
+
},
|
|
1249
|
+
"yAxisRangeMin": {
|
|
1250
|
+
"type": "number",
|
|
1251
|
+
"description": "Value-axis range."
|
|
1252
|
+
},
|
|
1253
|
+
"yAxisRangeMax": {
|
|
1254
|
+
"type": "number"
|
|
1255
|
+
},
|
|
1256
|
+
"reverseXAxis": {
|
|
1257
|
+
"type": "boolean",
|
|
1258
|
+
"description": "Reverse the category order."
|
|
1259
|
+
},
|
|
1260
|
+
"xAxisMaxItems": {
|
|
1261
|
+
"type": "number",
|
|
1262
|
+
"description": "Cap on rendered categories."
|
|
1263
|
+
},
|
|
1264
|
+
"showLegend": {
|
|
1265
|
+
"type": "boolean"
|
|
1266
|
+
},
|
|
1267
|
+
"maxLegendItems": {
|
|
1268
|
+
"type": "number"
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
},
|
|
1272
|
+
"title": {
|
|
1273
|
+
"type": "string"
|
|
1274
|
+
},
|
|
1275
|
+
"description": {
|
|
1276
|
+
"type": "string"
|
|
1277
|
+
},
|
|
1278
|
+
"rows": {
|
|
1279
|
+
"type": "array",
|
|
1280
|
+
"items": {
|
|
1281
|
+
"$ref": "#/$defs/SpecRow"
|
|
1282
|
+
},
|
|
1283
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
1284
|
+
},
|
|
1285
|
+
"loading": {
|
|
1286
|
+
"type": "boolean",
|
|
1287
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
1288
|
+
},
|
|
1289
|
+
"error": {
|
|
1290
|
+
"type": "string",
|
|
1291
|
+
"description": "Render the error state with this message instead of data."
|
|
1292
|
+
}
|
|
1293
|
+
},
|
|
1294
|
+
"required": [
|
|
1295
|
+
"chart",
|
|
1296
|
+
"groupBy",
|
|
1297
|
+
"measure",
|
|
1298
|
+
"xAxis"
|
|
1299
|
+
]
|
|
1300
|
+
},
|
|
1301
|
+
"LineSpec": {
|
|
1302
|
+
"type": "object",
|
|
1303
|
+
"additionalProperties": false,
|
|
1304
|
+
"properties": {
|
|
1305
|
+
"chart": {
|
|
1306
|
+
"type": "string",
|
|
1307
|
+
"const": "line"
|
|
1308
|
+
},
|
|
1309
|
+
"xAxis": {
|
|
1310
|
+
"$ref": "#/$defs/FieldRef"
|
|
1311
|
+
},
|
|
1312
|
+
"measures": {
|
|
1313
|
+
"anyOf": [
|
|
1314
|
+
{
|
|
1315
|
+
"$ref": "#/$defs/FieldRef"
|
|
1316
|
+
},
|
|
1317
|
+
{
|
|
1318
|
+
"type": "array",
|
|
1319
|
+
"items": {
|
|
1320
|
+
"$ref": "#/$defs/FieldRef"
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
],
|
|
1324
|
+
"description": "One measure per line."
|
|
1325
|
+
},
|
|
1326
|
+
"granularity": {
|
|
1327
|
+
"$ref": "#/$defs/Granularity",
|
|
1328
|
+
"description": "When `xAxis` is a time field: its bucket size."
|
|
1329
|
+
},
|
|
1330
|
+
"options": {
|
|
1331
|
+
"type": "object",
|
|
1332
|
+
"additionalProperties": false,
|
|
1333
|
+
"properties": {
|
|
1334
|
+
"showTooltips": {
|
|
1335
|
+
"type": "boolean"
|
|
1336
|
+
},
|
|
1337
|
+
"showValueLabels": {
|
|
1338
|
+
"type": "boolean"
|
|
1339
|
+
},
|
|
1340
|
+
"showLogarithmicScale": {
|
|
1341
|
+
"type": "boolean"
|
|
1342
|
+
},
|
|
1343
|
+
"xAxisLabel": {
|
|
1344
|
+
"type": "string",
|
|
1345
|
+
"description": "Category-axis label (vertical orientation; see header)."
|
|
1346
|
+
},
|
|
1347
|
+
"yAxisLabel": {
|
|
1348
|
+
"type": "string",
|
|
1349
|
+
"description": "Value-axis label."
|
|
1350
|
+
},
|
|
1351
|
+
"yAxisRangeMin": {
|
|
1352
|
+
"type": "number",
|
|
1353
|
+
"description": "Value-axis range."
|
|
1354
|
+
},
|
|
1355
|
+
"yAxisRangeMax": {
|
|
1356
|
+
"type": "number"
|
|
1357
|
+
},
|
|
1358
|
+
"reverseXAxis": {
|
|
1359
|
+
"type": "boolean",
|
|
1360
|
+
"description": "Reverse the category order."
|
|
1361
|
+
},
|
|
1362
|
+
"xAxisMaxItems": {
|
|
1363
|
+
"type": "number",
|
|
1364
|
+
"description": "Cap on rendered categories."
|
|
1365
|
+
},
|
|
1366
|
+
"showLegend": {
|
|
1367
|
+
"type": "boolean"
|
|
1368
|
+
},
|
|
1369
|
+
"maxLegendItems": {
|
|
1370
|
+
"type": "number"
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
},
|
|
1374
|
+
"title": {
|
|
1375
|
+
"type": "string"
|
|
1376
|
+
},
|
|
1377
|
+
"description": {
|
|
1378
|
+
"type": "string"
|
|
1379
|
+
},
|
|
1380
|
+
"rows": {
|
|
1381
|
+
"type": "array",
|
|
1382
|
+
"items": {
|
|
1383
|
+
"$ref": "#/$defs/SpecRow"
|
|
1384
|
+
},
|
|
1385
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
1386
|
+
},
|
|
1387
|
+
"loading": {
|
|
1388
|
+
"type": "boolean",
|
|
1389
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
1390
|
+
},
|
|
1391
|
+
"error": {
|
|
1392
|
+
"type": "string",
|
|
1393
|
+
"description": "Render the error state with this message instead of data."
|
|
1394
|
+
}
|
|
1395
|
+
},
|
|
1396
|
+
"required": [
|
|
1397
|
+
"chart",
|
|
1398
|
+
"measures",
|
|
1399
|
+
"xAxis"
|
|
1400
|
+
]
|
|
1401
|
+
},
|
|
1402
|
+
"LineWithKpiTabsSpec": {
|
|
1403
|
+
"type": "object",
|
|
1404
|
+
"additionalProperties": false,
|
|
1405
|
+
"properties": {
|
|
1406
|
+
"chart": {
|
|
1407
|
+
"type": "string",
|
|
1408
|
+
"const": "lineWithKpiTabs"
|
|
1409
|
+
},
|
|
1410
|
+
"xAxis": {
|
|
1411
|
+
"$ref": "#/$defs/FieldRef"
|
|
1412
|
+
},
|
|
1413
|
+
"measures": {
|
|
1414
|
+
"anyOf": [
|
|
1415
|
+
{
|
|
1416
|
+
"$ref": "#/$defs/FieldRef"
|
|
1417
|
+
},
|
|
1418
|
+
{
|
|
1419
|
+
"type": "array",
|
|
1420
|
+
"items": {
|
|
1421
|
+
"$ref": "#/$defs/FieldRef"
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
],
|
|
1425
|
+
"description": "One measure per KPI tab; each tab plots its measure as the line."
|
|
1426
|
+
},
|
|
1427
|
+
"kpiRows": {
|
|
1428
|
+
"type": "array",
|
|
1429
|
+
"items": {
|
|
1430
|
+
"$ref": "#/$defs/SpecRow"
|
|
1431
|
+
},
|
|
1432
|
+
"description": "One row holding each measure's headline number for the tabs. Derived by summing `rows` when omitted."
|
|
1433
|
+
},
|
|
1434
|
+
"granularity": {
|
|
1435
|
+
"$ref": "#/$defs/Granularity"
|
|
1436
|
+
},
|
|
1437
|
+
"options": {
|
|
1438
|
+
"type": "object",
|
|
1439
|
+
"additionalProperties": false,
|
|
1440
|
+
"properties": {
|
|
1441
|
+
"showTooltips": {
|
|
1442
|
+
"type": "boolean"
|
|
1443
|
+
},
|
|
1444
|
+
"showValueLabels": {
|
|
1445
|
+
"type": "boolean"
|
|
1446
|
+
},
|
|
1447
|
+
"showLogarithmicScale": {
|
|
1448
|
+
"type": "boolean"
|
|
1449
|
+
},
|
|
1450
|
+
"xAxisLabel": {
|
|
1451
|
+
"type": "string",
|
|
1452
|
+
"description": "Category-axis label (vertical orientation; see header)."
|
|
1453
|
+
},
|
|
1454
|
+
"yAxisLabel": {
|
|
1455
|
+
"type": "string",
|
|
1456
|
+
"description": "Value-axis label."
|
|
1457
|
+
},
|
|
1458
|
+
"yAxisRangeMin": {
|
|
1459
|
+
"type": "number",
|
|
1460
|
+
"description": "Value-axis range."
|
|
1461
|
+
},
|
|
1462
|
+
"yAxisRangeMax": {
|
|
1463
|
+
"type": "number"
|
|
1464
|
+
},
|
|
1465
|
+
"reverseXAxis": {
|
|
1466
|
+
"type": "boolean",
|
|
1467
|
+
"description": "Reverse the category order."
|
|
1468
|
+
},
|
|
1469
|
+
"xAxisMaxItems": {
|
|
1470
|
+
"type": "number",
|
|
1471
|
+
"description": "Cap on rendered categories."
|
|
1472
|
+
},
|
|
1473
|
+
"showLegend": {
|
|
1474
|
+
"type": "boolean"
|
|
1475
|
+
},
|
|
1476
|
+
"maxLegendItems": {
|
|
1477
|
+
"type": "number"
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
},
|
|
1481
|
+
"title": {
|
|
1482
|
+
"type": "string"
|
|
1483
|
+
},
|
|
1484
|
+
"description": {
|
|
1485
|
+
"type": "string"
|
|
1486
|
+
},
|
|
1487
|
+
"rows": {
|
|
1488
|
+
"type": "array",
|
|
1489
|
+
"items": {
|
|
1490
|
+
"$ref": "#/$defs/SpecRow"
|
|
1491
|
+
},
|
|
1492
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
1493
|
+
},
|
|
1494
|
+
"loading": {
|
|
1495
|
+
"type": "boolean",
|
|
1496
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
1497
|
+
},
|
|
1498
|
+
"error": {
|
|
1499
|
+
"type": "string",
|
|
1500
|
+
"description": "Render the error state with this message instead of data."
|
|
1501
|
+
}
|
|
1502
|
+
},
|
|
1503
|
+
"required": [
|
|
1504
|
+
"chart",
|
|
1505
|
+
"measures",
|
|
1506
|
+
"xAxis"
|
|
1507
|
+
]
|
|
1508
|
+
},
|
|
1509
|
+
"NativeDataType": {
|
|
1510
|
+
"type": "string",
|
|
1511
|
+
"enum": [
|
|
1512
|
+
"string",
|
|
1513
|
+
"number",
|
|
1514
|
+
"time",
|
|
1515
|
+
"boolean"
|
|
1516
|
+
]
|
|
1517
|
+
},
|
|
1518
|
+
"PieSpec": {
|
|
1519
|
+
"type": "object",
|
|
1520
|
+
"additionalProperties": false,
|
|
1521
|
+
"properties": {
|
|
1522
|
+
"chart": {
|
|
1523
|
+
"type": "string",
|
|
1524
|
+
"enum": [
|
|
1525
|
+
"pie",
|
|
1526
|
+
"donut"
|
|
1527
|
+
]
|
|
1528
|
+
},
|
|
1529
|
+
"dimension": {
|
|
1530
|
+
"$ref": "#/$defs/FieldRef"
|
|
1531
|
+
},
|
|
1532
|
+
"measure": {
|
|
1533
|
+
"$ref": "#/$defs/FieldRef"
|
|
1534
|
+
},
|
|
1535
|
+
"options": {
|
|
1536
|
+
"type": "object",
|
|
1537
|
+
"additionalProperties": false,
|
|
1538
|
+
"properties": {
|
|
1539
|
+
"showTooltips": {
|
|
1540
|
+
"type": "boolean"
|
|
1541
|
+
},
|
|
1542
|
+
"showValueLabels": {
|
|
1543
|
+
"type": "boolean"
|
|
1544
|
+
},
|
|
1545
|
+
"showValueLabelsAsPercentage": {
|
|
1546
|
+
"type": "boolean"
|
|
1547
|
+
},
|
|
1548
|
+
"showLegend": {
|
|
1549
|
+
"type": "boolean"
|
|
1550
|
+
},
|
|
1551
|
+
"maxLegendItems": {
|
|
1552
|
+
"type": "number"
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
},
|
|
1556
|
+
"title": {
|
|
1557
|
+
"type": "string"
|
|
1558
|
+
},
|
|
1559
|
+
"description": {
|
|
1560
|
+
"type": "string"
|
|
1561
|
+
},
|
|
1562
|
+
"rows": {
|
|
1563
|
+
"type": "array",
|
|
1564
|
+
"items": {
|
|
1565
|
+
"$ref": "#/$defs/SpecRow"
|
|
1566
|
+
},
|
|
1567
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
1568
|
+
},
|
|
1569
|
+
"loading": {
|
|
1570
|
+
"type": "boolean",
|
|
1571
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
1572
|
+
},
|
|
1573
|
+
"error": {
|
|
1574
|
+
"type": "string",
|
|
1575
|
+
"description": "Render the error state with this message instead of data."
|
|
1576
|
+
}
|
|
1577
|
+
},
|
|
1578
|
+
"required": [
|
|
1579
|
+
"chart",
|
|
1580
|
+
"dimension",
|
|
1581
|
+
"measure"
|
|
1582
|
+
]
|
|
1583
|
+
},
|
|
1584
|
+
"PivotSpec": {
|
|
1585
|
+
"type": "object",
|
|
1586
|
+
"additionalProperties": false,
|
|
1587
|
+
"properties": {
|
|
1588
|
+
"chart": {
|
|
1589
|
+
"type": "string",
|
|
1590
|
+
"const": "pivot"
|
|
1591
|
+
},
|
|
1592
|
+
"rowDimension": {
|
|
1593
|
+
"$ref": "#/$defs/FieldRef"
|
|
1594
|
+
},
|
|
1595
|
+
"columnDimension": {
|
|
1596
|
+
"$ref": "#/$defs/FieldRef"
|
|
1597
|
+
},
|
|
1598
|
+
"measures": {
|
|
1599
|
+
"anyOf": [
|
|
1600
|
+
{
|
|
1601
|
+
"$ref": "#/$defs/FieldRef"
|
|
1602
|
+
},
|
|
1603
|
+
{
|
|
1604
|
+
"type": "array",
|
|
1605
|
+
"items": {
|
|
1606
|
+
"$ref": "#/$defs/FieldRef"
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
]
|
|
1610
|
+
},
|
|
1611
|
+
"subRowDimension": {
|
|
1612
|
+
"$ref": "#/$defs/FieldRef",
|
|
1613
|
+
"description": "Expandable second row level. Requires `subRows`."
|
|
1614
|
+
},
|
|
1615
|
+
"subRows": {
|
|
1616
|
+
"type": "array",
|
|
1617
|
+
"items": {
|
|
1618
|
+
"$ref": "#/$defs/SpecRow"
|
|
1619
|
+
},
|
|
1620
|
+
"description": "Rows for the sub-row level, long format including the parent row key."
|
|
1621
|
+
},
|
|
1622
|
+
"options": {
|
|
1623
|
+
"type": "object",
|
|
1624
|
+
"properties": {
|
|
1625
|
+
"displayNullAs": {
|
|
1626
|
+
"type": "string"
|
|
1627
|
+
},
|
|
1628
|
+
"columnWidth": {
|
|
1629
|
+
"type": "number"
|
|
1630
|
+
},
|
|
1631
|
+
"firstColumnWidth": {
|
|
1632
|
+
"type": "number"
|
|
1633
|
+
}
|
|
1634
|
+
},
|
|
1635
|
+
"additionalProperties": false
|
|
1636
|
+
},
|
|
1637
|
+
"title": {
|
|
1638
|
+
"type": "string"
|
|
1639
|
+
},
|
|
1640
|
+
"description": {
|
|
1641
|
+
"type": "string"
|
|
1642
|
+
},
|
|
1643
|
+
"rows": {
|
|
1644
|
+
"type": "array",
|
|
1645
|
+
"items": {
|
|
1646
|
+
"$ref": "#/$defs/SpecRow"
|
|
1647
|
+
},
|
|
1648
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
1649
|
+
},
|
|
1650
|
+
"loading": {
|
|
1651
|
+
"type": "boolean",
|
|
1652
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
1653
|
+
},
|
|
1654
|
+
"error": {
|
|
1655
|
+
"type": "string",
|
|
1656
|
+
"description": "Render the error state with this message instead of data."
|
|
1657
|
+
}
|
|
1658
|
+
},
|
|
1659
|
+
"required": [
|
|
1660
|
+
"chart",
|
|
1661
|
+
"columnDimension",
|
|
1662
|
+
"measures",
|
|
1663
|
+
"rowDimension"
|
|
1664
|
+
]
|
|
1665
|
+
},
|
|
1666
|
+
"ScatterSpec": {
|
|
1667
|
+
"type": "object",
|
|
1668
|
+
"additionalProperties": false,
|
|
1669
|
+
"properties": {
|
|
1670
|
+
"chart": {
|
|
1671
|
+
"type": "string",
|
|
1672
|
+
"const": "scatter"
|
|
1673
|
+
},
|
|
1674
|
+
"xMeasure": {
|
|
1675
|
+
"$ref": "#/$defs/FieldRef"
|
|
1676
|
+
},
|
|
1677
|
+
"yMeasure": {
|
|
1678
|
+
"$ref": "#/$defs/FieldRef"
|
|
1679
|
+
},
|
|
1680
|
+
"pointDimension": {
|
|
1681
|
+
"$ref": "#/$defs/FieldRef",
|
|
1682
|
+
"description": "Dimension identifying each point."
|
|
1683
|
+
},
|
|
1684
|
+
"groupByDimension": {
|
|
1685
|
+
"$ref": "#/$defs/FieldRef",
|
|
1686
|
+
"description": "Optional dimension that colors points by group."
|
|
1687
|
+
},
|
|
1688
|
+
"options": {
|
|
1689
|
+
"type": "object",
|
|
1690
|
+
"additionalProperties": false,
|
|
1691
|
+
"properties": {
|
|
1692
|
+
"showTooltips": {
|
|
1693
|
+
"type": "boolean"
|
|
1694
|
+
},
|
|
1695
|
+
"showPointLabels": {
|
|
1696
|
+
"type": "boolean",
|
|
1697
|
+
"description": "Label each point with its dimension value."
|
|
1698
|
+
},
|
|
1699
|
+
"showValueLabels": {
|
|
1700
|
+
"type": "boolean"
|
|
1701
|
+
},
|
|
1702
|
+
"showLogarithmicScale": {
|
|
1703
|
+
"type": "boolean"
|
|
1704
|
+
},
|
|
1705
|
+
"xAxisLabel": {
|
|
1706
|
+
"type": "string"
|
|
1707
|
+
},
|
|
1708
|
+
"yAxisLabel": {
|
|
1709
|
+
"type": "string"
|
|
1710
|
+
},
|
|
1711
|
+
"xAxisRangeMin": {
|
|
1712
|
+
"type": "number"
|
|
1713
|
+
},
|
|
1714
|
+
"xAxisRangeMax": {
|
|
1715
|
+
"type": "number"
|
|
1716
|
+
},
|
|
1717
|
+
"yAxisRangeMin": {
|
|
1718
|
+
"type": "number"
|
|
1719
|
+
},
|
|
1720
|
+
"yAxisRangeMax": {
|
|
1721
|
+
"type": "number"
|
|
1722
|
+
},
|
|
1723
|
+
"reverseXAxis": {
|
|
1724
|
+
"type": "boolean"
|
|
1725
|
+
},
|
|
1726
|
+
"pointColor": {
|
|
1727
|
+
"type": "string",
|
|
1728
|
+
"description": "CSS color for ungrouped points."
|
|
1729
|
+
},
|
|
1730
|
+
"showLegend": {
|
|
1731
|
+
"type": "boolean"
|
|
1732
|
+
},
|
|
1733
|
+
"maxLegendItems": {
|
|
1734
|
+
"type": "number"
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
},
|
|
1738
|
+
"title": {
|
|
1739
|
+
"type": "string"
|
|
1740
|
+
},
|
|
1741
|
+
"description": {
|
|
1742
|
+
"type": "string"
|
|
1743
|
+
},
|
|
1744
|
+
"rows": {
|
|
1745
|
+
"type": "array",
|
|
1746
|
+
"items": {
|
|
1747
|
+
"$ref": "#/$defs/SpecRow"
|
|
1748
|
+
},
|
|
1749
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
1750
|
+
},
|
|
1751
|
+
"loading": {
|
|
1752
|
+
"type": "boolean",
|
|
1753
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
1754
|
+
},
|
|
1755
|
+
"error": {
|
|
1756
|
+
"type": "string",
|
|
1757
|
+
"description": "Render the error state with this message instead of data."
|
|
1758
|
+
}
|
|
1759
|
+
},
|
|
1760
|
+
"required": [
|
|
1761
|
+
"chart",
|
|
1762
|
+
"pointDimension",
|
|
1763
|
+
"xMeasure",
|
|
1764
|
+
"yMeasure"
|
|
1765
|
+
]
|
|
1766
|
+
},
|
|
1767
|
+
"SpecField": {
|
|
1768
|
+
"type": "object",
|
|
1769
|
+
"properties": {
|
|
1770
|
+
"name": {
|
|
1771
|
+
"type": "string",
|
|
1772
|
+
"description": "Row key: values are read from `rows[i][name]`."
|
|
1773
|
+
},
|
|
1774
|
+
"title": {
|
|
1775
|
+
"type": "string",
|
|
1776
|
+
"description": "Display name. Defaults to `name`."
|
|
1777
|
+
},
|
|
1778
|
+
"type": {
|
|
1779
|
+
"$ref": "#/$defs/NativeDataType",
|
|
1780
|
+
"description": "Inferred from the row values when omitted."
|
|
1781
|
+
},
|
|
1782
|
+
"role": {
|
|
1783
|
+
"type": "string",
|
|
1784
|
+
"enum": [
|
|
1785
|
+
"dimension",
|
|
1786
|
+
"measure"
|
|
1787
|
+
],
|
|
1788
|
+
"description": "Only meaningful where a chart takes mixed columns (`table`): whether the field is a category (`dimension`) or a numeric value (`measure`). Inferred from `type`/row values when omitted."
|
|
1789
|
+
},
|
|
1790
|
+
"format": {
|
|
1791
|
+
"$ref": "#/$defs/SpecFieldFormat"
|
|
1792
|
+
}
|
|
1793
|
+
},
|
|
1794
|
+
"required": [
|
|
1795
|
+
"name"
|
|
1796
|
+
],
|
|
1797
|
+
"additionalProperties": false
|
|
1798
|
+
},
|
|
1799
|
+
"SpecFieldFormat": {
|
|
1800
|
+
"type": "object",
|
|
1801
|
+
"properties": {
|
|
1802
|
+
"prefix": {
|
|
1803
|
+
"type": "string",
|
|
1804
|
+
"description": "Prefix."
|
|
1805
|
+
},
|
|
1806
|
+
"suffix": {
|
|
1807
|
+
"type": "string",
|
|
1808
|
+
"description": "Suffix."
|
|
1809
|
+
},
|
|
1810
|
+
"displayName": {
|
|
1811
|
+
"type": "string",
|
|
1812
|
+
"description": "Display name."
|
|
1813
|
+
},
|
|
1814
|
+
"maxCharacters": {
|
|
1815
|
+
"type": "number",
|
|
1816
|
+
"description": "Maximum characters. Applies to string fields."
|
|
1817
|
+
},
|
|
1818
|
+
"decimalPlaces": {
|
|
1819
|
+
"type": "number",
|
|
1820
|
+
"description": "Decimal places. Applies to number fields."
|
|
1821
|
+
},
|
|
1822
|
+
"currency": {
|
|
1823
|
+
"type": "string",
|
|
1824
|
+
"description": "Currency. e.g. EUR. Applies to number fields."
|
|
1825
|
+
},
|
|
1826
|
+
"abbreviateLargeNumber": {
|
|
1827
|
+
"type": "boolean",
|
|
1828
|
+
"description": "Abbreviate large number. Applies to number fields."
|
|
1829
|
+
},
|
|
1830
|
+
"color": {
|
|
1831
|
+
"type": "string",
|
|
1832
|
+
"description": "Color."
|
|
1833
|
+
},
|
|
1834
|
+
"showValueAsPercentage": {
|
|
1835
|
+
"type": "boolean",
|
|
1836
|
+
"description": "Show values as percentage."
|
|
1837
|
+
},
|
|
1838
|
+
"ignoreEmptyDate": {
|
|
1839
|
+
"type": "boolean",
|
|
1840
|
+
"description": "Ignore empty dates. When enabled, dates with no data will be omitted instead of shown as empty. Applies to time fields."
|
|
1841
|
+
},
|
|
1842
|
+
"lineColor": {
|
|
1843
|
+
"type": "string",
|
|
1844
|
+
"description": "Line color."
|
|
1845
|
+
},
|
|
1846
|
+
"dashedLine": {
|
|
1847
|
+
"type": "boolean",
|
|
1848
|
+
"description": "Dashed line."
|
|
1849
|
+
},
|
|
1850
|
+
"connectGaps": {
|
|
1851
|
+
"type": "boolean",
|
|
1852
|
+
"description": "Connect gaps."
|
|
1853
|
+
},
|
|
1854
|
+
"fillUnderLine": {
|
|
1855
|
+
"type": "boolean",
|
|
1856
|
+
"description": "Fill under line."
|
|
1857
|
+
},
|
|
1858
|
+
"useSecondaryAxis": {
|
|
1859
|
+
"type": "boolean",
|
|
1860
|
+
"description": "Assign to secondary axis."
|
|
1861
|
+
},
|
|
1862
|
+
"previousLineColor": {
|
|
1863
|
+
"type": "string",
|
|
1864
|
+
"description": "Previous line color."
|
|
1865
|
+
},
|
|
1866
|
+
"lineDashed": {
|
|
1867
|
+
"type": "boolean",
|
|
1868
|
+
"description": "Primary line dashed."
|
|
1869
|
+
},
|
|
1870
|
+
"previousLineDashed": {
|
|
1871
|
+
"type": "boolean",
|
|
1872
|
+
"description": "Compared line dashed."
|
|
1873
|
+
},
|
|
1874
|
+
"invertChangeColors": {
|
|
1875
|
+
"type": "boolean",
|
|
1876
|
+
"description": "Reverse positive/negative colors."
|
|
1877
|
+
},
|
|
1878
|
+
"reverseTrendDirection": {
|
|
1879
|
+
"type": "boolean",
|
|
1880
|
+
"description": 'Reverse trend direction. Reverses the up/down trend arrow independently of "Reverse positive/negative colors" above. Existing dashboards keep their current look until this is changed explicitly.'
|
|
1881
|
+
},
|
|
1882
|
+
"displayChangeAsPercentage": {
|
|
1883
|
+
"type": "boolean",
|
|
1884
|
+
"description": "Display change as %."
|
|
1885
|
+
},
|
|
1886
|
+
"percentageDecimalPlaces": {
|
|
1887
|
+
"type": "number",
|
|
1888
|
+
"description": "Percentage decimal places."
|
|
1889
|
+
},
|
|
1890
|
+
"columnAggregation": {
|
|
1891
|
+
"type": "array",
|
|
1892
|
+
"items": {
|
|
1893
|
+
"type": "string",
|
|
1894
|
+
"enum": [
|
|
1895
|
+
"sum",
|
|
1896
|
+
"min",
|
|
1897
|
+
"max",
|
|
1898
|
+
"average"
|
|
1899
|
+
]
|
|
1900
|
+
},
|
|
1901
|
+
"description": "Show column calculation."
|
|
1902
|
+
},
|
|
1903
|
+
"rowAggregation": {
|
|
1904
|
+
"type": "array",
|
|
1905
|
+
"items": {
|
|
1906
|
+
"type": "string",
|
|
1907
|
+
"enum": [
|
|
1908
|
+
"sum",
|
|
1909
|
+
"min",
|
|
1910
|
+
"max",
|
|
1911
|
+
"average"
|
|
1912
|
+
]
|
|
1913
|
+
},
|
|
1914
|
+
"description": "Show row calculation."
|
|
1915
|
+
},
|
|
1916
|
+
"showAsPercentage": {
|
|
1917
|
+
"type": "boolean",
|
|
1918
|
+
"description": "Show as percentage. If turned on, other measures may be ignored."
|
|
1919
|
+
},
|
|
1920
|
+
"width": {
|
|
1921
|
+
"type": "number",
|
|
1922
|
+
"description": "Width. You can input a number in pixels e.g. 400."
|
|
1923
|
+
},
|
|
1924
|
+
"align": {
|
|
1925
|
+
"type": "string",
|
|
1926
|
+
"enum": [
|
|
1927
|
+
"left",
|
|
1928
|
+
"center",
|
|
1929
|
+
"right"
|
|
1930
|
+
],
|
|
1931
|
+
"description": "Align."
|
|
1932
|
+
},
|
|
1933
|
+
"tableCellStyle": {
|
|
1934
|
+
"type": "string",
|
|
1935
|
+
"enum": [
|
|
1936
|
+
"Bold",
|
|
1937
|
+
"Italic",
|
|
1938
|
+
"Positive vs Negative"
|
|
1939
|
+
],
|
|
1940
|
+
"description": "Table cell style."
|
|
1941
|
+
},
|
|
1942
|
+
"displayFormat": {
|
|
1943
|
+
"type": "string",
|
|
1944
|
+
"enum": [
|
|
1945
|
+
"Markdown",
|
|
1946
|
+
"Json"
|
|
1947
|
+
],
|
|
1948
|
+
"description": "Display format."
|
|
1949
|
+
},
|
|
1950
|
+
"displayNullAs": {
|
|
1951
|
+
"type": "string",
|
|
1952
|
+
"description": "Rendered in place of null/undefined values."
|
|
1953
|
+
}
|
|
1954
|
+
},
|
|
1955
|
+
"additionalProperties": false,
|
|
1956
|
+
"description": "Per-field options, applied via the field's `inputs`: formatting (prefix, suffix, decimalPlaces, …) plus chart-specific ones such as a pivot table's columnAggregation/rowAggregation. Time-axis settings live on the chart."
|
|
1957
|
+
},
|
|
1958
|
+
"SpecRow": {
|
|
1959
|
+
"type": "object",
|
|
1960
|
+
"additionalProperties": {}
|
|
1961
|
+
},
|
|
1962
|
+
"TableSpec": {
|
|
1963
|
+
"type": "object",
|
|
1964
|
+
"additionalProperties": false,
|
|
1965
|
+
"properties": {
|
|
1966
|
+
"chart": {
|
|
1967
|
+
"type": "string",
|
|
1968
|
+
"const": "table"
|
|
1969
|
+
},
|
|
1970
|
+
"columns": {
|
|
1971
|
+
"type": "array",
|
|
1972
|
+
"items": {
|
|
1973
|
+
"$ref": "#/$defs/FieldRef"
|
|
1974
|
+
},
|
|
1975
|
+
"description": "Columns, in display order. `role` disambiguates dimension vs measure."
|
|
1976
|
+
},
|
|
1977
|
+
"options": {
|
|
1978
|
+
"type": "object",
|
|
1979
|
+
"properties": {
|
|
1980
|
+
"showIndex": {
|
|
1981
|
+
"type": "boolean",
|
|
1982
|
+
"description": "Number the rows."
|
|
1983
|
+
},
|
|
1984
|
+
"displayNullAs": {
|
|
1985
|
+
"type": "string"
|
|
1986
|
+
}
|
|
1987
|
+
},
|
|
1988
|
+
"additionalProperties": false
|
|
1989
|
+
},
|
|
1990
|
+
"title": {
|
|
1991
|
+
"type": "string"
|
|
1992
|
+
},
|
|
1993
|
+
"description": {
|
|
1994
|
+
"type": "string"
|
|
1995
|
+
},
|
|
1996
|
+
"rows": {
|
|
1997
|
+
"type": "array",
|
|
1998
|
+
"items": {
|
|
1999
|
+
"$ref": "#/$defs/SpecRow"
|
|
2000
|
+
},
|
|
2001
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
2002
|
+
},
|
|
2003
|
+
"loading": {
|
|
2004
|
+
"type": "boolean",
|
|
2005
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
2006
|
+
},
|
|
2007
|
+
"error": {
|
|
2008
|
+
"type": "string",
|
|
2009
|
+
"description": "Render the error state with this message instead of data."
|
|
2010
|
+
}
|
|
2011
|
+
},
|
|
2012
|
+
"required": [
|
|
2013
|
+
"chart",
|
|
2014
|
+
"columns"
|
|
2015
|
+
]
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
};
|
|
2019
|
+
const chartSpecToolSchema = {
|
|
2020
|
+
"type": "object",
|
|
2021
|
+
"description": "A chart to render. `chart` selects the kind and which other fields apply. A field (`dimension`, `measure`, `measures`, `xAxis`, ...) is a bare row-key string or a { name, ... } object. Options use vertical orientation for every kind: `xAxis`/`xAxisLabel` is the category axis and `yAxisRange*` the value range, even for horizontal variants. Set `granularity` on the chart, never on a field, when the category axis is a time field. `rows` is long format with zone-less ISO time strings.\nFields by chart kind (every kind also accepts options, title, description, rows, loading, error):\nbar, barHorizontal: dimension, measures (optional: granularity)\nbarGrouped, barGroupedHorizontal, barStacked, barStackedHorizontal: xAxis, groupBy, measure (optional: granularity)\nline: xAxis, measures (optional: granularity)\nlineGrouped: xAxis, groupBy, measure (optional: granularity)\nlineWithKpiTabs: xAxis, measures (optional: kpiRows, granularity)\nlineComparison: xAxis, measures (optional: comparisonRows, comparisonLabel, dateRange, comparisonDateRange, granularity)\nlineComparisonWithKpiTabs: xAxis, measures (optional: comparisonRows, kpiRows, kpiComparisonRows, comparisonLabel, dateRange, comparisonDateRange, granularity)\narea: xAxis, measure (optional: groupBy, granularity)\nbarLine: dimension, barMeasures (optional: lineMeasures, granularity)\npie, donut: dimension, measure\ndonutLabel: dimension, measure (optional: innerLabel)\nscatter: xMeasure, yMeasure, pointDimension (optional: groupByDimension)\nbubble: xMeasure, yMeasure, bubbleSizeMeasure, pointDimension (optional: groupByDimension)\nkpi: measure (optional: value)\nkpiComparison: measure (optional: value, comparisonValue, comparisonRows, comparisonLabel, dateRange, comparisonDateRange)\ntable: columns\nheatmap: rowDimension, columnDimension, measure\npivot: rowDimension, columnDimension, measures (optional: subRowDimension, subRows)",
|
|
2022
|
+
"properties": {
|
|
2023
|
+
"chart": {
|
|
2024
|
+
"type": "string",
|
|
2025
|
+
"enum": [
|
|
2026
|
+
"bar",
|
|
2027
|
+
"barHorizontal",
|
|
2028
|
+
"barGrouped",
|
|
2029
|
+
"barGroupedHorizontal",
|
|
2030
|
+
"barStacked",
|
|
2031
|
+
"barStackedHorizontal",
|
|
2032
|
+
"line",
|
|
2033
|
+
"lineGrouped",
|
|
2034
|
+
"lineWithKpiTabs",
|
|
2035
|
+
"lineComparison",
|
|
2036
|
+
"lineComparisonWithKpiTabs",
|
|
2037
|
+
"area",
|
|
2038
|
+
"barLine",
|
|
2039
|
+
"pie",
|
|
2040
|
+
"donut",
|
|
2041
|
+
"donutLabel",
|
|
2042
|
+
"scatter",
|
|
2043
|
+
"bubble",
|
|
2044
|
+
"kpi",
|
|
2045
|
+
"kpiComparison",
|
|
2046
|
+
"table",
|
|
2047
|
+
"heatmap",
|
|
2048
|
+
"pivot"
|
|
2049
|
+
],
|
|
2050
|
+
"description": "Chart kind. Selects which of the other fields apply (see the root description)."
|
|
2051
|
+
},
|
|
2052
|
+
"title": {
|
|
2053
|
+
"type": "string"
|
|
2054
|
+
},
|
|
2055
|
+
"description": {
|
|
2056
|
+
"type": "string"
|
|
2057
|
+
},
|
|
2058
|
+
"rows": {
|
|
2059
|
+
"type": "array",
|
|
2060
|
+
"items": {
|
|
2061
|
+
"$ref": "#/$defs/SpecRow"
|
|
2062
|
+
},
|
|
2063
|
+
"description": "The data, long format: one row per category (× group) combination. Omit while loading. Time values are zone-less ISO strings — the renderer also accepts `YYYY-MM-DD` and epoch milliseconds and normalizes."
|
|
2064
|
+
},
|
|
2065
|
+
"loading": {
|
|
2066
|
+
"type": "boolean",
|
|
2067
|
+
"description": "Force the loading state, e.g. while more rows stream in."
|
|
2068
|
+
},
|
|
2069
|
+
"error": {
|
|
2070
|
+
"type": "string",
|
|
2071
|
+
"description": "Render the error state with this message instead of data."
|
|
2072
|
+
},
|
|
2073
|
+
"dimension": {
|
|
2074
|
+
"$ref": "#/$defs/FieldRef",
|
|
2075
|
+
"description": "Category dimension."
|
|
2076
|
+
},
|
|
2077
|
+
"measures": {
|
|
2078
|
+
"anyOf": [
|
|
2079
|
+
{
|
|
2080
|
+
"$ref": "#/$defs/FieldRef"
|
|
2081
|
+
},
|
|
2082
|
+
{
|
|
2083
|
+
"type": "array",
|
|
2084
|
+
"items": {
|
|
2085
|
+
"$ref": "#/$defs/FieldRef"
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
2088
|
+
],
|
|
2089
|
+
"description": "`bar`, `barHorizontal`: One measure per bar series. `line`: One measure per line. `lineWithKpiTabs`: One measure per KPI tab; each tab plots its measure as the line."
|
|
2090
|
+
},
|
|
2091
|
+
"granularity": {
|
|
2092
|
+
"$ref": "#/$defs/Granularity",
|
|
2093
|
+
"description": "`bar`, `barHorizontal`: When `dimension` is a time field: its bucket size. `barGrouped`, `barGroupedHorizontal`, `barStacked`, `barStackedHorizontal`, `line`: When `xAxis` is a time field: its bucket size."
|
|
2094
|
+
},
|
|
2095
|
+
"options": {
|
|
2096
|
+
"type": "object",
|
|
2097
|
+
"additionalProperties": false,
|
|
2098
|
+
"properties": {
|
|
2099
|
+
"showTooltips": {
|
|
2100
|
+
"type": "boolean"
|
|
2101
|
+
},
|
|
2102
|
+
"showValueLabels": {
|
|
2103
|
+
"type": "boolean"
|
|
2104
|
+
},
|
|
2105
|
+
"showLogarithmicScale": {
|
|
2106
|
+
"type": "boolean"
|
|
2107
|
+
},
|
|
2108
|
+
"xAxisLabel": {
|
|
2109
|
+
"type": "string",
|
|
2110
|
+
"description": "Category-axis label (vertical orientation; see header)."
|
|
2111
|
+
},
|
|
2112
|
+
"yAxisLabel": {
|
|
2113
|
+
"type": "string",
|
|
2114
|
+
"description": "Value-axis label."
|
|
2115
|
+
},
|
|
2116
|
+
"yAxisRangeMin": {
|
|
2117
|
+
"type": "number",
|
|
2118
|
+
"description": "Value-axis range."
|
|
2119
|
+
},
|
|
2120
|
+
"yAxisRangeMax": {
|
|
2121
|
+
"type": "number"
|
|
2122
|
+
},
|
|
2123
|
+
"reverseXAxis": {
|
|
2124
|
+
"type": "boolean",
|
|
2125
|
+
"description": "Reverse the category order."
|
|
2126
|
+
},
|
|
2127
|
+
"xAxisMaxItems": {
|
|
2128
|
+
"type": "number",
|
|
2129
|
+
"description": "Cap on rendered categories."
|
|
2130
|
+
},
|
|
2131
|
+
"showLegend": {
|
|
2132
|
+
"type": "boolean"
|
|
2133
|
+
},
|
|
2134
|
+
"maxLegendItems": {
|
|
2135
|
+
"type": "number"
|
|
2136
|
+
},
|
|
2137
|
+
"showTotalLabels": {
|
|
2138
|
+
"type": "boolean"
|
|
2139
|
+
},
|
|
2140
|
+
"showComparisonAxis": {
|
|
2141
|
+
"type": "boolean",
|
|
2142
|
+
"description": "Second x-axis showing the comparison period's dates."
|
|
2143
|
+
},
|
|
2144
|
+
"showValueLabelsLine": {
|
|
2145
|
+
"type": "boolean"
|
|
2146
|
+
},
|
|
2147
|
+
"yAxisSecondaryLabel": {
|
|
2148
|
+
"type": "string",
|
|
2149
|
+
"description": "Right (line) axis."
|
|
2150
|
+
},
|
|
2151
|
+
"yAxisSecondaryMin": {
|
|
2152
|
+
"type": "number"
|
|
2153
|
+
},
|
|
2154
|
+
"yAxisSecondaryMax": {
|
|
2155
|
+
"type": "number"
|
|
2156
|
+
},
|
|
2157
|
+
"showValueLabelsAsPercentage": {
|
|
2158
|
+
"type": "boolean"
|
|
2159
|
+
},
|
|
2160
|
+
"showPointLabels": {
|
|
2161
|
+
"type": "boolean",
|
|
2162
|
+
"description": "Label each point with its dimension value."
|
|
2163
|
+
},
|
|
2164
|
+
"xAxisRangeMin": {
|
|
2165
|
+
"type": "number"
|
|
2166
|
+
},
|
|
2167
|
+
"xAxisRangeMax": {
|
|
2168
|
+
"type": "number"
|
|
2169
|
+
},
|
|
2170
|
+
"pointColor": {
|
|
2171
|
+
"type": "string",
|
|
2172
|
+
"description": "CSS color for ungrouped points."
|
|
2173
|
+
},
|
|
2174
|
+
"bubbleRadiusMin": {
|
|
2175
|
+
"type": "number"
|
|
2176
|
+
},
|
|
2177
|
+
"bubbleRadiusMax": {
|
|
2178
|
+
"type": "number"
|
|
2179
|
+
},
|
|
2180
|
+
"fontSize": {
|
|
2181
|
+
"type": "number"
|
|
2182
|
+
},
|
|
2183
|
+
"displayNullAs": {
|
|
2184
|
+
"type": "string"
|
|
2185
|
+
},
|
|
2186
|
+
"changeFontSize": {
|
|
2187
|
+
"type": "number"
|
|
2188
|
+
},
|
|
2189
|
+
"displayChangeAsPercentage": {
|
|
2190
|
+
"type": "boolean"
|
|
2191
|
+
},
|
|
2192
|
+
"reversePositiveNegativeColors": {
|
|
2193
|
+
"type": "boolean",
|
|
2194
|
+
"description": "When a decrease is good (costs, churn)."
|
|
2195
|
+
},
|
|
2196
|
+
"percentageDecimalPlaces": {
|
|
2197
|
+
"type": "number"
|
|
2198
|
+
},
|
|
2199
|
+
"showIndex": {
|
|
2200
|
+
"type": "boolean",
|
|
2201
|
+
"description": "Number the rows."
|
|
2202
|
+
},
|
|
2203
|
+
"showValues": {
|
|
2204
|
+
"type": "boolean",
|
|
2205
|
+
"description": "Print the measure value in each cell."
|
|
2206
|
+
},
|
|
2207
|
+
"minColor": {
|
|
2208
|
+
"type": "string",
|
|
2209
|
+
"description": "CSS colors for the value scale."
|
|
2210
|
+
},
|
|
2211
|
+
"midColor": {
|
|
2212
|
+
"type": "string"
|
|
2213
|
+
},
|
|
2214
|
+
"maxColor": {
|
|
2215
|
+
"type": "string"
|
|
2216
|
+
},
|
|
2217
|
+
"minThreshold": {
|
|
2218
|
+
"type": "string",
|
|
2219
|
+
"description": "Values at/below this render as minColor."
|
|
2220
|
+
},
|
|
2221
|
+
"maxThreshold": {
|
|
2222
|
+
"type": "string",
|
|
2223
|
+
"description": "Values at/above this render as maxColor."
|
|
2224
|
+
},
|
|
2225
|
+
"columnWidth": {
|
|
2226
|
+
"type": "number"
|
|
2227
|
+
},
|
|
2228
|
+
"firstColumnWidth": {
|
|
2229
|
+
"type": "number"
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
},
|
|
2233
|
+
"xAxis": {
|
|
2234
|
+
"$ref": "#/$defs/FieldRef",
|
|
2235
|
+
"description": "Category axis dimension (renders on y for horizontal variants)."
|
|
2236
|
+
},
|
|
2237
|
+
"groupBy": {
|
|
2238
|
+
"$ref": "#/$defs/FieldRef",
|
|
2239
|
+
"description": "`barGrouped`, `barGroupedHorizontal`, `barStacked`, `barStackedHorizontal`: Dimension that splits each category into grouped/stacked bars. `lineGrouped`: Dimension that splits the measure into one line per value. `area`: Stacking dimension. Omit for a single-series area."
|
|
2240
|
+
},
|
|
2241
|
+
"measure": {
|
|
2242
|
+
"$ref": "#/$defs/FieldRef"
|
|
2243
|
+
},
|
|
2244
|
+
"kpiRows": {
|
|
2245
|
+
"type": "array",
|
|
2246
|
+
"items": {
|
|
2247
|
+
"$ref": "#/$defs/SpecRow"
|
|
2248
|
+
},
|
|
2249
|
+
"description": "`lineWithKpiTabs`: One row holding each measure's headline number for the tabs. Derived by summing `rows` when omitted. `lineComparisonWithKpiTabs`: See LineWithKpiTabsSpec.kpiRows; derived from `rows` when omitted."
|
|
2250
|
+
},
|
|
2251
|
+
"comparisonRows": {
|
|
2252
|
+
"type": "array",
|
|
2253
|
+
"items": {
|
|
2254
|
+
"$ref": "#/$defs/SpecRow"
|
|
2255
|
+
},
|
|
2256
|
+
"description": "`lineComparison`: Rows for the comparison period, same shape as `rows`; aligned by position. `kpiComparison`: Rows for the comparison period, same shape as `rows`."
|
|
2257
|
+
},
|
|
2258
|
+
"comparisonLabel": {
|
|
2259
|
+
"type": "string",
|
|
2260
|
+
"description": "Label for the comparison, e.g. 'Previous period'."
|
|
2261
|
+
},
|
|
2262
|
+
"dateRange": {
|
|
2263
|
+
"$ref": "#/$defs/DateRangeSpec",
|
|
2264
|
+
"description": "`lineComparison`: Periods covered; derived from each row set's time extent when omitted. `kpiComparison`: Period the main value covers."
|
|
2265
|
+
},
|
|
2266
|
+
"comparisonDateRange": {
|
|
2267
|
+
"$ref": "#/$defs/DateRangeSpec",
|
|
2268
|
+
"description": "Period the comparison value covers."
|
|
2269
|
+
},
|
|
2270
|
+
"kpiComparisonRows": {
|
|
2271
|
+
"type": "array",
|
|
2272
|
+
"items": {
|
|
2273
|
+
"$ref": "#/$defs/SpecRow"
|
|
2274
|
+
},
|
|
2275
|
+
"description": "Headline numbers for the comparison period; derived from `comparisonRows`."
|
|
2276
|
+
},
|
|
2277
|
+
"barMeasures": {
|
|
2278
|
+
"anyOf": [
|
|
2279
|
+
{
|
|
2280
|
+
"$ref": "#/$defs/FieldRef"
|
|
2281
|
+
},
|
|
2282
|
+
{
|
|
2283
|
+
"type": "array",
|
|
2284
|
+
"items": {
|
|
2285
|
+
"$ref": "#/$defs/FieldRef"
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
],
|
|
2289
|
+
"description": "Measures drawn as bars (left axis)."
|
|
2290
|
+
},
|
|
2291
|
+
"lineMeasures": {
|
|
2292
|
+
"anyOf": [
|
|
2293
|
+
{
|
|
2294
|
+
"$ref": "#/$defs/FieldRef"
|
|
2295
|
+
},
|
|
2296
|
+
{
|
|
2297
|
+
"type": "array",
|
|
2298
|
+
"items": {
|
|
2299
|
+
"$ref": "#/$defs/FieldRef"
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
],
|
|
2303
|
+
"description": "Measures drawn as lines (right axis)."
|
|
2304
|
+
},
|
|
2305
|
+
"innerLabel": {
|
|
2306
|
+
"type": "object",
|
|
2307
|
+
"properties": {
|
|
2308
|
+
"text": {
|
|
2309
|
+
"type": "string"
|
|
2310
|
+
},
|
|
2311
|
+
"measure": {
|
|
2312
|
+
"$ref": "#/$defs/FieldRef"
|
|
2313
|
+
},
|
|
2314
|
+
"value": {
|
|
2315
|
+
"type": [
|
|
2316
|
+
"number",
|
|
2317
|
+
"string"
|
|
2318
|
+
]
|
|
2319
|
+
}
|
|
2320
|
+
},
|
|
2321
|
+
"additionalProperties": false,
|
|
2322
|
+
"description": "The headline number in the donut's center. Omitted fields are derived: `measure` defaults to the main measure, `value` to the sum of the rows."
|
|
2323
|
+
},
|
|
2324
|
+
"xMeasure": {
|
|
2325
|
+
"$ref": "#/$defs/FieldRef"
|
|
2326
|
+
},
|
|
2327
|
+
"yMeasure": {
|
|
2328
|
+
"$ref": "#/$defs/FieldRef"
|
|
2329
|
+
},
|
|
2330
|
+
"pointDimension": {
|
|
2331
|
+
"$ref": "#/$defs/FieldRef",
|
|
2332
|
+
"description": "Dimension identifying each point."
|
|
2333
|
+
},
|
|
2334
|
+
"groupByDimension": {
|
|
2335
|
+
"$ref": "#/$defs/FieldRef",
|
|
2336
|
+
"description": "Optional dimension that colors points by group."
|
|
2337
|
+
},
|
|
2338
|
+
"bubbleSizeMeasure": {
|
|
2339
|
+
"$ref": "#/$defs/FieldRef"
|
|
2340
|
+
},
|
|
2341
|
+
"value": {
|
|
2342
|
+
"type": [
|
|
2343
|
+
"number",
|
|
2344
|
+
"string"
|
|
2345
|
+
],
|
|
2346
|
+
"description": "`kpi`: Shortcut for `rows: [{ [measure.name]: value }]`. Ignored when `rows` is set. `kpiComparison`: Shortcut for `rows`; see KpiSpec.value."
|
|
2347
|
+
},
|
|
2348
|
+
"comparisonValue": {
|
|
2349
|
+
"type": [
|
|
2350
|
+
"number",
|
|
2351
|
+
"string"
|
|
2352
|
+
],
|
|
2353
|
+
"description": "The value compared against. Shortcut for `comparisonRows`."
|
|
2354
|
+
},
|
|
2355
|
+
"columns": {
|
|
2356
|
+
"type": "array",
|
|
2357
|
+
"items": {
|
|
2358
|
+
"$ref": "#/$defs/FieldRef"
|
|
2359
|
+
},
|
|
2360
|
+
"description": "Columns, in display order. `role` disambiguates dimension vs measure."
|
|
2361
|
+
},
|
|
2362
|
+
"rowDimension": {
|
|
2363
|
+
"$ref": "#/$defs/FieldRef"
|
|
2364
|
+
},
|
|
2365
|
+
"columnDimension": {
|
|
2366
|
+
"$ref": "#/$defs/FieldRef"
|
|
2367
|
+
},
|
|
2368
|
+
"subRowDimension": {
|
|
2369
|
+
"$ref": "#/$defs/FieldRef",
|
|
2370
|
+
"description": "Expandable second row level. Requires `subRows`."
|
|
2371
|
+
},
|
|
2372
|
+
"subRows": {
|
|
2373
|
+
"type": "array",
|
|
2374
|
+
"items": {
|
|
2375
|
+
"$ref": "#/$defs/SpecRow"
|
|
2376
|
+
},
|
|
2377
|
+
"description": "Rows for the sub-row level, long format including the parent row key."
|
|
2378
|
+
}
|
|
2379
|
+
},
|
|
2380
|
+
"required": [
|
|
2381
|
+
"chart"
|
|
2382
|
+
],
|
|
2383
|
+
"additionalProperties": false,
|
|
2384
|
+
"$defs": {
|
|
2385
|
+
"DateRangeSpec": {
|
|
2386
|
+
"type": "object",
|
|
2387
|
+
"properties": {
|
|
2388
|
+
"from": {
|
|
2389
|
+
"type": "string"
|
|
2390
|
+
},
|
|
2391
|
+
"to": {
|
|
2392
|
+
"type": "string"
|
|
2393
|
+
}
|
|
2394
|
+
},
|
|
2395
|
+
"additionalProperties": false,
|
|
2396
|
+
"description": "ISO date strings (`YYYY-MM-DD` or full timestamps), no zone suffix."
|
|
2397
|
+
},
|
|
2398
|
+
"FieldRef": {
|
|
2399
|
+
"anyOf": [
|
|
2400
|
+
{
|
|
2401
|
+
"type": "string"
|
|
2402
|
+
},
|
|
2403
|
+
{
|
|
2404
|
+
"$ref": "#/$defs/SpecField"
|
|
2405
|
+
}
|
|
2406
|
+
],
|
|
2407
|
+
"description": "A field is a bare row-key string or a full descriptor."
|
|
2408
|
+
},
|
|
2409
|
+
"Granularity": {
|
|
2410
|
+
"type": "string",
|
|
2411
|
+
"enum": [
|
|
2412
|
+
"second",
|
|
2413
|
+
"minute",
|
|
2414
|
+
"hour",
|
|
2415
|
+
"day",
|
|
2416
|
+
"week",
|
|
2417
|
+
"month",
|
|
2418
|
+
"quarter",
|
|
2419
|
+
"year"
|
|
2420
|
+
]
|
|
2421
|
+
},
|
|
2422
|
+
"NativeDataType": {
|
|
2423
|
+
"type": "string",
|
|
2424
|
+
"enum": [
|
|
2425
|
+
"string",
|
|
2426
|
+
"number",
|
|
2427
|
+
"time",
|
|
2428
|
+
"boolean"
|
|
2429
|
+
]
|
|
2430
|
+
},
|
|
2431
|
+
"SpecField": {
|
|
2432
|
+
"type": "object",
|
|
2433
|
+
"properties": {
|
|
2434
|
+
"name": {
|
|
2435
|
+
"type": "string",
|
|
2436
|
+
"description": "Row key: values are read from `rows[i][name]`."
|
|
2437
|
+
},
|
|
2438
|
+
"title": {
|
|
2439
|
+
"type": "string",
|
|
2440
|
+
"description": "Display name. Defaults to `name`."
|
|
2441
|
+
},
|
|
2442
|
+
"type": {
|
|
2443
|
+
"$ref": "#/$defs/NativeDataType",
|
|
2444
|
+
"description": "Inferred from the row values when omitted."
|
|
2445
|
+
},
|
|
2446
|
+
"role": {
|
|
2447
|
+
"type": "string",
|
|
2448
|
+
"enum": [
|
|
2449
|
+
"dimension",
|
|
2450
|
+
"measure"
|
|
2451
|
+
],
|
|
2452
|
+
"description": "Only meaningful where a chart takes mixed columns (`table`): whether the field is a category (`dimension`) or a numeric value (`measure`). Inferred from `type`/row values when omitted."
|
|
2453
|
+
},
|
|
2454
|
+
"format": {
|
|
2455
|
+
"$ref": "#/$defs/SpecFieldFormat"
|
|
2456
|
+
}
|
|
2457
|
+
},
|
|
2458
|
+
"required": [
|
|
2459
|
+
"name"
|
|
2460
|
+
],
|
|
2461
|
+
"additionalProperties": false
|
|
2462
|
+
},
|
|
2463
|
+
"SpecFieldFormat": {
|
|
2464
|
+
"type": "object",
|
|
2465
|
+
"properties": {
|
|
2466
|
+
"prefix": {
|
|
2467
|
+
"type": "string",
|
|
2468
|
+
"description": "Prefix."
|
|
2469
|
+
},
|
|
2470
|
+
"suffix": {
|
|
2471
|
+
"type": "string",
|
|
2472
|
+
"description": "Suffix."
|
|
2473
|
+
},
|
|
2474
|
+
"displayName": {
|
|
2475
|
+
"type": "string",
|
|
2476
|
+
"description": "Display name."
|
|
2477
|
+
},
|
|
2478
|
+
"maxCharacters": {
|
|
2479
|
+
"type": "number",
|
|
2480
|
+
"description": "Maximum characters. Applies to string fields."
|
|
2481
|
+
},
|
|
2482
|
+
"decimalPlaces": {
|
|
2483
|
+
"type": "number",
|
|
2484
|
+
"description": "Decimal places. Applies to number fields."
|
|
2485
|
+
},
|
|
2486
|
+
"currency": {
|
|
2487
|
+
"type": "string",
|
|
2488
|
+
"description": "Currency. e.g. EUR. Applies to number fields."
|
|
2489
|
+
},
|
|
2490
|
+
"abbreviateLargeNumber": {
|
|
2491
|
+
"type": "boolean",
|
|
2492
|
+
"description": "Abbreviate large number. Applies to number fields."
|
|
2493
|
+
},
|
|
2494
|
+
"color": {
|
|
2495
|
+
"type": "string",
|
|
2496
|
+
"description": "Color."
|
|
2497
|
+
},
|
|
2498
|
+
"showValueAsPercentage": {
|
|
2499
|
+
"type": "boolean",
|
|
2500
|
+
"description": "Show values as percentage."
|
|
2501
|
+
},
|
|
2502
|
+
"ignoreEmptyDate": {
|
|
2503
|
+
"type": "boolean",
|
|
2504
|
+
"description": "Ignore empty dates. When enabled, dates with no data will be omitted instead of shown as empty. Applies to time fields."
|
|
2505
|
+
},
|
|
2506
|
+
"lineColor": {
|
|
2507
|
+
"type": "string",
|
|
2508
|
+
"description": "Line color."
|
|
2509
|
+
},
|
|
2510
|
+
"dashedLine": {
|
|
2511
|
+
"type": "boolean",
|
|
2512
|
+
"description": "Dashed line."
|
|
2513
|
+
},
|
|
2514
|
+
"connectGaps": {
|
|
2515
|
+
"type": "boolean",
|
|
2516
|
+
"description": "Connect gaps."
|
|
2517
|
+
},
|
|
2518
|
+
"fillUnderLine": {
|
|
2519
|
+
"type": "boolean",
|
|
2520
|
+
"description": "Fill under line."
|
|
2521
|
+
},
|
|
2522
|
+
"useSecondaryAxis": {
|
|
2523
|
+
"type": "boolean",
|
|
2524
|
+
"description": "Assign to secondary axis."
|
|
2525
|
+
},
|
|
2526
|
+
"previousLineColor": {
|
|
2527
|
+
"type": "string",
|
|
2528
|
+
"description": "Previous line color."
|
|
2529
|
+
},
|
|
2530
|
+
"lineDashed": {
|
|
2531
|
+
"type": "boolean",
|
|
2532
|
+
"description": "Primary line dashed."
|
|
2533
|
+
},
|
|
2534
|
+
"previousLineDashed": {
|
|
2535
|
+
"type": "boolean",
|
|
2536
|
+
"description": "Compared line dashed."
|
|
2537
|
+
},
|
|
2538
|
+
"invertChangeColors": {
|
|
2539
|
+
"type": "boolean",
|
|
2540
|
+
"description": "Reverse positive/negative colors."
|
|
2541
|
+
},
|
|
2542
|
+
"reverseTrendDirection": {
|
|
2543
|
+
"type": "boolean",
|
|
2544
|
+
"description": 'Reverse trend direction. Reverses the up/down trend arrow independently of "Reverse positive/negative colors" above. Existing dashboards keep their current look until this is changed explicitly.'
|
|
2545
|
+
},
|
|
2546
|
+
"displayChangeAsPercentage": {
|
|
2547
|
+
"type": "boolean",
|
|
2548
|
+
"description": "Display change as %."
|
|
2549
|
+
},
|
|
2550
|
+
"percentageDecimalPlaces": {
|
|
2551
|
+
"type": "number",
|
|
2552
|
+
"description": "Percentage decimal places."
|
|
2553
|
+
},
|
|
2554
|
+
"columnAggregation": {
|
|
2555
|
+
"type": "array",
|
|
2556
|
+
"items": {
|
|
2557
|
+
"type": "string",
|
|
2558
|
+
"enum": [
|
|
2559
|
+
"sum",
|
|
2560
|
+
"min",
|
|
2561
|
+
"max",
|
|
2562
|
+
"average"
|
|
2563
|
+
]
|
|
2564
|
+
},
|
|
2565
|
+
"description": "Show column calculation."
|
|
2566
|
+
},
|
|
2567
|
+
"rowAggregation": {
|
|
2568
|
+
"type": "array",
|
|
2569
|
+
"items": {
|
|
2570
|
+
"type": "string",
|
|
2571
|
+
"enum": [
|
|
2572
|
+
"sum",
|
|
2573
|
+
"min",
|
|
2574
|
+
"max",
|
|
2575
|
+
"average"
|
|
2576
|
+
]
|
|
2577
|
+
},
|
|
2578
|
+
"description": "Show row calculation."
|
|
2579
|
+
},
|
|
2580
|
+
"showAsPercentage": {
|
|
2581
|
+
"type": "boolean",
|
|
2582
|
+
"description": "Show as percentage. If turned on, other measures may be ignored."
|
|
2583
|
+
},
|
|
2584
|
+
"width": {
|
|
2585
|
+
"type": "number",
|
|
2586
|
+
"description": "Width. You can input a number in pixels e.g. 400."
|
|
2587
|
+
},
|
|
2588
|
+
"align": {
|
|
2589
|
+
"type": "string",
|
|
2590
|
+
"enum": [
|
|
2591
|
+
"left",
|
|
2592
|
+
"center",
|
|
2593
|
+
"right"
|
|
2594
|
+
],
|
|
2595
|
+
"description": "Align."
|
|
2596
|
+
},
|
|
2597
|
+
"tableCellStyle": {
|
|
2598
|
+
"type": "string",
|
|
2599
|
+
"enum": [
|
|
2600
|
+
"Bold",
|
|
2601
|
+
"Italic",
|
|
2602
|
+
"Positive vs Negative"
|
|
2603
|
+
],
|
|
2604
|
+
"description": "Table cell style."
|
|
2605
|
+
},
|
|
2606
|
+
"displayFormat": {
|
|
2607
|
+
"type": "string",
|
|
2608
|
+
"enum": [
|
|
2609
|
+
"Markdown",
|
|
2610
|
+
"Json"
|
|
2611
|
+
],
|
|
2612
|
+
"description": "Display format."
|
|
2613
|
+
},
|
|
2614
|
+
"displayNullAs": {
|
|
2615
|
+
"type": "string",
|
|
2616
|
+
"description": "Rendered in place of null/undefined values."
|
|
2617
|
+
}
|
|
2618
|
+
},
|
|
2619
|
+
"additionalProperties": false,
|
|
2620
|
+
"description": "Per-field options, applied via the field's `inputs`: formatting (prefix, suffix, decimalPlaces, …) plus chart-specific ones such as a pivot table's columnAggregation/rowAggregation. Time-axis settings live on the chart."
|
|
2621
|
+
},
|
|
2622
|
+
"SpecRow": {
|
|
2623
|
+
"type": "object",
|
|
2624
|
+
"additionalProperties": {}
|
|
2625
|
+
}
|
|
2626
|
+
}
|
|
2627
|
+
};
|
|
2628
|
+
const TOOL_NAME = "render_chart";
|
|
2629
|
+
const TOOL_DESCRIPTION = 'Render a chart, KPI or table in the user\'s app from a JSON spec. Set `chart` to the kind, name the row fields to plot (a bare row-key string such as "revenue", or { name, title, format }), and pass the data in `rows` as an array of flat objects in long format: one row per category and group combination, using only values you were given. Time values must be zone-less ISO strings such as "2025-03-01T00:00:00.000"; set `granularity` when the category axis is time. Format numbers with a field\'s `format` ({ prefix, suffix, decimalPlaces }). Options always use vertical orientation: `xAxis`/`xAxisLabel` is the category axis even for horizontal bars. One call renders one chart.';
|
|
2630
|
+
const renderChartTool = {
|
|
2631
|
+
name: TOOL_NAME,
|
|
2632
|
+
description: TOOL_DESCRIPTION,
|
|
2633
|
+
input_schema: chartSpecToolSchema
|
|
2634
|
+
};
|
|
2635
|
+
const renderChartToolOpenAI = {
|
|
2636
|
+
type: "function",
|
|
2637
|
+
function: {
|
|
2638
|
+
name: TOOL_NAME,
|
|
2639
|
+
description: TOOL_DESCRIPTION,
|
|
2640
|
+
parameters: chartSpecToolSchema
|
|
2641
|
+
}
|
|
2642
|
+
};
|
|
2643
|
+
const chartGuidance = `Charts: call ${TOOL_NAME} to show data. One call per chart; pick the kind from the shape of the data.
|
|
2644
|
+
|
|
2645
|
+
Choosing \`chart\`:
|
|
2646
|
+
- bar: one measure (or a few) compared across categories.
|
|
2647
|
+
- barHorizontal: the same, when labels are long or there are more than ~8 categories.
|
|
2648
|
+
- barGrouped, barGroupedHorizontal: a measure split by a second category (\`groupBy\`), parts side by side.
|
|
2649
|
+
- barStacked, barStackedHorizontal: the same split stacked, to show how the parts add up to a total.
|
|
2650
|
+
- line: a trend over time or another ordered x axis; one line per entry in \`measures\`.
|
|
2651
|
+
- lineGrouped: one measure drawn as a line per value of \`groupBy\`.
|
|
2652
|
+
- lineWithKpiTabs: a trend with one KPI tab per measure (the tab shows the measure's total);
|
|
2653
|
+
good for dashboards-in-one-chart like "revenue / orders / signups over time".
|
|
2654
|
+
- lineComparison: this period against a previous one (\`rows\` vs \`comparisonRows\`, aligned by
|
|
2655
|
+
position); set \`comparisonLabel\`, e.g. "Previous period".
|
|
2656
|
+
- lineComparisonWithKpiTabs: the comparison plus KPI tabs; headline numbers are derived from the
|
|
2657
|
+
rows unless \`kpiRows\`/\`kpiComparisonRows\` are given.
|
|
2658
|
+
- area: volume over time; add \`groupBy\` to stack the parts.
|
|
2659
|
+
- barLine: bars (\`barMeasures\`) plus lines (\`lineMeasures\`) on a second axis, e.g. volume and a rate.
|
|
2660
|
+
- pie, donut: only shares of a whole: at most 8 slices, non-negative values. Otherwise use a bar chart.
|
|
2661
|
+
- donutLabel: a donut with a headline number in the center (\`innerLabel\`: { text, value } — the
|
|
2662
|
+
value defaults to the sum of the rows).
|
|
2663
|
+
- scatter: the relationship between two measures, one point per \`pointDimension\`.
|
|
2664
|
+
- bubble: scatter plus a third measure as point size (\`bubbleSizeMeasure\`).
|
|
2665
|
+
- kpi: one headline number.
|
|
2666
|
+
- kpiComparison: a number against another period (\`value\`, \`comparisonValue\`); set
|
|
2667
|
+
\`options.reversePositiveNegativeColors\` when lower is better.
|
|
2668
|
+
- table: row-level detail or exact values; mixed text and number \`columns\`.
|
|
2669
|
+
- heatmap: one measure across two categories as colour intensity (weekday by hour).
|
|
2670
|
+
- pivot: the same two-way layout with numbers in the cells, several measures and optional sub-rows.
|
|
2671
|
+
|
|
2672
|
+
Data rules:
|
|
2673
|
+
- \`rows\` is an array of flat objects in long format: one row per category and group combination.
|
|
2674
|
+
Never spread groups across columns; name the group field in \`groupBy\` instead.
|
|
2675
|
+
- Use only values from the data you were given. Omit \`rows\` while data is loading (set \`loading: true\`),
|
|
2676
|
+
or set \`error\` to show a message instead.
|
|
2677
|
+
- A field is a row key as a bare string ("revenue"), or { name, title?, type?, role?, format? } when it
|
|
2678
|
+
needs a display title or formatting. \`type\` ('string' | 'number' | 'time' | 'boolean') is inferred from rows.
|
|
2679
|
+
- Time values are zone-less ISO strings: "2025-03-01T00:00:00.000" ("2025-03-01" is also accepted).
|
|
2680
|
+
Never add a Z or a UTC offset.
|
|
2681
|
+
- When the category axis (\`dimension\` or \`xAxis\`) is a time field, set \`granularity\` on the chart,
|
|
2682
|
+
never on the field: second, minute, hour, day, week, month, quarter or year.
|
|
2683
|
+
The rows must already be bucketed at that granularity.
|
|
2684
|
+
- Format numbers with the field's \`format\`: { prefix: "$", suffix: "%", decimalPlaces: 1 }.
|
|
2685
|
+
Also available: displayName, displayNullAs, maxCharacters.
|
|
2686
|
+
- Options are always written in vertical orientation, including for horizontal variants:
|
|
2687
|
+
\`options.xAxisLabel\` labels the category axis; \`options.yAxisLabel\`, \`options.yAxisRangeMin\`
|
|
2688
|
+
and \`options.yAxisRangeMax\` the value axis. The renderer swaps them.
|
|
2689
|
+
- \`kpi\` and \`kpiComparison\` accept \`value\` (and \`comparisonValue\`) instead of \`rows\`.
|
|
2690
|
+
- In \`table\`, set a column's \`role\` ('dimension' | 'measure') only when it is ambiguous.
|
|
2691
|
+
- Give every chart a short \`title\` that says what it shows.`;
|
|
2692
|
+
export {
|
|
2693
|
+
chartGuidance,
|
|
2694
|
+
chartSpecSchema,
|
|
2695
|
+
chartSpecToolSchema,
|
|
2696
|
+
renderChartTool,
|
|
2697
|
+
renderChartToolOpenAI
|
|
2698
|
+
};
|
|
2699
|
+
//# sourceMappingURL=ai.js.map
|