@perses-dev/scatter-chart-plugin 0.6.0

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/LICENSE +201 -0
  2. package/README.md +41 -0
  3. package/__mf/css/async/341.9c79ef64.css +1 -0
  4. package/__mf/css/async/564.9c79ef64.css +1 -0
  5. package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
  6. package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
  7. package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
  8. package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
  9. package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
  10. package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
  11. package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
  12. package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
  13. package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
  14. package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
  15. package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
  16. package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
  17. package/__mf/js/527.d3310177.js +2 -0
  18. package/__mf/js/527.d3310177.js.LICENSE.txt +24 -0
  19. package/__mf/js/792.6224e3b1.js +6 -0
  20. package/__mf/js/792.6224e3b1.js.LICENSE.txt +9 -0
  21. package/__mf/js/ScatterChart.907123a8.js +5 -0
  22. package/__mf/js/async/150.4fc9e087.js +2 -0
  23. package/__mf/js/async/150.4fc9e087.js.LICENSE.txt +21 -0
  24. package/__mf/js/async/156.c11b1700.js +1 -0
  25. package/__mf/js/async/173.c19d3b98.js +2 -0
  26. package/__mf/js/async/173.c19d3b98.js.LICENSE.txt +19 -0
  27. package/__mf/js/async/507.3d416130.js +174 -0
  28. package/__mf/js/async/507.3d416130.js.LICENSE.txt +55 -0
  29. package/__mf/js/async/564.e5b95c38.js +2 -0
  30. package/__mf/js/async/564.e5b95c38.js.LICENSE.txt +9 -0
  31. package/__mf/js/async/651.791f807e.js +1 -0
  32. package/__mf/js/async/694.903128f9.js +1 -0
  33. package/__mf/js/async/740.c78d3483.js +1 -0
  34. package/__mf/js/async/75.06e41df4.js +1 -0
  35. package/__mf/js/async/770.da7255d0.js +1 -0
  36. package/__mf/js/async/960.e791a996.js +2 -0
  37. package/__mf/js/async/960.e791a996.js.LICENSE.txt +8 -0
  38. package/__mf/js/async/964.34b88a18.js +2 -0
  39. package/__mf/js/async/964.34b88a18.js.LICENSE.txt +9 -0
  40. package/__mf/js/async/__federation_expose_ScatterChart.9e6627ee.js +2 -0
  41. package/__mf/js/async/__federation_expose_ScatterChart.9e6627ee.js.LICENSE.txt +9 -0
  42. package/__mf/js/index.b48f09c4.js +1 -0
  43. package/lib/ScatterChart.d.ts +8 -0
  44. package/lib/ScatterChart.d.ts.map +1 -0
  45. package/lib/ScatterChart.js +27 -0
  46. package/lib/ScatterChart.js.map +1 -0
  47. package/lib/ScatterChartPanel.d.ts +37 -0
  48. package/lib/ScatterChartPanel.d.ts.map +1 -0
  49. package/lib/ScatterChartPanel.js +182 -0
  50. package/lib/ScatterChartPanel.js.map +1 -0
  51. package/lib/Scatterplot.d.ts +11 -0
  52. package/lib/Scatterplot.d.ts.map +1 -0
  53. package/lib/Scatterplot.js +113 -0
  54. package/lib/Scatterplot.js.map +1 -0
  55. package/lib/bootstrap.d.ts +2 -0
  56. package/lib/bootstrap.d.ts.map +1 -0
  57. package/lib/bootstrap.js +19 -0
  58. package/lib/bootstrap.js.map +1 -0
  59. package/lib/cjs/ScatterChart.js +33 -0
  60. package/lib/cjs/ScatterChartPanel.js +183 -0
  61. package/lib/cjs/Scatterplot.js +121 -0
  62. package/lib/cjs/bootstrap.js +26 -0
  63. package/lib/cjs/env.d.js +14 -0
  64. package/lib/cjs/getPluginModule.js +27 -0
  65. package/lib/cjs/index-federation.js +55 -0
  66. package/lib/cjs/index.js +28 -0
  67. package/lib/cjs/mock-trace-data.js +145 -0
  68. package/lib/cjs/scatter-chart-model.js +25 -0
  69. package/lib/cjs/setup-tests.js +19 -0
  70. package/lib/env.d.js +15 -0
  71. package/lib/env.d.js.map +1 -0
  72. package/lib/getPluginModule.d.ts +6 -0
  73. package/lib/getPluginModule.d.ts.map +1 -0
  74. package/lib/getPluginModule.js +16 -0
  75. package/lib/getPluginModule.js.map +1 -0
  76. package/lib/index-federation.d.ts +1 -0
  77. package/lib/index-federation.d.ts.map +1 -0
  78. package/lib/index-federation.js +15 -0
  79. package/lib/index-federation.js.map +1 -0
  80. package/lib/index.d.ts +6 -0
  81. package/lib/index.d.ts.map +1 -0
  82. package/lib/index.js +7 -0
  83. package/lib/index.js.map +1 -0
  84. package/lib/mock-trace-data.d.ts +88 -0
  85. package/lib/mock-trace-data.d.ts.map +1 -0
  86. package/lib/mock-trace-data.js +129 -0
  87. package/lib/mock-trace-data.js.map +1 -0
  88. package/lib/scatter-chart-model.d.ts +14 -0
  89. package/lib/scatter-chart-model.d.ts.map +1 -0
  90. package/lib/scatter-chart-model.js +19 -0
  91. package/lib/scatter-chart-model.js.map +1 -0
  92. package/lib/setup-tests.d.ts +2 -0
  93. package/lib/setup-tests.d.ts.map +1 -0
  94. package/lib/setup-tests.js +17 -0
  95. package/lib/setup-tests.js.map +1 -0
  96. package/mf-manifest.json +212 -0
  97. package/mf-stats.json +235 -0
  98. package/package.json +55 -0
