@perses-dev/components 0.0.0-snapshot-explorer-plugin-c4a7621 → 0.0.0-snapshot-profile-8090608

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/README.md +1 -4
  2. package/dist/ColorPicker/ColorPicker.js.map +1 -1
  3. package/dist/ColorPicker/OptionsColorPicker.js.map +1 -1
  4. package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
  5. package/dist/DragAndDrop/DragButton.d.ts +2 -2
  6. package/dist/DragAndDrop/DragButton.d.ts.map +1 -1
  7. package/dist/DragAndDrop/DragButton.js +5 -3
  8. package/dist/DragAndDrop/DragButton.js.map +1 -1
  9. package/dist/DragAndDrop/DropIndicator.js.map +1 -1
  10. package/dist/Drawer/Drawer.js.map +1 -1
  11. package/dist/EChart/EChart.d.ts +3 -2
  12. package/dist/EChart/EChart.d.ts.map +1 -1
  13. package/dist/EChart/EChart.js +26 -4
  14. package/dist/EChart/EChart.js.map +1 -1
  15. package/dist/InfoTooltip/InfoTooltip.js +2 -1
  16. package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
  17. package/dist/JSONEditor.d.ts.map +1 -1
  18. package/dist/JSONEditor.js +5 -6
  19. package/dist/JSONEditor.js.map +1 -1
  20. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
  21. package/dist/Overlay/Overlay.js +1 -1
  22. package/dist/Overlay/Overlay.js.map +1 -1
  23. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
  24. package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
  25. package/dist/Table/Table.d.ts +1 -1
  26. package/dist/Table/Table.d.ts.map +1 -1
  27. package/dist/Table/Table.js +15 -4
  28. package/dist/Table/Table.js.map +1 -1
  29. package/dist/Table/TableCell.d.ts +2 -1
  30. package/dist/Table/TableCell.d.ts.map +1 -1
  31. package/dist/Table/TableCell.js +4 -2
  32. package/dist/Table/TableCell.js.map +1 -1
  33. package/dist/Table/TableFoot.d.ts +4 -0
  34. package/dist/Table/TableFoot.d.ts.map +1 -0
  35. package/dist/{BarChart/index.js → Table/TableFoot.js} +11 -3
  36. package/dist/Table/TableFoot.js.map +1 -0
  37. package/dist/Table/TableHeaderCell.js.map +1 -1
  38. package/dist/Table/VirtualizedTable.d.ts +3 -2
  39. package/dist/Table/VirtualizedTable.d.ts.map +1 -1
  40. package/dist/Table/VirtualizedTable.js +33 -2
  41. package/dist/Table/VirtualizedTable.js.map +1 -1
  42. package/dist/Table/model/table-model.d.ts +18 -2
  43. package/dist/Table/model/table-model.d.ts.map +1 -1
  44. package/dist/Table/model/table-model.js +4 -2
  45. package/dist/Table/model/table-model.js.map +1 -1
  46. package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
  47. package/dist/ThresholdsEditor/ThresholdsEditor.js +1 -1
  48. package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
  49. package/dist/TimeChart/TimeChart.d.ts.map +1 -1
  50. package/dist/TimeChart/TimeChart.js +6 -6
  51. package/dist/TimeChart/TimeChart.js.map +1 -1
  52. package/dist/TimeRangeSelector/DateTimeRangePicker.js +1 -1
  53. package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +1 -1
  54. package/dist/TimeRangeSelector/TimeRangeSelector.d.ts +1 -1
  55. package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -1
  56. package/dist/TimeRangeSelector/utils.js.map +1 -1
  57. package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts.map +1 -1
  58. package/dist/TimeSeriesTooltip/LineChartTooltip.js +2 -5
  59. package/dist/TimeSeriesTooltip/LineChartTooltip.js.map +1 -1
  60. package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
  61. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
  62. package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
  63. package/dist/TimeSeriesTooltip/TimeChartTooltip.js +2 -5
  64. package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
  65. package/dist/TimeSeriesTooltip/tooltip-model.d.ts +1 -8
  66. package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
  67. package/dist/TimeSeriesTooltip/tooltip-model.js +6 -16
  68. package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
  69. package/dist/TimeSeriesTooltip/utils.d.ts +1 -1
  70. package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -1
  71. package/dist/TimeSeriesTooltip/utils.js +27 -23
  72. package/dist/TimeSeriesTooltip/utils.js.map +1 -1
  73. package/dist/TransformsEditor/TransformEditorContainer.js.map +1 -1
  74. package/dist/cjs/DragAndDrop/DragButton.js +4 -2
  75. package/dist/cjs/EChart/EChart.js +25 -3
  76. package/dist/cjs/InfoTooltip/InfoTooltip.js +2 -1
  77. package/dist/cjs/JSONEditor.js +4 -5
  78. package/dist/cjs/Overlay/Overlay.js +1 -1
  79. package/dist/cjs/Table/Table.js +14 -3
  80. package/dist/cjs/Table/TableCell.js +4 -2
  81. package/dist/cjs/{StatChart/utils/formatStatChartValue.js → Table/TableFoot.js} +12 -15
  82. package/dist/cjs/Table/VirtualizedTable.js +32 -1
  83. package/dist/cjs/Table/model/table-model.js +7 -2
  84. package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +9 -9
  85. package/dist/cjs/TimeChart/TimeChart.js +5 -5
  86. package/dist/cjs/TimeRangeSelector/DateTimeRangePicker.js +2 -2
  87. package/dist/cjs/TimeSeriesTooltip/LineChartTooltip.js +1 -4
  88. package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +1 -4
  89. package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +6 -25
  90. package/dist/cjs/TimeSeriesTooltip/utils.js +26 -22
  91. package/dist/cjs/context/ChartsProvider.js +3 -1
  92. package/dist/cjs/index.js +0 -5
  93. package/dist/cjs/test-utils/theme.js +1 -0
  94. package/dist/context/ChartsProvider.d.ts +2 -0
  95. package/dist/context/ChartsProvider.d.ts.map +1 -1
  96. package/dist/context/ChartsProvider.js +3 -1
  97. package/dist/context/ChartsProvider.js.map +1 -1
  98. package/dist/context/SnackbarProvider.js.map +1 -1
  99. package/dist/index.d.ts +0 -5
  100. package/dist/index.d.ts.map +1 -1
  101. package/dist/index.js +0 -5
  102. package/dist/index.js.map +1 -1
  103. package/dist/model/timeOption.js.map +1 -1
  104. package/dist/test-utils/theme.d.ts.map +1 -1
  105. package/dist/test-utils/theme.js +1 -0
  106. package/dist/test-utils/theme.js.map +1 -1
  107. package/dist/theme/component-overrides/alert.js.map +1 -1
  108. package/dist/utils/component-ids.js.map +1 -1
  109. package/package.json +6 -11
  110. package/dist/BarChart/BarChart.d.ts +0 -16
  111. package/dist/BarChart/BarChart.d.ts.map +0 -1
  112. package/dist/BarChart/BarChart.js +0 -134
  113. package/dist/BarChart/BarChart.js.map +0 -1
  114. package/dist/BarChart/index.d.ts +0 -2
  115. package/dist/BarChart/index.d.ts.map +0 -1
  116. package/dist/BarChart/index.js.map +0 -1
  117. package/dist/GaugeChart/GaugeChart.d.ts +0 -23
  118. package/dist/GaugeChart/GaugeChart.d.ts.map +0 -1
  119. package/dist/GaugeChart/GaugeChart.js +0 -214
  120. package/dist/GaugeChart/GaugeChart.js.map +0 -1
  121. package/dist/GaugeChart/index.d.ts +0 -2
  122. package/dist/GaugeChart/index.d.ts.map +0 -1
  123. package/dist/GaugeChart/index.js +0 -15
  124. package/dist/GaugeChart/index.js.map +0 -1
  125. package/dist/PieChart/PieChart.d.ts +0 -14
  126. package/dist/PieChart/PieChart.d.ts.map +0 -1
  127. package/dist/PieChart/PieChart.js +0 -92
  128. package/dist/PieChart/PieChart.js.map +0 -1
  129. package/dist/PieChart/index.d.ts +0 -2
  130. package/dist/PieChart/index.d.ts.map +0 -1
  131. package/dist/PieChart/index.js +0 -15
  132. package/dist/PieChart/index.js.map +0 -1
  133. package/dist/StatChart/StatChart.d.ts +0 -21
  134. package/dist/StatChart/StatChart.d.ts.map +0 -1
  135. package/dist/StatChart/StatChart.js +0 -185
  136. package/dist/StatChart/StatChart.js.map +0 -1
  137. package/dist/StatChart/calculateFontSize.d.ts +0 -16
  138. package/dist/StatChart/calculateFontSize.d.ts.map +0 -1
  139. package/dist/StatChart/calculateFontSize.js +0 -49
  140. package/dist/StatChart/calculateFontSize.js.map +0 -1
  141. package/dist/StatChart/index.d.ts +0 -2
  142. package/dist/StatChart/index.d.ts.map +0 -1
  143. package/dist/StatChart/index.js +0 -15
  144. package/dist/StatChart/index.js.map +0 -1
  145. package/dist/StatChart/utils/formatStatChartValue.d.ts +0 -3
  146. package/dist/StatChart/utils/formatStatChartValue.d.ts.map +0 -1
  147. package/dist/StatChart/utils/formatStatChartValue.js +0 -26
  148. package/dist/StatChart/utils/formatStatChartValue.js.map +0 -1
  149. package/dist/StatusHistoryChart/StatusHistoryChart.d.ts +0 -27
  150. package/dist/StatusHistoryChart/StatusHistoryChart.d.ts.map +0 -1
  151. package/dist/StatusHistoryChart/StatusHistoryChart.js +0 -132
  152. package/dist/StatusHistoryChart/StatusHistoryChart.js.map +0 -1
  153. package/dist/StatusHistoryChart/StatusHistoryTooltip.d.ts +0 -13
  154. package/dist/StatusHistoryChart/StatusHistoryTooltip.d.ts.map +0 -1
  155. package/dist/StatusHistoryChart/StatusHistoryTooltip.js +0 -47
  156. package/dist/StatusHistoryChart/StatusHistoryTooltip.js.map +0 -1
  157. package/dist/StatusHistoryChart/get-formatted-axis-label.d.ts +0 -2
  158. package/dist/StatusHistoryChart/get-formatted-axis-label.d.ts.map +0 -1
  159. package/dist/StatusHistoryChart/get-formatted-axis-label.js +0 -41
  160. package/dist/StatusHistoryChart/get-formatted-axis-label.js.map +0 -1
  161. package/dist/StatusHistoryChart/index.d.ts +0 -3
  162. package/dist/StatusHistoryChart/index.d.ts.map +0 -1
  163. package/dist/StatusHistoryChart/index.js +0 -16
  164. package/dist/StatusHistoryChart/index.js.map +0 -1
  165. package/dist/StatusHistoryChart/utils/get-color.d.ts +0 -6
  166. package/dist/StatusHistoryChart/utils/get-color.d.ts.map +0 -1
  167. package/dist/StatusHistoryChart/utils/get-color.js +0 -100
  168. package/dist/StatusHistoryChart/utils/get-color.js.map +0 -1
  169. package/dist/StatusHistoryChart/utils/get-tooltip-position.d.ts +0 -3
  170. package/dist/StatusHistoryChart/utils/get-tooltip-position.d.ts.map +0 -1
  171. package/dist/StatusHistoryChart/utils/get-tooltip-position.js +0 -27
  172. package/dist/StatusHistoryChart/utils/get-tooltip-position.js.map +0 -1
  173. package/dist/cjs/BarChart/BarChart.js +0 -142
  174. package/dist/cjs/BarChart/index.js +0 -30
  175. package/dist/cjs/GaugeChart/GaugeChart.js +0 -227
  176. package/dist/cjs/GaugeChart/index.js +0 -30
  177. package/dist/cjs/PieChart/PieChart.js +0 -100
  178. package/dist/cjs/PieChart/index.js +0 -30
  179. package/dist/cjs/StatChart/StatChart.js +0 -198
  180. package/dist/cjs/StatChart/calculateFontSize.js +0 -55
  181. package/dist/cjs/StatChart/index.js +0 -30
  182. package/dist/cjs/StatusHistoryChart/StatusHistoryChart.js +0 -140
  183. package/dist/cjs/StatusHistoryChart/StatusHistoryTooltip.js +0 -55
  184. package/dist/cjs/StatusHistoryChart/get-formatted-axis-label.js +0 -48
  185. package/dist/cjs/StatusHistoryChart/index.js +0 -31
  186. package/dist/cjs/StatusHistoryChart/utils/get-color.js +0 -125
  187. package/dist/cjs/StatusHistoryChart/utils/get-tooltip-position.js +0 -35
