@connectci/xdmod-charts 0.0.0-stage → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +6 -2
  3. package/dist/caption.d.ts +68 -0
  4. package/dist/caption.js +118 -0
  5. package/dist/csv.d.ts +22 -0
  6. package/dist/csv.js +95 -0
  7. package/dist/fixtures.d.ts +58 -0
  8. package/dist/fixtures.js +1 -0
  9. package/dist/format.d.ts +6 -0
  10. package/dist/format.js +39 -0
  11. package/dist/generated/palette.d.ts +4 -0
  12. package/dist/generated/palette.js +23 -0
  13. package/dist/generated/statistics.d.ts +6 -0
  14. package/dist/generated/statistics.js +217 -0
  15. package/dist/index.d.ts +13 -0
  16. package/dist/index.js +8 -0
  17. package/dist/measure.d.ts +7 -0
  18. package/dist/measure.js +14 -0
  19. package/dist/palette.d.ts +11 -0
  20. package/dist/palette.js +19 -0
  21. package/dist/parse.d.ts +3 -0
  22. package/dist/parse.js +82 -0
  23. package/dist/payload.d.ts +81 -0
  24. package/dist/payload.js +1 -0
  25. package/dist/view.d.ts +58 -0
  26. package/dist/view.js +243 -0
  27. package/fixtures/README.md +13 -0
  28. package/fixtures/aggregate-empty.json +85 -0
  29. package/fixtures/aggregate-fills-empty-buckets.json +118 -0
  30. package/fixtures/aggregate-has-more-others-count.json +103 -0
  31. package/fixtures/aggregate-incomplete-with-probe-day.json +108 -0
  32. package/fixtures/aggregate-jobs-by-resource.json +66 -0
  33. package/fixtures/aggregate-marks-resources-that-stop.json +125 -0
  34. package/fixtures/aggregate-no-fill-for-average.json +115 -0
  35. package/fixtures/aggregate-no-fill-incomplete-buckets.json +110 -0
  36. package/fixtures/aggregate-no-fill-when-bucket-filtered.json +114 -0
  37. package/fixtures/aggregate-no-fill-when-more.json +110 -0
  38. package/fixtures/aggregate-no-fill-with-offset.json +110 -0
  39. package/fixtures/aggregate-nominal-not-reordered.json +107 -0
  40. package/fixtures/aggregate-offset-page.json +103 -0
  41. package/fixtures/aggregate-ordered-bucket-order.json +116 -0
  42. package/fixtures/aggregate-probe-reaches-end.json +108 -0
  43. package/fixtures/aggregate-unknown-bucket-last.json +115 -0
  44. package/fixtures/aggregate-unordered.json +103 -0
  45. package/fixtures/average-leaves-gaps.json +125 -0
  46. package/fixtures/calendar-december-into-january.json +113 -0
  47. package/fixtures/calendar-range-ends-at-month-end.json +108 -0
  48. package/fixtures/cpu-hours-by-resource-incomplete.json +125 -0
  49. package/fixtures/early-end-average-by-resource-not-filled.json +147 -0
  50. package/fixtures/early-end-average-other-dimension.json +144 -0
  51. package/fixtures/early-end-daily-by-queue.json +180 -0
  52. package/fixtures/early-end-daily-series-stops.json +139 -0
  53. package/fixtures/early-end-day-inside-last-period.json +147 -0
  54. package/fixtures/early-end-fill-stops-at-last-day.json +145 -0
  55. package/fixtures/early-end-fills-to-resource-last-day.json +149 -0
  56. package/fixtures/early-end-other-dimension-never-filled.json +145 -0
  57. package/fixtures/early-end-probe-window-too-short.json +144 -0
  58. package/fixtures/early-end-resource-retired.json +144 -0
  59. package/fixtures/early-end-several-resources.json +205 -0
  60. package/fixtures/early-end-without-probe.json +140 -0
  61. package/fixtures/label-stripped-from-description.json +95 -0
  62. package/fixtures/no-series-values.json +86 -0
  63. package/fixtures/partial-last-day.json +119 -0
  64. package/fixtures/partial-last-month.json +122 -0
  65. package/fixtures/probe-day-after-range.json +113 -0
  66. package/fixtures/probe-day-inside-last-month.json +113 -0
  67. package/fixtures/probe-day-last-day-of-period.json +113 -0
  68. package/fixtures/rank-prefixes-on-series.json +130 -0
  69. package/fixtures/series-ended-before-probe-day.json +188 -0
  70. package/fixtures/timeseries-complete-last-period.json +113 -0
  71. package/fixtures/timeseries-month-gaps.json +121 -0
  72. package/fixtures/timeseries-more-series-than-palette.json +328 -0
  73. package/fixtures/warnings-all-three.json +104 -0
  74. package/fixtures/week-total-incomplete-last.json +135 -0
  75. package/fixtures/week-total-midweek-end.json +130 -0
  76. package/fixtures/week-total-midweek-start.json +129 -0
  77. package/package.json +32 -4
  78. package/rules/README.md +29 -0
  79. package/rules/palette.json +4 -0
  80. package/rules/statistics.json +217 -0
  81. package/schema/chart-payload.v1.json +320 -0
