@perses-dev/timeseries-chart-plugin 0.13.0-beta.2 → 0.13.0-beta.3

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 (105) hide show
  1. package/__mf/js/TimeSeriesChart.693fccf6.js +7 -0
  2. package/__mf/js/async/121.c3c0e54f.js +2 -0
  3. package/__mf/js/async/137.59c998ab.js +38 -0
  4. package/__mf/js/async/177.2fef2962.js +1 -0
  5. package/__mf/js/async/187.f5e8932b.js +1 -0
  6. package/__mf/js/async/192.c3dd56d5.js +1 -0
  7. package/__mf/js/async/2.60fa4a40.js +1 -0
  8. package/__mf/js/async/235.d23c8ef0.js +1 -0
  9. package/__mf/js/async/247.b8cba23e.js +7 -0
  10. package/__mf/js/async/274.72dfa9c8.js +2 -0
  11. package/__mf/js/async/356.8170c96d.js +1 -0
  12. package/__mf/js/async/392.b9ba5bf2.js +2 -0
  13. package/__mf/js/async/470.e09f33b7.js +2 -0
  14. package/__mf/js/async/491.85194549.js +1 -0
  15. package/__mf/js/async/52.0850e52c.js +1 -0
  16. package/__mf/js/async/527.f97d1b86.js +110 -0
  17. package/__mf/js/async/555.a66f6ab5.js +2 -0
  18. package/__mf/js/async/568.45da2c30.js +1 -0
  19. package/__mf/js/async/570.bafa9150.js +3 -0
  20. package/__mf/js/async/587.c9460696.js +1 -0
  21. package/__mf/js/async/588.0a1aa144.js +1 -0
  22. package/__mf/js/async/603.3b771310.js +2 -0
  23. package/__mf/js/async/603.3b771310.js.LICENSE.txt +9 -0
  24. package/__mf/js/async/616.79484ac8.js +1 -0
  25. package/__mf/js/async/655.dbf8c618.js +1 -0
  26. package/__mf/js/async/702.785cd635.js +2 -0
  27. package/__mf/js/async/71.8c6cf914.js +1 -0
  28. package/__mf/js/async/724.c45dcf5b.js +1 -0
  29. package/__mf/js/async/873.04a201bf.js +1 -0
  30. package/__mf/js/async/941.b89f8595.js +2 -0
  31. package/__mf/js/async/955.176fe200.js +1 -0
  32. package/__mf/js/async/968.2a9fb1a0.js +1 -0
  33. package/__mf/js/async/978.a9865b23.js +1 -0
  34. package/__mf/js/async/984.5778f693.js +22 -0
  35. package/__mf/js/async/{90.16425d5a.js.LICENSE.txt → 984.5778f693.js.LICENSE.txt} +0 -10
  36. package/__mf/js/async/__federation_expose_TimeSeriesChart.5f574fcb.js +1 -0
  37. package/__mf/js/async/lib-router.319c02cd.js +2 -0
  38. package/__mf/js/main.046b2715.js +7 -0
  39. package/lib/QuerySettingsEditor.d.ts.map +1 -1
  40. package/lib/QuerySettingsEditor.js +13 -11
  41. package/lib/QuerySettingsEditor.js.map +1 -1
  42. package/lib/TimeSeriesChartBase.d.ts +2 -0
  43. package/lib/TimeSeriesChartBase.d.ts.map +1 -1
  44. package/lib/TimeSeriesChartBase.js +90 -7
  45. package/lib/TimeSeriesChartBase.js.map +1 -1
  46. package/lib/TimeSeriesChartPanel.d.ts.map +1 -1
  47. package/lib/TimeSeriesChartPanel.js +7 -0
  48. package/lib/TimeSeriesChartPanel.js.map +1 -1
  49. package/lib/annotations/AnnotationTooltip.d.ts +18 -0
  50. package/lib/annotations/AnnotationTooltip.d.ts.map +1 -0
  51. package/lib/annotations/AnnotationTooltip.js +352 -0
  52. package/lib/annotations/AnnotationTooltip.js.map +1 -0
  53. package/lib/cjs/QuerySettingsEditor.js +12 -10
  54. package/lib/cjs/TimeSeriesChartBase.js +90 -7
  55. package/lib/cjs/TimeSeriesChartPanel.js +7 -0
  56. package/lib/cjs/annotations/AnnotationTooltip.js +370 -0
  57. package/lib/cjs/utils/annotation.js +37 -0
  58. package/lib/utils/annotation.d.ts +5 -0
  59. package/lib/utils/annotation.d.ts.map +1 -0
  60. package/lib/utils/annotation.js +29 -0
  61. package/lib/utils/annotation.js.map +1 -0
  62. package/mf-manifest.json +61 -36
  63. package/mf-stats.json +68 -36
  64. package/package.json +4 -3
  65. package/__mf/js/TimeSeriesChart.e9912623.js +0 -7
  66. package/__mf/js/async/121.df4898d6.js +0 -2
  67. package/__mf/js/async/177.56f1be10.js +0 -1
  68. package/__mf/js/async/192.beef3a1a.js +0 -1
  69. package/__mf/js/async/2.c3740bb9.js +0 -1
  70. package/__mf/js/async/235.c24f24f7.js +0 -1
  71. package/__mf/js/async/274.d112354f.js +0 -2
  72. package/__mf/js/async/291.5ce0f3cb.js +0 -39
  73. package/__mf/js/async/356.9f551c8a.js +0 -1
  74. package/__mf/js/async/392.2350fb02.js +0 -2
  75. package/__mf/js/async/470.a4fd777e.js +0 -2
  76. package/__mf/js/async/491.6f81cf51.js +0 -1
  77. package/__mf/js/async/568.cdcaf97d.js +0 -1
  78. package/__mf/js/async/587.c12780da.js +0 -1
  79. package/__mf/js/async/588.6662e16a.js +0 -1
  80. package/__mf/js/async/616.52acb1b4.js +0 -1
  81. package/__mf/js/async/681.8d61b348.js +0 -110
  82. package/__mf/js/async/702.de247ad8.js +0 -2
  83. package/__mf/js/async/71.84e486c9.js +0 -1
  84. package/__mf/js/async/724.3439df06.js +0 -1
  85. package/__mf/js/async/78.91de282a.js +0 -1
  86. package/__mf/js/async/821.aa2ab3e8.js +0 -7
  87. package/__mf/js/async/873.9aad328a.js +0 -1
  88. package/__mf/js/async/90.16425d5a.js +0 -24
  89. package/__mf/js/async/941.c0e2d25e.js +0 -2
  90. package/__mf/js/async/968.6de5fa7c.js +0 -1
  91. package/__mf/js/async/978.5c14e175.js +0 -1
  92. package/__mf/js/async/__federation_expose_TimeSeriesChart.58a7f341.js +0 -1
  93. package/__mf/js/async/lib-router.7a3f7bb4.js +0 -2
  94. package/__mf/js/main.de1f5d2f.js +0 -7
  95. /package/__mf/css/async/{821.85c2cbf6.css → 247.85c2cbf6.css} +0 -0
  96. /package/__mf/js/async/{121.df4898d6.js.LICENSE.txt → 121.c3c0e54f.js.LICENSE.txt} +0 -0
  97. /package/__mf/js/async/{821.aa2ab3e8.js.LICENSE.txt → 247.b8cba23e.js.LICENSE.txt} +0 -0
  98. /package/__mf/js/async/{274.d112354f.js.LICENSE.txt → 274.72dfa9c8.js.LICENSE.txt} +0 -0
  99. /package/__mf/js/async/{392.2350fb02.js.LICENSE.txt → 392.b9ba5bf2.js.LICENSE.txt} +0 -0
  100. /package/__mf/js/async/{470.a4fd777e.js.LICENSE.txt → 470.e09f33b7.js.LICENSE.txt} +0 -0
  101. /package/__mf/js/async/{681.8d61b348.js.LICENSE.txt → 527.f97d1b86.js.LICENSE.txt} +0 -0
  102. /package/__mf/js/async/{291.5ce0f3cb.js.LICENSE.txt → 555.a66f6ab5.js.LICENSE.txt} +0 -0
  103. /package/__mf/js/async/{702.de247ad8.js.LICENSE.txt → 702.785cd635.js.LICENSE.txt} +0 -0
  104. /package/__mf/js/async/{941.c0e2d25e.js.LICENSE.txt → 941.b89f8595.js.LICENSE.txt} +0 -0
  105. /package/__mf/js/async/{lib-router.7a3f7bb4.js.LICENSE.txt → lib-router.319c02cd.js.LICENSE.txt} +0 -0
