@perses-dev/stat-chart-plugin 0.14.0 → 0.15.0-beta.2
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/StatChart.bb7e0ece.js +7 -0
- package/__mf/js/async/121.f7e8e4a7.js +2 -0
- package/__mf/js/async/192.9808d269.js +1 -0
- package/__mf/js/async/2.a13c5048.js +1 -0
- package/__mf/js/async/235.7bcd2051.js +1 -0
- package/__mf/js/async/274.8d8be5c9.js +2 -0
- package/__mf/js/async/345.f2a95d9c.js +29 -0
- package/__mf/js/async/356.defde8e9.js +1 -0
- package/__mf/js/async/392.cb707a93.js +2 -0
- package/__mf/js/async/407.07aba336.js +4 -0
- package/__mf/js/async/407.07aba336.js.LICENSE.txt +9 -0
- package/__mf/js/async/450.3a0b1ae3.js +1 -0
- package/__mf/js/async/465.0b7086ef.js +2 -0
- package/__mf/js/async/470.26952ddf.js +2 -0
- package/__mf/js/async/496.b9973ffe.js +1 -0
- package/__mf/js/async/570.36d078cd.js +2 -0
- package/__mf/js/async/587.528aba30.js +1 -0
- package/__mf/js/async/588.29eb8c38.js +1 -0
- package/__mf/js/async/616.42a14f39.js +1 -0
- package/__mf/js/async/71.7f97cf3a.js +1 -0
- package/__mf/js/async/721.9ed0b42d.js +1 -0
- package/__mf/js/async/77.048fc50c.js +1 -0
- package/__mf/js/async/788.d3786b94.js +43 -0
- package/__mf/js/async/{580.4076ee7b.js.LICENSE.txt → 788.d3786b94.js.LICENSE.txt} +41 -1
- package/__mf/js/async/{866.cb6cbc7a.js → 866.180c7c1d.js} +6 -6
- package/__mf/js/async/873.d6bb2952.js +1 -0
- package/__mf/js/async/941.bf04fa66.js +2 -0
- package/__mf/js/async/968.0754c6b9.js +1 -0
- package/__mf/js/async/978.6043d74f.js +1 -0
- package/__mf/js/async/__federation_expose_StatChart.ea6bcd68.js +1 -0
- package/__mf/js/async/lib-router.a0b2cd64.js +2 -0
- package/__mf/js/{main.fe3736c5.js → main.ca1383be.js} +2 -2
- package/lib/StatChart.d.ts +3 -3
- package/lib/StatChart.d.ts.map +1 -1
- package/lib/StatChart.js +4 -4
- package/lib/StatChart.js.map +1 -1
- package/lib/StatChartBase.d.ts +4 -4
- package/lib/StatChartBase.d.ts.map +1 -1
- package/lib/StatChartBase.js +12 -12
- package/lib/StatChartBase.js.map +1 -1
- package/lib/StatChartOptionsEditorSettings.d.ts +2 -2
- package/lib/StatChartOptionsEditorSettings.d.ts.map +1 -1
- package/lib/StatChartOptionsEditorSettings.js +8 -8
- package/lib/StatChartOptionsEditorSettings.js.map +1 -1
- package/lib/StatChartPanel.d.ts +4 -4
- package/lib/StatChartPanel.d.ts.map +1 -1
- package/lib/StatChartPanel.js +14 -9
- package/lib/StatChartPanel.js.map +1 -1
- package/lib/StatChartValueMappingEditor.d.ts +3 -3
- package/lib/StatChartValueMappingEditor.d.ts.map +1 -1
- package/lib/StatChartValueMappingEditor.js +1 -1
- package/lib/StatChartValueMappingEditor.js.map +1 -1
- package/lib/bootstrap.js +2 -2
- package/lib/getPluginModule.d.ts +1 -1
- package/lib/getPluginModule.d.ts.map +1 -1
- package/lib/getPluginModule.js +3 -1
- package/lib/getPluginModule.js.map +1 -1
- package/lib/index-federation.js +1 -1
- package/lib/index.js +7 -7
- package/lib/index.js.map +1 -1
- package/lib/setup-tests.d.ts +1 -1
- package/lib/setup-tests.d.ts.map +1 -1
- package/lib/setup-tests.js +2 -2
- package/lib/setup-tests.js.map +1 -1
- package/lib/stat-chart-model.d.ts +3 -3
- package/lib/stat-chart-model.d.ts.map +1 -1
- package/lib/stat-chart-model.js.map +1 -1
- package/lib/utils/calculate-font-size.d.ts +1 -1
- package/lib/utils/calculate-font-size.d.ts.map +1 -1
- package/lib/utils/calculate-font-size.js +2 -2
- package/lib/utils/calculate-font-size.js.map +1 -1
- package/lib/utils/calculate-value.d.ts +3 -2
- package/lib/utils/calculate-value.d.ts.map +1 -1
- package/lib/utils/calculate-value.js +1 -1
- package/lib/utils/calculate-value.js.map +1 -1
- package/lib/utils/data-transform.d.ts +3 -3
- package/lib/utils/data-transform.d.ts.map +1 -1
- package/lib/utils/data-transform.js.map +1 -1
- package/lib/utils/format-stat-chart-value.d.ts +1 -1
- package/lib/utils/format-stat-chart-value.d.ts.map +1 -1
- package/lib/utils/format-stat-chart-value.js +1 -1
- package/lib/utils/format-stat-chart-value.js.map +1 -1
- package/lib/utils/get-color.d.ts +2 -2
- package/lib/utils/get-color.d.ts.map +1 -1
- package/lib/utils/get-color.js +1 -1
- package/lib/utils/get-color.js.map +1 -1
- package/mf-manifest.json +36 -35
- package/mf-stats.json +36 -35
- package/package.json +10 -10
- package/__mf/js/StatChart.19a287b0.js +0 -7
- package/__mf/js/async/121.a33651ce.js +0 -2
- package/__mf/js/async/177.4dddf131.js +0 -1
- package/__mf/js/async/187.d7e6b2db.js +0 -7
- package/__mf/js/async/187.d7e6b2db.js.LICENSE.txt +0 -39
- package/__mf/js/async/192.0b251884.js +0 -1
- package/__mf/js/async/2.e8bdc16f.js +0 -1
- package/__mf/js/async/235.f388b6fd.js +0 -1
- package/__mf/js/async/274.b762faf5.js +0 -2
- package/__mf/js/async/356.3f7b970d.js +0 -1
- package/__mf/js/async/392.70b1a3c5.js +0 -2
- package/__mf/js/async/450.bdfbd76f.js +0 -1
- package/__mf/js/async/465.7c60371f.js +0 -2
- package/__mf/js/async/470.cc046da0.js +0 -2
- package/__mf/js/async/546.f27d00a1.js +0 -24
- package/__mf/js/async/546.f27d00a1.js.LICENSE.txt +0 -19
- package/__mf/js/async/558.e8f8691f.js +0 -1
- package/__mf/js/async/570.264704d1.js +0 -2
- package/__mf/js/async/580.4076ee7b.js +0 -66
- package/__mf/js/async/587.7d22fb82.js +0 -1
- package/__mf/js/async/588.c00e3759.js +0 -1
- package/__mf/js/async/616.22b37336.js +0 -1
- package/__mf/js/async/71.1f2caf38.js +0 -1
- package/__mf/js/async/721.5c1c6916.js +0 -1
- package/__mf/js/async/873.13ff7de6.js +0 -1
- package/__mf/js/async/941.230549f5.js +0 -2
- package/__mf/js/async/968.bfd3594f.js +0 -1
- package/__mf/js/async/978.98475f4b.js +0 -1
- package/__mf/js/async/__federation_expose_StatChart.f4a2f598.js +0 -1
- package/__mf/js/async/lib-router.6c58ccc7.js +0 -2
- package/lib/cjs/StatChart.js +0 -43
- package/lib/cjs/StatChartBase.js +0 -263
- package/lib/cjs/StatChartOptionsEditorSettings.js +0 -171
- package/lib/cjs/StatChartPanel.js +0 -130
- package/lib/cjs/StatChartValueMappingEditor.js +0 -36
- package/lib/cjs/bootstrap.js +0 -26
- package/lib/cjs/env.d.js +0 -14
- package/lib/cjs/getPluginModule.js +0 -39
- package/lib/cjs/index-federation.js +0 -55
- package/lib/cjs/index.js +0 -42
- package/lib/cjs/setup-tests.js +0 -19
- package/lib/cjs/stat-chart-model.js +0 -74
- package/lib/cjs/utils/calculate-font-size.js +0 -55
- package/lib/cjs/utils/calculate-value.js +0 -30
- package/lib/cjs/utils/data-transform.js +0 -36
- package/lib/cjs/utils/format-stat-chart-value.js +0 -34
- package/lib/cjs/utils/get-color.js +0 -66
- /package/__mf/css/async/{187.85c2cbf6.css → 788.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{121.a33651ce.js.LICENSE.txt → 121.f7e8e4a7.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{274.b762faf5.js.LICENSE.txt → 274.8d8be5c9.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.70b1a3c5.js.LICENSE.txt → 392.cb707a93.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{465.7c60371f.js.LICENSE.txt → 465.0b7086ef.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{470.cc046da0.js.LICENSE.txt → 470.26952ddf.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{570.264704d1.js.LICENSE.txt → 570.36d078cd.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{866.cb6cbc7a.js.LICENSE.txt → 866.180c7c1d.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.230549f5.js.LICENSE.txt → 941.bf04fa66.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{lib-router.6c58ccc7.js.LICENSE.txt → lib-router.a0b2cd64.js.LICENSE.txt} +0 -0
|
@@ -1,30 +0,0 @@
|
|
|
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, "calculateValue", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return calculateValue;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
|
-
const calculateValue = (calculation, seriesData)=>{
|
|
25
|
-
if (_pluginsystem.CalculationsMap[calculation] === undefined) {
|
|
26
|
-
console.warn(`Invalid StatChart panel calculation ${calculation}, fallback to ${_pluginsystem.DEFAULT_CALCULATION}`);
|
|
27
|
-
}
|
|
28
|
-
const calculate = _pluginsystem.CalculationsMap[calculation] ?? _pluginsystem.CalculationsMap[_pluginsystem.DEFAULT_CALCULATION];
|
|
29
|
-
return calculate(seriesData.values);
|
|
30
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
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, "convertSparkline", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return convertSparkline;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
function convertSparkline(chartsTheme, color, sparkline) {
|
|
24
|
-
if (sparkline === undefined) return;
|
|
25
|
-
return {
|
|
26
|
-
lineStyle: {
|
|
27
|
-
width: sparkline.width ?? chartsTheme.sparkline.width,
|
|
28
|
-
color,
|
|
29
|
-
opacity: 1
|
|
30
|
-
},
|
|
31
|
-
areaStyle: {
|
|
32
|
-
color,
|
|
33
|
-
opacity: 0.4
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
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, "formatStatChartValue", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return formatStatChartValue;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _components = require("@perses-dev/components");
|
|
24
|
-
const formatStatChartValue = (value, format)=>{
|
|
25
|
-
if (value === null) {
|
|
26
|
-
return 'null';
|
|
27
|
-
} else if (typeof value === 'number') {
|
|
28
|
-
return (0, _components.formatValue)(value, format);
|
|
29
|
-
} else if (value === undefined) {
|
|
30
|
-
return '';
|
|
31
|
-
} else {
|
|
32
|
-
return value;
|
|
33
|
-
}
|
|
34
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
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, "getStatChartColor", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return getStatChartColor;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _components = require("@perses-dev/components");
|
|
24
|
-
function getStatChartColor(chartsTheme, spec, value) {
|
|
25
|
-
const { mappings, thresholds } = spec ?? {};
|
|
26
|
-
// Determine the default color from thresholds or theme
|
|
27
|
-
const defaultColor = thresholds?.defaultColor ?? chartsTheme.thresholds.defaultColor;
|
|
28
|
-
if (value === undefined || value === null || value === '' || !thresholds?.steps && !mappings) {
|
|
29
|
-
return defaultColor;
|
|
30
|
-
}
|
|
31
|
-
// Check mappings first
|
|
32
|
-
if (mappings?.length) {
|
|
33
|
-
const colorFromMappings = getColorFromMappings(value, mappings);
|
|
34
|
-
if (colorFromMappings) {
|
|
35
|
-
return colorFromMappings;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
// Check thresholds next
|
|
39
|
-
if (thresholds) {
|
|
40
|
-
const colorFromThresholds = getColorFromThresholds(value, thresholds, chartsTheme, defaultColor);
|
|
41
|
-
if (colorFromThresholds) {
|
|
42
|
-
return colorFromThresholds;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
// Fallback to default color
|
|
46
|
-
return defaultColor;
|
|
47
|
-
}
|
|
48
|
-
function getColorFromMappings(value, mappings) {
|
|
49
|
-
if (mappings?.length && value !== undefined && value !== null) {
|
|
50
|
-
const { color } = (0, _components.applyValueMapping)(value, mappings);
|
|
51
|
-
return color || null;
|
|
52
|
-
}
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
function getColorFromThresholds(value, thresholds, chartsTheme, defaultColor) {
|
|
56
|
-
if (thresholds?.steps && typeof value === 'number') {
|
|
57
|
-
const matchingColors = thresholds.steps.map((step, index)=>{
|
|
58
|
-
if (value >= step.value) {
|
|
59
|
-
return step.color ?? chartsTheme.thresholds.palette[index] ?? defaultColor;
|
|
60
|
-
}
|
|
61
|
-
return null;
|
|
62
|
-
}).filter((color)=>color !== null);
|
|
63
|
-
return matchingColors[matchingColors.length - 1] ?? null;
|
|
64
|
-
}
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/__mf/js/async/{lib-router.6c58ccc7.js.LICENSE.txt → lib-router.a0b2cd64.js.LICENSE.txt}
RENAMED
|
File without changes
|