@@ -0,0 +1,121 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "Scatterplot", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return Scatterplot;
21
+ }
22
+ });
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _react = require("react");
25
+ const _components = require("@perses-dev/components");
26
+ const _core = require("echarts/core");
27
+ const _charts = require("echarts/charts");
28
+ const _components1 = require("echarts/components");
29
+ const _renderers = require("echarts/renderers");
30
+ const _core1 = require("@perses-dev/core");
31
+ (0, _core.use)([
32
+ _components1.DatasetComponent,
33
+ _components1.DataZoomComponent,
34
+ _components1.LegendComponent,
35
+ _charts.ScatterChart,
36
+ _components1.GridComponent,
37
+ _components1.TitleComponent,
38
+ _components1.TooltipComponent,
39
+ _renderers.CanvasRenderer
40
+ ]);
41
+ const DATE_FORMATTER = new Intl.DateTimeFormat(undefined, {
42
+ dateStyle: 'long',
43
+ timeStyle: 'medium'
44
+ }).format;
45
+ function Scatterplot(props) {
46
+ const { width, height, options, onClick } = props;
47
+ const chartsTheme = (0, _components.useChartsTheme)();
48
+ // Apache EChart Options Docs: https://echarts.apache.org/en/option.html
49
+ const eChartOptions = {
50
+ dataset: options.dataset,
51
+ series: options.series,
52
+ dataZoom: options.dataZoom,
53
+ grid: {
54
+ bottom: 40,
55
+ top: 50,
56
+ left: 50,
57
+ right: 100
58
+ },
59
+ xAxis: {
60
+ type: 'time',
61
+ name: 'Local Time'
62
+ },
63
+ yAxis: {
64
+ scale: true,
65
+ type: 'value',
66
+ name: 'Duration',
67
+ axisLabel: {
68
+ formatter: (durationMs)=>(0, _core1.formatValue)(durationMs, {
69
+ unit: 'milliseconds'
70
+ })
71
+ }
72
+ },
73
+ animation: false,
74
+ tooltip: {
75
+ padding: 5,
76
+ borderWidth: 1,
77
+ trigger: 'axis',
78
+ axisPointer: {
79
+ type: 'cross'
80
+ },
81
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
82
+ formatter: function(params) {
83
+ // TODO: import type from ECharts instead of using any
84
+ const data = params[0].data;
85
+ return [
86
+ `<b>Service name</b>: ${data.rootServiceName}<br/>`,
87
+ `<b>Span name</b>: ${data.rootTraceName}<br/>`,
88
+ `<b>Time</b>: ${DATE_FORMATTER(data.startTime)}<br/>`,
89
+ `<b>Duration</b>: ${(0, _core1.formatValue)(data.durationMs, {
90
+ unit: 'milliseconds'
91
+ })}<br/>`,
92
+ `<b>Span count</b>: ${data.spanCount} (${data.errorCount} errors)<br/>`
93
+ ].join('');
94
+ }
95
+ },
96
+ legend: {
97
+ show: true,
98
+ type: 'scroll',
99
+ orient: 'horizontal',
100
+ bottom: 0
101
+ }
102
+ };
103
+ const handleEvents = (0, _react.useMemo)(()=>{
104
+ const handlers = {};
105
+ if (onClick) {
106
+ handlers.click = (params)=>onClick(params.data);
107
+ }
108
+ return handlers;
109
+ }, [
110
+ onClick
111
+ ]);
112
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.EChart, {
113
+ sx: {
114
+ width: width,
115
+ height: height
116
+ },
117
+ option: eChartOptions,
118
+ theme: chartsTheme.echartsTheme,
119
+ onEvents: handleEvents
120
+ });
121
+ }
@@ -0,0 +1,26 @@
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
+ const _jsxruntime = require("react/jsx-runtime");
18
+ const _react = /*#__PURE__*/ _interop_require_default(require("react"));
19
+ const _client = /*#__PURE__*/ _interop_require_default(require("react-dom/client"));
20
+ function _interop_require_default(obj) {
21
+ return obj && obj.__esModule ? obj : {
22
+ default: obj
23
+ };
24
+ }
25
+ const root = _client.default.createRoot(document.getElementById('root'));
26
+ root.render(/*#__PURE__*/ (0, _jsxruntime.jsx)(_react.default.StrictMode, {}));
@@ -0,0 +1,14 @@
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
+ /// <reference types="@rsbuild/core/types" />
14
+ "use strict";
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "getPluginModule", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return getPluginModule;
9
+ }
10
+ });
11
+ const _packagejson = /*#__PURE__*/ _interop_require_default(require("../package.json"));
12
+ function _interop_require_default(obj) {
13
+ return obj && obj.__esModule ? obj : {
14
+ default: obj
15
+ };
16
+ }
17
+ function getPluginModule() {
18
+ const { name, version, perses } = _packagejson.default;
19
+ return {
20
+ kind: 'PluginModule',
21
+ metadata: {
22
+ name,
23
+ version
24
+ },
25
+ spec: perses
26
+ };
27
+ }
@@ -0,0 +1,55 @@
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
+ function _getRequireWildcardCache(nodeInterop) {
15
+ if (typeof WeakMap !== "function") return null;
16
+ var cacheBabelInterop = new WeakMap();
17
+ var cacheNodeInterop = new WeakMap();
18
+ return (_getRequireWildcardCache = function(nodeInterop) {
19
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
20
+ })(nodeInterop);
21
+ }
22
+ function _interop_require_wildcard(obj, nodeInterop) {
23
+ if (!nodeInterop && obj && obj.__esModule) {
24
+ return obj;
25
+ }
26
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
27
+ return {
28
+ default: obj
29
+ };
30
+ }
31
+ var cache = _getRequireWildcardCache(nodeInterop);
32
+ if (cache && cache.has(obj)) {
33
+ return cache.get(obj);
34
+ }
35
+ var newObj = {
36
+ __proto__: null
37
+ };
38
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
39
+ for(var key in obj){
40
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
41
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
42
+ if (desc && (desc.get || desc.set)) {
43
+ Object.defineProperty(newObj, key, desc);
44
+ } else {
45
+ newObj[key] = obj[key];
46
+ }
47
+ }
48
+ }
49
+ newObj.default = obj;
50
+ if (cache) {
51
+ cache.set(obj, newObj);
52
+ }
53
+ return newObj;
54
+ }
55
+ Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./bootstrap")));
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "getPluginModule", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _getPluginModule.getPluginModule;
9
+ }
10
+ });
11
+ const _getPluginModule = require("./getPluginModule");
12
+ _export_star(require("./scatter-chart-model"), exports);
13
+ _export_star(require("./ScatterChart"), exports);
14
+ _export_star(require("./ScatterChartPanel"), exports);
15
+ _export_star(require("./Scatterplot"), exports);
16
+ function _export_star(from, to) {
17
+ Object.keys(from).forEach(function(k) {
18
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
19
+ Object.defineProperty(to, k, {
20
+ enumerable: true,
21
+ get: function() {
22
+ return from[k];
23
+ }
24
+ });
25
+ }
26
+ });
27
+ return from;
28
+ }
@@ -0,0 +1,145 @@
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
+ 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
+ MOCK_TRACE_SEARCH_RESULT: function() {
25
+ return MOCK_TRACE_SEARCH_RESULT;
26
+ },
27
+ MOCK_TRACE_SEARCH_RESULT_EMPTY: function() {
28
+ return MOCK_TRACE_SEARCH_RESULT_EMPTY;
29
+ },
30
+ MOCK_TRACE_SEARCH_RESULT_QUERY_RESULT: function() {
31
+ return MOCK_TRACE_SEARCH_RESULT_QUERY_RESULT;
32
+ },
33
+ MOCK_TRACE_SEARCH_RESULT_QUERY_RESULT_EMPTY: function() {
34
+ return MOCK_TRACE_SEARCH_RESULT_QUERY_RESULT_EMPTY;
35
+ }
36
+ });
37
+ const MOCK_TRACE_SEARCH_RESULT = {
38
+ searchResult: [
39
+ {
40
+ startTimeUnixMs: 1702915645000,
41
+ durationMs: 100,
42
+ serviceStats: {
43
+ 'service-name': {
44
+ spanCount: 10
45
+ },
46
+ 'second-service-name': {
47
+ spanCount: 3,
48
+ errorCount: 2
49
+ }
50
+ },
51
+ traceId: '123',
52
+ rootServiceName: 'service-name',
53
+ rootTraceName: 'span-name'
54
+ }
55
+ ],
56
+ metadata: {
57
+ executedQueryString: '{duration > 500ms}'
58
+ }
59
+ };
60
+ const MOCK_TRACE_SEARCH_RESULT_EMPTY = {
61
+ searchResult: [],
62
+ metadata: {
63
+ executedQueryString: '{duration > 500ms}'
64
+ }
65
+ };
66
+ const MOCK_TRACE_SEARCH_RESULT_QUERY_RESULT = [
67
+ {
68
+ status: 'success',
69
+ fetchStatus: 'idle',
70
+ isLoading: false,
71
+ isSuccess: true,
72
+ isError: false,
73
+ data: MOCK_TRACE_SEARCH_RESULT,
74
+ dataUpdatedAt: 1666500979895,
75
+ definition: {
76
+ kind: 'TraceQuery',
77
+ spec: {
78
+ plugin: {
79
+ kind: 'TempoTraceQuery',
80
+ spec: {
81
+ query: '{}',
82
+ datasource: {
83
+ kind: 'TempoDatasource',
84
+ name: 'tempolocal'
85
+ }
86
+ }
87
+ }
88
+ }
89
+ },
90
+ error: null,
91
+ errorUpdatedAt: 0,
92
+ failureCount: 0,
93
+ errorUpdateCount: 0,
94
+ isFetched: true,
95
+ isFetchedAfterMount: true,
96
+ isFetching: false,
97
+ isRefetching: false,
98
+ isLoadingError: false,
99
+ isPaused: false,
100
+ isPlaceholderData: false,
101
+ isPreviousData: false,
102
+ isRefetchError: false,
103
+ isStale: true
104
+ }
105
+ ];
106
+ const MOCK_TRACE_SEARCH_RESULT_QUERY_RESULT_EMPTY = [
107
+ {
108
+ status: 'success',
109
+ fetchStatus: 'idle',
110
+ isLoading: false,
111
+ isSuccess: true,
112
+ isError: false,
113
+ data: MOCK_TRACE_SEARCH_RESULT_EMPTY,
114
+ dataUpdatedAt: 1666500979895,
115
+ definition: {
116
+ kind: 'TraceQuery',
117
+ spec: {
118
+ plugin: {
119
+ kind: 'TempoTraceQuery',
120
+ spec: {
121
+ query: '{}',
122
+ datasource: {
123
+ kind: 'TempoDatasource',
124
+ name: 'tempolocal'
125
+ }
126
+ }
127
+ }
128
+ }
129
+ },
130
+ error: null,
131
+ errorUpdatedAt: 0,
132
+ failureCount: 0,
133
+ errorUpdateCount: 0,
134
+ isFetched: true,
135
+ isFetchedAfterMount: true,
136
+ isFetching: false,
137
+ isRefetching: false,
138
+ isLoadingError: false,
139
+ isPaused: false,
140
+ isPlaceholderData: false,
141
+ isPreviousData: false,
142
+ isRefetchError: false,
143
+ isStale: true
144
+ }
145
+ ];
@@ -0,0 +1,25 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "createInitialScatterChartOptions", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return createInitialScatterChartOptions;
21
+ }
22
+ });
23
+ function createInitialScatterChartOptions() {
24
+ return {};
25
+ }
@@ -0,0 +1,19 @@
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
+ require("@testing-library/jest-dom");
18
+ // Always mock e-charts during tests since we don't have a proper canvas in jsdom
19
+ jest.mock('echarts/core');
package/lib/env.d.js ADDED
@@ -0,0 +1,15 @@
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
+ /// <reference types="@rsbuild/core/types" />
14
+
15
+ //# sourceMappingURL=env.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/env.d.ts"],"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\n/// <reference types=\"@rsbuild/core/types\" />\n"],"names":[],"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,6CAA6C"}
@@ -0,0 +1,6 @@
1
+ import { PluginModuleResource } from '@perses-dev/plugin-system';
2
+ /**
3
+ * Returns the plugin module information from package.json
4
+ */
5
+ export declare function getPluginModule(): PluginModuleResource;
6
+ //# sourceMappingURL=getPluginModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPluginModule.d.ts","sourceRoot":"","sources":["../../src/getPluginModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAoB,MAAM,2BAA2B,CAAC;AAGnF;;GAEG;AACH,wBAAgB,eAAe,IAAI,oBAAoB,CAUtD"}
@@ -0,0 +1,16 @@
1
+ import packageJson from '../package.json';
2
+ /**
3
+ * Returns the plugin module information from package.json
4
+ */ export function getPluginModule() {
5
+ const { name, version, perses } = packageJson;
6
+ return {
7
+ kind: 'PluginModule',
8
+ metadata: {
9
+ name,
10
+ version
11
+ },
12
+ spec: perses
13
+ };
14
+ }
15
+
16
+ //# sourceMappingURL=getPluginModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/getPluginModule.ts"],"sourcesContent":["import { PluginModuleResource, PluginModuleSpec } from '@perses-dev/plugin-system';\nimport packageJson from '../package.json';\n\n/**\n * Returns the plugin module information from package.json\n */\nexport function getPluginModule(): PluginModuleResource {\n const { name, version, perses } = packageJson;\n return {\n kind: 'PluginModule',\n metadata: {\n name,\n version,\n },\n spec: perses as PluginModuleSpec,\n };\n}\n"],"names":["packageJson","getPluginModule","name","version","perses","kind","metadata","spec"],"mappings":"AACA,OAAOA,iBAAiB,kBAAkB;AAE1C;;CAEC,GACD,OAAO,SAASC;IACd,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGJ;IAClC,OAAO;QACLK,MAAM;QACNC,UAAU;YACRJ;YACAC;QACF;QACAI,MAAMH;IACR;AACF"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index-federation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-federation.d.ts","sourceRoot":"","sources":["../../src/index-federation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
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
+ import('./bootstrap');
14
+
15
+ //# sourceMappingURL=index-federation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index-federation.ts"],"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('./bootstrap');\n"],"names":[],"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,MAAM,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export { getPluginModule } from './getPluginModule';
2
+ export * from './scatter-chart-model';
3
+ export * from './ScatterChart';
4
+ export * from './ScatterChartPanel';
5
+ export * from './Scatterplot';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export { getPluginModule } from './getPluginModule';
2
+ export * from './scatter-chart-model';
3
+ export * from './ScatterChart';
4
+ export * from './ScatterChartPanel';
5
+ export * from './Scatterplot';
6
+
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { getPluginModule } from './getPluginModule';\nexport * from './scatter-chart-model';\nexport * from './ScatterChart';\nexport * from './ScatterChartPanel';\nexport * from './Scatterplot';\n"],"names":["getPluginModule"],"mappings":"AAAA,SAASA,eAAe,QAAQ,oBAAoB;AACpD,cAAc,wBAAwB;AACtC,cAAc,iBAAiB;AAC/B,cAAc,sBAAsB;AACpC,cAAc,gBAAgB"}
@@ -0,0 +1,88 @@
1
+ import { TraceData } from '@perses-dev/core';
2
+ /**
3
+ * Mock data we get from getTraceData() in @perses/tempo-plugin.
4
+ */
5
+ export declare const MOCK_TRACE_SEARCH_RESULT: TraceData;
6
+ export declare const MOCK_TRACE_SEARCH_RESULT_EMPTY: TraceData;
7
+ /**
8
+ * Mocks results obtained from useTraceQueries() in @perses/plugin-system/runtime.
9
+ * This function uses then React TanStack function useQueries(fooQuery) to
10
+ * handle fetching.
11
+ */
12
+ export declare const MOCK_TRACE_SEARCH_RESULT_QUERY_RESULT: {
13
+ status: string;
14
+ fetchStatus: string;
15
+ isLoading: boolean;
16
+ isSuccess: boolean;
17
+ isError: boolean;
18
+ data: TraceData;
19
+ dataUpdatedAt: number;
20
+ definition: {
21
+ kind: string;
22
+ spec: {
23
+ plugin: {
24
+ kind: string;
25
+ spec: {
26
+ query: string;
27
+ datasource: {
28
+ kind: string;
29
+ name: string;
30
+ };
31
+ };
32
+ };
33
+ };
34
+ };
35
+ error: null;
36
+ errorUpdatedAt: number;
37
+ failureCount: number;
38
+ errorUpdateCount: number;
39
+ isFetched: boolean;
40
+ isFetchedAfterMount: boolean;
41
+ isFetching: boolean;
42
+ isRefetching: boolean;
43
+ isLoadingError: boolean;
44
+ isPaused: boolean;
45
+ isPlaceholderData: boolean;
46
+ isPreviousData: boolean;
47
+ isRefetchError: boolean;
48
+ isStale: boolean;
49
+ }[];
50
+ export declare const MOCK_TRACE_SEARCH_RESULT_QUERY_RESULT_EMPTY: {
51
+ status: string;
52
+ fetchStatus: string;
53
+ isLoading: boolean;
54
+ isSuccess: boolean;
55
+ isError: boolean;
56
+ data: TraceData;
57
+ dataUpdatedAt: number;
58
+ definition: {
59
+ kind: string;
60
+ spec: {
61
+ plugin: {
62
+ kind: string;
63
+ spec: {
64
+ query: string;
65
+ datasource: {
66
+ kind: string;
67
+ name: string;
68
+ };
69
+ };
70
+ };
71
+ };
72
+ };
73
+ error: null;
74
+ errorUpdatedAt: number;
75
+ failureCount: number;
76
+ errorUpdateCount: number;
77
+ isFetched: boolean;
78
+ isFetchedAfterMount: boolean;
79
+ isFetching: boolean;
80
+ isRefetching: boolean;
81
+ isLoadingError: boolean;
82
+ isPaused: boolean;
83
+ isPlaceholderData: boolean;
84
+ isPreviousData: boolean;
85
+ isRefetchError: boolean;
86
+ isStale: boolean;
87
+ }[];
88
+ //# sourceMappingURL=mock-trace-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-trace-data.d.ts","sourceRoot":"","sources":["../../src/mock-trace-data.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,SAsBtC,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,SAK5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCjD,CAAC;AAEF,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCvD,CAAC"}