@perses-dev/timeseries-chart-plugin 0.12.0 → 0.13.0-beta.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/__mf/css/async/826.85c2cbf6.css +1 -0
- package/__mf/font/inter-cyrillic-300-normal.432f2b21.woff +0 -0
- package/__mf/font/inter-cyrillic-300-normal.9da91009.woff2 +0 -0
- package/__mf/font/inter-cyrillic-400-normal.372704ff.woff2 +0 -0
- package/__mf/font/inter-cyrillic-400-normal.a6b6ef6f.woff +0 -0
- package/__mf/font/inter-cyrillic-500-normal.7c15bba8.woff2 +0 -0
- package/__mf/font/inter-cyrillic-500-normal.b9f8c929.woff +0 -0
- package/__mf/font/inter-cyrillic-600-normal.2f42892a.woff2 +0 -0
- package/__mf/font/inter-cyrillic-600-normal.c3987adc.woff +0 -0
- package/__mf/font/inter-cyrillic-700-normal.93eba3c3.woff +0 -0
- package/__mf/font/inter-cyrillic-700-normal.e9e5b2dc.woff2 +0 -0
- package/__mf/font/inter-cyrillic-900-normal.f285bd7a.woff2 +0 -0
- package/__mf/font/inter-cyrillic-900-normal.ffbd8a3a.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-300-normal.95bb9038.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-300-normal.cfc143a9.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-400-normal.2a31c04b.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-400-normal.f572b170.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-500-normal.5a6bb1da.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-500-normal.fe0d9b14.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-600-normal.ecbdecad.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-600-normal.f7b3c15b.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-700-normal.4b4022a6.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-700-normal.74b516d2.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-900-normal.9970ddb5.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-900-normal.a0d59adc.woff2 +0 -0
- package/__mf/font/inter-greek-300-normal.0d7be683.woff2 +0 -0
- package/__mf/font/inter-greek-300-normal.8f0b988e.woff +0 -0
- package/__mf/font/inter-greek-400-normal.cc58c11b.woff +0 -0
- package/__mf/font/inter-greek-400-normal.d7020e3c.woff2 +0 -0
- package/__mf/font/inter-greek-500-normal.d9a33207.woff +0 -0
- package/__mf/font/inter-greek-500-normal.f41f43db.woff2 +0 -0
- package/__mf/font/inter-greek-600-normal.4ec0c1c1.woff +0 -0
- package/__mf/font/inter-greek-600-normal.cc532937.woff2 +0 -0
- package/__mf/font/inter-greek-700-normal.5ec6c758.woff +0 -0
- package/__mf/font/inter-greek-700-normal.97f0eeeb.woff2 +0 -0
- package/__mf/font/inter-greek-900-normal.46b66369.woff2 +0 -0
- package/__mf/font/inter-greek-900-normal.9ae3a3c5.woff +0 -0
- package/__mf/font/inter-greek-ext-300-normal.10247a66.woff2 +0 -0
- package/__mf/font/inter-greek-ext-300-normal.4668e5cb.woff +0 -0
- package/__mf/font/inter-greek-ext-400-normal.4ce1df5d.woff2 +0 -0
- package/__mf/font/inter-greek-ext-400-normal.88ede1ea.woff +0 -0
- package/__mf/font/inter-greek-ext-500-normal.7a4aa726.woff +0 -0
- package/__mf/font/inter-greek-ext-500-normal.cbd51e2d.woff2 +0 -0
- package/__mf/font/inter-greek-ext-600-normal.089a95ee.woff +0 -0
- package/__mf/font/inter-greek-ext-600-normal.1f33d317.woff2 +0 -0
- package/__mf/font/inter-greek-ext-700-normal.31f1075d.woff +0 -0
- package/__mf/font/inter-greek-ext-700-normal.827cd618.woff2 +0 -0
- package/__mf/font/inter-greek-ext-900-normal.531bcee7.woff +0 -0
- package/__mf/font/inter-greek-ext-900-normal.8a9b36b9.woff2 +0 -0
- package/__mf/font/inter-latin-300-normal.15fb600d.woff2 +0 -0
- package/__mf/font/inter-latin-300-normal.6f95f590.woff +0 -0
- package/__mf/font/inter-latin-400-normal.2c7a775c.woff +0 -0
- package/__mf/font/inter-latin-400-normal.ef6d3f52.woff2 +0 -0
- package/__mf/font/inter-latin-500-normal.b7b43ace.woff2 +0 -0
- package/__mf/font/inter-latin-500-normal.cb4c8ceb.woff +0 -0
- package/__mf/font/inter-latin-600-normal.8fb1a964.woff2 +0 -0
- package/__mf/font/inter-latin-600-normal.ce0f5f43.woff +0 -0
- package/__mf/font/inter-latin-700-normal.953b7aa5.woff2 +0 -0
- package/__mf/font/inter-latin-700-normal.9c21d4dc.woff +0 -0
- package/__mf/font/inter-latin-900-normal.2a8028ec.woff2 +0 -0
- package/__mf/font/inter-latin-900-normal.fa252135.woff +0 -0
- package/__mf/font/inter-latin-ext-300-normal.167cc8c9.woff2 +0 -0
- package/__mf/font/inter-latin-ext-300-normal.f695be66.woff +0 -0
- package/__mf/font/inter-latin-ext-400-normal.32a25442.woff2 +0 -0
- package/__mf/font/inter-latin-ext-400-normal.4edcaace.woff +0 -0
- package/__mf/font/inter-latin-ext-500-normal.a19a84a6.woff +0 -0
- package/__mf/font/inter-latin-ext-500-normal.d9b491de.woff2 +0 -0
- package/__mf/font/inter-latin-ext-600-normal.38b075d8.woff2 +0 -0
- package/__mf/font/inter-latin-ext-600-normal.49faa47a.woff +0 -0
- package/__mf/font/inter-latin-ext-700-normal.93534b50.woff +0 -0
- package/__mf/font/inter-latin-ext-700-normal.b63daa1a.woff2 +0 -0
- package/__mf/font/inter-latin-ext-900-normal.0efdb307.woff +0 -0
- package/__mf/font/inter-latin-ext-900-normal.9c0fc2c7.woff2 +0 -0
- package/__mf/font/inter-vietnamese-300-normal.aad496d8.woff +0 -0
- package/__mf/font/inter-vietnamese-300-normal.ad9ef503.woff2 +0 -0
- package/__mf/font/inter-vietnamese-400-normal.a9dd2faf.woff +0 -0
- package/__mf/font/inter-vietnamese-400-normal.de4fc44f.woff2 +0 -0
- package/__mf/font/inter-vietnamese-500-normal.7c0a695f.woff2 +0 -0
- package/__mf/font/inter-vietnamese-500-normal.a3a73b95.woff +0 -0
- package/__mf/font/inter-vietnamese-600-normal.9d518599.woff2 +0 -0
- package/__mf/font/inter-vietnamese-600-normal.c5ce3fcb.woff +0 -0
- package/__mf/font/inter-vietnamese-700-normal.bc68b199.woff +0 -0
- package/__mf/font/inter-vietnamese-700-normal.faf12809.woff2 +0 -0
- package/__mf/font/inter-vietnamese-900-normal.2b782045.woff +0 -0
- package/__mf/font/inter-vietnamese-900-normal.e639b65a.woff2 +0 -0
- package/__mf/js/TimeSeriesChart.7df900ef.js +7 -0
- package/__mf/js/async/121.df4898d6.js +2 -0
- package/__mf/js/async/177.56f1be10.js +1 -0
- package/__mf/js/async/192.beef3a1a.js +1 -0
- package/__mf/js/async/2.c3740bb9.js +1 -0
- package/__mf/js/async/235.c24f24f7.js +1 -0
- package/__mf/js/async/274.d112354f.js +2 -0
- package/__mf/js/async/356.9f551c8a.js +1 -0
- package/__mf/js/async/366.084dd32e.js +24 -0
- package/__mf/js/async/377.7ec764e5.js +2 -0
- package/__mf/js/async/{544.4dd63985.js.LICENSE.txt → 377.7ec764e5.js.LICENSE.txt} +1 -1
- package/__mf/js/async/392.2350fb02.js +2 -0
- package/__mf/js/async/470.a4fd777e.js +2 -0
- package/__mf/js/async/491.6f81cf51.js +1 -0
- package/__mf/js/async/558.401fb679.js +1 -0
- package/__mf/js/async/587.c12780da.js +1 -0
- package/__mf/js/async/588.6662e16a.js +1 -0
- package/__mf/js/async/616.52acb1b4.js +1 -0
- package/__mf/js/async/702.de247ad8.js +2 -0
- package/__mf/js/async/71.84e486c9.js +1 -0
- package/__mf/js/async/721.88bf4be4.js +110 -0
- package/__mf/js/async/{390.ad50daba.js.LICENSE.txt → 721.88bf4be4.js.LICENSE.txt} +1 -1
- package/__mf/js/async/78.91de282a.js +1 -0
- package/__mf/js/async/826.c7b150c6.js +7 -0
- package/__mf/js/async/{97.3f27a901.js.LICENSE.txt → 826.c7b150c6.js.LICENSE.txt} +19 -1
- package/__mf/js/async/873.9aad328a.js +1 -0
- package/__mf/js/async/891.18ba0e56.js +38 -0
- package/__mf/js/async/941.c0e2d25e.js +2 -0
- package/__mf/js/async/945.1a85358e.js +1 -0
- package/__mf/js/async/968.6de5fa7c.js +1 -0
- package/__mf/js/async/978.5c14e175.js +1 -0
- package/__mf/js/async/__federation_expose_TimeSeriesChart.0329eb0a.js +1 -0
- package/__mf/js/async/lib-router.1934857d.js +2 -0
- package/__mf/js/main.496219f9.js +7 -0
- package/lib/QuerySettingsEditor.d.ts.map +1 -1
- package/lib/QuerySettingsEditor.js +179 -167
- package/lib/QuerySettingsEditor.js.map +1 -1
- package/lib/TimeSeriesChartBase.d.ts.map +1 -1
- package/lib/TimeSeriesChartBase.js +12 -10
- package/lib/TimeSeriesChartBase.js.map +1 -1
- package/lib/TimeSeriesChartPanel.d.ts.map +1 -1
- package/lib/TimeSeriesChartPanel.js +2 -1
- package/lib/TimeSeriesChartPanel.js.map +1 -1
- package/lib/TimeSeriesExportAction.js +1 -1
- package/lib/TimeSeriesExportAction.js.map +1 -1
- package/lib/cjs/QuerySettingsEditor.js +177 -165
- package/lib/cjs/TimeSeriesChartBase.js +10 -8
- package/lib/cjs/TimeSeriesChartPanel.js +2 -1
- package/lib/cjs/TimeSeriesExportAction.js +5 -5
- package/lib/cjs/index.js +0 -1
- package/lib/cjs/utils/timezone-formatter.js +48 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/timezone-formatter.d.ts +5 -0
- package/lib/utils/timezone-formatter.d.ts.map +1 -0
- package/lib/utils/timezone-formatter.js +42 -0
- package/lib/utils/timezone-formatter.js.map +1 -0
- package/mf-manifest.json +63 -52
- package/mf-stats.json +75 -56
- package/package.json +4 -4
- package/__mf/css/async/442.d3010b86.css +0 -1
- package/__mf/css/async/61.d3010b86.css +0 -1
- package/__mf/css/async/823.d3010b86.css +0 -1
- package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
- package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
- package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
- package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
- package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
- package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
- package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
- package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
- package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
- package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
- package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
- package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
- package/__mf/js/TimeSeriesChart.e51aefbf.js +0 -6
- package/__mf/js/async/121.a742c022.js +0 -2
- package/__mf/js/async/177.97e14ed0.js +0 -1
- package/__mf/js/async/192.30450189.js +0 -1
- package/__mf/js/async/2.68ee9e1b.js +0 -1
- package/__mf/js/async/235.a53a2591.js +0 -1
- package/__mf/js/async/274.8e8950b6.js +0 -2
- package/__mf/js/async/356.dee0f34a.js +0 -1
- package/__mf/js/async/390.ad50daba.js +0 -110
- package/__mf/js/async/392.550376f0.js +0 -2
- package/__mf/js/async/470.4c93905a.js +0 -2
- package/__mf/js/async/489.8bb61ec9.js +0 -1
- package/__mf/js/async/491.35fc6280.js +0 -1
- package/__mf/js/async/544.4dd63985.js +0 -2
- package/__mf/js/async/558.5a41ebcc.js +0 -1
- package/__mf/js/async/587.40becf9b.js +0 -1
- package/__mf/js/async/588.33924c3f.js +0 -1
- package/__mf/js/async/616.6d37f37b.js +0 -1
- package/__mf/js/async/648.128f31b8.js +0 -22
- package/__mf/js/async/702.5d93a78a.js +0 -2
- package/__mf/js/async/71.e481dbdb.js +0 -1
- package/__mf/js/async/78.362ece9d.js +0 -1
- package/__mf/js/async/867.12a42f78.js +0 -38
- package/__mf/js/async/873.11e0e15e.js +0 -1
- package/__mf/js/async/941.5331fb70.js +0 -2
- package/__mf/js/async/968.2ea36b8a.js +0 -1
- package/__mf/js/async/97.3f27a901.js +0 -7
- package/__mf/js/async/978.844227d5.js +0 -1
- package/__mf/js/async/__federation_expose_TimeSeriesChart.8cacec73.js +0 -3
- package/__mf/js/async/lib-router.9730f5e9.js +0 -2
- package/__mf/js/main.90e8ca42.js +0 -6
- package/lib/CSVExportUtils.d.ts +0 -39
- package/lib/CSVExportUtils.d.ts.map +0 -1
- package/lib/CSVExportUtils.js +0 -212
- package/lib/CSVExportUtils.js.map +0 -1
- package/lib/cjs/CSVExportUtils.js +0 -246
- /package/__mf/js/async/{121.a742c022.js.LICENSE.txt → 121.df4898d6.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{274.8e8950b6.js.LICENSE.txt → 274.d112354f.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{648.128f31b8.js.LICENSE.txt → 366.084dd32e.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.550376f0.js.LICENSE.txt → 392.2350fb02.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{470.4c93905a.js.LICENSE.txt → 470.a4fd777e.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{702.5d93a78a.js.LICENSE.txt → 702.de247ad8.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.5331fb70.js.LICENSE.txt → 941.c0e2d25e.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{lib-router.9730f5e9.js.LICENSE.txt → lib-router.1934857d.js.LICENSE.txt} +0 -0
|
@@ -212,19 +212,20 @@ function QuerySettingsEditor(props) {
|
|
|
212
212
|
qs.areaOpacity = undefined;
|
|
213
213
|
});
|
|
214
214
|
};
|
|
215
|
-
const
|
|
215
|
+
const addFormat = (i)=>{
|
|
216
216
|
updateQuerySettings(i, (qs)=>{
|
|
217
217
|
qs.format = {
|
|
218
|
-
unit: 'decimal'
|
|
218
|
+
unit: 'decimal',
|
|
219
|
+
shortValues: true
|
|
219
220
|
};
|
|
220
221
|
});
|
|
221
222
|
};
|
|
222
|
-
const
|
|
223
|
+
const removeFormat = (i)=>{
|
|
223
224
|
updateQuerySettings(i, (qs)=>{
|
|
224
225
|
qs.format = undefined;
|
|
225
226
|
});
|
|
226
227
|
};
|
|
227
|
-
const
|
|
228
|
+
const handleFormatChange = (i, format)=>{
|
|
228
229
|
updateQuerySettings(i, (qs)=>{
|
|
229
230
|
qs.format = format;
|
|
230
231
|
});
|
|
@@ -288,9 +289,9 @@ function QuerySettingsEditor(props) {
|
|
|
288
289
|
onRemoveLineStyle: ()=>removeLineStyle(i),
|
|
289
290
|
onAddAreaOpacity: ()=>addAreaOpacity(i),
|
|
290
291
|
onRemoveAreaOpacity: ()=>removeAreaOpacity(i),
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
292
|
+
onAddFormat: ()=>addFormat(i),
|
|
293
|
+
onRemoveFormat: ()=>removeFormat(i),
|
|
294
|
+
onFormatChange: (format)=>handleFormatChange(i, format)
|
|
294
295
|
}, i)),
|
|
295
296
|
queryCount > 0 && firstAvailableQueryIndex !== NO_INDEX_AVAILABLE && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
296
297
|
variant: "contained",
|
|
@@ -304,7 +305,7 @@ function QuerySettingsEditor(props) {
|
|
|
304
305
|
]
|
|
305
306
|
});
|
|
306
307
|
}
|
|
307
|
-
function QuerySettingsInput({ querySettings: { queryIndex, colorMode, colorValue, lineStyle, areaOpacity, format }, availableQueryIndexes, onQueryIndexChange, onColorModeChange, onColorValueChange, onLineStyleChange, onAreaOpacityChange, onDelete, inputRef, onAddColor: onAddColor, onRemoveColor: onRemoveColor, onAddLineStyle, onRemoveLineStyle, onAddAreaOpacity, onRemoveAreaOpacity,
|
|
308
|
+
function QuerySettingsInput({ querySettings: { queryIndex, colorMode, colorValue, lineStyle, areaOpacity, format }, availableQueryIndexes, onQueryIndexChange, onColorModeChange, onColorValueChange, onLineStyleChange, onAreaOpacityChange, onDelete, inputRef, onAddColor: onAddColor, onRemoveColor: onRemoveColor, onAddLineStyle, onRemoveLineStyle, onAddAreaOpacity, onRemoveAreaOpacity, onAddFormat, onRemoveFormat, onFormatChange }) {
|
|
308
309
|
// current query index should also be selectable
|
|
309
310
|
const selectableQueryIndexes = availableQueryIndexes.concat(queryIndex).sort((a, b)=>a - b);
|
|
310
311
|
// State for dropdown menu
|
|
@@ -328,9 +329,9 @@ function QuerySettingsInput({ querySettings: { queryIndex, colorMode, colorValue
|
|
|
328
329
|
action: onAddAreaOpacity
|
|
329
330
|
});
|
|
330
331
|
if (format === undefined) options.push({
|
|
331
|
-
key: '
|
|
332
|
-
label: '
|
|
333
|
-
action:
|
|
332
|
+
key: 'format',
|
|
333
|
+
label: 'Format',
|
|
334
|
+
action: onAddFormat
|
|
334
335
|
});
|
|
335
336
|
return options;
|
|
336
337
|
}, [
|
|
@@ -341,7 +342,7 @@ function QuerySettingsInput({ querySettings: { queryIndex, colorMode, colorValue
|
|
|
341
342
|
onAddColor,
|
|
342
343
|
onAddLineStyle,
|
|
343
344
|
onAddAreaOpacity,
|
|
344
|
-
|
|
345
|
+
onAddFormat
|
|
345
346
|
]);
|
|
346
347
|
const handleAddMenuClick = (event)=>{
|
|
347
348
|
if (availableOptions.length === 1 && availableOptions[0]) {
|
|
@@ -359,172 +360,183 @@ function QuerySettingsInput({ querySettings: { queryIndex, colorMode, colorValue
|
|
|
359
360
|
action();
|
|
360
361
|
handleMenuClose();
|
|
361
362
|
};
|
|
362
|
-
return /*#__PURE__*/ (0, _jsxruntime.
|
|
363
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
363
364
|
sx: {
|
|
364
365
|
borderBottom: '1px solid',
|
|
365
366
|
borderColor: 'divider',
|
|
366
367
|
borderRadius: 1,
|
|
367
|
-
p: 2
|
|
368
|
+
p: 2,
|
|
369
|
+
display: 'flex',
|
|
370
|
+
flexWrap: 'nowrap',
|
|
371
|
+
flexDirection: 'row'
|
|
368
372
|
},
|
|
369
|
-
children:
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
},
|
|
386
|
-
children: selectableQueryIndexes.map((qi)=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.MenuItem, {
|
|
387
|
-
value: qi,
|
|
388
|
-
children: [
|
|
389
|
-
"#",
|
|
390
|
-
qi + 1
|
|
391
|
-
]
|
|
392
|
-
}, `query-${qi}`))
|
|
393
|
-
}),
|
|
394
|
-
colorMode && /*#__PURE__*/ (0, _jsxruntime.jsxs)(SettingsSection, {
|
|
395
|
-
label: "Color",
|
|
396
|
-
onRemove: onRemoveColor,
|
|
397
|
-
children: [
|
|
398
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TextField, {
|
|
399
|
-
select: true,
|
|
400
|
-
value: colorMode,
|
|
401
|
-
onChange: onColorModeChange,
|
|
402
|
-
size: "small",
|
|
403
|
-
sx: {
|
|
404
|
-
flexGrow: 1
|
|
405
|
-
},
|
|
406
|
-
children: [
|
|
407
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
408
|
-
value: "fixed-single",
|
|
409
|
-
children: "Fixed (single)"
|
|
410
|
-
}),
|
|
411
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
412
|
-
value: "fixed",
|
|
413
|
-
children: "Fixed"
|
|
414
|
-
})
|
|
415
|
-
]
|
|
416
|
-
}),
|
|
417
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsColorPicker, {
|
|
418
|
-
label: `Query n°${queryIndex + 1}`,
|
|
419
|
-
color: colorValue || DEFAULT_COLOR_VALUE,
|
|
420
|
-
onColorChange: onColorValueChange
|
|
421
|
-
})
|
|
422
|
-
]
|
|
423
|
-
}),
|
|
424
|
-
lineStyle && /*#__PURE__*/ (0, _jsxruntime.jsxs)(SettingsSection, {
|
|
425
|
-
label: "Line Style",
|
|
426
|
-
onRemove: onRemoveLineStyle,
|
|
427
|
-
children: [
|
|
428
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ToggleButtonGroup, {
|
|
429
|
-
color: "primary",
|
|
430
|
-
exclusive: true,
|
|
431
|
-
value: lineStyle,
|
|
432
|
-
onChange: (__, newValue)=>{
|
|
433
|
-
if (newValue !== null) {
|
|
434
|
-
onLineStyleChange(newValue);
|
|
435
|
-
}
|
|
436
|
-
},
|
|
437
|
-
size: "small",
|
|
438
|
-
children: Object.entries(_timeserieschartmodel.LINE_STYLE_CONFIG).map(([styleValue, config])=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ToggleButton, {
|
|
439
|
-
value: styleValue,
|
|
440
|
-
"aria-label": `${styleValue} line style`,
|
|
441
|
-
children: config.label
|
|
442
|
-
}, styleValue))
|
|
443
|
-
}),
|
|
444
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
445
|
-
sx: {
|
|
446
|
-
flexGrow: 1
|
|
447
|
-
}
|
|
448
|
-
})
|
|
449
|
-
]
|
|
450
|
-
}),
|
|
451
|
-
areaOpacity !== undefined && /*#__PURE__*/ (0, _jsxruntime.jsxs)(SettingsSection, {
|
|
452
|
-
label: "Opacity",
|
|
453
|
-
onRemove: onRemoveAreaOpacity,
|
|
454
|
-
children: [
|
|
455
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {}),
|
|
456
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Slider, {
|
|
457
|
-
value: areaOpacity,
|
|
458
|
-
valueLabelDisplay: "auto",
|
|
459
|
-
step: _timeserieschartmodel.OPACITY_CONFIG.step,
|
|
460
|
-
marks: true,
|
|
461
|
-
min: _timeserieschartmodel.OPACITY_CONFIG.min,
|
|
462
|
-
max: _timeserieschartmodel.OPACITY_CONFIG.max,
|
|
463
|
-
onChange: onAreaOpacityChange,
|
|
464
|
-
sx: {
|
|
465
|
-
flexGrow: 1
|
|
466
|
-
}
|
|
467
|
-
})
|
|
468
|
-
]
|
|
469
|
-
}),
|
|
470
|
-
format !== undefined && /*#__PURE__*/ (0, _jsxruntime.jsx)(SettingsSection, {
|
|
471
|
-
label: "Unit",
|
|
472
|
-
onRemove: onRemoveUnit,
|
|
473
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
373
|
+
children: [
|
|
374
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
375
|
+
direction: "row",
|
|
376
|
+
alignItems: "center",
|
|
377
|
+
sx: {
|
|
378
|
+
flexWrap: 'wrap',
|
|
379
|
+
gap: 2,
|
|
380
|
+
flexGrow: 1
|
|
381
|
+
},
|
|
382
|
+
children: [
|
|
383
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
384
|
+
select: true,
|
|
385
|
+
inputRef: inputRef,
|
|
386
|
+
value: queryIndex,
|
|
387
|
+
label: "Query",
|
|
388
|
+
onChange: onQueryIndexChange,
|
|
474
389
|
sx: {
|
|
475
|
-
minWidth: '
|
|
390
|
+
minWidth: '75px'
|
|
476
391
|
},
|
|
477
|
-
children:
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
392
|
+
children: selectableQueryIndexes.map((qi)=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.MenuItem, {
|
|
393
|
+
value: qi,
|
|
394
|
+
children: [
|
|
395
|
+
"#",
|
|
396
|
+
qi + 1
|
|
397
|
+
]
|
|
398
|
+
}, `query-${qi}`))
|
|
399
|
+
}),
|
|
400
|
+
colorMode && /*#__PURE__*/ (0, _jsxruntime.jsxs)(SettingsSection, {
|
|
401
|
+
label: "Color",
|
|
402
|
+
onRemove: onRemoveColor,
|
|
403
|
+
children: [
|
|
404
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TextField, {
|
|
405
|
+
select: true,
|
|
406
|
+
value: colorMode,
|
|
407
|
+
onChange: onColorModeChange,
|
|
408
|
+
size: "small",
|
|
409
|
+
sx: {
|
|
410
|
+
flexGrow: 1
|
|
411
|
+
},
|
|
412
|
+
children: [
|
|
413
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
414
|
+
value: "fixed-single",
|
|
415
|
+
children: "Fixed (single)"
|
|
416
|
+
}),
|
|
417
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
418
|
+
value: "fixed",
|
|
419
|
+
children: "Fixed"
|
|
420
|
+
})
|
|
421
|
+
]
|
|
422
|
+
}),
|
|
423
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsColorPicker, {
|
|
424
|
+
label: `Query n°${queryIndex + 1}`,
|
|
425
|
+
color: colorValue || DEFAULT_COLOR_VALUE,
|
|
426
|
+
onColorChange: onColorValueChange
|
|
427
|
+
})
|
|
428
|
+
]
|
|
429
|
+
}),
|
|
430
|
+
lineStyle && /*#__PURE__*/ (0, _jsxruntime.jsxs)(SettingsSection, {
|
|
431
|
+
label: "Line Style",
|
|
432
|
+
onRemove: onRemoveLineStyle,
|
|
433
|
+
children: [
|
|
434
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ToggleButtonGroup, {
|
|
435
|
+
color: "primary",
|
|
436
|
+
exclusive: true,
|
|
437
|
+
value: lineStyle,
|
|
438
|
+
onChange: (__, newValue)=>{
|
|
439
|
+
if (newValue !== null) {
|
|
440
|
+
onLineStyleChange(newValue);
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
size: "small",
|
|
444
|
+
children: Object.entries(_timeserieschartmodel.LINE_STYLE_CONFIG).map(([styleValue, config])=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ToggleButton, {
|
|
445
|
+
value: styleValue,
|
|
446
|
+
"aria-label": `${styleValue} line style`,
|
|
447
|
+
children: config.label
|
|
448
|
+
}, styleValue))
|
|
449
|
+
}),
|
|
450
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
451
|
+
sx: {
|
|
452
|
+
flexGrow: 1
|
|
453
|
+
}
|
|
454
|
+
})
|
|
455
|
+
]
|
|
456
|
+
}),
|
|
457
|
+
areaOpacity !== undefined && /*#__PURE__*/ (0, _jsxruntime.jsxs)(SettingsSection, {
|
|
458
|
+
label: "Opacity",
|
|
459
|
+
onRemove: onRemoveAreaOpacity,
|
|
460
|
+
children: [
|
|
461
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {}),
|
|
462
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Slider, {
|
|
463
|
+
value: areaOpacity,
|
|
464
|
+
valueLabelDisplay: "auto",
|
|
465
|
+
step: _timeserieschartmodel.OPACITY_CONFIG.step,
|
|
466
|
+
marks: true,
|
|
467
|
+
min: _timeserieschartmodel.OPACITY_CONFIG.min,
|
|
468
|
+
max: _timeserieschartmodel.OPACITY_CONFIG.max,
|
|
469
|
+
onChange: onAreaOpacityChange,
|
|
470
|
+
sx: {
|
|
471
|
+
flexGrow: 1
|
|
472
|
+
}
|
|
473
|
+
})
|
|
474
|
+
]
|
|
475
|
+
}),
|
|
476
|
+
format !== undefined && /*#__PURE__*/ (0, _jsxruntime.jsx)(SettingsSection, {
|
|
477
|
+
label: "Format",
|
|
478
|
+
onRemove: onRemoveFormat,
|
|
479
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
480
|
+
sx: {
|
|
481
|
+
minWidth: '180px',
|
|
482
|
+
display: 'flex',
|
|
483
|
+
gap: 1,
|
|
484
|
+
flexDirection: 'column'
|
|
497
485
|
},
|
|
498
|
-
children:
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
},
|
|
503
|
-
children: [
|
|
504
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Plus.default, {
|
|
505
|
-
sx: {
|
|
506
|
-
mr: 1,
|
|
507
|
-
fontSize: '1rem'
|
|
508
|
-
}
|
|
509
|
-
}),
|
|
510
|
-
option.label
|
|
511
|
-
]
|
|
512
|
-
}, option.key))
|
|
486
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.FormatControls, {
|
|
487
|
+
value: format,
|
|
488
|
+
onChange: onFormatChange
|
|
489
|
+
})
|
|
513
490
|
})
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
491
|
+
}),
|
|
492
|
+
availableOptions.length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
493
|
+
children: [
|
|
494
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
495
|
+
onClick: handleAddMenuClick,
|
|
496
|
+
"aria-label": "Add option",
|
|
497
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Plus.default, {})
|
|
498
|
+
}),
|
|
499
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Menu, {
|
|
500
|
+
anchorEl: anchorEl,
|
|
501
|
+
open: Boolean(anchorEl),
|
|
502
|
+
onClose: handleMenuClose,
|
|
503
|
+
anchorOrigin: {
|
|
504
|
+
vertical: 'bottom',
|
|
505
|
+
horizontal: 'left'
|
|
506
|
+
},
|
|
507
|
+
children: availableOptions.map((option)=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.MenuItem, {
|
|
508
|
+
onClick: ()=>handleMenuItemClick(option.action),
|
|
509
|
+
sx: {
|
|
510
|
+
minWidth: '120px'
|
|
511
|
+
},
|
|
512
|
+
children: [
|
|
513
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Plus.default, {
|
|
514
|
+
sx: {
|
|
515
|
+
mr: 1,
|
|
516
|
+
fontSize: '1rem'
|
|
517
|
+
}
|
|
518
|
+
}),
|
|
519
|
+
option.label
|
|
520
|
+
]
|
|
521
|
+
}, option.key))
|
|
522
|
+
})
|
|
523
|
+
]
|
|
524
|
+
})
|
|
525
|
+
]
|
|
526
|
+
}),
|
|
527
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
528
|
+
sx: {
|
|
529
|
+
display: 'flex',
|
|
530
|
+
alignItems: 'center',
|
|
531
|
+
justifyContent: 'center'
|
|
532
|
+
},
|
|
533
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
522
534
|
"aria-label": `delete settings for query n°${queryIndex + 1}`,
|
|
523
535
|
onClick: onDelete,
|
|
524
536
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DeleteOutline.default, {})
|
|
525
537
|
})
|
|
526
|
-
|
|
527
|
-
|
|
538
|
+
})
|
|
539
|
+
]
|
|
528
540
|
});
|
|
529
541
|
}
|
|
530
542
|
// Reusable section component
|
|
@@ -25,13 +25,13 @@ const _react = require("react");
|
|
|
25
25
|
const _material = require("@mui/material");
|
|
26
26
|
const _merge = /*#__PURE__*/ _interop_require_default(require("lodash/merge"));
|
|
27
27
|
const _isEqual = /*#__PURE__*/ _interop_require_default(require("lodash/isEqual"));
|
|
28
|
-
const _datefnstz = require("date-fns-tz");
|
|
29
28
|
const _core = require("@perses-dev/core");
|
|
30
29
|
const _core1 = require("echarts/core");
|
|
31
30
|
const _charts = require("echarts/charts");
|
|
32
31
|
const _components = require("echarts/components");
|
|
33
32
|
const _renderers = require("echarts/renderers");
|
|
34
33
|
const _components1 = require("@perses-dev/components");
|
|
34
|
+
const _timezoneformatter = require("./utils/timezone-formatter");
|
|
35
35
|
function _interop_require_default(obj) {
|
|
36
36
|
return obj && obj.__esModule ? obj : {
|
|
37
37
|
default: obj
|
|
@@ -61,6 +61,9 @@ const TimeSeriesChartBase = /*#__PURE__*/ (0, _react.forwardRef)(function TimeCh
|
|
|
61
61
|
const [isDragging, setIsDragging] = (0, _react.useState)(false);
|
|
62
62
|
const [startX, setStartX] = (0, _react.useState)(0);
|
|
63
63
|
const { timeZone } = (0, _components1.useTimeZone)();
|
|
64
|
+
const getTimezoneAwareAxisFormatter = (0, _react.useCallback)((rangeMs)=>(0, _timezoneformatter.createTimezoneAwareAxisFormatter)(rangeMs, timeZone), [
|
|
65
|
+
timeZone
|
|
66
|
+
]);
|
|
64
67
|
let timeScale;
|
|
65
68
|
if (timeScaleProp === undefined) {
|
|
66
69
|
const commonTimeScale = (0, _core.getCommonTimeScale)(data);
|
|
@@ -142,12 +145,11 @@ const TimeSeriesChartBase = /*#__PURE__*/ (0, _react.forwardRef)(function TimeCh
|
|
|
142
145
|
// Utilizes ECharts dataset so raw data is separate from series option style properties
|
|
143
146
|
// https://apache.github.io/echarts-handbook/en/concepts/dataset/
|
|
144
147
|
const dataset = [];
|
|
145
|
-
const isLocalTimeZone = timeZone === 'local';
|
|
146
148
|
data.map((d, index)=>{
|
|
147
149
|
const values = d.values.map(([timestamp, value])=>{
|
|
148
150
|
const val = value === null ? '-' : value; // echarts use '-' to represent null data
|
|
149
151
|
return [
|
|
150
|
-
|
|
152
|
+
timestamp,
|
|
151
153
|
val
|
|
152
154
|
];
|
|
153
155
|
});
|
|
@@ -171,11 +173,11 @@ const TimeSeriesChartBase = /*#__PURE__*/ (0, _react.forwardRef)(function TimeCh
|
|
|
171
173
|
series: updatedSeriesMapping,
|
|
172
174
|
xAxis: {
|
|
173
175
|
type: 'time',
|
|
174
|
-
min:
|
|
175
|
-
max:
|
|
176
|
+
min: timeScale.startMs,
|
|
177
|
+
max: timeScale.endMs,
|
|
176
178
|
axisLabel: {
|
|
177
179
|
hideOverlap: true,
|
|
178
|
-
formatter: (
|
|
180
|
+
formatter: getTimezoneAwareAxisFormatter(timeScale.rangeMs ?? 0)
|
|
179
181
|
},
|
|
180
182
|
axisPointer: {
|
|
181
183
|
snap: false
|
|
@@ -224,10 +226,10 @@ const TimeSeriesChartBase = /*#__PURE__*/ (0, _react.forwardRef)(function TimeCh
|
|
|
224
226
|
noDataOption,
|
|
225
227
|
__experimentalEChartsOptionsOverride,
|
|
226
228
|
noDataVariant,
|
|
227
|
-
timeZone,
|
|
228
229
|
isStackedBar,
|
|
229
230
|
enablePinning,
|
|
230
|
-
pinnedCrosshair
|
|
231
|
+
pinnedCrosshair,
|
|
232
|
+
getTimezoneAwareAxisFormatter
|
|
231
233
|
]);
|
|
232
234
|
// Update adjacent charts so tooltip is unpinned when current chart is clicked.
|
|
233
235
|
(0, _react.useEffect)(()=>{
|
|
@@ -216,7 +216,8 @@ function TimeSeriesChartPanel(props) {
|
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
|
|
219
|
+
// map thresholds only if there is at least one time series to avoid displaying thresholds without any data
|
|
220
|
+
if (thresholds && thresholds.steps && timeChartData.length > 0) {
|
|
220
221
|
// Convert how thresholds are defined in the panel spec to valid ECharts 'line' series.
|
|
221
222
|
// These are styled with predefined colors and a dashed style to look different than series from query results.
|
|
222
223
|
// Regular series are used instead of markLines since thresholds currently show in our React TimeSeriesTooltip.
|
|
@@ -25,7 +25,7 @@ const _material = require("@mui/material");
|
|
|
25
25
|
const _components = require("@perses-dev/components");
|
|
26
26
|
const _Download = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Download"));
|
|
27
27
|
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
28
|
-
const
|
|
28
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
29
29
|
function _interop_require_default(obj) {
|
|
30
30
|
return obj && obj.__esModule ? obj : {
|
|
31
31
|
default: obj
|
|
@@ -74,12 +74,12 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
74
74
|
}
|
|
75
75
|
const TimeSeriesExportAction = ({ queryResults, definition })=>{
|
|
76
76
|
const exportableData = (0, _react.useMemo)(()=>{
|
|
77
|
-
return (0,
|
|
77
|
+
return (0, _pluginsystem.extractExportableData)(queryResults);
|
|
78
78
|
}, [
|
|
79
79
|
queryResults
|
|
80
80
|
]);
|
|
81
81
|
const canExport = (0, _react.useMemo)(()=>{
|
|
82
|
-
return (0,
|
|
82
|
+
return (0, _pluginsystem.isExportableData)(exportableData);
|
|
83
83
|
}, [
|
|
84
84
|
exportableData
|
|
85
85
|
]);
|
|
@@ -87,10 +87,10 @@ const TimeSeriesExportAction = ({ queryResults, definition })=>{
|
|
|
87
87
|
if (!exportableData || !canExport) return;
|
|
88
88
|
try {
|
|
89
89
|
const title = definition?.spec?.display?.name || 'Time Series Data';
|
|
90
|
-
const csvBlob = (0,
|
|
90
|
+
const csvBlob = (0, _pluginsystem.exportDataAsCSV)({
|
|
91
91
|
data: exportableData
|
|
92
92
|
});
|
|
93
|
-
const baseFilename = (0,
|
|
93
|
+
const baseFilename = (0, _pluginsystem.sanitizeFilename)(title);
|
|
94
94
|
const filename = `${baseFilename}_data.csv`;
|
|
95
95
|
const link = document.createElement('a');
|
|
96
96
|
link.href = URL.createObjectURL(csvBlob);
|
package/lib/cjs/index.js
CHANGED
|
@@ -29,7 +29,6 @@ _export_star(require("./YAxisOptionsEditor"), exports);
|
|
|
29
29
|
_export_star(require("./TimeSeriesChartPanel"), exports);
|
|
30
30
|
_export_star(require("./TimeSeriesChartBase"), exports);
|
|
31
31
|
_export_star(require("./time-series-chart-model"), exports);
|
|
32
|
-
_export_star(require("./CSVExportUtils"), exports);
|
|
33
32
|
function _export_star(from, to) {
|
|
34
33
|
Object.keys(from).forEach(function(k) {
|
|
35
34
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -0,0 +1,48 @@
|
|
|
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, "createTimezoneAwareAxisFormatter", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return createTimezoneAwareAxisFormatter;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _components = require("@perses-dev/components");
|
|
24
|
+
const DAY_MS = 86400000;
|
|
25
|
+
const MONTH_MS = 2629440000;
|
|
26
|
+
const YEAR_MS = 31536000000;
|
|
27
|
+
function createTimezoneAwareAxisFormatter(rangeMs, timeZone) {
|
|
28
|
+
return function(value) {
|
|
29
|
+
const timeStamp = new Date(Number(value));
|
|
30
|
+
// more than 5 years
|
|
31
|
+
if (rangeMs > YEAR_MS * 5) {
|
|
32
|
+
return (0, _components.formatWithTimeZone)(timeStamp, 'yyyy', timeZone);
|
|
33
|
+
}
|
|
34
|
+
// more than 2 years
|
|
35
|
+
if (rangeMs > YEAR_MS * 2) {
|
|
36
|
+
return (0, _components.formatWithTimeZone)(timeStamp, 'MMM yyyy', timeZone);
|
|
37
|
+
}
|
|
38
|
+
// between 10 days to 6 months
|
|
39
|
+
if (rangeMs > DAY_MS * 10 && rangeMs < MONTH_MS * 6) {
|
|
40
|
+
return (0, _components.formatWithTimeZone)(timeStamp, 'dd.MM', timeZone);
|
|
41
|
+
}
|
|
42
|
+
// between 2 and 10 days
|
|
43
|
+
if (rangeMs > DAY_MS * 2 && rangeMs <= DAY_MS * 10) {
|
|
44
|
+
return (0, _components.formatWithTimeZone)(timeStamp, 'dd.MM HH:mm', timeZone);
|
|
45
|
+
}
|
|
46
|
+
return (0, _components.formatWithTimeZone)(timeStamp, 'HH:mm', timeZone);
|
|
47
|
+
};
|
|
48
|
+
}
|
package/lib/index.d.ts
CHANGED
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC"}
|
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.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\nexport { getPluginModule } from './getPluginModule';\nexport * from './TimeSeriesChart';\nexport * from './GeneralSettingsEditor';\nexport * from './QuerySettingsEditor';\nexport * from './VisualOptionsEditor';\nexport * from './YAxisOptionsEditor';\nexport * from './TimeSeriesChartPanel';\nexport * from './TimeSeriesChartBase';\nexport * from './time-series-chart-model';\
|
|
1
|
+
{"version":3,"sources":["../../src/index.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\nexport { getPluginModule } from './getPluginModule';\nexport * from './TimeSeriesChart';\nexport * from './GeneralSettingsEditor';\nexport * from './QuerySettingsEditor';\nexport * from './VisualOptionsEditor';\nexport * from './YAxisOptionsEditor';\nexport * from './TimeSeriesChartPanel';\nexport * from './TimeSeriesChartBase';\nexport * from './time-series-chart-model';\n"],"names":["getPluginModule"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,eAAe,QAAQ,oBAAoB;AACpD,cAAc,oBAAoB;AAClC,cAAc,0BAA0B;AACxC,cAAc,wBAAwB;AACtC,cAAc,wBAAwB;AACtC,cAAc,uBAAuB;AACrC,cAAc,yBAAyB;AACvC,cAAc,wBAAwB;AACtC,cAAc,4BAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timezone-formatter.d.ts","sourceRoot":"","sources":["../../../src/utils/timezone-formatter.ts"],"names":[],"mappings":"AAmBA;;GAEG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAC/D,OAAO,MAAM,KAAG,MAAM,CAyBxC"}
|