@perses-dev/gauge-chart-plugin 0.10.0 → 0.11.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/css/async/442.d3010b86.css +1 -0
- package/__mf/css/async/61.d3010b86.css +1 -0
- package/__mf/css/async/823.d3010b86.css +1 -0
- package/__mf/js/GaugeChart.64278e7a.js +6 -0
- package/__mf/js/async/{964.eba21d42.js → 121.0385c285.js} +2 -2
- package/__mf/js/async/127.5ef482f0.js +29 -0
- package/__mf/js/async/{488.d3de7c62.js → 177.4d5022bb.js} +1 -1
- package/__mf/js/async/192.8bf7cec4.js +1 -0
- package/__mf/js/async/204.368d6115.js +10 -0
- package/__mf/js/async/235.675ef806.js +1 -0
- package/__mf/js/async/252.30692fba.js +22 -0
- package/__mf/js/async/274.07ee62ee.js +2 -0
- package/__mf/js/async/350.26d75fbf.js +1 -0
- package/__mf/js/async/356.a480b281.js +1 -0
- package/__mf/js/async/{930.1937c2c4.js → 377.9f5a442b.js} +1 -1
- package/__mf/js/async/392.f9d6a7ae.js +2 -0
- package/__mf/js/async/403.4dee4df3.js +2 -0
- package/__mf/js/async/410.3d37263a.js +1 -0
- package/__mf/js/async/{553.ac447ad8.js → 458.2a1e1dfe.js} +1 -1
- package/__mf/js/async/467.fcde6002.js +111 -0
- package/__mf/js/async/470.9855b786.js +2 -0
- package/__mf/js/async/{296.bdf413a6.js → 496.63537c05.js} +1 -1
- package/__mf/js/async/{214.a5a27e07.js → 587.e32d2906.js} +1 -1
- package/__mf/js/async/588.7dda8aa9.js +1 -0
- package/__mf/js/async/616.1b1bb2ba.js +1 -0
- package/__mf/js/async/71.773ab397.js +1 -0
- package/__mf/js/async/756.ae22d123.js +1 -0
- package/__mf/js/async/77.429aab8d.js +1 -0
- package/__mf/js/async/790.e67bc862.js +7 -0
- package/__mf/js/async/854.0822db86.js +1 -0
- package/__mf/js/async/873.b08548ee.js +1 -0
- package/__mf/js/async/941.9ebff559.js +2 -0
- package/__mf/js/async/963.c04e5fd0.js +1 -0
- package/__mf/js/async/{738.24d6cefe.js → 968.be22fbda.js} +1 -1
- package/__mf/js/async/978.26163709.js +1 -0
- package/__mf/js/async/__federation_expose_GaugeChart.54f4fa10.js +1 -0
- package/__mf/js/async/lib-router.c318fd9d.js +2 -0
- package/__mf/js/main.967c5d04.js +6 -0
- package/lib/GaugeChartBase.d.ts +3 -5
- package/lib/GaugeChartBase.d.ts.map +1 -1
- package/lib/GaugeChartBase.js +51 -75
- package/lib/GaugeChartBase.js.map +1 -1
- package/lib/GaugeChartOptionsEditorSettings.js +1 -1
- package/lib/GaugeChartOptionsEditorSettings.js.map +1 -1
- package/lib/GaugeChartPanel.d.ts.map +1 -1
- package/lib/GaugeChartPanel.js +59 -11
- package/lib/GaugeChartPanel.js.map +1 -1
- package/lib/bootstrap.js +1 -1
- package/lib/bootstrap.js.map +1 -1
- package/lib/cjs/GaugeChartBase.js +52 -81
- package/lib/cjs/GaugeChartPanel.js +60 -12
- package/lib/cjs/gauge-chart-model.js +5 -5
- package/lib/cjs/index-federation.js +12 -12
- package/lib/cjs/thresholds.js +3 -3
- package/mf-manifest.json +39 -39
- package/mf-stats.json +39 -39
- package/package.json +4 -4
- package/__mf/css/async/263.683bd428.css +0 -1
- package/__mf/css/async/341.683bd428.css +0 -1
- package/__mf/css/async/759.683bd428.css +0 -1
- package/__mf/js/GaugeChart.a227385b.js +0 -5
- package/__mf/js/async/109.38fe9d18.js +0 -73
- package/__mf/js/async/116.577ccfb6.js +0 -29
- package/__mf/js/async/119.be08efba.js +0 -111
- package/__mf/js/async/173.9d9aaec5.js +0 -2
- package/__mf/js/async/224.b7775059.js +0 -1
- package/__mf/js/async/238.16f121d4.js +0 -1
- package/__mf/js/async/288.6d46d8e7.js +0 -7
- package/__mf/js/async/292.149a1005.js +0 -1
- package/__mf/js/async/298.bad26699.js +0 -1
- package/__mf/js/async/308.b768a783.js +0 -1
- package/__mf/js/async/409.b3df73a9.js +0 -1
- package/__mf/js/async/413.1b99956f.js +0 -2
- package/__mf/js/async/422.088d32ca.js +0 -1
- package/__mf/js/async/623.7ff5fe72.js +0 -1
- package/__mf/js/async/694.dd75606a.js +0 -1
- package/__mf/js/async/740.87850b80.js +0 -1
- package/__mf/js/async/75.b72fd8c7.js +0 -1
- package/__mf/js/async/770.ac5776da.js +0 -1
- package/__mf/js/async/774.fffc4f90.js +0 -1
- package/__mf/js/async/790.1575a3f0.js +0 -1
- package/__mf/js/async/863.a5e334d8.js +0 -2
- package/__mf/js/async/929.904de1f6.js +0 -10
- package/__mf/js/async/960.f1e14dae.js +0 -2
- package/__mf/js/async/981.55bd66db.js +0 -2
- package/__mf/js/async/__federation_expose_GaugeChart.4c068ee6.js +0 -1
- package/__mf/js/async/lib-router.34d74652.js +0 -2
- package/__mf/js/main.3b4e4de9.js +0 -5
- /package/__mf/js/async/{964.eba21d42.js.LICENSE.txt → 121.0385c285.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{929.904de1f6.js.LICENSE.txt → 204.368d6115.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{109.38fe9d18.js.LICENSE.txt → 252.30692fba.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{960.f1e14dae.js.LICENSE.txt → 274.07ee62ee.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{981.55bd66db.js.LICENSE.txt → 392.f9d6a7ae.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{413.1b99956f.js.LICENSE.txt → 403.4dee4df3.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{119.be08efba.js.LICENSE.txt → 467.fcde6002.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{173.9d9aaec5.js.LICENSE.txt → 470.9855b786.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{288.6d46d8e7.js.LICENSE.txt → 790.e67bc862.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{863.a5e334d8.js.LICENSE.txt → 941.9ebff559.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{lib-router.34d74652.js.LICENSE.txt → lib-router.c318fd9d.js.LICENSE.txt} +0 -0
|
@@ -14,18 +14,10 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
get: all[name]
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
_export(exports, {
|
|
24
|
-
GaugeChartBase: function() {
|
|
17
|
+
Object.defineProperty(exports, "GaugeChartBase", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
25
20
|
return GaugeChartBase;
|
|
26
|
-
},
|
|
27
|
-
getResponsiveValueSize: function() {
|
|
28
|
-
return getResponsiveValueSize;
|
|
29
21
|
}
|
|
30
22
|
});
|
|
31
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -42,17 +34,40 @@ const _renderers = require("echarts/renderers");
|
|
|
42
34
|
_components1.TooltipComponent,
|
|
43
35
|
_renderers.CanvasRenderer
|
|
44
36
|
]);
|
|
45
|
-
const PROGRESS_WIDTH = 16;
|
|
46
37
|
// adjusts when to show pointer icon
|
|
47
38
|
const GAUGE_SMALL_BREAKPOINT = 170;
|
|
48
39
|
function GaugeChartBase(props) {
|
|
49
|
-
const { width, height, data, format, axisLine, max } = props;
|
|
40
|
+
const { width, height, data, format, axisLine, max, valueFontSize, progressWidth, titleFontSize } = props;
|
|
50
41
|
const chartsTheme = (0, _components.useChartsTheme)();
|
|
51
42
|
// useDeepMemo ensures value size util does not rerun everytime you hover on the chart
|
|
52
|
-
const option = (0,
|
|
43
|
+
const option = (0, _components.useDeepMemo)(()=>{
|
|
53
44
|
if (data.value === undefined) return chartsTheme.noDataOption;
|
|
54
|
-
//
|
|
55
|
-
const
|
|
45
|
+
// Base configuration shared by both series (= progress & scale)
|
|
46
|
+
const baseGaugeConfig = {
|
|
47
|
+
type: 'gauge',
|
|
48
|
+
center: [
|
|
49
|
+
'50%',
|
|
50
|
+
'65%'
|
|
51
|
+
],
|
|
52
|
+
startAngle: 200,
|
|
53
|
+
endAngle: -20,
|
|
54
|
+
min: 0,
|
|
55
|
+
max: max,
|
|
56
|
+
axisTick: {
|
|
57
|
+
show: false
|
|
58
|
+
},
|
|
59
|
+
splitLine: {
|
|
60
|
+
show: false
|
|
61
|
+
},
|
|
62
|
+
axisLabel: {
|
|
63
|
+
show: false
|
|
64
|
+
},
|
|
65
|
+
data: [
|
|
66
|
+
{
|
|
67
|
+
value: data.value
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
};
|
|
56
71
|
return {
|
|
57
72
|
title: {
|
|
58
73
|
show: false
|
|
@@ -61,28 +76,18 @@ function GaugeChartBase(props) {
|
|
|
61
76
|
show: false
|
|
62
77
|
},
|
|
63
78
|
series: [
|
|
79
|
+
// Inner gauge (progress)
|
|
64
80
|
{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
'50%',
|
|
68
|
-
'65%'
|
|
69
|
-
],
|
|
70
|
-
radius: '86%',
|
|
71
|
-
startAngle: 200,
|
|
72
|
-
endAngle: -20,
|
|
73
|
-
min: 0,
|
|
74
|
-
max,
|
|
81
|
+
...baseGaugeConfig,
|
|
82
|
+
radius: '90%',
|
|
75
83
|
silent: true,
|
|
76
84
|
progress: {
|
|
77
85
|
show: true,
|
|
78
|
-
width:
|
|
86
|
+
width: progressWidth,
|
|
79
87
|
itemStyle: {
|
|
80
88
|
color: 'auto'
|
|
81
89
|
}
|
|
82
90
|
},
|
|
83
|
-
pointer: {
|
|
84
|
-
show: false
|
|
85
|
-
},
|
|
86
91
|
axisLine: {
|
|
87
92
|
lineStyle: {
|
|
88
93
|
color: [
|
|
@@ -91,22 +96,12 @@ function GaugeChartBase(props) {
|
|
|
91
96
|
'rgba(127,127,127,0.35)'
|
|
92
97
|
]
|
|
93
98
|
],
|
|
94
|
-
width:
|
|
99
|
+
width: progressWidth
|
|
95
100
|
}
|
|
96
101
|
},
|
|
97
|
-
|
|
98
|
-
show: false,
|
|
99
|
-
distance: 0
|
|
100
|
-
},
|
|
101
|
-
splitLine: {
|
|
102
|
+
pointer: {
|
|
102
103
|
show: false
|
|
103
104
|
},
|
|
104
|
-
axisLabel: {
|
|
105
|
-
show: false,
|
|
106
|
-
distance: -18,
|
|
107
|
-
color: '#999',
|
|
108
|
-
fontSize: 12
|
|
109
|
-
},
|
|
110
105
|
anchor: {
|
|
111
106
|
show: false
|
|
112
107
|
},
|
|
@@ -115,24 +110,12 @@ function GaugeChartBase(props) {
|
|
|
115
110
|
},
|
|
116
111
|
detail: {
|
|
117
112
|
show: false
|
|
118
|
-
}
|
|
119
|
-
data: [
|
|
120
|
-
{
|
|
121
|
-
value: data.value
|
|
122
|
-
}
|
|
123
|
-
]
|
|
113
|
+
}
|
|
124
114
|
},
|
|
115
|
+
// Outer gauge (scale & display)
|
|
125
116
|
{
|
|
126
|
-
|
|
127
|
-
center: [
|
|
128
|
-
'50%',
|
|
129
|
-
'65%'
|
|
130
|
-
],
|
|
117
|
+
...baseGaugeConfig,
|
|
131
118
|
radius: '100%',
|
|
132
|
-
startAngle: 200,
|
|
133
|
-
endAngle: -20,
|
|
134
|
-
min: 0,
|
|
135
|
-
max,
|
|
136
119
|
pointer: {
|
|
137
120
|
show: true,
|
|
138
121
|
// pointer hidden for small panels, path taken from ex: https://echarts.apache.org/examples/en/editor.html?c=gauge-grade
|
|
@@ -147,16 +130,8 @@ function GaugeChartBase(props) {
|
|
|
147
130
|
color: 'auto'
|
|
148
131
|
}
|
|
149
132
|
},
|
|
150
|
-
axisLine,
|
|
151
|
-
|
|
152
|
-
show: false
|
|
153
|
-
},
|
|
154
|
-
splitLine: {
|
|
155
|
-
show: false
|
|
156
|
-
},
|
|
157
|
-
axisLabel: {
|
|
158
|
-
show: false
|
|
159
|
-
},
|
|
133
|
+
axisLine: axisLine,
|
|
134
|
+
// `detail` is the text displayed in the middle
|
|
160
135
|
detail: {
|
|
161
136
|
show: true,
|
|
162
137
|
width: '60%',
|
|
@@ -166,7 +141,7 @@ function GaugeChartBase(props) {
|
|
|
166
141
|
'-9%'
|
|
167
142
|
],
|
|
168
143
|
color: 'inherit',
|
|
169
|
-
fontSize:
|
|
144
|
+
fontSize: valueFontSize,
|
|
170
145
|
formatter: data.value === null ? // at this level because the `formatter` function argument is `NaN`
|
|
171
146
|
// when the value is `null`, making it difficult to differentiate
|
|
172
147
|
// `null` from a true `NaN` case.
|
|
@@ -188,7 +163,7 @@ function GaugeChartBase(props) {
|
|
|
188
163
|
'55%'
|
|
189
164
|
],
|
|
190
165
|
overflow: 'truncate',
|
|
191
|
-
fontSize:
|
|
166
|
+
fontSize: titleFontSize,
|
|
192
167
|
width: width * 0.8
|
|
193
168
|
}
|
|
194
169
|
}
|
|
@@ -203,24 +178,20 @@ function GaugeChartBase(props) {
|
|
|
203
178
|
chartsTheme,
|
|
204
179
|
format,
|
|
205
180
|
axisLine,
|
|
206
|
-
max
|
|
181
|
+
max,
|
|
182
|
+
valueFontSize,
|
|
183
|
+
progressWidth,
|
|
184
|
+
titleFontSize
|
|
207
185
|
]);
|
|
208
186
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.EChart, {
|
|
209
|
-
|
|
187
|
+
style: {
|
|
210
188
|
width: width,
|
|
211
|
-
height: height
|
|
189
|
+
height: height
|
|
190
|
+
},
|
|
191
|
+
sx: {
|
|
212
192
|
padding: `${chartsTheme.container.padding.default}px`
|
|
213
193
|
},
|
|
214
194
|
option: option,
|
|
215
195
|
theme: chartsTheme.echartsTheme
|
|
216
196
|
});
|
|
217
197
|
}
|
|
218
|
-
function getResponsiveValueSize(value, format, width, height) {
|
|
219
|
-
const MIN_SIZE = 3;
|
|
220
|
-
const MAX_SIZE = 24;
|
|
221
|
-
const SIZE_MULTIPLIER = 0.7;
|
|
222
|
-
const formattedValue = typeof value === 'number' ? (0, _core.formatValue)(value, format) : `${value}`;
|
|
223
|
-
const valueCharacters = formattedValue.length ?? 2;
|
|
224
|
-
const valueSize = Math.min(width, height) / valueCharacters * SIZE_MULTIPLIER;
|
|
225
|
-
return `clamp(${MIN_SIZE}px, ${valueSize}px, ${MAX_SIZE}px)`;
|
|
226
|
-
}
|
|
@@ -17,14 +17,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
function _export(target, all) {
|
|
18
18
|
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
GaugeChartLoading
|
|
24
|
+
get GaugeChartLoading () {
|
|
25
25
|
return GaugeChartLoading;
|
|
26
26
|
},
|
|
27
|
-
GaugeChartPanel
|
|
27
|
+
get GaugeChartPanel () {
|
|
28
28
|
return GaugeChartPanel;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -48,6 +48,40 @@ const EMPTY_GAUGE_SERIES = {
|
|
|
48
48
|
};
|
|
49
49
|
const GAUGE_MIN_WIDTH = 90;
|
|
50
50
|
const PANEL_PADDING_OFFSET = 20;
|
|
51
|
+
/**
|
|
52
|
+
* Calculate responsive progress width based on panel dimensions
|
|
53
|
+
*/ function getResponsiveProgressWidth(width, height) {
|
|
54
|
+
const MIN_WIDTH = 10;
|
|
55
|
+
const MAX_WIDTH = 48;
|
|
56
|
+
const RATIO = 0.1; // 10% of the smaller dimension
|
|
57
|
+
const minSize = Math.min(width, height);
|
|
58
|
+
// Use RATIO of the smaller dimension as base, with reasonable min/max bounds
|
|
59
|
+
return Math.max(MIN_WIDTH, Math.min(MAX_WIDTH, Math.round(minSize * RATIO)));
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Responsive font size depending on number of characters and panel dimensions.
|
|
63
|
+
* Uses clamp to ensure the text never overflows and scales appropriately with panel size.
|
|
64
|
+
* (Value refers to the main number value displayed inside the gauge)
|
|
65
|
+
*/ function getResponsiveValueFontSize(value, format, width, height) {
|
|
66
|
+
const MIN_SIZE = 8;
|
|
67
|
+
const MAX_SIZE = 64;
|
|
68
|
+
const formattedValue = typeof value === 'number' ? (0, _core.formatValue)(value, format) : `${value}`;
|
|
69
|
+
const valueTextLength = Math.max(formattedValue.length, 6); // Ensure a minimum length to avoid overly large text for short values
|
|
70
|
+
const availableSpace = Math.min(width, height);
|
|
71
|
+
const fontSize = availableSpace / valueTextLength;
|
|
72
|
+
return `clamp(${MIN_SIZE}px, ${fontSize}px, ${MAX_SIZE}px)`;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Calculate responsive title font size based on panel dimensions
|
|
76
|
+
* (Title refers to the text displayed below the gauge as a legend)
|
|
77
|
+
*/ function getResponsiveTitleFontSize(width, height) {
|
|
78
|
+
const MIN_SIZE = 10;
|
|
79
|
+
const MAX_SIZE = 16;
|
|
80
|
+
const RATIO = 0.06; // Use 6% of the smaller dimension as base
|
|
81
|
+
const size = Math.round(Math.min(width, height) * RATIO);
|
|
82
|
+
// Scale based on panel size, with reasonable min/max bounds
|
|
83
|
+
return Math.max(MIN_SIZE, Math.min(MAX_SIZE, size));
|
|
84
|
+
}
|
|
51
85
|
function GaugeChartPanel(props) {
|
|
52
86
|
const { spec: pluginSpec, contentDimensions, queryResults } = props;
|
|
53
87
|
const { calculation, max, legend } = pluginSpec;
|
|
@@ -87,30 +121,40 @@ function GaugeChartPanel(props) {
|
|
|
87
121
|
thresholdMax = format.unit === 'percent' ? _gaugechartmodel.DEFAULT_MAX_PERCENT : _gaugechartmodel.DEFAULT_MAX_PERCENT_DECIMAL;
|
|
88
122
|
}
|
|
89
123
|
const axisLineColors = (0, _thresholds.convertThresholds)(thresholds, format, thresholdMax, thresholdsColors);
|
|
124
|
+
// accounts for showing a separate chart for each time series
|
|
125
|
+
let chartWidth = contentDimensions.width / gaugeData.length - PANEL_PADDING_OFFSET;
|
|
126
|
+
if (chartWidth < GAUGE_MIN_WIDTH && gaugeData.length > 1) {
|
|
127
|
+
// enables horizontal scroll when charts overflow outside of panel
|
|
128
|
+
chartWidth = GAUGE_MIN_WIDTH;
|
|
129
|
+
}
|
|
130
|
+
// Calculate responsive values based on chart dimensions
|
|
131
|
+
const progressWidth = getResponsiveProgressWidth(chartWidth, contentDimensions.height);
|
|
132
|
+
const axisLineWidth = Math.round(progressWidth * 0.2); // Axis line width is 20% of progress width
|
|
133
|
+
const titleFontSize = getResponsiveTitleFontSize(chartWidth, contentDimensions.height);
|
|
90
134
|
const axisLine = {
|
|
91
135
|
show: true,
|
|
92
136
|
lineStyle: {
|
|
93
|
-
width:
|
|
137
|
+
width: axisLineWidth,
|
|
94
138
|
color: axisLineColors
|
|
95
139
|
}
|
|
96
140
|
};
|
|
97
141
|
// no data message handled inside chart component
|
|
98
142
|
if (!gaugeData.length) {
|
|
143
|
+
const emptyValueFontSize = getResponsiveValueFontSize(null, format, contentDimensions.width, contentDimensions.height);
|
|
144
|
+
const emptyProgressWidth = getResponsiveProgressWidth(contentDimensions.width, contentDimensions.height);
|
|
145
|
+
const emptyTitleFontSize = getResponsiveTitleFontSize(contentDimensions.width, contentDimensions.height);
|
|
99
146
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_GaugeChartBase.GaugeChartBase, {
|
|
100
147
|
width: contentDimensions.width,
|
|
101
148
|
height: contentDimensions.height,
|
|
102
149
|
data: EMPTY_GAUGE_SERIES,
|
|
103
150
|
format: format,
|
|
104
151
|
axisLine: axisLine,
|
|
105
|
-
max: thresholdMax
|
|
152
|
+
max: thresholdMax,
|
|
153
|
+
valueFontSize: emptyValueFontSize,
|
|
154
|
+
progressWidth: emptyProgressWidth,
|
|
155
|
+
titleFontSize: emptyTitleFontSize
|
|
106
156
|
});
|
|
107
157
|
}
|
|
108
|
-
// accounts for showing a separate chart for each time series
|
|
109
|
-
let chartWidth = contentDimensions.width / gaugeData.length - PANEL_PADDING_OFFSET;
|
|
110
|
-
if (chartWidth < GAUGE_MIN_WIDTH && gaugeData.length > 1) {
|
|
111
|
-
// enables horizontal scroll when charts overflow outside of panel
|
|
112
|
-
chartWidth = GAUGE_MIN_WIDTH;
|
|
113
|
-
}
|
|
114
158
|
const hasMultipleCharts = gaugeData.length > 1;
|
|
115
159
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
116
160
|
direction: "row",
|
|
@@ -122,6 +166,7 @@ function GaugeChartPanel(props) {
|
|
|
122
166
|
overflowX: gaugeData.length > 1 ? 'scroll' : 'auto'
|
|
123
167
|
},
|
|
124
168
|
children: gaugeData.map((series, seriesIndex)=>{
|
|
169
|
+
const fontSize = getResponsiveValueFontSize(series.value ?? null, format, chartWidth, contentDimensions.height);
|
|
125
170
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
126
171
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_GaugeChartBase.GaugeChartBase, {
|
|
127
172
|
width: chartWidth,
|
|
@@ -129,7 +174,10 @@ function GaugeChartPanel(props) {
|
|
|
129
174
|
data: series,
|
|
130
175
|
format: format,
|
|
131
176
|
axisLine: axisLine,
|
|
132
|
-
max: thresholdMax
|
|
177
|
+
max: thresholdMax,
|
|
178
|
+
valueFontSize: fontSize,
|
|
179
|
+
progressWidth: progressWidth,
|
|
180
|
+
titleFontSize: titleFontSize
|
|
133
181
|
})
|
|
134
182
|
}, `gauge-series-${seriesIndex}`);
|
|
135
183
|
})
|
|
@@ -17,20 +17,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
function _export(target, all) {
|
|
18
18
|
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
DEFAULT_FORMAT
|
|
24
|
+
get DEFAULT_FORMAT () {
|
|
25
25
|
return DEFAULT_FORMAT;
|
|
26
26
|
},
|
|
27
|
-
DEFAULT_MAX_PERCENT
|
|
27
|
+
get DEFAULT_MAX_PERCENT () {
|
|
28
28
|
return DEFAULT_MAX_PERCENT;
|
|
29
29
|
},
|
|
30
|
-
DEFAULT_MAX_PERCENT_DECIMAL
|
|
30
|
+
get DEFAULT_MAX_PERCENT_DECIMAL () {
|
|
31
31
|
return DEFAULT_MAX_PERCENT_DECIMAL;
|
|
32
32
|
},
|
|
33
|
-
createInitialGaugeChartOptions
|
|
33
|
+
get createInitialGaugeChartOptions () {
|
|
34
34
|
return createInitialGaugeChartOptions;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
// Copyright 2024 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
1
|
"use strict";
|
|
14
2
|
function _getRequireWildcardCache(nodeInterop) {
|
|
15
3
|
if (typeof WeakMap !== "function") return null;
|
|
@@ -52,4 +40,16 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
52
40
|
}
|
|
53
41
|
return newObj;
|
|
54
42
|
}
|
|
43
|
+
// Copyright 2024 The Perses Authors
|
|
44
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
45
|
+
// you may not use this file except in compliance with the License.
|
|
46
|
+
// You may obtain a copy of the License at
|
|
47
|
+
//
|
|
48
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
49
|
+
//
|
|
50
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
51
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
52
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
53
|
+
// See the License for the specific language governing permissions and
|
|
54
|
+
// limitations under the License.
|
|
55
55
|
Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./bootstrap")));
|
package/lib/cjs/thresholds.js
CHANGED
|
@@ -17,14 +17,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
function _export(target, all) {
|
|
18
18
|
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
convertThresholds
|
|
24
|
+
get convertThresholds () {
|
|
25
25
|
return convertThresholds;
|
|
26
26
|
},
|
|
27
|
-
defaultThresholdInput
|
|
27
|
+
get defaultThresholdInput () {
|
|
28
28
|
return defaultThresholdInput;
|
|
29
29
|
}
|
|
30
30
|
});
|
package/mf-manifest.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"name": "GaugeChart",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.
|
|
8
|
+
"buildVersion": "0.11.1",
|
|
9
9
|
"buildName": "@perses-dev/gauge-chart-plugin"
|
|
10
10
|
},
|
|
11
11
|
"remoteEntry": {
|
|
12
|
-
"name": "__mf/js/GaugeChart.
|
|
12
|
+
"name": "__mf/js/GaugeChart.64278e7a.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"api": ""
|
|
21
21
|
},
|
|
22
22
|
"globalName": "GaugeChart",
|
|
23
|
-
"pluginVersion": "0.
|
|
23
|
+
"pluginVersion": "0.21.6",
|
|
24
24
|
"prefetchInterface": false,
|
|
25
25
|
"getPublicPath": "function() { const prefix = window.PERSES_PLUGIN_ASSETS_PATH || window.PERSES_APP_CONFIG?.api_prefix || \"\"; return prefix + \"/plugins/GaugeChart/\"; }"
|
|
26
26
|
},
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"js": {
|
|
36
36
|
"async": [],
|
|
37
37
|
"sync": [
|
|
38
|
-
"__mf/js/async/
|
|
38
|
+
"__mf/js/async/274.07ee62ee.js"
|
|
39
39
|
]
|
|
40
40
|
},
|
|
41
41
|
"css": {
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"js": {
|
|
55
55
|
"async": [],
|
|
56
56
|
"sync": [
|
|
57
|
-
"__mf/js/async/
|
|
58
|
-
"__mf/js/async/
|
|
59
|
-
"__mf/js/async/
|
|
57
|
+
"__mf/js/async/235.675ef806.js",
|
|
58
|
+
"__mf/js/async/616.1b1bb2ba.js",
|
|
59
|
+
"__mf/js/async/854.0822db86.js"
|
|
60
60
|
]
|
|
61
61
|
},
|
|
62
62
|
"css": {
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"js": {
|
|
76
76
|
"async": [],
|
|
77
77
|
"sync": [
|
|
78
|
-
"__mf/js/async/
|
|
79
|
-
"__mf/js/async/
|
|
78
|
+
"__mf/js/async/587.e32d2906.js",
|
|
79
|
+
"__mf/js/async/968.be22fbda.js"
|
|
80
80
|
]
|
|
81
81
|
},
|
|
82
82
|
"css": {
|
|
@@ -88,14 +88,14 @@
|
|
|
88
88
|
{
|
|
89
89
|
"id": "GaugeChart:@perses-dev/components",
|
|
90
90
|
"name": "@perses-dev/components",
|
|
91
|
-
"version": "0.
|
|
91
|
+
"version": "0.53.0-beta.2",
|
|
92
92
|
"singleton": true,
|
|
93
|
-
"requiredVersion": "^0.
|
|
93
|
+
"requiredVersion": "^0.53.0-beta.2",
|
|
94
94
|
"assets": {
|
|
95
95
|
"js": {
|
|
96
96
|
"async": [],
|
|
97
97
|
"sync": [
|
|
98
|
-
"__mf/js/async/
|
|
98
|
+
"__mf/js/async/790.e67bc862.js"
|
|
99
99
|
]
|
|
100
100
|
},
|
|
101
101
|
"css": {
|
|
@@ -107,14 +107,14 @@
|
|
|
107
107
|
{
|
|
108
108
|
"id": "GaugeChart:@perses-dev/plugin-system",
|
|
109
109
|
"name": "@perses-dev/plugin-system",
|
|
110
|
-
"version": "0.
|
|
110
|
+
"version": "0.53.0-beta.2",
|
|
111
111
|
"singleton": true,
|
|
112
|
-
"requiredVersion": "^0.
|
|
112
|
+
"requiredVersion": "^0.53.0-beta.2",
|
|
113
113
|
"assets": {
|
|
114
114
|
"js": {
|
|
115
115
|
"async": [],
|
|
116
116
|
"sync": [
|
|
117
|
-
"__mf/js/async/
|
|
117
|
+
"__mf/js/async/252.30692fba.js"
|
|
118
118
|
]
|
|
119
119
|
},
|
|
120
120
|
"css": {
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"js": {
|
|
134
134
|
"async": [],
|
|
135
135
|
"sync": [
|
|
136
|
-
"__mf/js/async/
|
|
136
|
+
"__mf/js/async/192.8bf7cec4.js"
|
|
137
137
|
]
|
|
138
138
|
},
|
|
139
139
|
"css": {
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"js": {
|
|
153
153
|
"async": [],
|
|
154
154
|
"sync": [
|
|
155
|
-
"__mf/js/async/
|
|
155
|
+
"__mf/js/async/873.b08548ee.js"
|
|
156
156
|
]
|
|
157
157
|
},
|
|
158
158
|
"css": {
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
"js": {
|
|
172
172
|
"async": [],
|
|
173
173
|
"sync": [
|
|
174
|
-
"__mf/js/async/
|
|
174
|
+
"__mf/js/async/963.c04e5fd0.js"
|
|
175
175
|
]
|
|
176
176
|
},
|
|
177
177
|
"css": {
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
"js": {
|
|
191
191
|
"async": [],
|
|
192
192
|
"sync": [
|
|
193
|
-
"__mf/js/async/
|
|
193
|
+
"__mf/js/async/392.f9d6a7ae.js"
|
|
194
194
|
]
|
|
195
195
|
},
|
|
196
196
|
"css": {
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
"js": {
|
|
210
210
|
"async": [],
|
|
211
211
|
"sync": [
|
|
212
|
-
"__mf/js/async/
|
|
212
|
+
"__mf/js/async/496.63537c05.js"
|
|
213
213
|
]
|
|
214
214
|
},
|
|
215
215
|
"css": {
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
"js": {
|
|
229
229
|
"async": [],
|
|
230
230
|
"sync": [
|
|
231
|
-
"__mf/js/async/
|
|
231
|
+
"__mf/js/async/470.9855b786.js"
|
|
232
232
|
]
|
|
233
233
|
},
|
|
234
234
|
"css": {
|
|
@@ -247,7 +247,7 @@
|
|
|
247
247
|
"js": {
|
|
248
248
|
"async": [],
|
|
249
249
|
"sync": [
|
|
250
|
-
"__mf/js/async/
|
|
250
|
+
"__mf/js/async/121.0385c285.js"
|
|
251
251
|
]
|
|
252
252
|
},
|
|
253
253
|
"css": {
|
|
@@ -266,8 +266,8 @@
|
|
|
266
266
|
"js": {
|
|
267
267
|
"async": [],
|
|
268
268
|
"sync": [
|
|
269
|
-
"__mf/js/async/
|
|
270
|
-
"__mf/js/async/
|
|
269
|
+
"__mf/js/async/458.2a1e1dfe.js",
|
|
270
|
+
"__mf/js/async/77.429aab8d.js"
|
|
271
271
|
]
|
|
272
272
|
},
|
|
273
273
|
"css": {
|
|
@@ -286,7 +286,7 @@
|
|
|
286
286
|
"js": {
|
|
287
287
|
"async": [],
|
|
288
288
|
"sync": [
|
|
289
|
-
"__mf/js/async/
|
|
289
|
+
"__mf/js/async/978.26163709.js"
|
|
290
290
|
]
|
|
291
291
|
},
|
|
292
292
|
"css": {
|
|
@@ -304,27 +304,27 @@
|
|
|
304
304
|
"assets": {
|
|
305
305
|
"js": {
|
|
306
306
|
"sync": [
|
|
307
|
-
"__mf/js/async/
|
|
308
|
-
"__mf/js/async/
|
|
309
|
-
"__mf/js/async/
|
|
310
|
-
"__mf/js/async/
|
|
311
|
-
"__mf/js/async/__federation_expose_GaugeChart.
|
|
307
|
+
"__mf/js/async/403.4dee4df3.js",
|
|
308
|
+
"__mf/js/async/204.368d6115.js",
|
|
309
|
+
"__mf/js/async/467.fcde6002.js",
|
|
310
|
+
"__mf/js/async/756.ae22d123.js",
|
|
311
|
+
"__mf/js/async/__federation_expose_GaugeChart.54f4fa10.js"
|
|
312
312
|
],
|
|
313
313
|
"async": [
|
|
314
|
-
"__mf/js/async/
|
|
315
|
-
"__mf/js/async/
|
|
316
|
-
"__mf/js/async/
|
|
317
|
-
"__mf/js/async/
|
|
318
|
-
"__mf/js/async/
|
|
319
|
-
"__mf/js/async/lib-router.
|
|
320
|
-
"__mf/js/async/
|
|
314
|
+
"__mf/js/async/588.7dda8aa9.js",
|
|
315
|
+
"__mf/js/async/71.773ab397.js",
|
|
316
|
+
"__mf/js/async/356.a480b281.js",
|
|
317
|
+
"__mf/js/async/410.3d37263a.js",
|
|
318
|
+
"__mf/js/async/127.5ef482f0.js",
|
|
319
|
+
"__mf/js/async/lib-router.c318fd9d.js",
|
|
320
|
+
"__mf/js/async/177.4d5022bb.js"
|
|
321
321
|
]
|
|
322
322
|
},
|
|
323
323
|
"css": {
|
|
324
324
|
"sync": [],
|
|
325
325
|
"async": [
|
|
326
|
-
"__mf/css/async/
|
|
327
|
-
"__mf/css/async/
|
|
326
|
+
"__mf/css/async/61.d3010b86.css",
|
|
327
|
+
"__mf/css/async/823.d3010b86.css"
|
|
328
328
|
]
|
|
329
329
|
}
|
|
330
330
|
},
|