@@ -1,31 +0,0 @@
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
- _export_star(require("./StatusHistoryChart"), exports);
18
- _export_star(require("./utils/get-color"), exports);
19
- function _export_star(from, to) {
20
- Object.keys(from).forEach(function(k) {
21
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
22
- Object.defineProperty(to, k, {
23
- enumerable: true,
24
- get: function() {
25
- return from[k];
26
- }
27
- });
28
- }
29
- });
30
- return from;
31
- }
@@ -1,125 +0,0 @@
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
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- function _export(target, all) {
18
- for(var name in all)Object.defineProperty(target, name, {
19
- enumerable: true,
20
- get: all[name]
21
- });
22
- }
23
- _export(exports, {
24
- FALLBACK_COLOR: function() {
25
- return FALLBACK_COLOR;
26
- },
27
- getColorForValue: function() {
28
- return getColorForValue;
29
- },
30
- getColorsForValues: function() {
31
- return getColorsForValues;
32
- },
33
- hexToHSL: function() {
34
- return hexToHSL;
35
- },
36
- hslToHex: function() {
37
- return hslToHex;
38
- }
39
- });
40
- const FALLBACK_COLOR = '#1f77b4';
41
- function getColorForValue(value, baseColor) {
42
- // Validate base color
43
- if (!baseColor.match(/^#[0-9A-Fa-f]{6}$/)) {
44
- baseColor = FALLBACK_COLOR;
45
- }
46
- try {
47
- const [baseH, baseS, baseL] = hexToHSL(baseColor);
48
- // Ensure numeric values are valid
49
- if (isNaN(baseH) || isNaN(baseS) || isNaN(baseL)) {
50
- throw new Error('Invalid HSL values');
51
- }
52
- // Create deterministic hash
53
- const hash = String(value).split('').reduce((acc, char)=>acc + char.charCodeAt(0), 0);
54
- const hueStep = 60;
55
- const lightnessVariation = 15;
56
- const hueOffset = hash % 6 * hueStep; // 6 segments of 60° each
57
- const newH = (baseH + hueOffset) % 360;
58
- const newL = baseL + (hash % 2 ? lightnessVariation : -lightnessVariation);
59
- // Keep saturation high for better distinction
60
- const newS = Math.min(baseS + 10, 90);
61
- const color = hslToHex(Math.abs(newH), Math.min(Math.max(newS, 50), 90), Math.min(Math.max(newL, 30), 70) // Keep lightness 30-70%
62
- );
63
- // Validate generated color
64
- if (!color.match(/^#[0-9A-Fa-f]{6}$/)) {
65
- throw new Error('Invalid generated color');
66
- }
67
- return color;
68
- } catch (_) {
69
- return FALLBACK_COLOR;
70
- }
71
- }
72
- function getColorsForValues(uniqueValues, themeColors) {
73
- // If we have enough theme colors, use them
74
- if (themeColors.length >= uniqueValues.length) {
75
- return themeColors.slice(0, uniqueValues.length);
76
- }
77
- // Use theme colors first, then generate additional ones
78
- return uniqueValues.map((value, index)=>{
79
- if (index < themeColors.length) {
80
- return themeColors[index] || FALLBACK_COLOR;
81
- }
82
- return getColorForValue(value, themeColors[0] || FALLBACK_COLOR);
83
- });
84
- }
85
- function hexToHSL(hex) {
86
- const r = parseInt(hex.slice(1, 3), 16) / 255;
87
- const g = parseInt(hex.slice(3, 5), 16) / 255;
88
- const b = parseInt(hex.slice(5, 7), 16) / 255;
89
- const max = Math.max(r, g, b);
90
- const min = Math.min(r, g, b);
91
- let h = 0;
92
- let s = 0;
93
- const l = (max + min) / 2;
94
- if (max !== min) {
95
- const d = max - min;
96
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
97
- switch(max){
98
- case r:
99
- h = (g - b) / d + (g < b ? 6 : 0);
100
- break;
101
- case g:
102
- h = (b - r) / d + 2;
103
- break;
104
- case b:
105
- h = (r - g) / d + 4;
106
- break;
107
- }
108
- h /= 6;
109
- }
110
- return [
111
- h * 360,
112
- s * 100,
113
- l * 100
114
- ];
115
- }
116
- function hslToHex(h, s, l) {
117
- l /= 100;
118
- const a = s * Math.min(l, 1 - l) / 100;
119
- const f = (n)=>{
120
- const k = (n + h / 30) % 12;
121
- const color = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
122
- return Math.round(255 * color).toString(16).padStart(2, '0');
123
- };
124
- return `#${f(0)}${f(8)}${f(4)}`;
125
- }
@@ -1,35 +0,0 @@
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
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- Object.defineProperty(exports, "getTooltipPosition", {
18
- enumerable: true,
19
- get: function() {
20
- return getTooltipPosition;
21
- }
22
- });
23
- const getTooltipPosition = (...data)=>{
24
- const point = data[0];
25
- const size = data[4];
26
- // calculate the position to avoid overflow
27
- const [x, y] = point;
28
- const { contentSize, viewSize } = size;
29
- const posX = x + contentSize[0] > viewSize[0] ? x - contentSize[0] : x;
30
- const posY = y + contentSize[1] > viewSize[1] ? y - contentSize[1] : y;
31
- return [
32
- posX,
33
- posY
34
- ];
35
- };