@@ -0,0 +1,320 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/connectci-platform/xdmod-charts/schema/chart-payload.v1.json",
4
+ "title": "XDMoD chart payload v1",
5
+ "description": "The chart a get_chart_data tool result carries. Version policy: the contract stays version 1 and changes only add optional fields. Enumerated fields are closed: a client that meets a value it does not know shows no chart and the text answer stands. A client ignores fields it does not know, so additionalProperties is not restricted.",
6
+ "type": "object",
7
+ "required": [
8
+ "version",
9
+ "realm",
10
+ "statistic",
11
+ "group_by",
12
+ "dataset_type",
13
+ "requested",
14
+ "counted",
15
+ "last_period_incomplete",
16
+ "measure",
17
+ "dimension",
18
+ "filters",
19
+ "has_more",
20
+ "source",
21
+ "retrieved"
22
+ ],
23
+ "properties": {
24
+ "version": {
25
+ "const": 1
26
+ },
27
+ "realm": {
28
+ "type": "string"
29
+ },
30
+ "statistic": {
31
+ "type": "string"
32
+ },
33
+ "group_by": {
34
+ "type": "string"
35
+ },
36
+ "dataset_type": {
37
+ "enum": [
38
+ "timeseries",
39
+ "aggregate"
40
+ ]
41
+ },
42
+ "unit": {
43
+ "enum": [
44
+ "Day",
45
+ "Week",
46
+ "Month",
47
+ "Quarter",
48
+ "Year"
49
+ ]
50
+ },
51
+ "requested": {
52
+ "type": "object",
53
+ "required": [
54
+ "start",
55
+ "end"
56
+ ],
57
+ "properties": {
58
+ "start": {
59
+ "type": "string"
60
+ },
61
+ "end": {
62
+ "type": "string"
63
+ }
64
+ }
65
+ },
66
+ "counted": {
67
+ "type": "object",
68
+ "required": [
69
+ "start",
70
+ "end"
71
+ ],
72
+ "properties": {
73
+ "start": {
74
+ "type": "string"
75
+ },
76
+ "end": {
77
+ "type": "string"
78
+ }
79
+ }
80
+ },
81
+ "last_period_incomplete": {
82
+ "type": "boolean"
83
+ },
84
+ "measure": {
85
+ "type": "object",
86
+ "required": [
87
+ "label",
88
+ "description",
89
+ "kind",
90
+ "missing"
91
+ ],
92
+ "properties": {
93
+ "label": {
94
+ "type": "string"
95
+ },
96
+ "description": {
97
+ "type": "string"
98
+ },
99
+ "kind": {
100
+ "enum": [
101
+ "total",
102
+ "average"
103
+ ]
104
+ },
105
+ "missing": {
106
+ "enum": [
107
+ "zero",
108
+ "gap"
109
+ ]
110
+ },
111
+ "unit": {
112
+ "type": "string"
113
+ }
114
+ }
115
+ },
116
+ "dimension": {
117
+ "type": "object",
118
+ "required": [
119
+ "name",
120
+ "ordered"
121
+ ],
122
+ "properties": {
123
+ "name": {
124
+ "type": "string"
125
+ },
126
+ "ordered": {
127
+ "type": "boolean"
128
+ }
129
+ }
130
+ },
131
+ "filters": {
132
+ "type": "object",
133
+ "required": [
134
+ "notes"
135
+ ],
136
+ "properties": {
137
+ "notes": {
138
+ "type": "array",
139
+ "items": {
140
+ "type": "string"
141
+ }
142
+ }
143
+ }
144
+ },
145
+ "time_basis": {
146
+ "type": "object",
147
+ "required": [
148
+ "zone"
149
+ ],
150
+ "properties": {
151
+ "zone": {
152
+ "type": "string"
153
+ }
154
+ }
155
+ },
156
+ "warnings": {
157
+ "type": "array",
158
+ "items": {
159
+ "type": "object",
160
+ "required": [
161
+ "code",
162
+ "text"
163
+ ],
164
+ "properties": {
165
+ "code": {
166
+ "type": "string"
167
+ },
168
+ "text": {
169
+ "type": "string"
170
+ }
171
+ }
172
+ }
173
+ },
174
+ "instance": {
175
+ "type": "object",
176
+ "required": [
177
+ "name",
178
+ "url"
179
+ ],
180
+ "properties": {
181
+ "name": {
182
+ "type": "string"
183
+ },
184
+ "url": {
185
+ "type": "string",
186
+ "pattern": "^https:"
187
+ }
188
+ }
189
+ },
190
+ "series": {
191
+ "type": "array",
192
+ "items": {
193
+ "type": "object",
194
+ "required": [
195
+ "name",
196
+ "points"
197
+ ],
198
+ "properties": {
199
+ "name": {
200
+ "type": "string"
201
+ },
202
+ "points": {
203
+ "type": "array",
204
+ "items": {
205
+ "type": "object",
206
+ "required": [
207
+ "start",
208
+ "value"
209
+ ],
210
+ "properties": {
211
+ "start": {
212
+ "type": "string"
213
+ },
214
+ "value": {
215
+ "type": [
216
+ "number",
217
+ "null"
218
+ ]
219
+ }
220
+ }
221
+ }
222
+ },
223
+ "data_through": {
224
+ "type": "string"
225
+ },
226
+ "data_through_precision": {
227
+ "enum": [
228
+ "day",
229
+ "period"
230
+ ]
231
+ },
232
+ "data_through_source": {
233
+ "enum": [
234
+ "resource",
235
+ "series"
236
+ ]
237
+ }
238
+ }
239
+ }
240
+ },
241
+ "categories": {
242
+ "type": "array",
243
+ "items": {
244
+ "type": "object",
245
+ "required": [
246
+ "name",
247
+ "value"
248
+ ],
249
+ "properties": {
250
+ "name": {
251
+ "type": "string"
252
+ },
253
+ "value": {
254
+ "type": [
255
+ "number",
256
+ "null"
257
+ ]
258
+ },
259
+ "data_through": {
260
+ "type": "string"
261
+ },
262
+ "data_through_source": {
263
+ "enum": [
264
+ "resource",
265
+ "series"
266
+ ]
267
+ }
268
+ }
269
+ }
270
+ },
271
+ "offset": {
272
+ "type": [
273
+ "integer",
274
+ "null"
275
+ ],
276
+ "minimum": 0
277
+ },
278
+ "others_count": {
279
+ "type": [
280
+ "integer",
281
+ "null"
282
+ ],
283
+ "minimum": 0
284
+ },
285
+ "data_through": {
286
+ "type": [
287
+ "string",
288
+ "null"
289
+ ]
290
+ },
291
+ "data_through_precision": {
292
+ "enum": [
293
+ "day",
294
+ "period",
295
+ null
296
+ ]
297
+ },
298
+ "last_data_period_partial": {
299
+ "type": "boolean"
300
+ },
301
+ "has_more": {
302
+ "type": "boolean"
303
+ },
304
+ "ranked_by": {
305
+ "const": "value"
306
+ },
307
+ "link": {
308
+ "type": [
309
+ "string",
310
+ "null"
311
+ ]
312
+ },
313
+ "source": {
314
+ "const": "XDMoD"
315
+ },
316
+ "retrieved": {
317
+ "type": "string"
318
+ }
319
+ }
320
+ }