@grafana/viz-contract 1.2.0 → 1.4.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/package.json +1 -1
- package/registry/notices.json +1 -1
- package/registry/states.json +2 -2
- package/renderer-api.d.ts +12 -5
package/package.json
CHANGED
package/registry/notices.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"code": "series-truncated",
|
|
17
17
|
"raisedBy": "renderer",
|
|
18
18
|
"when": "The frames have more series than maxSeries",
|
|
19
|
-
"message": "<omitted> series
|
|
19
|
+
"message": "<omitted> series are not shown. The first <maxSeries> series are drawn."
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"code": "chart-changed",
|
package/registry/states.json
CHANGED
|
@@ -68,12 +68,12 @@
|
|
|
68
68
|
"refresh": [
|
|
69
69
|
{
|
|
70
70
|
"code": "refresh-failed",
|
|
71
|
-
"when": "The App calls setRefreshed(false, error) with an error text, or onRefresh throws",
|
|
71
|
+
"when": "The App calls setRefreshed(id, false, error) with an error text, or onRefresh throws",
|
|
72
72
|
"message": "Refresh failed: <error>"
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
"code": "refresh-failed-no-detail",
|
|
76
|
-
"when": "The App calls setRefreshed(false) with no error text",
|
|
76
|
+
"when": "The App calls setRefreshed(id, false) with no error text",
|
|
77
77
|
"message": "Refresh failed."
|
|
78
78
|
},
|
|
79
79
|
{
|
package/renderer-api.d.ts
CHANGED
|
@@ -34,8 +34,11 @@ export interface RenderOptions {
|
|
|
34
34
|
export interface RenderHandle {
|
|
35
35
|
/** Draws a new viz spec in the same element. */
|
|
36
36
|
update(spec: unknown): void;
|
|
37
|
-
/**
|
|
38
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Gives the result of the refresh with this id. id is the id of the RefreshRequest. With ok false, error is the
|
|
39
|
+
* text that the Renderer shows.
|
|
40
|
+
*/
|
|
41
|
+
setRefreshed(id: string, ok: boolean, error?: string): void;
|
|
39
42
|
/** Removes the chart and its listeners. */
|
|
40
43
|
destroy(): void;
|
|
41
44
|
}
|
|
@@ -64,7 +67,11 @@ export interface Notice {
|
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
/**
|
|
67
|
-
*
|
|
68
|
-
* example now-6h to now, stays relative. An
|
|
70
|
+
* A refresh. id is a new value for each call of onRefresh. The App gives it to setRefreshed. For timeRange, from
|
|
71
|
+
* and to are the range that the user picked. A relative range, for example now-6h to now, stays relative. An
|
|
72
|
+
* absolute range is in epoch milliseconds.
|
|
69
73
|
*/
|
|
70
|
-
export type RefreshRequest = {
|
|
74
|
+
export type RefreshRequest = { id: string } & (
|
|
75
|
+
| { cause: 'refresh' }
|
|
76
|
+
| { cause: 'timeRange'; from: string; to: string }
|
|
77
|
+
);
|