@perses-dev/timeseries-table-plugin 0.10.0 → 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.
Files changed (98) hide show
  1. package/__mf/css/async/3061.d3010b86.css +1 -0
  2. package/__mf/css/async/5442.d3010b86.css +1 -0
  3. package/__mf/css/async/7823.d3010b86.css +1 -0
  4. package/__mf/js/TimeSeriesTable.dcf4db64.js +6 -0
  5. package/__mf/js/async/1490.d65ef46d.js +22 -0
  6. package/__mf/js/async/1616.9128b0ad.js +1 -0
  7. package/__mf/js/async/2043.25c4bdae.js +2 -0
  8. package/__mf/js/async/2710.135d1c9a.js +37 -0
  9. package/__mf/js/async/2757.0345b149.js +1 -0
  10. package/__mf/js/async/383.737ba616.js +110 -0
  11. package/__mf/js/async/392.cf8653c1.js +2 -0
  12. package/__mf/js/async/{1553.e6de2b38.js → 4077.f3b86639.js} +1 -1
  13. package/__mf/js/async/{1964.e8379895.js → 4121.dba206d9.js} +2 -2
  14. package/__mf/js/async/{2651.58562451.js → 5002.cb23162d.js} +1 -1
  15. package/__mf/js/async/{1640.7dff76a2.js → 5019.e08c46de.js} +1 -1
  16. package/__mf/js/async/5071.c6ed8044.js +1 -0
  17. package/__mf/js/async/{5214.f8a936d3.js → 5587.3a411f0e.js} +1 -1
  18. package/__mf/js/async/5790.109680a8.js +7 -0
  19. package/__mf/js/async/6274.a2bf6069.js +2 -0
  20. package/__mf/js/async/{7623.4af707a1.js → 6458.15500279.js} +1 -1
  21. package/__mf/js/async/6517.c68cf337.js +2 -0
  22. package/__mf/js/async/{4062.06d99d86.js → 7177.d83435b9.js} +1 -1
  23. package/__mf/js/async/7192.a68f2ae7.js +1 -0
  24. package/__mf/js/async/7417.abe3c9e4.js +1 -0
  25. package/__mf/js/async/7452.1003e5e8.js +2 -0
  26. package/__mf/js/async/7968.6af57fc4.js +1 -0
  27. package/__mf/js/async/7978.91d4d06a.js +1 -0
  28. package/__mf/js/async/8252.7b50f677.js +1 -0
  29. package/__mf/js/async/8356.ab75baaf.js +1 -0
  30. package/__mf/js/async/8470.05175ff7.js +2 -0
  31. package/__mf/js/async/873.84c80238.js +1 -0
  32. package/__mf/js/async/9235.84d86874.js +1 -0
  33. package/__mf/js/async/9355.76d84af8.js +2 -0
  34. package/__mf/js/async/941.f114fee2.js +2 -0
  35. package/__mf/js/async/{8488.78819d8f.js → 9558.1a195bd1.js} +1 -1
  36. package/__mf/js/async/9588.b67a10d7.js +1 -0
  37. package/__mf/js/async/__federation_expose_TimeSeriesTable.ffca818d.js +1 -0
  38. package/__mf/js/async/lib-router.4afa3869.js +2 -0
  39. package/__mf/js/main.493f6616.js +6 -0
  40. package/lib/TimeSeriesTablePanel.d.ts.map +1 -1
  41. package/lib/TimeSeriesTablePanel.js +4 -2
  42. package/lib/TimeSeriesTablePanel.js.map +1 -1
  43. package/lib/bootstrap.js +1 -1
  44. package/lib/bootstrap.js.map +1 -1
  45. package/lib/cjs/TimeSeriesTablePanel.js +3 -1
  46. package/lib/cjs/components/DataTable.js +19 -11
  47. package/lib/cjs/index-federation.js +12 -12
  48. package/lib/cjs/test/mock-query-results.js +7 -7
  49. package/lib/components/DataTable.d.ts.map +1 -1
  50. package/lib/components/DataTable.js +16 -8
  51. package/lib/components/DataTable.js.map +1 -1
  52. package/mf-manifest.json +43 -44
  53. package/mf-stats.json +43 -44
  54. package/package.json +6 -6
  55. package/__mf/css/async/2341.53436797.css +0 -1
  56. package/__mf/css/async/5263.53436797.css +0 -1
  57. package/__mf/css/async/6759.53436797.css +0 -1
  58. package/__mf/js/TimeSeriesTable.5cab3fff.js +0 -5
  59. package/__mf/js/async/1143.c1a3fae7.js +0 -1
  60. package/__mf/js/async/2292.af6c5129.js +0 -2
  61. package/__mf/js/async/3224.ef58dd81.js +0 -1
  62. package/__mf/js/async/3288.ad1ec88e.js +0 -7
  63. package/__mf/js/async/3391.dd33a872.js +0 -73
  64. package/__mf/js/async/3863.03c54690.js +0 -2
  65. package/__mf/js/async/3957.d7ae436a.js +0 -110
  66. package/__mf/js/async/3960.6ab28dd0.js +0 -2
  67. package/__mf/js/async/4075.81eb38e5.js +0 -1
  68. package/__mf/js/async/4162.c4ff6149.js +0 -2
  69. package/__mf/js/async/4238.84860856.js +0 -1
  70. package/__mf/js/async/5061.f4a2c42a.js +0 -2
  71. package/__mf/js/async/5377.d0550808.js +0 -1
  72. package/__mf/js/async/5409.f5850fb9.js +0 -1
  73. package/__mf/js/async/5981.1321459e.js +0 -2
  74. package/__mf/js/async/6109.f2d98501.js +0 -1
  75. package/__mf/js/async/6292.10c49829.js +0 -1
  76. package/__mf/js/async/6770.d29c9af3.js +0 -1
  77. package/__mf/js/async/694.de4b3cd4.js +0 -1
  78. package/__mf/js/async/738.aed331d8.js +0 -1
  79. package/__mf/js/async/7482.8f69a947.js +0 -2
  80. package/__mf/js/async/7557.1d9dfec0.js +0 -37
  81. package/__mf/js/async/7740.1883bdd9.js +0 -1
  82. package/__mf/js/async/9173.c0a91319.js +0 -2
  83. package/__mf/js/async/9200.9f82e7b2.js +0 -1
  84. package/__mf/js/async/__federation_expose_TimeSeriesTable.a1506383.js +0 -1
  85. package/__mf/js/async/lib-router.9b92565d.js +0 -2
  86. package/__mf/js/main.89c53b57.js +0 -5
  87. /package/__mf/js/async/{3391.dd33a872.js.LICENSE.txt → 1490.d65ef46d.js.LICENSE.txt} +0 -0
  88. /package/__mf/js/async/{2292.af6c5129.js.LICENSE.txt → 2043.25c4bdae.js.LICENSE.txt} +0 -0
  89. /package/__mf/js/async/{3957.d7ae436a.js.LICENSE.txt → 383.737ba616.js.LICENSE.txt} +0 -0
  90. /package/__mf/js/async/{5981.1321459e.js.LICENSE.txt → 392.cf8653c1.js.LICENSE.txt} +0 -0
  91. /package/__mf/js/async/{1964.e8379895.js.LICENSE.txt → 4121.dba206d9.js.LICENSE.txt} +0 -0
  92. /package/__mf/js/async/{3288.ad1ec88e.js.LICENSE.txt → 5790.109680a8.js.LICENSE.txt} +0 -0
  93. /package/__mf/js/async/{3960.6ab28dd0.js.LICENSE.txt → 6274.a2bf6069.js.LICENSE.txt} +0 -0
  94. /package/__mf/js/async/{7482.8f69a947.js.LICENSE.txt → 7452.1003e5e8.js.LICENSE.txt} +0 -0
  95. /package/__mf/js/async/{9173.c0a91319.js.LICENSE.txt → 8470.05175ff7.js.LICENSE.txt} +0 -0
  96. /package/__mf/js/async/{5061.f4a2c42a.js.LICENSE.txt → 9355.76d84af8.js.LICENSE.txt} +0 -0
  97. /package/__mf/js/async/{3863.03c54690.js.LICENSE.txt → 941.f114fee2.js.LICENSE.txt} +0 -0
  98. /package/__mf/js/async/{lib-router.9b92565d.js.LICENSE.txt → lib-router.4afa3869.js.LICENSE.txt} +0 -0
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  // Copyright 2024 The Perses Authors
2
3
  // Licensed under the Apache License, Version 2.0 (the "License");
