@perses-dev/histogram-chart-plugin 0.9.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.
- package/LICENSE +201 -0
- package/README.md +23 -0
- package/__mf/css/async/341.1e19d050.css +1 -0
- package/__mf/css/async/759.1e19d050.css +1 -0
- package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
- package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
- package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
- package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
- package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
- package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
- package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
- package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
- package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
- package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
- package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
- package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
- package/__mf/js/HistogramChart.93af6e55.js +5 -0
- package/__mf/js/async/173.1e8a2c14.js +2 -0
- package/__mf/js/async/173.1e8a2c14.js.LICENSE.txt +19 -0
- package/__mf/js/async/293.280a8f4f.js +1 -0
- package/__mf/js/async/39.719defa2.js +144 -0
- package/__mf/js/async/39.719defa2.js.LICENSE.txt +21 -0
- package/__mf/js/async/774.b18c4a5c.js +1 -0
- package/__mf/js/async/790.15c77240.js +1 -0
- package/__mf/js/async/814.7ccaa658.js +10 -0
- package/__mf/js/async/814.7ccaa658.js.LICENSE.txt +61 -0
- package/__mf/js/async/863.bd42f0c4.js +2 -0
- package/__mf/js/async/863.bd42f0c4.js.LICENSE.txt +9 -0
- package/__mf/js/async/934.27722fd3.js +2 -0
- package/__mf/js/async/934.27722fd3.js.LICENSE.txt +37 -0
- package/__mf/js/async/964.b6419e33.js +2 -0
- package/__mf/js/async/964.b6419e33.js.LICENSE.txt +9 -0
- package/__mf/js/async/981.b29ba452.js +2 -0
- package/__mf/js/async/981.b29ba452.js.LICENSE.txt +8 -0
- package/__mf/js/async/__federation_expose_HistogramChart.d98de268.js +1 -0
- package/__mf/js/main.534b29fb.js +5 -0
- package/lib/HistogramChart.d.ts +8 -0
- package/lib/HistogramChart.d.ts.map +1 -0
- package/lib/HistogramChart.js +34 -0
- package/lib/HistogramChart.js.map +1 -0
- package/lib/bootstrap.d.ts +2 -0
- package/lib/bootstrap.d.ts.map +1 -0
- package/lib/bootstrap.js +19 -0
- package/lib/bootstrap.js.map +1 -0
- package/lib/cjs/HistogramChart.js +40 -0
- package/lib/cjs/bootstrap.js +26 -0
- package/lib/cjs/components/HistogramChart.js +154 -0
- package/lib/cjs/components/HistogramChartOptionsEditorSettings.js +120 -0
- package/lib/cjs/components/HistogramChartPanel.js +103 -0
- package/lib/cjs/components/index.js +32 -0
- package/lib/cjs/env.d.js +14 -0
- package/lib/cjs/getPluginModule.js +27 -0
- package/lib/cjs/histogram-chart-model.js +60 -0
- package/lib/cjs/index-federation.js +55 -0
- package/lib/cjs/index.js +47 -0
- package/lib/cjs/setup-tests.js +19 -0
- package/lib/cjs/utils/index.js +30 -0
- package/lib/cjs/utils/thresholds.js +22 -0
- package/lib/components/HistogramChart.d.ts +16 -0
- package/lib/components/HistogramChart.d.ts.map +1 -0
- package/lib/components/HistogramChart.js +146 -0
- package/lib/components/HistogramChart.js.map +1 -0
- package/lib/components/HistogramChartOptionsEditorSettings.d.ts +4 -0
- package/lib/components/HistogramChartOptionsEditorSettings.d.ts.map +1 -0
- package/lib/components/HistogramChartOptionsEditorSettings.js +107 -0
- package/lib/components/HistogramChartOptionsEditorSettings.js.map +1 -0
- package/lib/components/HistogramChartPanel.d.ts +7 -0
- package/lib/components/HistogramChartPanel.d.ts.map +1 -0
- package/lib/components/HistogramChartPanel.js +90 -0
- package/lib/components/HistogramChartPanel.js.map +1 -0
- package/lib/components/index.d.ts +4 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +17 -0
- package/lib/components/index.js.map +1 -0
- package/lib/env.d.js +15 -0
- package/lib/env.d.js.map +1 -0
- package/lib/getPluginModule.d.ts +6 -0
- package/lib/getPluginModule.d.ts.map +1 -0
- package/lib/getPluginModule.js +16 -0
- package/lib/getPluginModule.js.map +1 -0
- package/lib/histogram-chart-model.d.ts +29 -0
- package/lib/histogram-chart-model.d.ts.map +1 -0
- package/lib/histogram-chart-model.js +31 -0
- package/lib/histogram-chart-model.js.map +1 -0
- package/lib/index-federation.d.ts +1 -0
- package/lib/index-federation.d.ts.map +1 -0
- package/lib/index-federation.js +15 -0
- package/lib/index-federation.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/lib/setup-tests.d.ts +2 -0
- package/lib/setup-tests.d.ts.map +1 -0
- package/lib/setup-tests.js +17 -0
- package/lib/setup-tests.js.map +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/index.js +15 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/thresholds.d.ts +4 -0
- package/lib/utils/thresholds.d.ts.map +1 -0
- package/lib/utils/thresholds.js +14 -0
- package/lib/utils/thresholds.js.map +1 -0
- package/mf-manifest.json +169 -0
- package/mf-stats.json +199 -0
- package/package.json +55 -0
|
@@ -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,29 @@
|
|
|
1
|
+
import { Definition, FormatOptions, ThresholdOptions } from '@perses-dev/core';
|
|
2
|
+
import { OptionsEditorProps } from '@perses-dev/plugin-system';
|
|
3
|
+
export declare const DEFAULT_FORMAT: FormatOptions;
|
|
4
|
+
export declare const DEFAULT_THRESHOLDS: ThresholdOptions;
|
|
5
|
+
export declare const DEFAULT_MIN_PERCENT = 0;
|
|
6
|
+
export declare const DEFAULT_MAX_PERCENT = 100;
|
|
7
|
+
export declare const DEFAULT_MIN_PERCENT_DECIMAL = 0;
|
|
8
|
+
export declare const DEFAULT_MAX_PERCENT_DECIMAL = 1;
|
|
9
|
+
/**
|
|
10
|
+
* The schema for a HistogramChart panel.
|
|
11
|
+
*/
|
|
12
|
+
export interface HistogramChartDefinition extends Definition<HistogramChartOptions> {
|
|
13
|
+
kind: 'HistogramChart';
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The Options object type supported by the HistogramChart panel plugin.
|
|
17
|
+
*/
|
|
18
|
+
export interface HistogramChartOptions {
|
|
19
|
+
format?: FormatOptions;
|
|
20
|
+
min?: number;
|
|
21
|
+
max?: number;
|
|
22
|
+
thresholds?: ThresholdOptions;
|
|
23
|
+
}
|
|
24
|
+
export type HistogramChartOptionsEditorProps = OptionsEditorProps<HistogramChartOptions>;
|
|
25
|
+
/**
|
|
26
|
+
* Creates the initial/empty options for a HistogramChart panel.
|
|
27
|
+
*/
|
|
28
|
+
export declare function createInitialHistogramChartOptions(): HistogramChartOptions;
|
|
29
|
+
//# sourceMappingURL=histogram-chart-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"histogram-chart-model.d.ts","sourceRoot":"","sources":["../../src/histogram-chart-model.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,eAAO,MAAM,cAAc,EAAE,aAAmC,CAAC;AACjE,eAAO,MAAM,kBAAkB,EAAE,gBAA8C,CAAC;AAChF,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAC7C,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,UAAU,CAAC,qBAAqB,CAAC;IACjF,IAAI,EAAE,gBAAgB,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B;AAED,MAAM,MAAM,gCAAgC,GAAG,kBAAkB,CAAC,qBAAqB,CAAC,CAAC;AAEzF;;GAEG;AACH,wBAAgB,kCAAkC,IAAI,qBAAqB,CAI1E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
export const DEFAULT_FORMAT = {
|
|
14
|
+
unit: 'decimal'
|
|
15
|
+
};
|
|
16
|
+
export const DEFAULT_THRESHOLDS = {
|
|
17
|
+
defaultColor: '#56b4e9'
|
|
18
|
+
};
|
|
19
|
+
export const DEFAULT_MIN_PERCENT = 0;
|
|
20
|
+
export const DEFAULT_MAX_PERCENT = 100;
|
|
21
|
+
export const DEFAULT_MIN_PERCENT_DECIMAL = 0;
|
|
22
|
+
export const DEFAULT_MAX_PERCENT_DECIMAL = 1;
|
|
23
|
+
/**
|
|
24
|
+
* Creates the initial/empty options for a HistogramChart panel.
|
|
25
|
+
*/ export function createInitialHistogramChartOptions() {
|
|
26
|
+
return {
|
|
27
|
+
format: DEFAULT_FORMAT
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=histogram-chart-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/histogram-chart-model.ts"],"sourcesContent":["// Copyright 2025 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 { Definition, FormatOptions, ThresholdOptions } from '@perses-dev/core';\nimport { OptionsEditorProps } from '@perses-dev/plugin-system';\n\nexport const DEFAULT_FORMAT: FormatOptions = { unit: 'decimal' };\nexport const DEFAULT_THRESHOLDS: ThresholdOptions = { defaultColor: '#56b4e9' };\nexport const DEFAULT_MIN_PERCENT = 0;\nexport const DEFAULT_MAX_PERCENT = 100;\nexport const DEFAULT_MIN_PERCENT_DECIMAL = 0;\nexport const DEFAULT_MAX_PERCENT_DECIMAL = 1;\n\n/**\n * The schema for a HistogramChart panel.\n */\nexport interface HistogramChartDefinition extends Definition<HistogramChartOptions> {\n kind: 'HistogramChart';\n}\n\n/**\n * The Options object type supported by the HistogramChart panel plugin.\n */\nexport interface HistogramChartOptions {\n format?: FormatOptions;\n min?: number;\n max?: number;\n thresholds?: ThresholdOptions;\n}\n\nexport type HistogramChartOptionsEditorProps = OptionsEditorProps<HistogramChartOptions>;\n\n/**\n * Creates the initial/empty options for a HistogramChart panel.\n */\nexport function createInitialHistogramChartOptions(): HistogramChartOptions {\n return {\n format: DEFAULT_FORMAT,\n };\n}\n"],"names":["DEFAULT_FORMAT","unit","DEFAULT_THRESHOLDS","defaultColor","DEFAULT_MIN_PERCENT","DEFAULT_MAX_PERCENT","DEFAULT_MIN_PERCENT_DECIMAL","DEFAULT_MAX_PERCENT_DECIMAL","createInitialHistogramChartOptions","format"],"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;AAKjC,OAAO,MAAMA,iBAAgC;IAAEC,MAAM;AAAU,EAAE;AACjE,OAAO,MAAMC,qBAAuC;IAAEC,cAAc;AAAU,EAAE;AAChF,OAAO,MAAMC,sBAAsB,EAAE;AACrC,OAAO,MAAMC,sBAAsB,IAAI;AACvC,OAAO,MAAMC,8BAA8B,EAAE;AAC7C,OAAO,MAAMC,8BAA8B,EAAE;AAqB7C;;CAEC,GACD,OAAO,SAASC;IACd,OAAO;QACLC,QAAQT;IACV;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 2025 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 2025 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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
export { getPluginModule } from './getPluginModule';
|
|
14
|
+
export { HistogramChartPanel } from './components';
|
|
15
|
+
export * from './histogram-chart-model';
|
|
16
|
+
export * from './HistogramChart';
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// Copyright 2025 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\nexport { getPluginModule } from './getPluginModule';\nexport { HistogramChartPanel } from './components';\nexport * from './histogram-chart-model';\nexport * from './HistogramChart';\n"],"names":["getPluginModule","HistogramChartPanel"],"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,eAAe,QAAQ,oBAAoB;AACpD,SAASC,mBAAmB,QAAQ,eAAe;AACnD,cAAc,0BAA0B;AACxC,cAAc,mBAAmB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-tests.d.ts","sourceRoot":"","sources":["../../src/setup-tests.ts"],"names":[],"mappings":"AAaA,OAAO,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright 2025 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 '@testing-library/jest-dom';
|
|
14
|
+
// Always mock e-charts during tests since we don't have a proper canvas in jsdom
|
|
15
|
+
jest.mock('echarts/core');
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=setup-tests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/setup-tests.ts"],"sourcesContent":["// Copyright 2025 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 '@testing-library/jest-dom';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\njest.mock('echarts/core');\n"],"names":["jest","mock"],"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,OAAO,4BAA4B;AAEnC,iFAAiF;AACjFA,KAAKC,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
export * from './thresholds';
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/index.ts"],"sourcesContent":["// Copyright 2025 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\nexport * from './thresholds';\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,cAAc,eAAe"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ThresholdOptions } from '@perses-dev/core';
|
|
2
|
+
import { PersesChartsTheme } from '@perses-dev/components';
|
|
3
|
+
export declare function getColorFromThresholds(value: number, thresholds: ThresholdOptions | undefined, chartsTheme: PersesChartsTheme, defaultColor: string): string | null;
|
|
4
|
+
//# sourceMappingURL=thresholds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thresholds.d.ts","sourceRoot":"","sources":["../../../src/utils/thresholds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,gBAAgB,GAAG,SAAS,EACxC,WAAW,EAAE,iBAAiB,EAC9B,YAAY,EAAE,MAAM,GACnB,MAAM,GAAG,IAAI,CAcf"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function getColorFromThresholds(value, thresholds, chartsTheme, defaultColor) {
|
|
2
|
+
if (thresholds?.steps) {
|
|
3
|
+
const matchingColors = thresholds.steps.map((step, index)=>{
|
|
4
|
+
if (value >= step.value) {
|
|
5
|
+
return step.color ?? chartsTheme.thresholds.palette[index] ?? thresholds.defaultColor ?? defaultColor;
|
|
6
|
+
}
|
|
7
|
+
return null;
|
|
8
|
+
}).filter((color)=>color !== null);
|
|
9
|
+
return matchingColors[matchingColors.length - 1] ?? thresholds.defaultColor ?? defaultColor;
|
|
10
|
+
}
|
|
11
|
+
return thresholds?.defaultColor ?? defaultColor;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=thresholds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/thresholds.ts"],"sourcesContent":["import { ThresholdOptions } from '@perses-dev/core';\nimport { PersesChartsTheme } from '@perses-dev/components';\n\nexport function getColorFromThresholds(\n value: number,\n thresholds: ThresholdOptions | undefined,\n chartsTheme: PersesChartsTheme,\n defaultColor: string\n): string | null {\n if (thresholds?.steps) {\n const matchingColors = thresholds.steps\n .map((step, index) => {\n if (value >= step.value) {\n return step.color ?? chartsTheme.thresholds.palette[index] ?? thresholds.defaultColor ?? defaultColor;\n }\n return null;\n })\n .filter((color): color is string => color !== null);\n\n return matchingColors[matchingColors.length - 1] ?? thresholds.defaultColor ?? defaultColor;\n }\n return thresholds?.defaultColor ?? defaultColor;\n}\n"],"names":["getColorFromThresholds","value","thresholds","chartsTheme","defaultColor","steps","matchingColors","map","step","index","color","palette","filter","length"],"mappings":"AAGA,OAAO,SAASA,uBACdC,KAAa,EACbC,UAAwC,EACxCC,WAA8B,EAC9BC,YAAoB;IAEpB,IAAIF,YAAYG,OAAO;QACrB,MAAMC,iBAAiBJ,WAAWG,KAAK,CACpCE,GAAG,CAAC,CAACC,MAAMC;YACV,IAAIR,SAASO,KAAKP,KAAK,EAAE;gBACvB,OAAOO,KAAKE,KAAK,IAAIP,YAAYD,UAAU,CAACS,OAAO,CAACF,MAAM,IAAIP,WAAWE,YAAY,IAAIA;YAC3F;YACA,OAAO;QACT,GACCQ,MAAM,CAAC,CAACF,QAA2BA,UAAU;QAEhD,OAAOJ,cAAc,CAACA,eAAeO,MAAM,GAAG,EAAE,IAAIX,WAAWE,YAAY,IAAIA;IACjF;IACA,OAAOF,YAAYE,gBAAgBA;AACrC"}
|
package/mf-manifest.json
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "HistogramChart",
|
|
3
|
+
"name": "HistogramChart",
|
|
4
|
+
"metaData": {
|
|
5
|
+
"name": "HistogramChart",
|
|
6
|
+
"type": "app",
|
|
7
|
+
"buildInfo": {
|
|
8
|
+
"buildVersion": "0.9.0",
|
|
9
|
+
"buildName": "@perses-dev/histogram-chart-plugin"
|
|
10
|
+
},
|
|
11
|
+
"remoteEntry": {
|
|
12
|
+
"name": "__mf/js/HistogramChart.93af6e55.js",
|
|
13
|
+
"path": "",
|
|
14
|
+
"type": "global"
|
|
15
|
+
},
|
|
16
|
+
"types": {
|
|
17
|
+
"path": "",
|
|
18
|
+
"name": "",
|
|
19
|
+
"zip": "",
|
|
20
|
+
"api": ""
|
|
21
|
+
},
|
|
22
|
+
"globalName": "HistogramChart",
|
|
23
|
+
"pluginVersion": "0.18.1",
|
|
24
|
+
"prefetchInterface": false,
|
|
25
|
+
"publicPath": "/plugins/HistogramChart/"
|
|
26
|
+
},
|
|
27
|
+
"shared": [
|
|
28
|
+
{
|
|
29
|
+
"id": "HistogramChart:@perses-dev/components",
|
|
30
|
+
"name": "@perses-dev/components",
|
|
31
|
+
"version": "0.52.0-beta.5",
|
|
32
|
+
"singleton": true,
|
|
33
|
+
"requiredVersion": "^0.52.0-beta.5",
|
|
34
|
+
"assets": {
|
|
35
|
+
"js": {
|
|
36
|
+
"async": [],
|
|
37
|
+
"sync": [
|
|
38
|
+
"__mf/js/async/39.719defa2.js"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"css": {
|
|
42
|
+
"async": [],
|
|
43
|
+
"sync": []
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": "HistogramChart:@perses-dev/core",
|
|
49
|
+
"name": "@perses-dev/core",
|
|
50
|
+
"version": "0.52.0-beta.5",
|
|
51
|
+
"singleton": true,
|
|
52
|
+
"requiredVersion": "^0.52.0-beta.5",
|
|
53
|
+
"assets": {
|
|
54
|
+
"js": {
|
|
55
|
+
"async": [],
|
|
56
|
+
"sync": [
|
|
57
|
+
"__mf/js/async/934.27722fd3.js"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"css": {
|
|
61
|
+
"async": [],
|
|
62
|
+
"sync": []
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"id": "HistogramChart:immer",
|
|
68
|
+
"name": "immer",
|
|
69
|
+
"version": "10.1.1",
|
|
70
|
+
"singleton": true,
|
|
71
|
+
"requiredVersion": "^10.1.1",
|
|
72
|
+
"assets": {
|
|
73
|
+
"js": {
|
|
74
|
+
"async": [],
|
|
75
|
+
"sync": [
|
|
76
|
+
"__mf/js/async/774.b18c4a5c.js"
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
"css": {
|
|
80
|
+
"async": [],
|
|
81
|
+
"sync": []
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"id": "HistogramChart:lodash",
|
|
87
|
+
"name": "lodash",
|
|
88
|
+
"version": "4.17.21",
|
|
89
|
+
"singleton": true,
|
|
90
|
+
"requiredVersion": "^4.17.21",
|
|
91
|
+
"assets": {
|
|
92
|
+
"js": {
|
|
93
|
+
"async": [],
|
|
94
|
+
"sync": [
|
|
95
|
+
"__mf/js/async/981.b29ba452.js"
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
"css": {
|
|
99
|
+
"async": [],
|
|
100
|
+
"sync": []
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "HistogramChart:react-dom",
|
|
106
|
+
"name": "react-dom",
|
|
107
|
+
"version": "18.3.1",
|
|
108
|
+
"singleton": true,
|
|
109
|
+
"requiredVersion": "18.2.0",
|
|
110
|
+
"assets": {
|
|
111
|
+
"js": {
|
|
112
|
+
"async": [],
|
|
113
|
+
"sync": [
|
|
114
|
+
"__mf/js/async/173.1e8a2c14.js"
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
"css": {
|
|
118
|
+
"async": [],
|
|
119
|
+
"sync": []
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": "HistogramChart:react",
|
|
125
|
+
"name": "react",
|
|
126
|
+
"version": "18.3.1",
|
|
127
|
+
"singleton": true,
|
|
128
|
+
"requiredVersion": "18.2.0",
|
|
129
|
+
"assets": {
|
|
130
|
+
"js": {
|
|
131
|
+
"async": [],
|
|
132
|
+
"sync": [
|
|
133
|
+
"__mf/js/async/964.b6419e33.js"
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
"css": {
|
|
137
|
+
"async": [],
|
|
138
|
+
"sync": []
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"remotes": [],
|
|
144
|
+
"exposes": [
|
|
145
|
+
{
|
|
146
|
+
"id": "HistogramChart:HistogramChart",
|
|
147
|
+
"name": "HistogramChart",
|
|
148
|
+
"assets": {
|
|
149
|
+
"js": {
|
|
150
|
+
"sync": [
|
|
151
|
+
"__mf/js/async/293.280a8f4f.js",
|
|
152
|
+
"__mf/js/async/814.7ccaa658.js",
|
|
153
|
+
"__mf/js/async/__federation_expose_HistogramChart.d98de268.js"
|
|
154
|
+
],
|
|
155
|
+
"async": [
|
|
156
|
+
"__mf/js/async/790.15c77240.js"
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
"css": {
|
|
160
|
+
"sync": [],
|
|
161
|
+
"async": [
|
|
162
|
+
"__mf/css/async/341.1e19d050.css"
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"path": "./HistogramChart"
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
}
|
package/mf-stats.json
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "HistogramChart",
|
|
3
|
+
"name": "HistogramChart",
|
|
4
|
+
"metaData": {
|
|
5
|
+
"name": "HistogramChart",
|
|
6
|
+
"type": "app",
|
|
7
|
+
"buildInfo": {
|
|
8
|
+
"buildVersion": "0.9.0",
|
|
9
|
+
"buildName": "@perses-dev/histogram-chart-plugin"
|
|
10
|
+
},
|
|
11
|
+
"remoteEntry": {
|
|
12
|
+
"name": "__mf/js/HistogramChart.93af6e55.js",
|
|
13
|
+
"path": "",
|
|
14
|
+
"type": "global"
|
|
15
|
+
},
|
|
16
|
+
"types": {
|
|
17
|
+
"path": "",
|
|
18
|
+
"name": "",
|
|
19
|
+
"zip": "",
|
|
20
|
+
"api": ""
|
|
21
|
+
},
|
|
22
|
+
"globalName": "HistogramChart",
|
|
23
|
+
"pluginVersion": "0.18.1",
|
|
24
|
+
"prefetchInterface": false,
|
|
25
|
+
"publicPath": "/plugins/HistogramChart/"
|
|
26
|
+
},
|
|
27
|
+
"shared": [
|
|
28
|
+
{
|
|
29
|
+
"singleton": true,
|
|
30
|
+
"requiredVersion": "^0.52.0-beta.5",
|
|
31
|
+
"shareScope": "default",
|
|
32
|
+
"name": "@perses-dev/components",
|
|
33
|
+
"version": "0.52.0-beta.5",
|
|
34
|
+
"eager": false,
|
|
35
|
+
"id": "HistogramChart:@perses-dev/components",
|
|
36
|
+
"assets": {
|
|
37
|
+
"js": {
|
|
38
|
+
"async": [],
|
|
39
|
+
"sync": [
|
|
40
|
+
"__mf/js/async/39.719defa2.js"
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"css": {
|
|
44
|
+
"async": [],
|
|
45
|
+
"sync": []
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"usedIn": [
|
|
49
|
+
"./HistogramChart"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"singleton": true,
|
|
54
|
+
"requiredVersion": "^0.52.0-beta.5",
|
|
55
|
+
"shareScope": "default",
|
|
56
|
+
"name": "@perses-dev/core",
|
|
57
|
+
"version": "0.52.0-beta.5",
|
|
58
|
+
"eager": false,
|
|
59
|
+
"id": "HistogramChart:@perses-dev/core",
|
|
60
|
+
"assets": {
|
|
61
|
+
"js": {
|
|
62
|
+
"async": [],
|
|
63
|
+
"sync": [
|
|
64
|
+
"__mf/js/async/934.27722fd3.js"
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"css": {
|
|
68
|
+
"async": [],
|
|
69
|
+
"sync": []
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"usedIn": []
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"singleton": true,
|
|
76
|
+
"requiredVersion": "^10.1.1",
|
|
77
|
+
"shareScope": "default",
|
|
78
|
+
"name": "immer",
|
|
79
|
+
"version": "10.1.1",
|
|
80
|
+
"eager": false,
|
|
81
|
+
"id": "HistogramChart:immer",
|
|
82
|
+
"assets": {
|
|
83
|
+
"js": {
|
|
84
|
+
"async": [],
|
|
85
|
+
"sync": [
|
|
86
|
+
"__mf/js/async/774.b18c4a5c.js"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
"css": {
|
|
90
|
+
"async": [],
|
|
91
|
+
"sync": []
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"usedIn": [
|
|
95
|
+
"./HistogramChart"
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"singleton": true,
|
|
100
|
+
"requiredVersion": "^4.17.21",
|
|
101
|
+
"shareScope": "default",
|
|
102
|
+
"name": "lodash",
|
|
103
|
+
"version": "4.17.21",
|
|
104
|
+
"eager": false,
|
|
105
|
+
"id": "HistogramChart:lodash",
|
|
106
|
+
"assets": {
|
|
107
|
+
"js": {
|
|
108
|
+
"async": [],
|
|
109
|
+
"sync": [
|
|
110
|
+
"__mf/js/async/981.b29ba452.js"
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"css": {
|
|
114
|
+
"async": [],
|
|
115
|
+
"sync": []
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"usedIn": []
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"singleton": true,
|
|
122
|
+
"requiredVersion": "18.2.0",
|
|
123
|
+
"shareScope": "default",
|
|
124
|
+
"name": "react-dom",
|
|
125
|
+
"version": "18.3.1",
|
|
126
|
+
"eager": false,
|
|
127
|
+
"id": "HistogramChart:react-dom",
|
|
128
|
+
"assets": {
|
|
129
|
+
"js": {
|
|
130
|
+
"async": [],
|
|
131
|
+
"sync": [
|
|
132
|
+
"__mf/js/async/173.1e8a2c14.js"
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
"css": {
|
|
136
|
+
"async": [],
|
|
137
|
+
"sync": []
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"usedIn": []
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"singleton": true,
|
|
144
|
+
"requiredVersion": "18.2.0",
|
|
145
|
+
"shareScope": "default",
|
|
146
|
+
"name": "react",
|
|
147
|
+
"version": "18.3.1",
|
|
148
|
+
"eager": false,
|
|
149
|
+
"id": "HistogramChart:react",
|
|
150
|
+
"assets": {
|
|
151
|
+
"js": {
|
|
152
|
+
"async": [],
|
|
153
|
+
"sync": [
|
|
154
|
+
"__mf/js/async/964.b6419e33.js"
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
"css": {
|
|
158
|
+
"async": [],
|
|
159
|
+
"sync": []
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"usedIn": [
|
|
163
|
+
"./HistogramChart"
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"remotes": [],
|
|
168
|
+
"exposes": [
|
|
169
|
+
{
|
|
170
|
+
"path": "./HistogramChart",
|
|
171
|
+
"id": "HistogramChart:HistogramChart",
|
|
172
|
+
"name": "HistogramChart",
|
|
173
|
+
"requires": [
|
|
174
|
+
"react",
|
|
175
|
+
"immer",
|
|
176
|
+
"@perses-dev/components"
|
|
177
|
+
],
|
|
178
|
+
"file": "src/HistogramChart.ts",
|
|
179
|
+
"assets": {
|
|
180
|
+
"js": {
|
|
181
|
+
"sync": [
|
|
182
|
+
"__mf/js/async/293.280a8f4f.js",
|
|
183
|
+
"__mf/js/async/814.7ccaa658.js",
|
|
184
|
+
"__mf/js/async/__federation_expose_HistogramChart.d98de268.js"
|
|
185
|
+
],
|
|
186
|
+
"async": [
|
|
187
|
+
"__mf/js/async/790.15c77240.js"
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
"css": {
|
|
191
|
+
"sync": [],
|
|
192
|
+
"async": [
|
|
193
|
+
"__mf/css/async/341.1e19d050.css"
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
}
|