@grafana/viz-contract 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/LICENSE +201 -0
- package/README.md +140 -0
- package/fixtures/epoch-range/args.json +14 -0
- package/fixtures/epoch-range/meta.json +4 -0
- package/fixtures/epoch-range/request.json +17 -0
- package/fixtures/epoch-range/response.json +114 -0
- package/fixtures/epoch-range/result.json +252 -0
- package/fixtures/epoch-range/spec.json +141 -0
- package/fixtures/epoch-range/state.json +4 -0
- package/fixtures/error-all-queries-failed/spec.json +45 -0
- package/fixtures/error-all-queries-failed/state.json +8 -0
- package/fixtures/error-invalid-spec/spec.json +25 -0
- package/fixtures/error-invalid-spec/state.json +8 -0
- package/fixtures/error-unsupported-panel-type/spec.json +1372 -0
- package/fixtures/error-unsupported-panel-type/state.json +8 -0
- package/fixtures/error-unsupported-spec-version/spec.json +1372 -0
- package/fixtures/error-unsupported-spec-version/state.json +8 -0
- package/fixtures/hostile-label/args.json +14 -0
- package/fixtures/hostile-label/meta.json +4 -0
- package/fixtures/hostile-label/request.json +17 -0
- package/fixtures/hostile-label/response.json +420 -0
- package/fixtures/hostile-label/result.json +558 -0
- package/fixtures/hostile-label/spec.json +447 -0
- package/fixtures/hostile-label/state.json +4 -0
- package/fixtures/no-data/args.json +14 -0
- package/fixtures/no-data/meta.json +4 -0
- package/fixtures/no-data/request.json +17 -0
- package/fixtures/no-data/response.json +40 -0
- package/fixtures/no-data/result.json +178 -0
- package/fixtures/no-data/spec.json +67 -0
- package/fixtures/no-data/state.json +4 -0
- package/fixtures/partial-error/args.json +20 -0
- package/fixtures/partial-error/meta.json +4 -0
- package/fixtures/partial-error/request.json +28 -0
- package/fixtures/partial-error/response.json +220 -0
- package/fixtures/partial-error/result.json +358 -0
- package/fixtures/partial-error/spec.json +253 -0
- package/fixtures/partial-error/state.json +9 -0
- package/fixtures/pick-annotations-only/args.json +10 -0
- package/fixtures/pick-annotations-only/meta.json +4 -0
- package/fixtures/pick-annotations-only/response.json +41 -0
- package/fixtures/pick-annotations-only/result.json +53 -0
- package/fixtures/pick-categories/args.json +10 -0
- package/fixtures/pick-categories/meta.json +4 -0
- package/fixtures/pick-categories/response.json +58 -0
- package/fixtures/pick-categories/result.json +116 -0
- package/fixtures/pick-empty-result/args.json +10 -0
- package/fixtures/pick-empty-result/meta.json +4 -0
- package/fixtures/pick-empty-result/response.json +11 -0
- package/fixtures/pick-empty-result/result.json +23 -0
- package/fixtures/pick-failed-query-with-frames/args.json +10 -0
- package/fixtures/pick-failed-query-with-frames/meta.json +4 -0
- package/fixtures/pick-failed-query-with-frames/response.json +43 -0
- package/fixtures/pick-failed-query-with-frames/result.json +131 -0
- package/fixtures/pick-few-parts/args.json +10 -0
- package/fixtures/pick-few-parts/meta.json +4 -0
- package/fixtures/pick-few-parts/response.json +40 -0
- package/fixtures/pick-few-parts/result.json +98 -0
- package/fixtures/pick-heatmap-cells/args.json +10 -0
- package/fixtures/pick-heatmap-cells/meta.json +4 -0
- package/fixtures/pick-heatmap-cells/response.json +55 -0
- package/fixtures/pick-heatmap-cells/result.json +143 -0
- package/fixtures/pick-log-lines/args.json +10 -0
- package/fixtures/pick-log-lines/meta.json +4 -0
- package/fixtures/pick-log-lines/response.json +49 -0
- package/fixtures/pick-log-lines/result.json +76 -0
- package/fixtures/pick-no-rows/args.json +10 -0
- package/fixtures/pick-no-rows/meta.json +4 -0
- package/fixtures/pick-no-rows/response.json +32 -0
- package/fixtures/pick-no-rows/result.json +120 -0
- package/fixtures/pick-node-graph/args.json +10 -0
- package/fixtures/pick-node-graph/meta.json +4 -0
- package/fixtures/pick-node-graph/response.json +77 -0
- package/fixtures/pick-node-graph/result.json +89 -0
- package/fixtures/pick-numeric-only/args.json +10 -0
- package/fixtures/pick-numeric-only/meta.json +4 -0
- package/fixtures/pick-numeric-only/response.json +40 -0
- package/fixtures/pick-numeric-only/result.json +89 -0
- package/fixtures/pick-single-stat/args.json +10 -0
- package/fixtures/pick-single-stat/meta.json +4 -0
- package/fixtures/pick-single-stat/response.json +29 -0
- package/fixtures/pick-single-stat/result.json +69 -0
- package/fixtures/pick-time-series-instant/args.json +10 -0
- package/fixtures/pick-time-series-instant/meta.json +4 -0
- package/fixtures/pick-time-series-instant/response.json +40 -0
- package/fixtures/pick-time-series-instant/result.json +128 -0
- package/fixtures/pick-time-series-long/args.json +10 -0
- package/fixtures/pick-time-series-long/meta.json +4 -0
- package/fixtures/pick-time-series-long/response.json +61 -0
- package/fixtures/pick-time-series-long/result.json +167 -0
- package/fixtures/pick-time-series-multi-frame/args.json +10 -0
- package/fixtures/pick-time-series-multi-frame/meta.json +4 -0
- package/fixtures/pick-time-series-multi-frame/response.json +74 -0
- package/fixtures/pick-time-series-multi-frame/result.json +162 -0
- package/fixtures/pick-time-series-null-time/args.json +10 -0
- package/fixtures/pick-time-series-null-time/meta.json +4 -0
- package/fixtures/pick-time-series-null-time/response.json +40 -0
- package/fixtures/pick-time-series-null-time/result.json +128 -0
- package/fixtures/pick-time-series-single/args.json +10 -0
- package/fixtures/pick-time-series-single/meta.json +4 -0
- package/fixtures/pick-time-series-single/response.json +40 -0
- package/fixtures/pick-time-series-single/result.json +128 -0
- package/fixtures/pick-time-series-wide/args.json +10 -0
- package/fixtures/pick-time-series-wide/meta.json +4 -0
- package/fixtures/pick-time-series-wide/response.json +61 -0
- package/fixtures/pick-time-series-wide/result.json +149 -0
- package/fixtures/prometheus-line/args.json +14 -0
- package/fixtures/prometheus-line/meta.json +4 -0
- package/fixtures/prometheus-line/request.json +17 -0
- package/fixtures/prometheus-line/response.json +1344 -0
- package/fixtures/prometheus-line/result.json +1483 -0
- package/fixtures/prometheus-line/spec.json +1372 -0
- package/fixtures/prometheus-line/state.json +4 -0
- package/fixtures/smoke-barchart/spec.json +64 -0
- package/fixtures/smoke-barchart/state.json +4 -0
- package/fixtures/smoke-boxplot/spec.json +96 -0
- package/fixtures/smoke-boxplot/state.json +4 -0
- package/fixtures/smoke-bubble/spec.json +229 -0
- package/fixtures/smoke-bubble/state.json +4 -0
- package/fixtures/smoke-candlestick/spec.json +97 -0
- package/fixtures/smoke-candlestick/state.json +4 -0
- package/fixtures/smoke-chord/spec.json +72 -0
- package/fixtures/smoke-chord/state.json +4 -0
- package/fixtures/smoke-funnel/spec.json +62 -0
- package/fixtures/smoke-funnel/state.json +4 -0
- package/fixtures/smoke-geomap/spec.json +76 -0
- package/fixtures/smoke-geomap/state.json +4 -0
- package/fixtures/smoke-heatmap/spec.json +103 -0
- package/fixtures/smoke-heatmap/state.json +4 -0
- package/fixtures/smoke-histogram/spec.json +63 -0
- package/fixtures/smoke-histogram/state.json +4 -0
- package/fixtures/smoke-nodeGraph/spec.json +101 -0
- package/fixtures/smoke-nodeGraph/state.json +4 -0
- package/fixtures/smoke-parallel/spec.json +78 -0
- package/fixtures/smoke-parallel/state.json +4 -0
- package/fixtures/smoke-piechart/spec.json +62 -0
- package/fixtures/smoke-piechart/state.json +4 -0
- package/fixtures/smoke-radar/spec.json +82 -0
- package/fixtures/smoke-radar/state.json +4 -0
- package/fixtures/smoke-sankey/spec.json +72 -0
- package/fixtures/smoke-sankey/state.json +4 -0
- package/fixtures/smoke-state-timeline/spec.json +64 -0
- package/fixtures/smoke-state-timeline/state.json +4 -0
- package/fixtures/smoke-status-history/spec.json +64 -0
- package/fixtures/smoke-status-history/state.json +4 -0
- package/fixtures/smoke-streamgraph/spec.json +229 -0
- package/fixtures/smoke-streamgraph/state.json +4 -0
- package/fixtures/smoke-sunburst/spec.json +72 -0
- package/fixtures/smoke-sunburst/state.json +4 -0
- package/fixtures/smoke-timeseries/spec.json +163 -0
- package/fixtures/smoke-timeseries/state.json +4 -0
- package/fixtures/smoke-treemap/spec.json +72 -0
- package/fixtures/smoke-treemap/state.json +4 -0
- package/fixtures/too-large/args.json +14 -0
- package/fixtures/too-large/meta.json +4 -0
- package/fixtures/type-mismatch/args.json +15 -0
- package/fixtures/type-mismatch/meta.json +4 -0
- package/fixtures/type-mismatch/request.json +17 -0
- package/fixtures/type-mismatch/response.json +1344 -0
- package/fixtures/type-mismatch/result.json +9 -0
- package/package.json +32 -0
- package/registry/chart-types.json +170 -0
- package/registry/constants.json +14 -0
- package/registry/notices.json +40 -0
- package/registry/panel-types.json +14 -0
- package/registry/pick.json +46 -0
- package/registry/states.json +85 -0
- package/renderer-api.d.ts +70 -0
- package/schemas/bundled/query-datasource-args.schema.json +86 -0
- package/schemas/bundled/registry.schema.json +375 -0
- package/schemas/bundled/tool-result.schema.json +245 -0
- package/schemas/bundled/viz-spec.schema.json +261 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Viz spec",
|
|
4
|
+
"description": "The JSON object that the App gives to the Renderer. The Renderer ignores fields that it does not know.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"specVersion",
|
|
8
|
+
"panel",
|
|
9
|
+
"data"
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"specVersion": {
|
|
13
|
+
"const": 1,
|
|
14
|
+
"$comment": "Generated from registry/constants.json (specVersion). Do not edit."
|
|
15
|
+
},
|
|
16
|
+
"panel": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"description": "A Grafana panel JSON. type, options and fieldConfig come from the panel of the tool result. datasource and targets come from the tool arguments.",
|
|
19
|
+
"required": [
|
|
20
|
+
"type"
|
|
21
|
+
],
|
|
22
|
+
"properties": {
|
|
23
|
+
"type": {
|
|
24
|
+
"$ref": "#/$defs/tool-result.$defs.panelId"
|
|
25
|
+
},
|
|
26
|
+
"options": {
|
|
27
|
+
"type": "object"
|
|
28
|
+
},
|
|
29
|
+
"fieldConfig": {
|
|
30
|
+
"$ref": "#/$defs/tool-result.$defs.panel.properties.fieldConfig"
|
|
31
|
+
},
|
|
32
|
+
"datasource": {
|
|
33
|
+
"$ref": "#/$defs/datasourceRef"
|
|
34
|
+
},
|
|
35
|
+
"targets": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"items": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"required": [
|
|
40
|
+
"refId"
|
|
41
|
+
],
|
|
42
|
+
"properties": {
|
|
43
|
+
"refId": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
},
|
|
46
|
+
"datasource": {
|
|
47
|
+
"$ref": "#/$defs/datasourceRef"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"data": {
|
|
55
|
+
"$ref": "#/$defs/tool-result.$defs.data"
|
|
56
|
+
},
|
|
57
|
+
"notices": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"description": "Notices of the App, for example chart-changed. The Renderer shows them with its own notices.",
|
|
60
|
+
"items": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"required": [
|
|
63
|
+
"code",
|
|
64
|
+
"message"
|
|
65
|
+
],
|
|
66
|
+
"properties": {
|
|
67
|
+
"code": {
|
|
68
|
+
"type": "string"
|
|
69
|
+
},
|
|
70
|
+
"message": {
|
|
71
|
+
"type": "string"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"additionalProperties": false
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"theme": {
|
|
78
|
+
"enum": [
|
|
79
|
+
"dark",
|
|
80
|
+
"light"
|
|
81
|
+
],
|
|
82
|
+
"default": "dark"
|
|
83
|
+
},
|
|
84
|
+
"timeZone": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"default": "browser",
|
|
87
|
+
"description": "browser, utc, or an IANA time zone name, for example Europe/Paris."
|
|
88
|
+
},
|
|
89
|
+
"grafanaUrl": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"format": "uri",
|
|
92
|
+
"description": "The base URL of the Grafana that ran the query."
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"$defs": {
|
|
96
|
+
"datasourceRef": {
|
|
97
|
+
"type": "object",
|
|
98
|
+
"required": [
|
|
99
|
+
"uid"
|
|
100
|
+
],
|
|
101
|
+
"properties": {
|
|
102
|
+
"type": {
|
|
103
|
+
"type": "string"
|
|
104
|
+
},
|
|
105
|
+
"uid": {
|
|
106
|
+
"type": "string"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"tool-result.$defs.panelId": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"$comment": "Generated from registry/panel-types.json. Do not edit.",
|
|
113
|
+
"enum": [
|
|
114
|
+
"grafana-echartscartesian-panel",
|
|
115
|
+
"grafana-echartsgeo-panel",
|
|
116
|
+
"grafana-echartsheatmap-panel",
|
|
117
|
+
"grafana-echartshierarchy-panel",
|
|
118
|
+
"grafana-echartsmultivariate-panel",
|
|
119
|
+
"grafana-echartsparttowhole-panel",
|
|
120
|
+
"grafana-relations-panel",
|
|
121
|
+
"grafana-echartsstatetimeline-panel",
|
|
122
|
+
"grafana-echartsstatushistory-panel",
|
|
123
|
+
"grafana-echartsstream-panel"
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
"tool-result.$defs.panel.properties.fieldConfig": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"properties": {
|
|
129
|
+
"defaults": {
|
|
130
|
+
"type": "object",
|
|
131
|
+
"properties": {
|
|
132
|
+
"unit": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"minLength": 1
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"overrides": {
|
|
139
|
+
"type": "array"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"tool-result.$defs.data": {
|
|
144
|
+
"type": "object",
|
|
145
|
+
"required": [
|
|
146
|
+
"range",
|
|
147
|
+
"capturedAt",
|
|
148
|
+
"results"
|
|
149
|
+
],
|
|
150
|
+
"properties": {
|
|
151
|
+
"range": {
|
|
152
|
+
"type": "object",
|
|
153
|
+
"description": "The absolute time range of the query, in epoch milliseconds.",
|
|
154
|
+
"required": [
|
|
155
|
+
"from",
|
|
156
|
+
"to"
|
|
157
|
+
],
|
|
158
|
+
"properties": {
|
|
159
|
+
"from": {
|
|
160
|
+
"type": "integer"
|
|
161
|
+
},
|
|
162
|
+
"to": {
|
|
163
|
+
"type": "integer"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"additionalProperties": false
|
|
167
|
+
},
|
|
168
|
+
"capturedAt": {
|
|
169
|
+
"type": "integer",
|
|
170
|
+
"description": "The time when the response of /api/ds/query arrived, in epoch milliseconds."
|
|
171
|
+
},
|
|
172
|
+
"results": {
|
|
173
|
+
"$ref": "#/$defs/tool-result.$defs.results"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"tool-result.$defs.results": {
|
|
178
|
+
"type": "object",
|
|
179
|
+
"description": "The results object of the /api/ds/query response, with no change. The key is the refId.",
|
|
180
|
+
"minProperties": 1,
|
|
181
|
+
"additionalProperties": {
|
|
182
|
+
"type": "object",
|
|
183
|
+
"required": [
|
|
184
|
+
"status"
|
|
185
|
+
],
|
|
186
|
+
"properties": {
|
|
187
|
+
"status": {
|
|
188
|
+
"type": "integer"
|
|
189
|
+
},
|
|
190
|
+
"frames": {
|
|
191
|
+
"type": "array",
|
|
192
|
+
"items": {
|
|
193
|
+
"$ref": "#/$defs/tool-result.$defs.frame"
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"error": {
|
|
197
|
+
"type": "string"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"tool-result.$defs.frame": {
|
|
203
|
+
"type": "object",
|
|
204
|
+
"description": "A frame in the DataFrameJSON format of the dataplane contract.",
|
|
205
|
+
"required": [
|
|
206
|
+
"schema"
|
|
207
|
+
],
|
|
208
|
+
"properties": {
|
|
209
|
+
"schema": {
|
|
210
|
+
"type": "object",
|
|
211
|
+
"properties": {
|
|
212
|
+
"refId": {
|
|
213
|
+
"type": "string"
|
|
214
|
+
},
|
|
215
|
+
"meta": {
|
|
216
|
+
"type": "object"
|
|
217
|
+
},
|
|
218
|
+
"fields": {
|
|
219
|
+
"type": "array",
|
|
220
|
+
"items": {
|
|
221
|
+
"type": "object",
|
|
222
|
+
"required": [
|
|
223
|
+
"name"
|
|
224
|
+
],
|
|
225
|
+
"properties": {
|
|
226
|
+
"name": {
|
|
227
|
+
"type": "string"
|
|
228
|
+
},
|
|
229
|
+
"type": {
|
|
230
|
+
"type": "string"
|
|
231
|
+
},
|
|
232
|
+
"labels": {
|
|
233
|
+
"type": "object",
|
|
234
|
+
"additionalProperties": {
|
|
235
|
+
"type": "string"
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"config": {
|
|
239
|
+
"type": "object"
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"data": {
|
|
247
|
+
"type": "object",
|
|
248
|
+
"properties": {
|
|
249
|
+
"values": {
|
|
250
|
+
"type": "array",
|
|
251
|
+
"items": {
|
|
252
|
+
"type": "array"
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"$comment": "Generated from schemas/viz-spec.schema.json. Do not edit."
|
|
261
|
+
}
|