3
4
  // you may not use this file except in compliance with the License.
@@ -10,7 +11,6 @@
10
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
12
  // See the License for the specific language governing permissions and
12
13
  // limitations under the License.
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { Box } from '@mui/material';
15
15
  import { useChartsTheme } from '@perses-dev/components';
16
16
  import { DataTable } from './components';
@@ -19,8 +19,10 @@ export function TimeSeriesTablePanel(props) {
19
19
  const chartsTheme = useChartsTheme();
20
20
  const contentPadding = chartsTheme.container.padding.default;
21
21
  return /*#__PURE__*/ _jsx(Box, {
22
+ style: {
23
+ height: contentDimensions?.height ?? 0
24
+ },
22
25
  sx: {
23
- height: contentDimensions?.height || 0,
24
26
  padding: `${contentPadding}px`,
25
27
  overflowY: 'scroll'
26
28
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/TimeSeriesTablePanel.tsx"],"sourcesContent":["// Copyright 2024 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 { Box } from '@mui/material';\nimport { useChartsTheme } from '@perses-dev/components';\nimport { ReactElement } from 'react';\nimport { PanelProps } from '@perses-dev/plugin-system';\nimport { TimeSeriesData } from '@perses-dev/core';\nimport { TimeSeriesTableOptions } from './model';\nimport { DataTable } from './components';\n\nexport type TimeSeriesTableProps = PanelProps<TimeSeriesTableOptions, TimeSeriesData>;\n\nexport function TimeSeriesTablePanel(props: TimeSeriesTableProps): ReactElement {\n const { contentDimensions, queryResults } = props;\n const chartsTheme = useChartsTheme();\n const contentPadding = chartsTheme.container.padding.default;\n\n return (\n <Box sx={{ height: contentDimensions?.height || 0, padding: `${contentPadding}px`, overflowY: 'scroll' }}>\n <DataTable queryResults={queryResults} />\n </Box>\n );\n}\n"],"names":["Box","useChartsTheme","DataTable","TimeSeriesTablePanel","props","contentDimensions","queryResults","chartsTheme","contentPadding","container","padding","default","sx","height","overflowY"],"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,GAAG,QAAQ,gBAAgB;AACpC,SAASC,cAAc,QAAQ,yBAAyB;AAKxD,SAASC,SAAS,QAAQ,eAAe;AAIzC,OAAO,SAASC,qBAAqBC,KAA2B;IAC9D,MAAM,EAAEC,iBAAiB,EAAEC,YAAY,EAAE,GAAGF;IAC5C,MAAMG,cAAcN;IACpB,MAAMO,iBAAiBD,YAAYE,SAAS,CAACC,OAAO,CAACC,OAAO;IAE5D,qBACE,KAACX;QAAIY,IAAI;YAAEC,QAAQR,mBAAmBQ,UAAU;YAAGH,SAAS,GAAGF,eAAe,EAAE,CAAC;YAAEM,WAAW;QAAS;kBACrG,cAAA,KAACZ;YAAUI,cAAcA;;;AAG/B"}
1
+ {"version":3,"sources":["../../src/TimeSeriesTablePanel.tsx"],"sourcesContent":["// Copyright 2024 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 { Box } from '@mui/material';\nimport { useChartsTheme } from '@perses-dev/components';\nimport { ReactElement } from 'react';\nimport { PanelProps } from '@perses-dev/plugin-system';\nimport { TimeSeriesData } from '@perses-dev/core';\n\nimport { TimeSeriesTableOptions } from './model';\nimport { DataTable } from './components';\n\nexport type TimeSeriesTableProps = PanelProps<TimeSeriesTableOptions, TimeSeriesData>;\n\nexport function TimeSeriesTablePanel(props: TimeSeriesTableProps): ReactElement {\n const { contentDimensions, queryResults } = props;\n const chartsTheme = useChartsTheme();\n const contentPadding = chartsTheme.container.padding.default;\n\n return (\n <Box\n style={{ height: contentDimensions?.height ?? 0 }}\n sx={{ padding: `${contentPadding}px`, overflowY: 'scroll' }}\n >\n <DataTable queryResults={queryResults} />\n </Box>\n );\n}\n"],"names":["Box","useChartsTheme","DataTable","TimeSeriesTablePanel","props","contentDimensions","queryResults","chartsTheme","contentPadding","container","padding","default","style","height","sx","overflowY"],"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,GAAG,QAAQ,gBAAgB;AACpC,SAASC,cAAc,QAAQ,yBAAyB;AAMxD,SAASC,SAAS,QAAQ,eAAe;AAIzC,OAAO,SAASC,qBAAqBC,KAA2B;IAC9D,MAAM,EAAEC,iBAAiB,EAAEC,YAAY,EAAE,GAAGF;IAC5C,MAAMG,cAAcN;IACpB,MAAMO,iBAAiBD,YAAYE,SAAS,CAACC,OAAO,CAACC,OAAO;IAE5D,qBACE,KAACX;QACCY,OAAO;YAAEC,QAAQR,mBAAmBQ,UAAU;QAAE;QAChDC,IAAI;YAAEJ,SAAS,GAAGF,eAAe,EAAE,CAAC;YAAEO,WAAW;QAAS;kBAE1D,cAAA,KAACb;YAAUI,cAAcA;;;AAG/B"}
package/lib/bootstrap.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  // Copyright 2024 The Perses Authors
2
3
  // Licensed under the Apache License, Version 2.0 (the "License");
3
4
  // you may not use this file except in compliance with the License.
@@ -10,7 +11,6 @@
10
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
12
  // See the License for the specific language governing permissions and
12
13
  // limitations under the License.
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import React from 'react';
15
15
  import ReactDOM from 'react-dom/client';
16
16
  const root = ReactDOM.createRoot(document.getElementById('root'));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/bootstrap.tsx"],"sourcesContent":["// Copyright 2024 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 React from 'react';\nimport ReactDOM from 'react-dom/client';\n\nconst root = ReactDOM.createRoot(document.getElementById('root')!);\nroot.render(<React.StrictMode></React.StrictMode>);\n"],"names":["React","ReactDOM","root","createRoot","document","getElementById","render","StrictMode"],"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,OAAOA,WAAW,QAAQ;AAC1B,OAAOC,cAAc,mBAAmB;AAExC,MAAMC,OAAOD,SAASE,UAAU,CAACC,SAASC,cAAc,CAAC;AACzDH,KAAKI,MAAM,eAAC,KAACN,MAAMO,UAAU"}
1
+ {"version":3,"sources":["../../src/bootstrap.tsx"],"sourcesContent":["// Copyright 2024 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 React from 'react';\nimport ReactDOM from 'react-dom/client';\n\nconst root = ReactDOM.createRoot(document.getElementById('root')!);\nroot.render(<React.StrictMode></React.StrictMode>);\n"],"names":["React","ReactDOM","root","createRoot","document","getElementById","render","StrictMode"],"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,OAAOA,WAAW,QAAQ;AAC1B,OAAOC,cAAc,mBAAmB;AAExC,MAAMC,OAAOD,SAASE,UAAU,CAACC,SAASC,cAAc,CAAC;AACzDH,KAAKI,MAAM,eAAC,KAACN,MAAMO,UAAU"}
@@ -29,8 +29,10 @@ function TimeSeriesTablePanel(props) {
29
29
  const chartsTheme = (0, _components.useChartsTheme)();
30
30
  const contentPadding = chartsTheme.container.padding.default;
31
31
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
32
+ style: {
33
+ height: contentDimensions?.height ?? 0
34
+ },
32
35
  sx: {
33
- height: contentDimensions?.height || 0,
34
36
  padding: `${contentPadding}px`,
35
37
  overflowY: 'scroll'
36
38
  },
@@ -17,17 +17,17 @@ 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[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- DataTable: function() {
24
+ get DataTable () {
25
25
  return DataTable;
26
26
  },
27
- bucketRangeString: function() {
27
+ get bucketRangeString () {
28
28
  return bucketRangeString;
29
29
  },
30
- histogramTable: function() {
30
+ get histogramTable () {
31
31
  return histogramTable;
32
32
  }
33
33
  });
@@ -36,7 +36,7 @@ const _react = require("react");
36
36
  const _material = require("@mui/material");
37
37
  const _SeriesName = require("./SeriesName");
38
38
  const _EmbeddedPanel = require("./EmbeddedPanel");
39
- const MAX_FORMATABLE_SERIES = 1000;
39
+ const MAX_FORMATTABLE_SERIES = 1000;
40
40
  const DataTable = ({ queryResults })=>{
41
41
  const series = (0, _react.useMemo)(()=>queryResults.flatMap((d)=>d.data).flatMap((d)=>d?.series || []), [
42
42
  queryResults
@@ -45,18 +45,26 @@ const DataTable = ({ queryResults })=>{
45
45
  series,
46
46
  queryResults
47
47
  ]);
48
- if (!queryResults) {
49
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
50
- children: "No data"
48
+ if (!queryResults || !rows?.length) {
49
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
50
+ sx: {
51
+ display: 'flex',
52
+ justifyContent: 'center',
53
+ alignItems: 'center',
54
+ height: '100%'
55
+ },
56
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
57
+ children: "No data"
58
+ })
51
59
  });
52
60
  }
53
61
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
54
62
  children: [
55
- series.length >= MAX_FORMATABLE_SERIES && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Alert, {
63
+ series.length >= MAX_FORMATTABLE_SERIES && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Alert, {
56
64
  severity: "warning",
57
65
  children: [
58
66
  "Showing more than ",
59
- MAX_FORMATABLE_SERIES,
67
+ MAX_FORMATTABLE_SERIES,
60
68
  " series, turning off label formatting for performance reasons."
61
69
  ]
62
70
  }),
@@ -70,7 +78,7 @@ const DataTable = ({ queryResults })=>{
70
78
  });
71
79
  };
72
80
  function buildRows(series, queryResults) {
73
- const isFormatted = series.length < MAX_FORMATABLE_SERIES; // only format series names if we have less than 1000 series for performance reasons
81
+ const isFormatted = series.length < MAX_FORMATTABLE_SERIES; // only format series names if we have less than 1000 series for performance reasons
74
82
  return series.map((s, seriesIdx)=>{
75
83
  const displayTimeStamps = (s.values?.length ?? 0) > 1;
76
84
  const valuesAndTimes = s.values ? s.values.map((v, valIdx)=>{
@@ -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")));
@@ -17,26 +17,26 @@ 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[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- MOCK_NULL_QUERY_RESULT: function() {
24
+ get MOCK_NULL_QUERY_RESULT () {
25
25
  return MOCK_NULL_QUERY_RESULT;
26
26
  },
27
- MOCK_TIME_SERIES_DATA_MULTIVALUE: function() {
27
+ get MOCK_TIME_SERIES_DATA_MULTIVALUE () {
28
28
  return MOCK_TIME_SERIES_DATA_MULTIVALUE;
29
29
  },
30
- MOCK_TIME_SERIES_DATA_SINGLEVALUE: function() {
30
+ get MOCK_TIME_SERIES_DATA_SINGLEVALUE () {
31
31
  return MOCK_TIME_SERIES_DATA_SINGLEVALUE;
32
32
  },
33
- MOCK_TIME_SERIES_QUERY_DEFINITION: function() {
33
+ get MOCK_TIME_SERIES_QUERY_DEFINITION () {
34
34
  return MOCK_TIME_SERIES_QUERY_DEFINITION;
35
35
  },
36
- MOCK_TIME_SERIES_QUERY_RESULT_MULTIVALUE: function() {
36
+ get MOCK_TIME_SERIES_QUERY_RESULT_MULTIVALUE () {
37
37
  return MOCK_TIME_SERIES_QUERY_RESULT_MULTIVALUE;
38
38
  },
39
- MOCK_TIME_SERIES_QUERY_RESULT_SINGLEVALUE: function() {
39
+ get MOCK_TIME_SERIES_QUERY_RESULT_SINGLEVALUE () {
40
40
  return MOCK_TIME_SERIES_QUERY_RESULT_SINGLEVALUE;
41
41
  }
42
42
  });
@@ -1 +1 @@
1
- {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAc,cAAc,EAAyC,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACrH,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAMtD,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;CAChD;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,kBAAkB,cAAc,KAAG,YAAY,GAAG,IAoB3E,CAAC;AA4DF,eAAO,MAAM,iBAAiB,GAAI,6CAA6C,CAC7E,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,CACP,KAAG,MAEH,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,GAAG,cAAc,KAAG,SAsBlD,CAAC"}
1
+ {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAc,cAAc,EAAyC,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACrH,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAMtD,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;CAChD;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,kBAAkB,cAAc,KAAG,YAAY,GAAG,IA+B3E,CAAC;AA4DF,eAAO,MAAM,iBAAiB,GAAI,6CAA6C,CAC7E,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,CACP,KAAG,MAEH,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,GAAG,cAAc,KAAG,SAsBlD,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
2
  // Copyright 2024 The Perses Authors
2
3
  // Licensed under the Apache License, Version 2.0 (the "License");
3
4
  // you may not use this file except in compliance with the License.
@@ -10,12 +11,11 @@
10
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
12
  // See the License for the specific language governing permissions and
12
13
  // limitations under the License.
13
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
14
  import { useMemo } from 'react';
15
15
  import { Alert, Box, Stack, Table, TableBody, TableCell, TableHead, TableRow, Typography } from '@mui/material';
16
16
  import { SeriesName } from './SeriesName';
17
17
  import { EmbeddedPanel } from './EmbeddedPanel';
18
- const MAX_FORMATABLE_SERIES = 1000;
18
+ const MAX_FORMATTABLE_SERIES = 1000;
19
19
  /**
20
20
  * Designed to display timeseries data in a prometheus like table format.
21
21
  * The first column will contain the metric name and label combination, and the second column will contain the values.
@@ -31,18 +31,26 @@ const MAX_FORMATABLE_SERIES = 1000;
31
31
  series,
32
32
  queryResults
33
33
  ]);
34
- if (!queryResults) {
35
- return /*#__PURE__*/ _jsx(Typography, {
36
- children: "No data"
34
+ if (!queryResults || !rows?.length) {
35
+ return /*#__PURE__*/ _jsx(Box, {
36
+ sx: {
37
+ display: 'flex',
38
+ justifyContent: 'center',
39
+ alignItems: 'center',
40
+ height: '100%'
41
+ },
42
+ children: /*#__PURE__*/ _jsx(Typography, {
43
+ children: "No data"
44
+ })
37
45
  });
38
46
  }
39
47
  return /*#__PURE__*/ _jsxs(_Fragment, {
40
48
  children: [
41
- series.length >= MAX_FORMATABLE_SERIES && /*#__PURE__*/ _jsxs(Alert, {
49
+ series.length >= MAX_FORMATTABLE_SERIES && /*#__PURE__*/ _jsxs(Alert, {
42
50
  severity: "warning",
43
51
  children: [
44
52
  "Showing more than ",
45
- MAX_FORMATABLE_SERIES,
53
+ MAX_FORMATTABLE_SERIES,
46
54
  " series, turning off label formatting for performance reasons."
47
55
  ]
48
56
  }),
@@ -56,7 +64,7 @@ const MAX_FORMATABLE_SERIES = 1000;
56
64
  });
57
65
  };
58
66
  function buildRows(series, queryResults) {
59
- const isFormatted = series.length < MAX_FORMATABLE_SERIES; // only format series names if we have less than 1000 series for performance reasons
67
+ const isFormatted = series.length < MAX_FORMATTABLE_SERIES; // only format series names if we have less than 1000 series for performance reasons
60
68
  return series.map((s, seriesIdx)=>{
61
69
  const displayTimeStamps = (s.values?.length ?? 0) > 1;
62
70
  const valuesAndTimes = s.values ? s.values.map((v, valIdx)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/DataTable.tsx"],"sourcesContent":["// Copyright 2024 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 { ReactElement, ReactNode, useMemo } from 'react';\nimport { Alert, Box, Stack, Table, TableBody, TableCell, TableHead, TableRow, Typography } from '@mui/material';\nimport { TimeSeries, TimeSeriesData, BucketTuple, TimeSeriesHistogramTuple, HistogramValue } from '@perses-dev/core';\nimport { PanelData } from '@perses-dev/plugin-system';\nimport { SeriesName } from './SeriesName';\nimport { EmbeddedPanel } from './EmbeddedPanel';\n\nconst MAX_FORMATABLE_SERIES = 1000;\n\nexport interface DataTableProps {\n queryResults: Array<PanelData<TimeSeriesData>>;\n}\n\n/**\n * Designed to display timeseries data in a prometheus like table format.\n * The first column will contain the metric name and label combination, and the second column will contain the values.\n * This is inspired by prometheus DataTable.\n * https://github.com/prometheus/prometheus/blob/2524a915915d7eb1b1207152d2e0ce5771193404/web/ui/react-app/src/pages/graph/DataTable.tsx\n * @param result timeseries query result\n * @constructor\n */\nexport const DataTable = ({ queryResults }: DataTableProps): ReactElement | null => {\n const series = useMemo(() => queryResults.flatMap((d) => d.data).flatMap((d) => d?.series || []), [queryResults]);\n const rows = useMemo(() => buildRows(series, queryResults), [series, queryResults]);\n\n if (!queryResults) {\n return <Typography>No data</Typography>;\n }\n\n return (\n <>\n {series.length >= MAX_FORMATABLE_SERIES && (\n <Alert severity=\"warning\">\n Showing more than {MAX_FORMATABLE_SERIES} series, turning off label formatting for performance reasons.\n </Alert>\n )}\n <Table className=\"data-table\">\n <TableBody>{rows}</TableBody>\n </Table>\n </>\n );\n};\n\nfunction buildRows(series: TimeSeries[], queryResults: Array<PanelData<TimeSeriesData>>): ReactNode[] {\n const isFormatted = series.length < MAX_FORMATABLE_SERIES; // only format series names if we have less than 1000 series for performance reasons\n return series.map((s, seriesIdx) => {\n const displayTimeStamps = (s.values?.length ?? 0) > 1;\n const valuesAndTimes = s.values\n ? s.values.map((v, valIdx) => {\n return (\n <Typography key={valIdx}>\n {v[1]} {displayTimeStamps && <span>@{v[0]}</span>}\n </Typography>\n );\n })\n : [];\n\n let histogramsAndTimes = null;\n if (s.histograms && s.histograms.length > 0) {\n // Query results contains multiple series, create a new query result with only the current series\n const seriesQueryResult: PanelData<TimeSeriesData> = {\n ...queryResults[0]!,\n data: {\n ...queryResults[0]!.data,\n series: [queryResults[0]!.data.series[seriesIdx]!],\n },\n };\n\n histogramsAndTimes = s.histograms.map((h: TimeSeriesHistogramTuple, hisIdx: number) => {\n return (\n <Stack alignItems=\"center\" key={-hisIdx}>\n <Box width={400} height={200}>\n <EmbeddedPanel\n kind=\"HistogramChart\"\n spec={{ unit: 'decimal', width: 400, height: 200 }}\n queryResults={[seriesQueryResult]}\n />\n </Box>\n <Stack flexDirection=\"row\" justifyContent=\"space-between\" width=\"100%\">\n <Typography>Total count: {h[1].count}</Typography>\n <Typography>Sum: {h[1].sum}</Typography>\n </Stack>\n {histogramTable(h[1])}\n </Stack>\n );\n });\n }\n return (\n <TableRow style={{ whiteSpace: 'pre' }} key={seriesIdx}>\n <TableCell>\n <SeriesName name={s.name} formattedName={s.formattedName} labels={s.labels} isFormatted={isFormatted} />\n </TableCell>\n <TableCell>{s.histograms ? histogramsAndTimes : valuesAndTimes}</TableCell>\n </TableRow>\n );\n });\n}\n\nconst leftDelim = (br: number): string => (br === 3 || br === 1 ? '[' : '(');\nconst rightDelim = (br: number): string => (br === 3 || br === 0 ? ']' : ')');\n\nexport const bucketRangeString = ([boundaryRule, leftBoundary, rightBoundary]: [\n number,\n string,\n string,\n string,\n]): string => {\n return `${leftDelim(boundaryRule)}${leftBoundary} -> ${rightBoundary}${rightDelim(boundaryRule)}`;\n};\n\nexport const histogramTable = (h: HistogramValue): ReactNode => (\n <Table>\n <TableHead>\n <TableRow>\n <TableCell style={{ textAlign: 'center' }} colSpan={2}>\n Histogram Sample\n </TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n <TableRow>\n <TableCell>Range</TableCell>\n <TableCell>Count</TableCell>\n </TableRow>\n {h.buckets?.map((b: BucketTuple, i: number) => (\n <TableRow key={i}>\n <TableCell>{bucketRangeString(b)}</TableCell>\n <TableCell>{b[3]}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n);\n"],"names":["useMemo","Alert","Box","Stack","Table","TableBody","TableCell","TableHead","TableRow","Typography","SeriesName","EmbeddedPanel","MAX_FORMATABLE_SERIES","DataTable","queryResults","series","flatMap","d","data","rows","buildRows","length","severity","className","isFormatted","map","s","seriesIdx","displayTimeStamps","values","valuesAndTimes","v","valIdx","span","histogramsAndTimes","histograms","seriesQueryResult","h","hisIdx","alignItems","width","height","kind","spec","unit","flexDirection","justifyContent","count","sum","histogramTable","style","whiteSpace","name","formattedName","labels","leftDelim","br","rightDelim","bucketRangeString","boundaryRule","leftBoundary","rightBoundary","textAlign","colSpan","buckets","b","i"],"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,SAAkCA,OAAO,QAAQ,QAAQ;AACzD,SAASC,KAAK,EAAEC,GAAG,EAAEC,KAAK,EAAEC,KAAK,EAAEC,SAAS,EAAEC,SAAS,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,gBAAgB;AAGhH,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,aAAa,QAAQ,kBAAkB;AAEhD,MAAMC,wBAAwB;AAM9B;;;;;;;CAOC,GACD,OAAO,MAAMC,YAAY,CAAC,EAAEC,YAAY,EAAkB;IACxD,MAAMC,SAASf,QAAQ,IAAMc,aAAaE,OAAO,CAAC,CAACC,IAAMA,EAAEC,IAAI,EAAEF,OAAO,CAAC,CAACC,IAAMA,GAAGF,UAAU,EAAE,GAAG;QAACD;KAAa;IAChH,MAAMK,OAAOnB,QAAQ,IAAMoB,UAAUL,QAAQD,eAAe;QAACC;QAAQD;KAAa;IAElF,IAAI,CAACA,cAAc;QACjB,qBAAO,KAACL;sBAAW;;IACrB;IAEA,qBACE;;YACGM,OAAOM,MAAM,IAAIT,uCAChB,MAACX;gBAAMqB,UAAS;;oBAAU;oBACLV;oBAAsB;;;0BAG7C,KAACR;gBAAMmB,WAAU;0BACf,cAAA,KAAClB;8BAAWc;;;;;AAIpB,EAAE;AAEF,SAASC,UAAUL,MAAoB,EAAED,YAA8C;IACrF,MAAMU,cAAcT,OAAOM,MAAM,GAAGT,uBAAuB,oFAAoF;IAC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S0C,OAAO;gBAAEC,YAAY;YAAM;;8BACnC,KAAC7C;8BACC,cAAA,KAACI;wBAAW0C,MAAM1B,EAAE0B,IAAI;wBAAEC,eAAe3B,EAAE2B,aAAa;wBAAEC,QAAQ5B,EAAE4B,MAAM;wBAAE9B,aAAaA;;;8BAE3F,KAAClB;8BAAWoB,EAAES,UAAU,GAAGD,qBAAqBJ;;;WAJLH;IAOjD;AACF;AAEA,MAAM4B,YAAY,CAACC,KAAwBA,OAAO,KAAKA,OAAO,IAAI,MAAM;AACxE,MAAMC,aAAa,CAACD,KAAwBA,OAAO,KAAKA,OAAO,IAAI,MAAM;AAEzE,OAAO,MAAME,oBAAoB,CAAC,CAACC,cAAcC,cAAcC,cAK9D;IACC,OAAO,GAAGN,UAAUI,gBAAgBC,aAAa,IAAI,EAAEC,gBAAgBJ,WAAWE,eAAe;AACnG,EAAE;AAEF,OAAO,MAAMV,iBAAiB,CAACZ,kBAC7B,MAACjC;;0BACC,KAACG;0BACC,cAAA,KAACC;8BACC,cAAA,KAACF;wBAAU4C,OAAO;4BAAEY,WAAW;wBAAS;wBAAGC,SAAS;kCAAG;;;;0BAK3D,MAAC1D;;kCACC,MAACG;;0CACC,KAACF;0CAAU;;0CACX,KAACA;0CAAU;;;;oBAEZ+B,EAAE2B,OAAO,EAAEvC,IAAI,CAACwC,GAAgBC,kBAC/B,MAAC1D;;8CACC,KAACF;8CAAWoD,kBAAkBO;;8CAC9B,KAAC3D;8CAAW2D,CAAC,CAAC,EAAE;;;2BAFHC;;;;OAOrB"}
1
+ {"version":3,"sources":["../../../src/components/DataTable.tsx"],"sourcesContent":["// Copyright 2024 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 { ReactElement, ReactNode, useMemo } from 'react';\nimport { Alert, Box, Stack, Table, TableBody, TableCell, TableHead, TableRow, Typography } from '@mui/material';\nimport { TimeSeries, TimeSeriesData, BucketTuple, TimeSeriesHistogramTuple, HistogramValue } from '@perses-dev/core';\nimport { PanelData } from '@perses-dev/plugin-system';\nimport { SeriesName } from './SeriesName';\nimport { EmbeddedPanel } from './EmbeddedPanel';\n\nconst MAX_FORMATTABLE_SERIES = 1000;\n\nexport interface DataTableProps {\n queryResults: Array<PanelData<TimeSeriesData>>;\n}\n\n/**\n * Designed to display timeseries data in a prometheus like table format.\n * The first column will contain the metric name and label combination, and the second column will contain the values.\n * This is inspired by prometheus DataTable.\n * https://github.com/prometheus/prometheus/blob/2524a915915d7eb1b1207152d2e0ce5771193404/web/ui/react-app/src/pages/graph/DataTable.tsx\n * @param result timeseries query result\n * @constructor\n */\nexport const DataTable = ({ queryResults }: DataTableProps): ReactElement | null => {\n const series = useMemo(() => queryResults.flatMap((d) => d.data).flatMap((d) => d?.series || []), [queryResults]);\n const rows = useMemo(() => buildRows(series, queryResults), [series, queryResults]);\n\n if (!queryResults || !rows?.length) {\n return (\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n height: '100%',\n }}\n >\n <Typography>No data</Typography>\n </Box>\n );\n }\n\n return (\n <>\n {series.length >= MAX_FORMATTABLE_SERIES && (\n <Alert severity=\"warning\">\n Showing more than {MAX_FORMATTABLE_SERIES} series, turning off label formatting for performance reasons.\n </Alert>\n )}\n <Table className=\"data-table\">\n <TableBody>{rows}</TableBody>\n </Table>\n </>\n );\n};\n\nfunction buildRows(series: TimeSeries[], queryResults: Array<PanelData<TimeSeriesData>>): ReactNode[] {\n const isFormatted = series.length < MAX_FORMATTABLE_SERIES; // only format series names if we have less than 1000 series for performance reasons\n return series.map((s, seriesIdx) => {\n const displayTimeStamps = (s.values?.length ?? 0) > 1;\n const valuesAndTimes = s.values\n ? s.values.map((v, valIdx) => {\n return (\n <Typography key={valIdx}>\n {v[1]} {displayTimeStamps && <span>@{v[0]}</span>}\n </Typography>\n );\n })\n : [];\n\n let histogramsAndTimes = null;\n if (s.histograms && s.histograms.length > 0) {\n // Query results contains multiple series, create a new query result with only the current series\n const seriesQueryResult: PanelData<TimeSeriesData> = {\n ...queryResults[0]!,\n data: {\n ...queryResults[0]!.data,\n series: [queryResults[0]!.data.series[seriesIdx]!],\n },\n };\n\n histogramsAndTimes = s.histograms.map((h: TimeSeriesHistogramTuple, hisIdx: number) => {\n return (\n <Stack alignItems=\"center\" key={-hisIdx}>\n <Box width={400} height={200}>\n <EmbeddedPanel\n kind=\"HistogramChart\"\n spec={{ unit: 'decimal', width: 400, height: 200 }}\n queryResults={[seriesQueryResult]}\n />\n </Box>\n <Stack flexDirection=\"row\" justifyContent=\"space-between\" width=\"100%\">\n <Typography>Total count: {h[1].count}</Typography>\n <Typography>Sum: {h[1].sum}</Typography>\n </Stack>\n {histogramTable(h[1])}\n </Stack>\n );\n });\n }\n return (\n <TableRow style={{ whiteSpace: 'pre' }} key={seriesIdx}>\n <TableCell>\n <SeriesName name={s.name} formattedName={s.formattedName} labels={s.labels} isFormatted={isFormatted} />\n </TableCell>\n <TableCell>{s.histograms ? histogramsAndTimes : valuesAndTimes}</TableCell>\n </TableRow>\n );\n });\n}\n\nconst leftDelim = (br: number): string => (br === 3 || br === 1 ? '[' : '(');\nconst rightDelim = (br: number): string => (br === 3 || br === 0 ? ']' : ')');\n\nexport const bucketRangeString = ([boundaryRule, leftBoundary, rightBoundary]: [\n number,\n string,\n string,\n string,\n]): string => {\n return `${leftDelim(boundaryRule)}${leftBoundary} -> ${rightBoundary}${rightDelim(boundaryRule)}`;\n};\n\nexport const histogramTable = (h: HistogramValue): ReactNode => (\n <Table>\n <TableHead>\n <TableRow>\n <TableCell style={{ textAlign: 'center' }} colSpan={2}>\n Histogram Sample\n </TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n <TableRow>\n <TableCell>Range</TableCell>\n <TableCell>Count</TableCell>\n </TableRow>\n {h.buckets?.map((b: BucketTuple, i: number) => (\n <TableRow key={i}>\n <TableCell>{bucketRangeString(b)}</TableCell>\n <TableCell>{b[3]}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n);\n"],"names":["useMemo","Alert","Box","Stack","Table","TableBody","TableCell","TableHead","TableRow","Typography","SeriesName","EmbeddedPanel","MAX_FORMATTABLE_SERIES","DataTable","queryResults","series","flatMap","d","data","rows","buildRows","length","sx","display","justifyContent","alignItems","height","severity","className","isFormatted","map","s","seriesIdx","displayTimeStamps","values","valuesAndTimes","v","valIdx","span","histogramsAndTimes","histograms","seriesQueryResult","h","hisIdx","width","kind","spec","unit","flexDirection","count","sum","histogramTable","style","whiteSpace","name","formattedName","labels","leftDelim","br","rightDelim","bucketRangeString","boundaryRule","leftBoundary","rightBoundary","textAlign","colSpan","buckets","b","i"],"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,SAAkCA,OAAO,QAAQ,QAAQ;AACzD,SAASC,KAAK,EAAEC,GAAG,EAAEC,KAAK,EAAEC,KAAK,EAAEC,SAAS,EAAEC,SAAS,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,gBAAgB;AAGhH,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,aAAa,QAAQ,kBAAkB;AAEhD,MAAMC,yBAAyB;AAM/B;;;;;;;CAOC,GACD,OAAO,MAAMC,YAAY,CAAC,EAAEC,YAAY,EAAkB;IACxD,MAAMC,SAASf,QAAQ,IAAMc,aAAaE,OAAO,CAAC,CAACC,IAAMA,EAAEC,IAAI,EAAEF,OAAO,CAAC,CAACC,IAAMA,GAAGF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BAAS;wBAAGC,SAAS;kCAAG;;;;0BAK3D,MAAC5D;;kCACC,MAACG;;0CACC,KAACF;0CAAU;;0CACX,KAACA;0CAAU;;;;oBAEZoC,EAAEwB,OAAO,EAAEpC,IAAI,CAACqC,GAAgBC,kBAC/B,MAAC5D;;8CACC,KAACF;8CAAWsD,kBAAkBO;;8CAC9B,KAAC7D;8CAAW6D,CAAC,CAAC,EAAE;;;2BAFHC;;;;OAOrB"}
package/mf-manifest.json CHANGED
@@ -5,11 +5,11 @@
5
5
  "name": "TimeSeriesTable",
6
6
  "type": "app",
7
7
  "buildInfo": {
8
- "buildVersion": "0.10.0",
8
+ "buildVersion": "0.10.1",
9
9
  "buildName": "@perses-dev/timeseries-table-plugin"
10
10
  },
11
11
  "remoteEntry": {
12
- "name": "__mf/js/TimeSeriesTable.5cab3fff.js",
12
+ "name": "__mf/js/TimeSeriesTable.dcf4db64.js",
13
13
  "path": "",
14
14
  "type": "global"
15
15
  },
@@ -20,7 +20,7 @@
20
20
  "api": ""
21
21
  },
22
22
  "globalName": "TimeSeriesTable",
23
- "pluginVersion": "0.19.1",
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/TimeSeriesTable/\"; }"
26
26
  },
@@ -35,7 +35,7 @@
35
35
  "js": {
36
36
  "async": [],
37
37
  "sync": [
38
- "__mf/js/async/3960.6ab28dd0.js"
38
+ "__mf/js/async/6274.a2bf6069.js"
39
39
  ]
40
40
  },
41
41
  "css": {
@@ -54,8 +54,8 @@
54
54
  "js": {
55
55
  "async": [],
56
56
  "sync": [
57
- "__mf/js/async/6770.d29c9af3.js",
58
- "__mf/js/async/694.de4b3cd4.js"
57
+ "__mf/js/async/1616.9128b0ad.js",
58
+ "__mf/js/async/9235.84d86874.js"
59
59
  ]
60
60
  },
61
61
  "css": {
@@ -74,8 +74,8 @@
74
74
  "js": {
75
75
  "async": [],
76
76
  "sync": [
77
- "__mf/js/async/5214.f8a936d3.js",
78
- "__mf/js/async/738.aed331d8.js"
77
+ "__mf/js/async/5587.3a411f0e.js",
78
+ "__mf/js/async/7968.6af57fc4.js"
79
79
  ]
80
80
  },
81
81
  "css": {
@@ -87,14 +87,14 @@
87
87
  {
88
88
  "id": "TimeSeriesTable:@perses-dev/components",
89
89
  "name": "@perses-dev/components",
90
- "version": "0.52.0",
90
+ "version": "0.53.0-beta.2",
91
91
  "singleton": true,
92
- "requiredVersion": "^0.52.0",
92
+ "requiredVersion": "^0.53.0-beta.2",
93
93
  "assets": {
94
94
  "js": {
95
95
  "async": [],
96
96
  "sync": [
97
- "__mf/js/async/3288.ad1ec88e.js"
97
+ "__mf/js/async/5790.109680a8.js"
98
98
  ]
99
99
  },
100
100
  "css": {
@@ -106,14 +106,14 @@
106
106
  {
107
107
  "id": "TimeSeriesTable:@perses-dev/core",
108
108
  "name": "@perses-dev/core",
109
- "version": "0.52.0",
109
+ "version": "0.53.0-beta.2",
110
110
  "singleton": true,
111
- "requiredVersion": "^0.52.0",
111
+ "requiredVersion": "^0.53.0-beta.2",
112
112
  "assets": {
113
113
  "js": {
114
114
  "async": [],
115
115
  "sync": [
116
- "__mf/js/async/5061.f4a2c42a.js"
116
+ "__mf/js/async/9355.76d84af8.js"
117
117
  ]
118
118
  },
119
119
  "css": {
@@ -125,14 +125,14 @@
125
125
  {
126
126
  "id": "TimeSeriesTable:@perses-dev/dashboards",
127
127
  "name": "@perses-dev/dashboards",
128
- "version": "0.52.0",
128
+ "version": "0.53.0-beta.2",
129
129
  "singleton": true,
130
- "requiredVersion": "^0.52.0",
130
+ "requiredVersion": "^0.53.0-beta.2",
131
131
  "assets": {
132
132
  "js": {
133
133
  "async": [],
134
134
  "sync": [
135
- "__mf/js/async/3391.dd33a872.js"
135
+ "__mf/js/async/1490.d65ef46d.js"
136
136
  ]
137
137
  },
138
138
  "css": {
@@ -144,14 +144,14 @@
144
144
  {
145
145
  "id": "TimeSeriesTable:@perses-dev/plugin-system",
146
146
  "name": "@perses-dev/plugin-system",
147
- "version": "0.52.0",
147
+ "version": "0.53.0-beta.2",
148
148
  "singleton": true,
149
- "requiredVersion": "^0.52.0",
149
+ "requiredVersion": "^0.53.0-beta.2",
150
150
  "assets": {
151
151
  "js": {
152
152
  "async": [],
153
153
  "sync": [
154
- "__mf/js/async/6109.f2d98501.js"
154
+ "__mf/js/async/8252.7b50f677.js"
155
155
  ]
156
156
  },
157
157
  "css": {
@@ -170,7 +170,7 @@
170
170
  "js": {
171
171
  "async": [],
172
172
  "sync": [
173
- "__mf/js/async/4075.81eb38e5.js"
173
+ "__mf/js/async/7192.a68f2ae7.js"
174
174
  ]
175
175
  },
176
176
  "css": {
@@ -189,7 +189,7 @@
189
189
  "js": {
190
190
  "async": [],
191
191
  "sync": [
192
- "__mf/js/async/5409.f5850fb9.js"
192
+ "__mf/js/async/873.84c80238.js"
193
193
  ]
194
194
  },
195
195
  "css": {
@@ -208,7 +208,7 @@
208
208
  "js": {
209
209
  "async": [],
210
210
  "sync": [
211
- "__mf/js/async/5981.1321459e.js"
211
+ "__mf/js/async/392.cf8653c1.js"
212
212
  ]
213
213
  },
214
214
  "css": {
@@ -227,7 +227,7 @@
227
227
  "js": {
228
228
  "async": [],
229
229
  "sync": [
230
- "__mf/js/async/9173.c0a91319.js"
230
+ "__mf/js/async/8470.05175ff7.js"
231
231
  ]
232
232
  },
233
233
  "css": {
@@ -246,7 +246,7 @@
246
246
  "js": {
247
247
  "async": [],
248
248
  "sync": [
249
- "__mf/js/async/1964.e8379895.js"
249
+ "__mf/js/async/4121.dba206d9.js"
250
250
  ]
251
251
  },
252
252
  "css": {
@@ -265,8 +265,8 @@
265
265
  "js": {
266
266
  "async": [],
267
267
  "sync": [
268
- "__mf/js/async/1553.e6de2b38.js",
269
- "__mf/js/async/7623.4af707a1.js"
268
+ "__mf/js/async/4077.f3b86639.js",
269
+ "__mf/js/async/6458.15500279.js"
270
270
  ]
271
271
  },
272
272
  "css": {
@@ -285,7 +285,7 @@
285
285
  "js": {
286
286
  "async": [],
287
287
  "sync": [
288
- "__mf/js/async/7740.1883bdd9.js"
288
+ "__mf/js/async/7978.91d4d06a.js"
289
289
  ]
290
290
  },
291
291
  "css": {
@@ -303,29 +303,28 @@
303
303
  "assets": {
304
304
  "js": {
305
305
  "sync": [
306
- "__mf/js/async/4162.c4ff6149.js",
307
- "__mf/js/async/3957.d7ae436a.js",
308
- "__mf/js/async/__federation_expose_TimeSeriesTable.a1506383.js"
306
+ "__mf/js/async/6517.c68cf337.js",
307
+ "__mf/js/async/383.737ba616.js",
308
+ "__mf/js/async/__federation_expose_TimeSeriesTable.ffca818d.js"
309
309
  ],
310
310
  "async": [
311
- "__mf/js/async/lib-router.9b92565d.js",
312
- "__mf/js/async/6292.10c49829.js",
313
- "__mf/js/async/7557.1d9dfec0.js",
314
- "__mf/js/async/9200.9f82e7b2.js",
315
- "__mf/js/async/7482.8f69a947.js",
316
- "__mf/js/async/4238.84860856.js",
317
- "__mf/js/async/3224.ef58dd81.js",
318
- "__mf/js/async/1143.c1a3fae7.js",
319
- "__mf/js/async/5377.d0550808.js",
320
- "__mf/js/async/2292.af6c5129.js",
321
- "__mf/js/async/4062.06d99d86.js"
311
+ "__mf/js/async/lib-router.4afa3869.js",
312
+ "__mf/js/async/8356.ab75baaf.js",
313
+ "__mf/js/async/2710.135d1c9a.js",
314
+ "__mf/js/async/2757.0345b149.js",
315
+ "__mf/js/async/7452.1003e5e8.js",
316
+ "__mf/js/async/9588.b67a10d7.js",
317
+ "__mf/js/async/5071.c6ed8044.js",
318
+ "__mf/js/async/7417.abe3c9e4.js",
319
+ "__mf/js/async/2043.25c4bdae.js",
320
+ "__mf/js/async/9558.1a195bd1.js"
322
321
  ]
323
322
  },
324
323
  "css": {
325
324
  "sync": [],
326
325
  "async": [
327
- "__mf/css/async/5263.53436797.css",
328
- "__mf/css/async/2341.53436797.css"
326
+ "__mf/css/async/7823.d3010b86.css",
327
+ "__mf/css/async/3061.d3010b86.css"
329
328
  ]
330
329
  }
331
330
  },