@@ -0,0 +1,370 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ function _export(target, all) {
18
+ for(var name in all)Object.defineProperty(target, name, {
19
+ enumerable: true,
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
+ });
22
+ }
23
+ _export(exports, {
24
+ get AnnotationTooltip () {
25
+ return AnnotationTooltip;
26
+ },
27
+ get buildAnnotationSeries () {
28
+ return buildAnnotationSeries;
29
+ }
30
+ });
31
+ const _jsxruntime = require("react/jsx-runtime");
32
+ const _material = require("@mui/material");
33
+ const _Pin = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Pin"));
34
+ const _PinOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/PinOutline"));
35
+ const _useresizeobserver = /*#__PURE__*/ _interop_require_default(require("use-resize-observer"));
36
+ const _components = require("@perses-dev/components");
37
+ const _pluginsystem = require("@perses-dev/plugin-system");
38
+ function _interop_require_default(obj) {
39
+ return obj && obj.__esModule ? obj : {
40
+ default: obj
41
+ };
42
+ }
43
+ function AnnotationTooltip({ annotation, containerId, formatWithUserTimeZone, pinnedPos, enablePinning = true, onUnpinClick }) {
44
+ const mousePos = (0, _components.useMousePosition)();
45
+ const { height, width, ref: tooltipRef } = (0, _useresizeobserver.default)();
46
+ const isPinned = pinnedPos !== null;
47
+ if (!isPinned && mousePos === null) return null;
48
+ const containerElement = containerId ? document.querySelector(containerId) : undefined;
49
+ const maxHeight = containerElement ? containerElement.getBoundingClientRect().height : undefined;
50
+ const transform = (0, _components.assembleTransform)(mousePos, pinnedPos, height ?? 0, width ?? 0, containerElement);
51
+ const start = (0, _components.getDateAndTime)(annotation.start, formatWithUserTimeZone);
52
+ const end = annotation.end !== undefined ? (0, _components.getDateAndTime)(annotation.end, formatWithUserTimeZone) : null;
53
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Portal, {
54
+ container: containerElement,
55
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
56
+ ref: tooltipRef,
57
+ sx: (theme)=>(0, _components.getTooltipStyles)(theme, pinnedPos, maxHeight),
58
+ style: {
59
+ transform
60
+ },
61
+ children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
62
+ spacing: 0.5,
63
+ children: [
64
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
65
+ sx: (theme)=>({
66
+ width: '100%',
67
+ maxWidth: _components.TOOLTIP_MAX_WIDTH,
68
+ padding: theme.spacing(1.5, 2, 0.5, 2),
69
+ backgroundColor: theme.palette.designSystem?.grey[800] ?? _components.TOOLTIP_BG_COLOR_FALLBACK,
70
+ position: 'sticky',
71
+ top: 0,
72
+ left: 0
73
+ }),
74
+ children: [
75
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
76
+ sx: {
77
+ display: 'flex',
78
+ alignItems: 'center',
79
+ paddingBottom: 0.5,
80
+ width: '100%'
81
+ },
82
+ children: [
83
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
84
+ sx: {
85
+ width: 8,
86
+ height: 8,
87
+ borderRadius: '50%',
88
+ backgroundColor: annotation.color ?? _pluginsystem.DEFAULT_ANNOTATION_COLOR,
89
+ marginRight: 1,
90
+ flexShrink: 0
91
+ }
92
+ }),
93
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
94
+ sx: {
95
+ flexGrow: 1,
96
+ minWidth: 0
97
+ },
98
+ children: [
99
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
100
+ variant: "caption",
101
+ children: [
102
+ start.formattedDate,
103
+ " - ",
104
+ /*#__PURE__*/ (0, _jsxruntime.jsx)("strong", {
105
+ children: start.formattedTime
106
+ })
107
+ ]
108
+ }),
109
+ end && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
110
+ children: [
111
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
112
+ variant: "caption",
113
+ children: ' → '
114
+ }),
115
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
116
+ variant: "caption",
117
+ children: [
118
+ end.formattedDate,
119
+ " - ",
120
+ /*#__PURE__*/ (0, _jsxruntime.jsx)("strong", {
121
+ children: end.formattedTime
122
+ })
123
+ ]
124
+ })
125
+ ]
126
+ })
127
+ ]
128
+ }),
129
+ enablePinning && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
130
+ direction: "row",
131
+ alignItems: "center",
132
+ sx: {
133
+ marginLeft: 1,
134
+ flexShrink: 0
135
+ },
136
+ children: [
137
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
138
+ sx: {
139
+ marginRight: 0.5,
140
+ fontSize: 11,
141
+ verticalAlign: 'middle'
142
+ },
143
+ children: isPinned ? _components.UNPIN_TOOLTIP_HELP_TEXT : _components.PIN_TOOLTIP_HELP_TEXT
144
+ }),
145
+ isPinned ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_Pin.default, {
146
+ onClick: ()=>{
147
+ if (onUnpinClick !== undefined) onUnpinClick();
148
+ },
149
+ sx: {
150
+ fontSize: 16,
151
+ cursor: 'pointer'
152
+ }
153
+ }) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_PinOutline.default, {
154
+ sx: {
155
+ fontSize: 16
156
+ }
157
+ })
158
+ ]
159
+ })
160
+ ]
161
+ }),
162
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Divider, {
163
+ sx: (theme)=>({
164
+ width: '100%',
165
+ borderColor: theme.palette.grey['500']
166
+ })
167
+ })
168
+ ]
169
+ }),
170
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
171
+ sx: (theme)=>({
172
+ padding: theme.spacing(0.5, 2, 1.5, 2)
173
+ }),
174
+ children: [
175
+ annotation.title && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
176
+ variant: "caption",
177
+ sx: {
178
+ display: 'block',
179
+ fontWeight: 'bold',
180
+ marginBottom: 0.5
181
+ },
182
+ children: annotation.title
183
+ }),
184
+ annotation.legend && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
185
+ variant: "caption",
186
+ sx: {
187
+ display: 'block',
188
+ marginBottom: 0.5
189
+ },
190
+ children: annotation.legend
191
+ }),
192
+ annotation.tags && Object.keys(annotation.tags).length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
193
+ sx: {
194
+ display: 'flex',
195
+ flexWrap: 'wrap',
196
+ gap: 0.5,
197
+ marginTop: 0.5
198
+ },
199
+ children: Object.entries(annotation.tags).map(([key, value])=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
200
+ sx: (theme)=>({
201
+ backgroundColor: theme.palette.grey['700'],
202
+ borderRadius: '4px',
203
+ padding: '2px 6px',
204
+ fontSize: '0.7rem',
205
+ fontFamily: 'monospace'
206
+ }),
207
+ children: [
208
+ key,
209
+ ": ",
210
+ value
211
+ ]
212
+ }, key))
213
+ })
214
+ ]
215
+ })
216
+ ]
217
+ })
218
+ })
219
+ });
220
+ }
221
+ function buildAnnotationSeries(annotations) {
222
+ if (!annotations?.length) return [];
223
+ const markAreaData = [];
224
+ const markLineData = [];
225
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
226
+ const markPointData = [];
227
+ annotations.forEach((annotation, index)=>{
228
+ const color = annotation.color ?? _pluginsystem.DEFAULT_ANNOTATION_COLOR;
229
+ const opacity = 0.3;
230
+ if (annotation.end !== undefined) {
231
+ // Range annotation - use markArea and markLine (silent) + markers at start/end
232
+ markLineData.push({
233
+ xAxis: annotation.start,
234
+ lineStyle: {
235
+ color,
236
+ width: 2,
237
+ type: 'dashed'
238
+ },
239
+ label: {
240
+ show: false
241
+ },
242
+ annotationIndex: index
243
+ });
244
+ markLineData.push({
245
+ xAxis: annotation.end,
246
+ lineStyle: {
247
+ color,
248
+ width: 2,
249
+ type: 'dashed'
250
+ },
251
+ label: {
252
+ show: false
253
+ },
254
+ annotationIndex: index
255
+ });
256
+ markAreaData.push([
257
+ {
258
+ xAxis: annotation.start,
259
+ itemStyle: {
260
+ color,
261
+ opacity
262
+ }
263
+ },
264
+ {
265
+ xAxis: annotation.end
266
+ }
267
+ ]);
268
+ // Add start and end markers
269
+ for (const isStart of [
270
+ true,
271
+ false
272
+ ]){
273
+ markPointData.push({
274
+ coord: [
275
+ isStart ? annotation.start : annotation.end,
276
+ 0
277
+ ],
278
+ symbol: 'triangle',
279
+ symbolSize: [
280
+ 12,
281
+ 12
282
+ ],
283
+ symbolRotate: 0,
284
+ symbolOffset: [
285
+ 0,
286
+ 4
287
+ ],
288
+ itemStyle: {
289
+ color
290
+ },
291
+ annotationIndex: index,
292
+ emphasis: {
293
+ disabled: true
294
+ },
295
+ isStart: isStart,
296
+ isEnd: !isStart
297
+ });
298
+ }
299
+ } else {
300
+ // Point annotation - use markLine (silent) + single marker
301
+ markLineData.push({
302
+ xAxis: annotation.start,
303
+ lineStyle: {
304
+ color,
305
+ width: 2,
306
+ type: 'dashed'
307
+ },
308
+ label: {
309
+ show: false
310
+ },
311
+ annotationIndex: index
312
+ });
313
+ // Add point marker
314
+ markPointData.push({
315
+ coord: [
316
+ annotation.start,
317
+ 0
318
+ ],
319
+ symbol: 'triangle',
320
+ symbolSize: [
321
+ 12,
322
+ 10
323
+ ],
324
+ symbolRotate: 0,
325
+ symbolOffset: [
326
+ 0,
327
+ '120%'
328
+ ],
329
+ itemStyle: {
330
+ color
331
+ },
332
+ annotationIndex: index,
333
+ isPoint: true
334
+ });
335
+ }
336
+ });
337
+ const series = {
338
+ type: 'line',
339
+ data: [],
340
+ silent: false,
341
+ markArea: markAreaData.length > 0 ? {
342
+ silent: true,
343
+ data: markAreaData,
344
+ label: {
345
+ show: false
346
+ }
347
+ } : undefined,
348
+ markLine: markLineData.length > 0 ? {
349
+ silent: true,
350
+ symbol: [
351
+ 'none',
352
+ 'none'
353
+ ],
354
+ data: markLineData,
355
+ lineStyle: {
356
+ type: 'dashed'
357
+ }
358
+ } : undefined,
359
+ markPoint: markPointData.length > 0 ? {
360
+ silent: false,
361
+ data: markPointData,
362
+ label: {
363
+ show: false
364
+ }
365
+ } : undefined
366
+ };
367
+ return [
368
+ series
369
+ ];
370
+ }
@@ -0,0 +1,37 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the \"License\");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an \"AS IS\" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "convertAnnotationToTimeSeriesAnnotation", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return convertAnnotationToTimeSeriesAnnotation;
21
+ }
22
+ });
23
+ function convertAnnotationToTimeSeriesAnnotation(annotations) {
24
+ const result = [];
25
+ for (const annotation of annotations){
26
+ for (const item of annotation.data){
27
+ if (annotation.definition.display.hidden) {
28
+ continue;
29
+ }
30
+ result.push({
31
+ ...annotation.definition.display,
32
+ ...item
33
+ });
34
+ }
35
+ }
36
+ return result;
37
+ }
@@ -0,0 +1,5 @@
1
+ import { AnnotationData, AnnotationDisplay } from '@perses-dev/spec';
2
+ import { AnnotationSpecWithData } from '@perses-dev/dashboards';
3
+ export type TimeSeriesAnnotation = AnnotationData & AnnotationDisplay;
4
+ export declare function convertAnnotationToTimeSeriesAnnotation(annotations: AnnotationSpecWithData[]): TimeSeriesAnnotation[];
5
+ //# sourceMappingURL=annotation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotation.d.ts","sourceRoot":"","sources":["../../../src/utils/annotation.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG,iBAAiB,CAAC;AAEtE,wBAAgB,uCAAuC,CAAC,WAAW,EAAE,sBAAsB,EAAE,GAAG,oBAAoB,EAAE,CAcrH"}
@@ -0,0 +1,29 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the \"License\");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an \"AS IS\" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ export function convertAnnotationToTimeSeriesAnnotation(annotations) {
14
+ const result = [];
15
+ for (const annotation of annotations){
16
+ for (const item of annotation.data){
17
+ if (annotation.definition.display.hidden) {
18
+ continue;
19
+ }
20
+ result.push({
21
+ ...annotation.definition.display,
22
+ ...item
23
+ });
24
+ }
25
+ }
26
+ return result;
27
+ }
28
+
29
+ //# sourceMappingURL=annotation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/annotation.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { AnnotationData, AnnotationDisplay } from '@perses-dev/spec';\nimport { AnnotationSpecWithData } from '@perses-dev/dashboards';\n\nexport type TimeSeriesAnnotation = AnnotationData & AnnotationDisplay;\n\nexport function convertAnnotationToTimeSeriesAnnotation(annotations: AnnotationSpecWithData[]): TimeSeriesAnnotation[] {\n const result: TimeSeriesAnnotation[] = [];\n for (const annotation of annotations) {\n for (const item of annotation.data) {\n if (annotation.definition.display.hidden) {\n continue;\n }\n result.push({\n ...annotation.definition.display,\n ...item,\n });\n }\n }\n return result;\n}\n"],"names":["convertAnnotationToTimeSeriesAnnotation","annotations","result","annotation","item","data","definition","display","hidden","push"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAOjC,OAAO,SAASA,wCAAwCC,WAAqC;IAC3F,MAAMC,SAAiC,EAAE;IACzC,KAAK,MAAMC,cAAcF,YAAa;QACpC,KAAK,MAAMG,QAAQD,WAAWE,IAAI,CAAE;YAClC,IAAIF,WAAWG,UAAU,CAACC,OAAO,CAACC,MAAM,EAAE;gBACxC;YACF;YACAN,OAAOO,IAAI,CAAC;gBACV,GAAGN,WAAWG,UAAU,CAACC,OAAO;gBAChC,GAAGH,IAAI;YACT;QACF;IACF;IACA,OAAOF;AACT"}
package/mf-manifest.json CHANGED
@@ -5,11 +5,11 @@
5
5
  "name": "TimeSeriesChart",
