@perses-dev/timeseries-chart-plugin 0.9.1 → 0.10.1
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/js/TimeSeriesChart.2f8b193b.js +6 -0
- package/__mf/js/async/109.604f6c41.js +73 -0
- package/__mf/js/async/133.c48c8cc8.js +110 -0
- package/__mf/js/async/{879.24def15a.js.LICENSE.txt → 133.c48c8cc8.js.LICENSE.txt} +28 -0
- package/__mf/js/async/173.58a1dc61.js +2 -0
- package/__mf/js/async/214.37696543.js +1 -0
- package/__mf/js/async/224.2d3ce51f.js +1 -0
- package/__mf/js/async/238.767e5398.js +1 -0
- package/__mf/js/async/292.9efc6a73.js +1 -0
- package/__mf/js/async/409.97dde548.js +1 -0
- package/__mf/js/async/476.23a59a72.js +1 -0
- package/__mf/js/async/488.031fc875.js +1 -0
- package/__mf/js/async/53.8edfe937.js +2 -0
- package/__mf/js/async/547.bb4f1e58.js +7 -0
- package/__mf/js/async/580.5f4b0dbd.js +38 -0
- package/__mf/js/async/613.20f15bb7.js +1 -0
- package/__mf/js/async/62.f24fce0a.js +1 -0
- package/__mf/js/async/651.e0c9e225.js +1 -0
- package/__mf/js/async/686.0cd9a75c.js +1 -0
- package/__mf/js/async/694.ebf24a00.js +1 -0
- package/__mf/js/async/738.c37f7bca.js +1 -0
- package/__mf/js/async/740.f0e8d499.js +1 -0
- package/__mf/js/async/75.26ec5bee.js +1 -0
- package/__mf/js/async/770.e129dd07.js +1 -0
- package/__mf/js/async/797.72ff552e.js +2 -0
- package/__mf/js/async/863.f147d2ba.js +2 -0
- package/__mf/js/async/960.cd399075.js +2 -0
- package/__mf/js/async/964.719c530c.js +2 -0
- package/__mf/js/async/981.e360e7df.js +2 -0
- package/__mf/js/async/__federation_expose_TimeSeriesChart.f20a0aca.js +3 -0
- package/__mf/js/async/lib-router.25a1f509.js +2 -0
- package/__mf/js/main.42f3cc3e.js +6 -0
- package/lib/CSVExportUtils.d.ts +39 -0
- package/lib/CSVExportUtils.d.ts.map +1 -0
- package/lib/CSVExportUtils.js +212 -0
- package/lib/CSVExportUtils.js.map +1 -0
- package/lib/TimeSeriesChart.d.ts +0 -3
- package/lib/TimeSeriesChart.d.ts.map +1 -1
- package/lib/TimeSeriesChart.js +9 -4
- package/lib/TimeSeriesChart.js.map +1 -1
- package/lib/TimeSeriesChartOptionsEditorSettings.js +1 -0
- package/lib/TimeSeriesChartOptionsEditorSettings.js.map +1 -1
- package/lib/TimeSeriesChartPanel.d.ts.map +1 -1
- package/lib/TimeSeriesChartPanel.js.map +1 -1
- package/lib/TimeSeriesExportAction.d.ts +4 -0
- package/lib/TimeSeriesExportAction.d.ts.map +1 -0
- package/lib/TimeSeriesExportAction.js +69 -0
- package/lib/TimeSeriesExportAction.js.map +1 -0
- package/lib/cjs/CSVExportUtils.js +246 -0
- package/lib/cjs/TimeSeriesChart.js +8 -1
- package/lib/cjs/TimeSeriesChartOptionsEditorSettings.js +1 -0
- package/lib/cjs/TimeSeriesExportAction.js +123 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/utils/data-transform.js +0 -49
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/utils/data-transform.d.ts +1 -5
- package/lib/utils/data-transform.d.ts.map +1 -1
- package/lib/utils/data-transform.js +1 -49
- package/lib/utils/data-transform.js.map +1 -1
- package/mf-manifest.json +41 -90
- package/mf-stats.json +41 -90
- package/package.json +12 -4
- package/__mf/js/983.9bbeba19.js +0 -5
- package/__mf/js/TimeSeriesChart.63488d0a.js +0 -5
- package/__mf/js/async/171.598de6a9.js +0 -7
- package/__mf/js/async/173.f6f7e45b.js +0 -2
- package/__mf/js/async/214.2d4431c6.js +0 -1
- package/__mf/js/async/223.def4d0a9.js +0 -1
- package/__mf/js/async/224.ce414ffb.js +0 -1
- package/__mf/js/async/238.625b8a48.js +0 -1
- package/__mf/js/async/281.a2a87c37.js +0 -2
- package/__mf/js/async/292.311e6eb0.js +0 -1
- package/__mf/js/async/359.18a264e7.js +0 -2
- package/__mf/js/async/409.2808c63e.js +0 -1
- package/__mf/js/async/476.45fca8d3.js +0 -1
- package/__mf/js/async/488.0d0b1a91.js +0 -1
- package/__mf/js/async/620.d6f96402.js +0 -2
- package/__mf/js/async/651.80087530.js +0 -1
- package/__mf/js/async/656.d43503a5.js +0 -1
- package/__mf/js/async/694.27c70ab1.js +0 -1
- package/__mf/js/async/738.0a12bb44.js +0 -1
- package/__mf/js/async/740.67107c3c.js +0 -1
- package/__mf/js/async/75.5952779d.js +0 -1
- package/__mf/js/async/755.f76e3538.js +0 -38
- package/__mf/js/async/770.78a741ab.js +0 -1
- package/__mf/js/async/780.3fa36115.js +0 -110
- package/__mf/js/async/780.3fa36115.js.LICENSE.txt +0 -27
- package/__mf/js/async/845.6d99c354.js +0 -73
- package/__mf/js/async/879.24def15a.js +0 -2
- package/__mf/js/async/960.3047096d.js +0 -2
- package/__mf/js/async/964.6dfbf211.js +0 -2
- package/__mf/js/async/981.77f901c0.js +0 -2
- package/__mf/js/async/__federation_expose_TimeSeriesChart.cb3d3f05.js +0 -1
- package/__mf/js/async/lib-router.098fc614.js +0 -2
- package/__mf/js/main.cca17449.js +0 -1
- /package/__mf/js/async/{845.6d99c354.js.LICENSE.txt → 109.604f6c41.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{173.f6f7e45b.js.LICENSE.txt → 173.58a1dc61.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{359.18a264e7.js.LICENSE.txt → 53.8edfe937.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{171.598de6a9.js.LICENSE.txt → 547.bb4f1e58.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{281.a2a87c37.js.LICENSE.txt → 797.72ff552e.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{620.d6f96402.js.LICENSE.txt → 863.f147d2ba.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{960.3047096d.js.LICENSE.txt → 960.cd399075.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{964.6dfbf211.js.LICENSE.txt → 964.719c530c.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{981.77f901c0.js.LICENSE.txt → 981.e360e7df.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{lib-router.098fc614.js.LICENSE.txt → lib-router.25a1f509.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// Copyright 2023 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, "TimeSeriesExportAction", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return TimeSeriesExportAction;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
25
|
+
const _material = require("@mui/material");
|
|
26
|
+
const _Download = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Download"));
|
|
27
|
+
const _CSVExportUtils = require("./CSVExportUtils");
|
|
28
|
+
function _interop_require_default(obj) {
|
|
29
|
+
return obj && obj.__esModule ? obj : {
|
|
30
|
+
default: obj
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
34
|
+
if (typeof WeakMap !== "function") return null;
|
|
35
|
+
var cacheBabelInterop = new WeakMap();
|
|
36
|
+
var cacheNodeInterop = new WeakMap();
|
|
37
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
38
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
39
|
+
})(nodeInterop);
|
|
40
|
+
}
|
|
41
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
42
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
43
|
+
return obj;
|
|
44
|
+
}
|
|
45
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
46
|
+
return {
|
|
47
|
+
default: obj
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
51
|
+
if (cache && cache.has(obj)) {
|
|
52
|
+
return cache.get(obj);
|
|
53
|
+
}
|
|
54
|
+
var newObj = {
|
|
55
|
+
__proto__: null
|
|
56
|
+
};
|
|
57
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
58
|
+
for(var key in obj){
|
|
59
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
60
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
61
|
+
if (desc && (desc.get || desc.set)) {
|
|
62
|
+
Object.defineProperty(newObj, key, desc);
|
|
63
|
+
} else {
|
|
64
|
+
newObj[key] = obj[key];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
newObj.default = obj;
|
|
69
|
+
if (cache) {
|
|
70
|
+
cache.set(obj, newObj);
|
|
71
|
+
}
|
|
72
|
+
return newObj;
|
|
73
|
+
}
|
|
74
|
+
const TimeSeriesExportAction = ({ queryResults, definition })=>{
|
|
75
|
+
const exportableData = (0, _react.useMemo)(()=>{
|
|
76
|
+
return (0, _CSVExportUtils.extractExportableData)(queryResults);
|
|
77
|
+
}, [
|
|
78
|
+
queryResults
|
|
79
|
+
]);
|
|
80
|
+
const canExport = (0, _react.useMemo)(()=>{
|
|
81
|
+
return (0, _CSVExportUtils.isExportableData)(exportableData);
|
|
82
|
+
}, [
|
|
83
|
+
exportableData
|
|
84
|
+
]);
|
|
85
|
+
const handleExport = (0, _react.useCallback)(()=>{
|
|
86
|
+
if (!exportableData || !canExport) return;
|
|
87
|
+
try {
|
|
88
|
+
const title = definition?.spec?.display?.name || 'Time Series Data';
|
|
89
|
+
const csvBlob = (0, _CSVExportUtils.exportDataAsCSV)({
|
|
90
|
+
data: exportableData
|
|
91
|
+
});
|
|
92
|
+
const baseFilename = (0, _CSVExportUtils.sanitizeFilename)(title);
|
|
93
|
+
const filename = `${baseFilename}_data.csv`;
|
|
94
|
+
const link = document.createElement('a');
|
|
95
|
+
link.href = URL.createObjectURL(csvBlob);
|
|
96
|
+
link.download = filename;
|
|
97
|
+
document.body.appendChild(link);
|
|
98
|
+
link.click();
|
|
99
|
+
document.body.removeChild(link);
|
|
100
|
+
URL.revokeObjectURL(link.href);
|
|
101
|
+
} catch (error) {
|
|
102
|
+
console.error('Time series export failed:', error);
|
|
103
|
+
}
|
|
104
|
+
}, [
|
|
105
|
+
exportableData,
|
|
106
|
+
canExport,
|
|
107
|
+
definition
|
|
108
|
+
]);
|
|
109
|
+
if (!canExport) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Tooltip, {
|
|
113
|
+
title: "Export as CSV",
|
|
114
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
115
|
+
size: "small",
|
|
116
|
+
onClick: handleExport,
|
|
117
|
+
"aria-label": "Export time series data as CSV",
|
|
118
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Download.default, {
|
|
119
|
+
fontSize: "inherit"
|
|
120
|
+
})
|
|
121
|
+
})
|
|
122
|
+
});
|
|
123
|
+
};
|
package/lib/cjs/index.js
CHANGED
|
@@ -29,6 +29,7 @@ _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);
|
|
32
33
|
function _export_star(from, to) {
|
|
33
34
|
Object.keys(from).forEach(function(k) {
|
|
34
35
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -39,9 +39,6 @@ _export(exports, {
|
|
|
39
39
|
getCommonTimeScaleForQueries: function() {
|
|
40
40
|
return getCommonTimeScaleForQueries;
|
|
41
41
|
},
|
|
42
|
-
getLineSeries: function() {
|
|
43
|
-
return getLineSeries;
|
|
44
|
-
},
|
|
45
42
|
getThresholdSeries: function() {
|
|
46
43
|
return getThresholdSeries;
|
|
47
44
|
},
|
|
@@ -66,52 +63,6 @@ function getCommonTimeScaleForQueries(queries) {
|
|
|
66
63
|
const seriesData = queries.map((query)=>query.data);
|
|
67
64
|
return (0, _core.getCommonTimeScale)(seriesData);
|
|
68
65
|
}
|
|
69
|
-
function getLineSeries(id, formattedName, data, visual, paletteColor) {
|
|
70
|
-
const lineWidth = visual.lineWidth ?? _timeserieschartmodel.DEFAULT_LINE_WIDTH;
|
|
71
|
-
const pointRadius = visual.pointRadius ?? _timeserieschartmodel.DEFAULT_POINT_RADIUS;
|
|
72
|
-
// Shows datapoint symbols when selected time range is roughly 15 minutes or less
|
|
73
|
-
let showPoints = data !== undefined && data.length <= HIDE_DATAPOINTS_LIMIT;
|
|
74
|
-
// Allows overriding default behavior and opt-in to always show all symbols (can hurt performance)
|
|
75
|
-
if (visual.showPoints === 'always') {
|
|
76
|
-
showPoints = true;
|
|
77
|
-
}
|
|
78
|
-
return {
|
|
79
|
-
type: 'line',
|
|
80
|
-
id: id,
|
|
81
|
-
name: formattedName,
|
|
82
|
-
data: data,
|
|
83
|
-
connectNulls: visual.connectNulls ?? _timeserieschartmodel.DEFAULT_CONNECT_NULLS,
|
|
84
|
-
color: paletteColor,
|
|
85
|
-
stack: visual.stack === 'all' ? visual.stack : undefined,
|
|
86
|
-
sampling: 'lttb',
|
|
87
|
-
progressiveThreshold: _components.OPTIMIZED_MODE_SERIES_LIMIT,
|
|
88
|
-
showSymbol: showPoints,
|
|
89
|
-
showAllSymbol: true,
|
|
90
|
-
symbolSize: pointRadius,
|
|
91
|
-
lineStyle: {
|
|
92
|
-
width: lineWidth,
|
|
93
|
-
opacity: 0.8
|
|
94
|
-
},
|
|
95
|
-
areaStyle: {
|
|
96
|
-
opacity: visual.areaOpacity ?? _timeserieschartmodel.DEFAULT_AREA_OPACITY
|
|
97
|
-
},
|
|
98
|
-
// https://echarts.apache.org/en/option.html#series-line.emphasis
|
|
99
|
-
emphasis: {
|
|
100
|
-
focus: 'series',
|
|
101
|
-
disabled: visual.areaOpacity !== undefined && visual.areaOpacity > 0,
|
|
102
|
-
lineStyle: {
|
|
103
|
-
width: lineWidth + 1.5,
|
|
104
|
-
opacity: 1
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
blur: {
|
|
108
|
-
lineStyle: {
|
|
109
|
-
width: lineWidth,
|
|
110
|
-
opacity: BLUR_FADEOUT_OPACITY
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
66
|
function getTimeSeries(id, datasetIndex, formattedName, visual, timeScale, paletteColor) {
|
|
116
67
|
const lineWidth = visual.lineWidth ?? _timeserieschartmodel.DEFAULT_LINE_WIDTH;
|
|
117
68
|
const pointRadius = visual.pointRadius ?? _timeserieschartmodel.DEFAULT_POINT_RADIUS;
|
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,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,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,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC"}
|
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// Copyright 2025 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 './QuerySettingsEditor';\nexport * from './TimeSeriesChartOptionsEditorSettings';\nexport * from './VisualOptionsEditor';\nexport * from './YAxisOptionsEditor';\nexport * from './TimeSeriesChartPanel';\nexport * from './TimeSeriesChartBase';\nexport * from './time-series-chart-model';\n"],"names":["getPluginModule"],"mappings":"AAAA,oCAAoC;AACpC,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,wBAAwB;AACtC,cAAc,yCAAyC;AACvD,cAAc,wBAAwB;AACtC,cAAc,uBAAuB;AACrC,cAAc,yBAAyB;AACvC,cAAc,wBAAwB;AACtC,cAAc,4BAA4B"}
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// Copyright 2025 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 './QuerySettingsEditor';\nexport * from './TimeSeriesChartOptionsEditorSettings';\nexport * from './VisualOptionsEditor';\nexport * from './YAxisOptionsEditor';\nexport * from './TimeSeriesChartPanel';\nexport * from './TimeSeriesChartBase';\nexport * from './time-series-chart-model';\nexport * from './CSVExportUtils';\n"],"names":["getPluginModule"],"mappings":"AAAA,oCAAoC;AACpC,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,wBAAwB;AACtC,cAAc,yCAAyC;AACvD,cAAc,wBAAwB;AACtC,cAAc,uBAAuB;AACrC,cAAc,yBAAyB;AACvC,cAAc,wBAAwB;AACtC,cAAc,4BAA4B;AAC1C,cAAc,mBAAmB"}
|
|
@@ -15,11 +15,7 @@ export declare const BLUR_FADEOUT_OPACITY = 0.5;
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function getCommonTimeScaleForQueries(queries: Array<PanelData<TimeSeriesData>>): TimeScale | undefined;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
export declare function getLineSeries(id: string, formattedName: string, data: LegacyTimeSeries['data'], visual: TimeSeriesChartVisualOptions, paletteColor?: string): LegacyTimeSeries;
|
|
21
|
-
/**
|
|
22
|
-
* Gets ECharts line series option properties for recommended TimeChart
|
|
18
|
+
* Gets ECharts line series option properties for regular trends
|
|
23
19
|
*/
|
|
24
20
|
export declare function getTimeSeries(id: string, datasetIndex: number, formattedName: string, visual: TimeSeriesChartVisualOptions, timeScale: TimeScale, paletteColor: string): TimeSeriesOption;
|
|
25
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-transform.d.ts","sourceRoot":"","sources":["../../../src/utils/data-transform.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EACL,WAAW,EACX,SAAS,EACT,UAAU,EAGV,cAAc,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,gBAAgB,EAChB,iBAAiB,EAEjB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAQL,4BAA4B,EAC5B,2BAA2B,EAC5B,MAAM,4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GAEG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,EACV,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,4BAA4B,EACpC,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,MAAM,GACnB,gBAAgB,CAuElB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,GAAG,gBAAgB,CA2B9G;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,gBAAgB,EAAE,GAAG,UAAU,EAAE,EACvC,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,GACX,MAAM,CAMR;AA4BD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,GAAE,2BAAgC,GAAG,oBAAoB,CA8BnG;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI7C"}
|
|
@@ -29,55 +29,7 @@ export const BLUR_FADEOUT_OPACITY = 0.5;
|
|
|
29
29
|
return getCommonTimeScale(seriesData);
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
*/ export function getLineSeries(id, formattedName, data, visual, paletteColor) {
|
|
34
|
-
const lineWidth = visual.lineWidth ?? DEFAULT_LINE_WIDTH;
|
|
35
|
-
const pointRadius = visual.pointRadius ?? DEFAULT_POINT_RADIUS;
|
|
36
|
-
// Shows datapoint symbols when selected time range is roughly 15 minutes or less
|
|
37
|
-
let showPoints = data !== undefined && data.length <= HIDE_DATAPOINTS_LIMIT;
|
|
38
|
-
// Allows overriding default behavior and opt-in to always show all symbols (can hurt performance)
|
|
39
|
-
if (visual.showPoints === 'always') {
|
|
40
|
-
showPoints = true;
|
|
41
|
-
}
|
|
42
|
-
return {
|
|
43
|
-
type: 'line',
|
|
44
|
-
id: id,
|
|
45
|
-
name: formattedName,
|
|
46
|
-
data: data,
|
|
47
|
-
connectNulls: visual.connectNulls ?? DEFAULT_CONNECT_NULLS,
|
|
48
|
-
color: paletteColor,
|
|
49
|
-
stack: visual.stack === 'all' ? visual.stack : undefined,
|
|
50
|
-
sampling: 'lttb',
|
|
51
|
-
progressiveThreshold: OPTIMIZED_MODE_SERIES_LIMIT,
|
|
52
|
-
showSymbol: showPoints,
|
|
53
|
-
showAllSymbol: true,
|
|
54
|
-
symbolSize: pointRadius,
|
|
55
|
-
lineStyle: {
|
|
56
|
-
width: lineWidth,
|
|
57
|
-
opacity: 0.8
|
|
58
|
-
},
|
|
59
|
-
areaStyle: {
|
|
60
|
-
opacity: visual.areaOpacity ?? DEFAULT_AREA_OPACITY
|
|
61
|
-
},
|
|
62
|
-
// https://echarts.apache.org/en/option.html#series-line.emphasis
|
|
63
|
-
emphasis: {
|
|
64
|
-
focus: 'series',
|
|
65
|
-
disabled: visual.areaOpacity !== undefined && visual.areaOpacity > 0,
|
|
66
|
-
lineStyle: {
|
|
67
|
-
width: lineWidth + 1.5,
|
|
68
|
-
opacity: 1
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
blur: {
|
|
72
|
-
lineStyle: {
|
|
73
|
-
width: lineWidth,
|
|
74
|
-
opacity: BLUR_FADEOUT_OPACITY
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Gets ECharts line series option properties for recommended TimeChart
|
|
32
|
+
* Gets ECharts line series option properties for regular trends
|
|
81
33
|
*/ export function getTimeSeries(id, datasetIndex, formattedName, visual, timeScale, paletteColor) {
|
|
82
34
|
const lineWidth = visual.lineWidth ?? DEFAULT_LINE_WIDTH;
|
|
83
35
|
const pointRadius = visual.pointRadius ?? DEFAULT_POINT_RADIUS;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/data-transform.ts"],"sourcesContent":["// Copyright 2023 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 type { YAXisComponentOption } from 'echarts';\nimport { LineSeriesOption, BarSeriesOption } from 'echarts/charts';\nimport {\n StepOptions,\n TimeScale,\n TimeSeries,\n TimeSeriesValueTuple,\n getCommonTimeScale,\n TimeSeriesData,\n} from '@perses-dev/core';\nimport {\n OPTIMIZED_MODE_SERIES_LIMIT,\n LegacyTimeSeries,\n EChartsDataFormat,\n EChartsValues,\n TimeSeriesOption,\n} from '@perses-dev/components';\nimport { useTimeSeriesQueries, PanelData } from '@perses-dev/plugin-system';\nimport {\n DEFAULT_AREA_OPACITY,\n DEFAULT_CONNECT_NULLS,\n DEFAULT_LINE_WIDTH,\n DEFAULT_POINT_RADIUS,\n DEFAULT_Y_AXIS,\n POSITIVE_MIN_VALUE_MULTIPLIER,\n NEGATIVE_MIN_VALUE_MULTIPLIER,\n TimeSeriesChartVisualOptions,\n TimeSeriesChartYAxisOptions,\n} from '../time-series-chart-model';\n\nexport type RunningQueriesState = ReturnType<typeof useTimeSeriesQueries>;\n\nexport const EMPTY_GRAPH_DATA: EChartsDataFormat = {\n timeSeries: [],\n xAxis: [],\n legendItems: [],\n};\n\nexport const HIDE_DATAPOINTS_LIMIT = 70;\n\nexport const BLUR_FADEOUT_OPACITY = 0.5;\n\n/**\n * Given a list of running queries, calculates a common time scale for use on\n * the x axis (i.e. start/end dates and a step that is divisible into all of\n * the queries' steps).\n */\nexport function getCommonTimeScaleForQueries(queries: Array<PanelData<TimeSeriesData>>): TimeScale | undefined {\n const seriesData = queries.map((query) => query.data);\n return getCommonTimeScale(seriesData);\n}\n\n/**\n * [DEPRECATED] Gets ECharts line series option properties for legacy LineChart\n */\nexport function getLineSeries(\n id: string,\n formattedName: string,\n data: LegacyTimeSeries['data'],\n visual: TimeSeriesChartVisualOptions,\n paletteColor?: string\n): LegacyTimeSeries {\n const lineWidth = visual.lineWidth ?? DEFAULT_LINE_WIDTH;\n const pointRadius = visual.pointRadius ?? DEFAULT_POINT_RADIUS;\n\n // Shows datapoint symbols when selected time range is roughly 15 minutes or less\n let showPoints = data !== undefined && data.length <= HIDE_DATAPOINTS_LIMIT;\n // Allows overriding default behavior and opt-in to always show all symbols (can hurt performance)\n if (visual.showPoints === 'always') {\n showPoints = true;\n }\n\n return {\n type: 'line',\n id: id,\n name: formattedName,\n data: data,\n connectNulls: visual.connectNulls ?? DEFAULT_CONNECT_NULLS,\n color: paletteColor,\n stack: visual.stack === 'all' ? visual.stack : undefined,\n sampling: 'lttb',\n progressiveThreshold: OPTIMIZED_MODE_SERIES_LIMIT, // https://echarts.apache.org/en/option.html#series-lines.progressiveThreshold\n showSymbol: showPoints,\n showAllSymbol: true,\n symbolSize: pointRadius,\n lineStyle: {\n width: lineWidth,\n opacity: 0.8,\n },\n areaStyle: {\n opacity: visual.areaOpacity ?? DEFAULT_AREA_OPACITY,\n },\n // https://echarts.apache.org/en/option.html#series-line.emphasis\n emphasis: {\n focus: 'series',\n disabled: visual.areaOpacity !== undefined && visual.areaOpacity > 0, // prevents flicker when moving cursor between shaded regions\n lineStyle: {\n width: lineWidth + 1.5,\n opacity: 1,\n },\n },\n blur: {\n lineStyle: {\n width: lineWidth,\n opacity: BLUR_FADEOUT_OPACITY,\n },\n },\n };\n}\n\n/**\n * Gets ECharts line series option properties for recommended TimeChart\n */\nexport function getTimeSeries(\n id: string,\n datasetIndex: number,\n formattedName: string,\n visual: TimeSeriesChartVisualOptions,\n timeScale: TimeScale,\n paletteColor: string\n): TimeSeriesOption {\n const lineWidth = visual.lineWidth ?? DEFAULT_LINE_WIDTH;\n const pointRadius = visual.pointRadius ?? DEFAULT_POINT_RADIUS;\n\n // Shows datapoint symbols when selected time range is roughly 15 minutes or less\n const minuteMs = 60000;\n let showPoints = timeScale.rangeMs <= minuteMs * 15;\n // Allows overriding default behavior and opt-in to always show all symbols (can hurt performance)\n if (visual.showPoints === 'always') {\n showPoints = true;\n }\n\n if (visual.display === 'bar') {\n const series: BarSeriesOption = {\n type: 'bar',\n id: id,\n datasetIndex,\n name: formattedName,\n color: paletteColor,\n stack: visual.stack === 'all' ? visual.stack : undefined,\n label: {\n show: false,\n },\n };\n return series;\n }\n\n const series: LineSeriesOption = {\n type: 'line',\n id: id,\n datasetIndex,\n name: formattedName,\n connectNulls: visual.connectNulls ?? DEFAULT_CONNECT_NULLS,\n color: paletteColor,\n stack: visual.stack === 'all' ? visual.stack : undefined,\n sampling: 'lttb',\n progressiveThreshold: OPTIMIZED_MODE_SERIES_LIMIT, // https://echarts.apache.org/en/option.html#series-lines.progressiveThreshold\n showSymbol: showPoints,\n showAllSymbol: true,\n symbolSize: pointRadius,\n lineStyle: {\n width: lineWidth,\n opacity: 0.95,\n },\n areaStyle: {\n opacity: visual.areaOpacity ?? DEFAULT_AREA_OPACITY,\n },\n // https://echarts.apache.org/en/option.html#series-line.emphasis\n emphasis: {\n focus: 'series',\n disabled: visual.areaOpacity !== undefined && visual.areaOpacity > 0, // prevents flicker when moving cursor between shaded regions\n lineStyle: {\n width: lineWidth + 1,\n opacity: 1,\n },\n },\n selectedMode: 'single',\n select: {\n itemStyle: {\n borderColor: paletteColor,\n borderWidth: pointRadius + 0.5,\n },\n },\n blur: {\n lineStyle: {\n width: lineWidth,\n opacity: BLUR_FADEOUT_OPACITY,\n },\n },\n };\n return series;\n}\n\n/**\n * Gets threshold-specific line series styles\n * markLine cannot be used since it does not update yAxis max / min\n * and threshold data needs to show in the tooltip\n */\nexport function getThresholdSeries(name: string, threshold: StepOptions, seriesIndex: number): LineSeriesOption {\n return {\n type: 'line',\n name: name,\n id: name,\n datasetId: name,\n datasetIndex: seriesIndex,\n color: threshold.color,\n label: {\n show: false,\n },\n lineStyle: {\n type: 'dashed',\n width: 2,\n },\n emphasis: {\n focus: 'series',\n lineStyle: {\n width: 2.5,\n },\n },\n blur: {\n lineStyle: {\n opacity: BLUR_FADEOUT_OPACITY,\n },\n },\n };\n}\n\n/**\n * Converts percent threshold into absolute step value\n * If max is undefined, use the max value from time series data as default\n */\nexport function convertPercentThreshold(\n percent: number,\n data: LegacyTimeSeries[] | TimeSeries[],\n max?: number,\n min?: number\n): number {\n const percentDecimal = percent / 100;\n const adjustedMax = max ?? findMax(data);\n const adjustedMin = min ?? 0;\n const total = adjustedMax - adjustedMin;\n return percentDecimal * total + adjustedMin;\n}\n\nfunction findMax(data: LegacyTimeSeries[] | TimeSeries[]): number {\n let max = 0;\n if (data.length && data[0] !== undefined && (data as TimeSeries[])[0]?.values) {\n (data as TimeSeries[]).forEach((series) => {\n series.values.forEach((valueTuple: TimeSeriesValueTuple) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [_, value] = valueTuple;\n if (typeof value === 'number' && value > max) {\n max = value;\n }\n });\n });\n } else {\n (data as LegacyTimeSeries[]).forEach((series) => {\n if (series.data !== undefined) {\n series.data.forEach((value: EChartsValues) => {\n if (typeof value === 'number' && value > max) {\n max = value;\n }\n });\n }\n });\n }\n return max;\n}\n\n/**\n * Converts Perses panel yAxis from dashboard spec to ECharts supported yAxis options\n */\nexport function convertPanelYAxis(inputAxis: TimeSeriesChartYAxisOptions = {}): YAXisComponentOption {\n const yAxis: YAXisComponentOption = {\n show: true,\n axisLabel: {\n show: inputAxis?.show ?? DEFAULT_Y_AXIS.show,\n },\n min: inputAxis?.min,\n max: inputAxis?.max,\n };\n\n // Set the y-axis minimum relative to the data\n if (inputAxis?.min === undefined) {\n // https://echarts.apache.org/en/option.html#yAxis.min\n yAxis.min = (value): number => {\n if (value.min >= 0 && value.min <= 1) {\n // Helps with PercentDecimal units, or datasets that return 0 or 1 booleans\n return 0;\n }\n\n // Note: We can tweak the MULTIPLIER constants if we want\n // TODO: Experiment with using a padding that is based on the difference between max value and min value\n if (value.min > 0) {\n return roundDown(value.min * POSITIVE_MIN_VALUE_MULTIPLIER);\n } else {\n return roundDown(value.min * NEGATIVE_MIN_VALUE_MULTIPLIER);\n }\n };\n }\n\n return yAxis;\n}\n\n/**\n * Rounds down to nearest number with one significant digit.\n *\n * Examples:\n * 1. 675 --> 600\n * 2. 0.567 --> 0.5\n * 3. -12 --> -20\n */\nexport function roundDown(num: number): number {\n const magnitude = Math.floor(Math.log10(Math.abs(num)));\n const firstDigit = Math.floor(num / Math.pow(10, magnitude));\n return firstDigit * Math.pow(10, magnitude);\n}\n"],"names":["getCommonTimeScale","OPTIMIZED_MODE_SERIES_LIMIT","DEFAULT_AREA_OPACITY","DEFAULT_CONNECT_NULLS","DEFAULT_LINE_WIDTH","DEFAULT_POINT_RADIUS","DEFAULT_Y_AXIS","POSITIVE_MIN_VALUE_MULTIPLIER","NEGATIVE_MIN_VALUE_MULTIPLIER","EMPTY_GRAPH_DATA","timeSeries","xAxis","legendItems","HIDE_DATAPOINTS_LIMIT","BLUR_FADEOUT_OPACITY","getCommonTimeScaleForQueries","queries","seriesData","map","query","data","getLineSeries","id","formattedName","visual","paletteColor","lineWidth","pointRadius","showPoints","undefined","length","type","name","connectNulls","color","stack","sampling","progressiveThreshold","showSymbol","showAllSymbol","symbolSize","lineStyle","width","opacity","areaStyle","areaOpacity","emphasis","focus","disabled","blur","getTimeSeries","datasetIndex","timeScale","minuteMs","rangeMs","display","series","label","show","selectedMode","select","itemStyle","borderColor","borderWidth","getThresholdSeries","threshold","seriesIndex","datasetId","convertPercentThreshold","percent","max","min","percentDecimal","adjustedMax","findMax","adjustedMin","total","values","forEach","valueTuple","_","value","convertPanelYAxis","inputAxis","yAxis","axisLabel","roundDown","num","magnitude","Math","floor","log10","abs","firstDigit","pow"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;A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,OAAOK,aAAaJ,KAAKK,GAAG,CAAC,IAAIN;AACnC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/data-transform.ts"],"sourcesContent":["// Copyright 2023 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 type { YAXisComponentOption } from 'echarts';\nimport { LineSeriesOption, BarSeriesOption } from 'echarts/charts';\nimport {\n StepOptions,\n TimeScale,\n TimeSeries,\n TimeSeriesValueTuple,\n getCommonTimeScale,\n TimeSeriesData,\n} from '@perses-dev/core';\nimport {\n OPTIMIZED_MODE_SERIES_LIMIT,\n LegacyTimeSeries,\n EChartsDataFormat,\n EChartsValues,\n TimeSeriesOption,\n} from '@perses-dev/components';\nimport { useTimeSeriesQueries, PanelData } from '@perses-dev/plugin-system';\nimport {\n DEFAULT_AREA_OPACITY,\n DEFAULT_CONNECT_NULLS,\n DEFAULT_LINE_WIDTH,\n DEFAULT_POINT_RADIUS,\n DEFAULT_Y_AXIS,\n POSITIVE_MIN_VALUE_MULTIPLIER,\n NEGATIVE_MIN_VALUE_MULTIPLIER,\n TimeSeriesChartVisualOptions,\n TimeSeriesChartYAxisOptions,\n} from '../time-series-chart-model';\n\nexport type RunningQueriesState = ReturnType<typeof useTimeSeriesQueries>;\n\nexport const EMPTY_GRAPH_DATA: EChartsDataFormat = {\n timeSeries: [],\n xAxis: [],\n legendItems: [],\n};\n\nexport const HIDE_DATAPOINTS_LIMIT = 70;\n\nexport const BLUR_FADEOUT_OPACITY = 0.5;\n\n/**\n * Given a list of running queries, calculates a common time scale for use on\n * the x axis (i.e. start/end dates and a step that is divisible into all of\n * the queries' steps).\n */\nexport function getCommonTimeScaleForQueries(queries: Array<PanelData<TimeSeriesData>>): TimeScale | undefined {\n const seriesData = queries.map((query) => query.data);\n return getCommonTimeScale(seriesData);\n}\n\n/**\n * Gets ECharts line series option properties for regular trends\n */\nexport function getTimeSeries(\n id: string,\n datasetIndex: number,\n formattedName: string,\n visual: TimeSeriesChartVisualOptions,\n timeScale: TimeScale,\n paletteColor: string\n): TimeSeriesOption {\n const lineWidth = visual.lineWidth ?? DEFAULT_LINE_WIDTH;\n const pointRadius = visual.pointRadius ?? DEFAULT_POINT_RADIUS;\n\n // Shows datapoint symbols when selected time range is roughly 15 minutes or less\n const minuteMs = 60000;\n let showPoints = timeScale.rangeMs <= minuteMs * 15;\n // Allows overriding default behavior and opt-in to always show all symbols (can hurt performance)\n if (visual.showPoints === 'always') {\n showPoints = true;\n }\n\n if (visual.display === 'bar') {\n const series: BarSeriesOption = {\n type: 'bar',\n id: id,\n datasetIndex,\n name: formattedName,\n color: paletteColor,\n stack: visual.stack === 'all' ? visual.stack : undefined,\n label: {\n show: false,\n },\n };\n return series;\n }\n\n const series: LineSeriesOption = {\n type: 'line',\n id: id,\n datasetIndex,\n name: formattedName,\n connectNulls: visual.connectNulls ?? DEFAULT_CONNECT_NULLS,\n color: paletteColor,\n stack: visual.stack === 'all' ? visual.stack : undefined,\n sampling: 'lttb',\n progressiveThreshold: OPTIMIZED_MODE_SERIES_LIMIT, // https://echarts.apache.org/en/option.html#series-lines.progressiveThreshold\n showSymbol: showPoints,\n showAllSymbol: true,\n symbolSize: pointRadius,\n lineStyle: {\n width: lineWidth,\n opacity: 0.95,\n },\n areaStyle: {\n opacity: visual.areaOpacity ?? DEFAULT_AREA_OPACITY,\n },\n // https://echarts.apache.org/en/option.html#series-line.emphasis\n emphasis: {\n focus: 'series',\n disabled: visual.areaOpacity !== undefined && visual.areaOpacity > 0, // prevents flicker when moving cursor between shaded regions\n lineStyle: {\n width: lineWidth + 1,\n opacity: 1,\n },\n },\n selectedMode: 'single',\n select: {\n itemStyle: {\n borderColor: paletteColor,\n borderWidth: pointRadius + 0.5,\n },\n },\n blur: {\n lineStyle: {\n width: lineWidth,\n opacity: BLUR_FADEOUT_OPACITY,\n },\n },\n };\n return series;\n}\n\n/**\n * Gets threshold-specific line series styles\n * markLine cannot be used since it does not update yAxis max / min\n * and threshold data needs to show in the tooltip\n */\nexport function getThresholdSeries(name: string, threshold: StepOptions, seriesIndex: number): LineSeriesOption {\n return {\n type: 'line',\n name: name,\n id: name,\n datasetId: name,\n datasetIndex: seriesIndex,\n color: threshold.color,\n label: {\n show: false,\n },\n lineStyle: {\n type: 'dashed',\n width: 2,\n },\n emphasis: {\n focus: 'series',\n lineStyle: {\n width: 2.5,\n },\n },\n blur: {\n lineStyle: {\n opacity: BLUR_FADEOUT_OPACITY,\n },\n },\n };\n}\n\n/**\n * Converts percent threshold into absolute step value\n * If max is undefined, use the max value from time series data as default\n */\nexport function convertPercentThreshold(\n percent: number,\n data: LegacyTimeSeries[] | TimeSeries[],\n max?: number,\n min?: number\n): number {\n const percentDecimal = percent / 100;\n const adjustedMax = max ?? findMax(data);\n const adjustedMin = min ?? 0;\n const total = adjustedMax - adjustedMin;\n return percentDecimal * total + adjustedMin;\n}\n\nfunction findMax(data: LegacyTimeSeries[] | TimeSeries[]): number {\n let max = 0;\n if (data.length && data[0] !== undefined && (data as TimeSeries[])[0]?.values) {\n (data as TimeSeries[]).forEach((series) => {\n series.values.forEach((valueTuple: TimeSeriesValueTuple) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [_, value] = valueTuple;\n if (typeof value === 'number' && value > max) {\n max = value;\n }\n });\n });\n } else {\n (data as LegacyTimeSeries[]).forEach((series) => {\n if (series.data !== undefined) {\n series.data.forEach((value: EChartsValues) => {\n if (typeof value === 'number' && value > max) {\n max = value;\n }\n });\n }\n });\n }\n return max;\n}\n\n/**\n * Converts Perses panel yAxis from dashboard spec to ECharts supported yAxis options\n */\nexport function convertPanelYAxis(inputAxis: TimeSeriesChartYAxisOptions = {}): YAXisComponentOption {\n const yAxis: YAXisComponentOption = {\n show: true,\n axisLabel: {\n show: inputAxis?.show ?? DEFAULT_Y_AXIS.show,\n },\n min: inputAxis?.min,\n max: inputAxis?.max,\n };\n\n // Set the y-axis minimum relative to the data\n if (inputAxis?.min === undefined) {\n // https://echarts.apache.org/en/option.html#yAxis.min\n yAxis.min = (value): number => {\n if (value.min >= 0 && value.min <= 1) {\n // Helps with PercentDecimal units, or datasets that return 0 or 1 booleans\n return 0;\n }\n\n // Note: We can tweak the MULTIPLIER constants if we want\n // TODO: Experiment with using a padding that is based on the difference between max value and min value\n if (value.min > 0) {\n return roundDown(value.min * POSITIVE_MIN_VALUE_MULTIPLIER);\n } else {\n return roundDown(value.min * NEGATIVE_MIN_VALUE_MULTIPLIER);\n }\n };\n }\n\n return yAxis;\n}\n\n/**\n * Rounds down to nearest number with one significant digit.\n *\n * Examples:\n * 1. 675 --> 600\n * 2. 0.567 --> 0.5\n * 3. -12 --> -20\n */\nexport function roundDown(num: number): number {\n const magnitude = Math.floor(Math.log10(Math.abs(num)));\n const firstDigit = Math.floor(num / Math.pow(10, magnitude));\n return firstDigit * Math.pow(10, magnitude);\n}\n"],"names":["getCommonTimeScale","OPTIMIZED_MODE_SERIES_LIMIT","DEFAULT_AREA_OPACITY","DEFAULT_CONNECT_NULLS","DEFAULT_LINE_WIDTH","DEFAULT_POINT_RADIUS","DEFAULT_Y_AXIS","POSITIVE_MIN_VALUE_MULTIPLIER","NEGATIVE_MIN_VALUE_MULTIPLIER","EMPTY_GRAPH_DATA","timeSeries","xAxis","legendItems","HIDE_DATAPOINTS_LIMIT","BLUR_FADEOUT_OPACITY","getCommonTimeScaleForQueries","queries","seriesData","map","query","data","getTimeSeries","id","datasetIndex","formattedName","visual","timeScale","paletteColor","lineWidth","pointRadius","minuteMs","showPoints","rangeMs","display","series","type","name","color","stack","undefined","label","show","connectNulls","sampling","progressiveThreshold","showSymbol","showAllSymbol","symbolSize","lineStyle","width","opacity","areaStyle","areaOpacity","emphasis","focus","disabled","selectedMode","select","itemStyle","borderColor","borderWidth","blur","getThresholdSeries","threshold","seriesIndex","datasetId","convertPercentThreshold","percent","max","min","percentDecimal","adjustedMax","findMax","adjustedMin","total","length","values","forEach","valueTuple","_","value","convertPanelYAxis","inputAxis","yAxis","axisLabel","roundDown","num","magnitude","Math","floor","log10","abs","firstDigit","pow"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,SAKEA,kBAAkB,QAEb,mBAAmB;AAC1B,SACEC,2BAA2B,QAKtB,yBAAyB;AAEhC,SACEC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,EAClBC,oBAAoB,EACpBC,cAAc,EACdC,6BAA6B,EAC7BC,6BAA6B,QAGxB,6BAA6B;AAIpC,OAAO,MAAMC,mBAAsC;IACjDC,YAAY,EAAE;IACdC,OAAO,EAAE;IACTC,aAAa,EAAE;AACjB,EAAE;AAEF,OAAO,MAAMC,wBAAwB,GAAG;AAExC,OAAO,MAAMC,uBAAuB,IAAI;AAExC;;;;CAIC,GACD,OAAO,SAASC,6BAA6BC,OAAyC;IACpF,MAAMC,aAAaD,QAAQE,GAAG,CAAC,CAACC,QAAUA,MAAMC,IAAI;IACpD,OAAOpB,mBAAmBiB;AAC5B;AAEA;;CAEC,GACD,OAAO,SAASI,cACdC,EAAU,EACVC,YAAoB,EACpBC,aAAqB,EACrBC,MAAoC,EACpCC,SAAoB,EACpBC,YAAoB;IAEpB,MAAMC,YAAYH,OAAOG,SAAS,IAAIxB;IACtC,MAAMyB,cAAcJ,OAAOI,WAAW,IAAIxB;IAE1C,iFAAiF;IACjF,MAAMyB,WAAW;IACjB,IAAIC,aAAaL,UAAUM,OAAO,IAAIF,WAAW;IACjD,kGAAk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AEA,8CAA8C;IAC9C,IAAIc,WAAWb,QAAQ9B,WAAW;QAChC,sDAAsD;QACtD4C,MAAMd,GAAG,GAAG,CAACW;YACX,IAAIA,MAAMX,GAAG,IAAI,KAAKW,MAAMX,GAAG,IAAI,GAAG;gBACpC,2EAA2E;gBAC3E,OAAO;YACT;YAEA,yDAAyD;YACzD,wGAAwG;YACxG,IAAIW,MAAMX,GAAG,GAAG,GAAG;gBACjB,OAAOgB,UAAUL,MAAMX,GAAG,GAAG9D;YAC/B,OAAO;gBACL,OAAO8E,UAAUL,MAAMX,GAAG,GAAG7D;YAC/B;QACF;IACF;IAEA,OAAO2E;AACT;AAEA;;;;;;;CAOC,GACD,OAAO,SAASE,UAAUC,GAAW;IACnC,MAAMC,YAAYC,KAAKC,KAAK,CAACD,KAAKE,KAAK,CAACF,KAAKG,GAAG,CAACL;IACjD,MAAMM,aAAaJ,KAAKC,KAAK,CAACH,MAAME,KAAKK,GAAG,CAAC,IAAIN;IACjD,OAAOK,aAAaJ,KAAKK,GAAG,CAAC,IAAIN;AACnC"}
|
package/mf-manifest.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"name": "TimeSeriesChart",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.
|
|
8
|
+
"buildVersion": "0.10.1",
|
|
9
9
|
"buildName": "@perses-dev/timeseries-chart-plugin"
|
|
10
10
|
},
|
|
11
11
|
"remoteEntry": {
|
|
12
|
-
"name": "__mf/js/TimeSeriesChart.
|
|
12
|
+
"name": "__mf/js/TimeSeriesChart.2f8b193b.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": "0.
|
|
23
|
+
"pluginVersion": "0.19.1",
|
|
24
24
|
"prefetchInterface": false,
|
|
25
25
|
"publicPath": "/plugins/TimeSeriesChart/"
|
|
26
26
|
},
|
|
@@ -33,11 +33,9 @@
|
|
|
33
33
|
"requiredVersion": "^11.11.3",
|
|
34
34
|
"assets": {
|
|
35
35
|
"js": {
|
|
36
|
-
"async": [
|
|
37
|
-
"__mf/js/async/964.6dfbf211.js"
|
|
38
|
-
],
|
|
36
|
+
"async": [],
|
|
39
37
|
"sync": [
|
|
40
|
-
"__mf/js/async/960.
|
|
38
|
+
"__mf/js/async/960.cd399075.js"
|
|
41
39
|
]
|
|
42
40
|
},
|
|
43
41
|
"css": {
|
|
@@ -54,13 +52,10 @@
|
|
|
54
52
|
"requiredVersion": "^11.14.0",
|
|
55
53
|
"assets": {
|
|
56
54
|
"js": {
|
|
57
|
-
"async": [
|
|
58
|
-
"__mf/js/async/964.6dfbf211.js",
|
|
59
|
-
"__mf/js/async/960.3047096d.js"
|
|
60
|
-
],
|
|
55
|
+
"async": [],
|
|
61
56
|
"sync": [
|
|
62
|
-
"__mf/js/async/694.
|
|
63
|
-
"__mf/js/async/770.
|
|
57
|
+
"__mf/js/async/694.ebf24a00.js",
|
|
58
|
+
"__mf/js/async/770.e129dd07.js"
|
|
64
59
|
]
|
|
65
60
|
},
|
|
66
61
|
"css": {
|
|
@@ -77,12 +72,10 @@
|
|
|
77
72
|
"requiredVersion": "^3.10.0",
|
|
78
73
|
"assets": {
|
|
79
74
|
"js": {
|
|
80
|
-
"async": [
|
|
81
|
-
"__mf/js/async/964.6dfbf211.js"
|
|
82
|
-
],
|
|
75
|
+
"async": [],
|
|
83
76
|
"sync": [
|
|
84
|
-
"__mf/js/async/214.
|
|
85
|
-
"__mf/js/async/738.
|
|
77
|
+
"__mf/js/async/214.37696543.js",
|
|
78
|
+
"__mf/js/async/738.c37f7bca.js"
|
|
86
79
|
]
|
|
87
80
|
},
|
|
88
81
|
"css": {
|
|
@@ -94,21 +87,14 @@
|
|
|
94
87
|
{
|
|
95
88
|
"id": "TimeSeriesChart:@perses-dev/components",
|
|
96
89
|
"name": "@perses-dev/components",
|
|
97
|
-
"version": "0.
|
|
90
|
+
"version": "0.52.0-beta.5",
|
|
98
91
|
"singleton": true,
|
|
99
|
-
"requiredVersion": "^0.
|
|
92
|
+
"requiredVersion": "^0.52.0-beta.5",
|
|
100
93
|
"assets": {
|
|
101
94
|
"js": {
|
|
102
|
-
"async": [
|
|
103
|
-
"__mf/js/async/964.6dfbf211.js",
|
|
104
|
-
"__mf/js/async/173.f6f7e45b.js",
|
|
105
|
-
"__mf/js/async/960.3047096d.js",
|
|
106
|
-
"__mf/js/async/770.78a741ab.js",
|
|
107
|
-
"__mf/js/async/75.5952779d.js",
|
|
108
|
-
"__mf/js/async/740.67107c3c.js"
|
|
109
|
-
],
|
|
95
|
+
"async": [],
|
|
110
96
|
"sync": [
|
|
111
|
-
"__mf/js/async/
|
|
97
|
+
"__mf/js/async/547.bb4f1e58.js"
|
|
112
98
|
]
|
|
113
99
|
},
|
|
114
100
|
"css": {
|
|
@@ -120,37 +106,18 @@
|
|
|
120
106
|
{
|
|
121
107
|
"id": "TimeSeriesChart:@perses-dev/plugin-system",
|
|
122
108
|
"name": "@perses-dev/plugin-system",
|
|
123
|
-
"version": "0.
|
|
109
|
+
"version": "0.52.0-beta.5",
|
|
124
110
|
"singleton": true,
|
|
125
|
-
"requiredVersion": "^0.
|
|
111
|
+
"requiredVersion": "^0.52.0-beta.5",
|
|
126
112
|
"assets": {
|
|
127
113
|
"js": {
|
|
128
|
-
"async": [
|
|
129
|
-
"__mf/js/async/964.6dfbf211.js",
|
|
130
|
-
"__mf/js/async/173.f6f7e45b.js",
|
|
131
|
-
"__mf/js/async/960.3047096d.js",
|
|
132
|
-
"__mf/js/async/770.78a741ab.js",
|
|
133
|
-
"__mf/js/async/238.625b8a48.js",
|
|
134
|
-
"__mf/js/async/224.ce414ffb.js",
|
|
135
|
-
"__mf/js/async/75.5952779d.js",
|
|
136
|
-
"__mf/js/async/740.67107c3c.js",
|
|
137
|
-
"__mf/js/async/281.a2a87c37.js",
|
|
138
|
-
"__mf/js/async/476.45fca8d3.js",
|
|
139
|
-
"__mf/js/async/171.598de6a9.js",
|
|
140
|
-
"__mf/js/async/879.24def15a.js",
|
|
141
|
-
"__mf/js/async/738.0a12bb44.js",
|
|
142
|
-
"__mf/js/async/223.def4d0a9.js",
|
|
143
|
-
"__mf/js/async/409.2808c63e.js",
|
|
144
|
-
"__mf/js/async/981.77f901c0.js"
|
|
145
|
-
],
|
|
114
|
+
"async": [],
|
|
146
115
|
"sync": [
|
|
147
|
-
"__mf/js/async/
|
|
116
|
+
"__mf/js/async/109.604f6c41.js"
|
|
148
117
|
]
|
|
149
118
|
},
|
|
150
119
|
"css": {
|
|
151
|
-
"async": [
|
|
152
|
-
"__mf/css/async/263.9a1fa3dd.css"
|
|
153
|
-
],
|
|
120
|
+
"async": [],
|
|
154
121
|
"sync": []
|
|
155
122
|
}
|
|
156
123
|
}
|
|
@@ -165,7 +132,7 @@
|
|
|
165
132
|
"js": {
|
|
166
133
|
"async": [],
|
|
167
134
|
"sync": [
|
|
168
|
-
"__mf/js/async/75.
|
|
135
|
+
"__mf/js/async/75.26ec5bee.js"
|
|
169
136
|
]
|
|
170
137
|
},
|
|
171
138
|
"css": {
|
|
@@ -184,7 +151,7 @@
|
|
|
184
151
|
"js": {
|
|
185
152
|
"async": [],
|
|
186
153
|
"sync": [
|
|
187
|
-
"__mf/js/async/409.
|
|
154
|
+
"__mf/js/async/409.97dde548.js"
|
|
188
155
|
]
|
|
189
156
|
},
|
|
190
157
|
"css": {
|
|
@@ -203,7 +170,7 @@
|
|
|
203
170
|
"js": {
|
|
204
171
|
"async": [],
|
|
205
172
|
"sync": [
|
|
206
|
-
"__mf/js/async/981.
|
|
173
|
+
"__mf/js/async/981.e360e7df.js"
|
|
207
174
|
]
|
|
208
175
|
},
|
|
209
176
|
"css": {
|
|
@@ -220,11 +187,9 @@
|
|
|
220
187
|
"requiredVersion": "18.2.0",
|
|
221
188
|
"assets": {
|
|
222
189
|
"js": {
|
|
223
|
-
"async": [
|
|
224
|
-
"__mf/js/async/964.6dfbf211.js"
|
|
225
|
-
],
|
|
190
|
+
"async": [],
|
|
226
191
|
"sync": [
|
|
227
|
-
"__mf/js/async/173.
|
|
192
|
+
"__mf/js/async/173.58a1dc61.js"
|
|
228
193
|
]
|
|
229
194
|
},
|
|
230
195
|
"css": {
|
|
@@ -243,7 +208,7 @@
|
|
|
243
208
|
"js": {
|
|
244
209
|
"async": [],
|
|
245
210
|
"sync": [
|
|
246
|
-
"__mf/js/async/964.
|
|
211
|
+
"__mf/js/async/964.719c530c.js"
|
|
247
212
|
]
|
|
248
213
|
},
|
|
249
214
|
"css": {
|
|
@@ -260,12 +225,9 @@
|
|
|
260
225
|
"requiredVersion": "^3.2.0",
|
|
261
226
|
"assets": {
|
|
262
227
|
"js": {
|
|
263
|
-
"async": [
|
|
264
|
-
"__mf/js/async/238.625b8a48.js",
|
|
265
|
-
"__mf/js/async/75.5952779d.js"
|
|
266
|
-
],
|
|
228
|
+
"async": [],
|
|
267
229
|
"sync": [
|
|
268
|
-
"__mf/js/async/740.
|
|
230
|
+
"__mf/js/async/740.f0e8d499.js"
|
|
269
231
|
]
|
|
270
232
|
},
|
|
271
233
|
"css": {
|
|
@@ -283,32 +245,21 @@
|
|
|
283
245
|
"assets": {
|
|
284
246
|
"js": {
|
|
285
247
|
"sync": [
|
|
286
|
-
"__mf/js/async/
|
|
287
|
-
"__mf/js/async/
|
|
288
|
-
"__mf/js/async/
|
|
289
|
-
"__mf/js/async/
|
|
290
|
-
"__mf/js/async/
|
|
291
|
-
"__mf/js/async/__federation_expose_TimeSeriesChart.
|
|
248
|
+
"__mf/js/async/797.72ff552e.js",
|
|
249
|
+
"__mf/js/async/133.c48c8cc8.js",
|
|
250
|
+
"__mf/js/async/686.0cd9a75c.js",
|
|
251
|
+
"__mf/js/async/53.8edfe937.js",
|
|
252
|
+
"__mf/js/async/613.20f15bb7.js",
|
|
253
|
+
"__mf/js/async/__federation_expose_TimeSeriesChart.f20a0aca.js"
|
|
292
254
|
],
|
|
293
255
|
"async": [
|
|
294
|
-
"__mf/js/async/
|
|
295
|
-
"__mf/js/async/
|
|
296
|
-
"__mf/js/async/
|
|
297
|
-
"__mf/js/async/
|
|
298
|
-
"__mf/js/async/
|
|
299
|
-
"__mf/js/async/
|
|
300
|
-
"__mf/js/async/
|
|
301
|
-
"__mf/js/async/75.5952779d.js",
|
|
302
|
-
"__mf/js/async/292.311e6eb0.js",
|
|
303
|
-
"__mf/js/async/755.f76e3538.js",
|
|
304
|
-
"__mf/js/async/476.45fca8d3.js",
|
|
305
|
-
"__mf/js/async/171.598de6a9.js",
|
|
306
|
-
"__mf/js/async/lib-router.098fc614.js",
|
|
307
|
-
"__mf/js/async/845.6d99c354.js",
|
|
308
|
-
"__mf/js/async/488.0d0b1a91.js",
|
|
309
|
-
"__mf/js/async/738.0a12bb44.js",
|
|
310
|
-
"__mf/js/async/409.2808c63e.js",
|
|
311
|
-
"__mf/js/async/981.77f901c0.js"
|
|
256
|
+
"__mf/js/async/224.2d3ce51f.js",
|
|
257
|
+
"__mf/js/async/238.767e5398.js",
|
|
258
|
+
"__mf/js/async/292.9efc6a73.js",
|
|
259
|
+
"__mf/js/async/476.23a59a72.js",
|
|
260
|
+
"__mf/js/async/580.5f4b0dbd.js",
|
|
261
|
+
"__mf/js/async/lib-router.25a1f509.js",
|
|
262
|
+
"__mf/js/async/488.031fc875.js"
|
|
312
263
|
]
|
|
313
264
|
},
|
|
314
265
|
"css": {
|