6
6
  "type": "app",
7
7
  "buildInfo": {
8
- "buildVersion": "0.13.0-beta.2",
8
+ "buildVersion": "0.13.0-beta.3",
9
9
  "buildName": "@perses-dev/timeseries-chart-plugin"
10
10
  },
11
11
  "remoteEntry": {
12
- "name": "__mf/js/TimeSeriesChart.e9912623.js",
12
+ "name": "__mf/js/TimeSeriesChart.693fccf6.js",
13
13
  "path": "",
14
14
  "type": "global"
15
15
  },
@@ -20,7 +20,7 @@
20
20
  "api": ""
21
21
  },
22
22
  "globalName": "TimeSeriesChart",
23
- "pluginVersion": "2.5.1",
23
+ "pluginVersion": "2.6.0",
24
24
  "getPublicPath": "function() { const prefix = window.PERSES_PLUGIN_ASSETS_PATH || window.PERSES_APP_CONFIG?.api_prefix || \"\"; return prefix + \"/plugins/TimeSeriesChart/\"; }"
25
25
  },
26
26
  "shared": [
@@ -34,7 +34,7 @@
34
34
  "js": {
35
35
  "async": [],
36
36
  "sync": [
37
- "__mf/js/async/274.d112354f.js"
37
+ "__mf/js/async/274.72dfa9c8.js"
38
38
  ]
39
39
  },
40
40
  "css": {
@@ -54,8 +54,8 @@
54
54
  "js": {
55
55
  "async": [],
56
56
  "sync": [
57
- "__mf/js/async/235.c24f24f7.js",
58
- "__mf/js/async/616.52acb1b4.js"
57
+ "__mf/js/async/235.d23c8ef0.js",
58
+ "__mf/js/async/616.79484ac8.js"
59
59
  ]
60
60
  },
61
61
  "css": {
@@ -75,8 +75,8 @@
75
75
  "js": {
76
76
  "async": [],
77
77
  "sync": [
78
- "__mf/js/async/587.c12780da.js",
79
- "__mf/js/async/968.6de5fa7c.js"
78
+ "__mf/js/async/587.c9460696.js",
79
+ "__mf/js/async/968.2a9fb1a0.js"
80
80
  ]
81
81
  },
82
82
  "css": {
@@ -89,36 +89,56 @@
89
89
  {
90
90
  "id": "TimeSeriesChart:@perses-dev/components",
91
91
  "name": "@perses-dev/components",
92
- "version": "0.54.0-beta.8",
92
+ "version": "0.54.0-beta.11",
93
93
  "singleton": true,
94
- "requiredVersion": "^0.54.0-beta.8",
94
+ "requiredVersion": "^0.54.0-beta.11",
95
95
  "assets": {
96
96
  "js": {
97
97
  "async": [],
98
98
  "sync": [
99
- "__mf/js/async/821.aa2ab3e8.js"
99
+ "__mf/js/async/247.b8cba23e.js"
100
100
  ]
101
101
  },
102
102
  "css": {
103
103
  "async": [],
104
104
  "sync": [
105
- "__mf/css/async/821.85c2cbf6.css"
105
+ "__mf/css/async/247.85c2cbf6.css"
106
106
  ]
107
107
  }
108
108
  },
109
109
  "fallback": ""
110
110
  },
111
+ {
112
+ "id": "TimeSeriesChart:@perses-dev/dashboards",
113
+ "name": "@perses-dev/dashboards",
114
+ "version": "0.54.0-beta.11",
115
+ "singleton": true,
116
+ "requiredVersion": "^0.54.0-beta.11",
117
+ "assets": {
118
+ "js": {
119
+ "async": [],
120
+ "sync": [
121
+ "__mf/js/async/984.5778f693.js"
122
+ ]
123
+ },
124
+ "css": {
125
+ "async": [],
126
+ "sync": []
127
+ }
128
+ },
129
+ "fallback": ""
130
+ },
111
131
  {
112
132
  "id": "TimeSeriesChart:@perses-dev/plugin-system",
113
133
  "name": "@perses-dev/plugin-system",
114
- "version": "0.54.0-beta.8",
134
+ "version": "0.54.0-beta.11",
115
135
  "singleton": true,
116
- "requiredVersion": "^0.54.0-beta.8",
136
+ "requiredVersion": "^0.54.0-beta.11",
117
137
  "assets": {
118
138
  "js": {
119
139
  "async": [],
120
140
  "sync": [
121
- "__mf/js/async/90.16425d5a.js"
141
+ "__mf/js/async/570.bafa9150.js"
122
142
  ]
123
143
  },
124
144
  "css": {
@@ -131,14 +151,14 @@
131
151
  {
132
152
  "id": "TimeSeriesChart:date-fns",
133
153
  "name": "date-fns",
134
- "version": "4.1.0",
154
+ "version": "4.4.0",
135
155
  "singleton": true,
136
- "requiredVersion": "^4.1.0",
156
+ "requiredVersion": "^4.4.0",
137
157
  "assets": {
138
158
  "js": {
139
159
  "async": [],
140
160
  "sync": [
141
- "__mf/js/async/192.beef3a1a.js"
161
+ "__mf/js/async/192.c3dd56d5.js"
142
162
  ]
143
163
  },
144
164
  "css": {
@@ -158,7 +178,7 @@
158
178
  "js": {
159
179
  "async": [],
160
180
  "sync": [
161
- "__mf/js/async/873.9aad328a.js"
181
+ "__mf/js/async/873.04a201bf.js"
162
182
  ]
163
183
  },
164
184
  "css": {
@@ -178,7 +198,7 @@
178
198
  "js": {
179
199
  "async": [],
180
200
  "sync": [
181
- "__mf/js/async/392.2350fb02.js"
201
+ "__mf/js/async/392.b9ba5bf2.js"
182
202
  ]
183
203
  },
184
204
  "css": {
@@ -198,7 +218,7 @@
198
218
  "js": {
199
219
  "async": [],
200
220
  "sync": [
201
- "__mf/js/async/470.a4fd777e.js"
221
+ "__mf/js/async/470.e09f33b7.js"
202
222
  ]
203
223
  },
204
224
  "css": {
@@ -218,7 +238,7 @@
218
238
  "js": {
219
239
  "async": [],
220
240
  "sync": [
221
- "__mf/js/async/121.df4898d6.js"
241
+ "__mf/js/async/121.c3c0e54f.js"
222
242
  ]
223
243
  },
224
244
  "css": {
@@ -238,7 +258,7 @@
238
258
  "js": {
239
259
  "async": [],
240
260
  "sync": [
241
- "__mf/js/async/978.5c14e175.js"
261
+ "__mf/js/async/978.a9865b23.js"
242
262
  ]
243
263
  },
244
264
  "css": {
@@ -257,26 +277,31 @@
257
277
  "assets": {
258
278
  "js": {
259
279
  "sync": [
260
- "__mf/js/async/702.de247ad8.js",
261
- "__mf/js/async/681.8d61b348.js",
262
- "__mf/js/async/78.91de282a.js",
263
- "__mf/js/async/724.3439df06.js",
264
- "__mf/js/async/__federation_expose_TimeSeriesChart.58a7f341.js"
280
+ "__mf/js/async/955.176fe200.js",
281
+ "__mf/js/async/702.785cd635.js",
282
+ "__mf/js/async/527.f97d1b86.js",
283
+ "__mf/js/async/52.0850e52c.js",
284
+ "__mf/js/async/724.c45dcf5b.js",
285
+ "__mf/js/async/__federation_expose_TimeSeriesChart.5f574fcb.js"
265
286
  ],
266
287
  "async": [
267
- "__mf/js/async/588.6662e16a.js",
268
- "__mf/js/async/356.9f551c8a.js",
269
- "__mf/js/async/71.84e486c9.js",
270
- "__mf/js/async/291.5ce0f3cb.js",
271
- "__mf/js/async/491.6f81cf51.js",
272
- "__mf/js/async/lib-router.7a3f7bb4.js",
273
- "__mf/js/async/177.56f1be10.js"
288
+ "__mf/js/async/lib-router.319c02cd.js",
289
+ "__mf/js/async/356.8170c96d.js",
290
+ "__mf/js/async/655.dbf8c618.js",
291
+ "__mf/js/async/137.59c998ab.js",
292
+ "__mf/js/async/603.3b771310.js",
293
+ "__mf/js/async/555.a66f6ab5.js",
294
+ "__mf/js/async/588.0a1aa144.js",
295
+ "__mf/js/async/71.8c6cf914.js",
296
+ "__mf/js/async/491.85194549.js",
297
+ "__mf/js/async/187.f5e8932b.js",
298
+ "__mf/js/async/177.2fef2962.js"
274
299
  ]
275
300
  },
276
301
  "css": {
277
302
  "sync": [],
278
303
  "async": [
279
- "__mf/css/async/821.85c2cbf6.css"
304
+ "__mf/css/async/247.85c2cbf6.css"
280
305
  ]
281
306
  }
282
307
  },