@perses-dev/histogram-chart-plugin 0.11.0-beta.0 → 0.11.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/__mf/js/{HistogramChart.6093b28c.js → HistogramChart.f6bd8f08.js} +3 -3
- package/__mf/js/async/12.97ac25db.js +2 -0
- package/__mf/js/async/161.565de0af.js +144 -0
- package/__mf/js/async/392.712ee0cf.js +2 -0
- package/__mf/js/async/__federation_expose_HistogramChart.721e2e2a.js +1 -0
- package/__mf/js/{main.e8b69fff.js → main.26934b75.js} +3 -3
- package/lib/HistogramChart.js +1 -1
- package/lib/HistogramChart.js.map +1 -1
- package/lib/bootstrap.js +1 -1
- package/lib/bootstrap.js.map +1 -1
- package/lib/cjs/HistogramChart.js +1 -1
- package/lib/cjs/bootstrap.js +1 -1
- package/lib/cjs/components/HistogramChart.js +71 -20
- package/lib/cjs/components/HistogramChartOptionsEditorSettings.js +19 -1
- package/lib/cjs/components/HistogramChartPanel.js +3 -2
- package/lib/cjs/components/index.js +1 -1
- package/lib/cjs/env.d.js +1 -1
- package/lib/cjs/getPluginModule.js +12 -0
- package/lib/cjs/histogram-chart-model.js +25 -1
- package/lib/cjs/index-federation.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/setup-tests.js +1 -1
- package/lib/cjs/utils/index.js +1 -1
- package/lib/cjs/utils/thresholds.js +12 -0
- package/lib/components/HistogramChart.d.ts +3 -1
- package/lib/components/HistogramChart.d.ts.map +1 -1
- package/lib/components/HistogramChart.js +71 -20
- package/lib/components/HistogramChart.js.map +1 -1
- package/lib/components/HistogramChartOptionsEditorSettings.d.ts.map +1 -1
- package/lib/components/HistogramChartOptionsEditorSettings.js +21 -3
- package/lib/components/HistogramChartOptionsEditorSettings.js.map +1 -1
- package/lib/components/HistogramChartPanel.d.ts.map +1 -1
- package/lib/components/HistogramChartPanel.js +3 -2
- package/lib/components/HistogramChartPanel.js.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/index.js.map +1 -1
- package/lib/env.d.js +1 -1
- package/lib/env.d.js.map +1 -1
- package/lib/getPluginModule.d.ts.map +1 -1
- package/lib/getPluginModule.js +12 -0
- package/lib/getPluginModule.js.map +1 -1
- package/lib/histogram-chart-model.d.ts +11 -0
- package/lib/histogram-chart-model.d.ts.map +1 -1
- package/lib/histogram-chart-model.js +20 -1
- package/lib/histogram-chart-model.js.map +1 -1
- package/lib/index-federation.js +1 -1
- package/lib/index-federation.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/setup-tests.js +1 -1
- package/lib/setup-tests.js.map +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/thresholds.d.ts.map +1 -1
- package/lib/utils/thresholds.js +12 -0
- package/lib/utils/thresholds.js.map +1 -1
- package/mf-manifest.json +12 -12
- package/mf-stats.json +12 -12
- package/package.json +4 -4
- package/__mf/js/async/12.41482399.js +0 -2
- package/__mf/js/async/392.3fc5b732.js +0 -2
- package/__mf/js/async/735.ab58bf74.js +0 -144
- package/__mf/js/async/__federation_expose_HistogramChart.da17bbfc.js +0 -1
- /package/__mf/js/async/{12.41482399.js.LICENSE.txt → 12.97ac25db.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{735.ab58bf74.js.LICENSE.txt → 161.565de0af.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.3fc5b732.js.LICENSE.txt → 392.712ee0cf.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/HistogramChartOptionsEditorSettings.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../../src/components/HistogramChartOptionsEditorSettings.tsx"],"sourcesContent":["// Copyright 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 { TextField } from '@mui/material';\nimport {\n FormatControls,\n FormatControlsProps,\n OptionsEditorColumn,\n OptionsEditorControl,\n OptionsEditorGrid,\n OptionsEditorGroup,\n ThresholdsEditor,\n ThresholdsEditorProps,\n SettingsAutocomplete,\n} from '@perses-dev/components';\nimport { produce } from 'immer';\nimport merge from 'lodash/merge';\nimport { ReactElement } from 'react';\nimport {\n DEFAULT_FORMAT,\n DEFAULT_MAX_PERCENT,\n DEFAULT_MAX_PERCENT_DECIMAL,\n DEFAULT_MIN_PERCENT,\n DEFAULT_MIN_PERCENT_DECIMAL,\n DEFAULT_THRESHOLDS,\n HistogramChartOptions,\n HistogramChartOptionsEditorProps,\n LOG_BASE_CONFIG,\n LOG_BASE_OPTIONS,\n} from '../histogram-chart-model';\n\nexport function HistogramChartOptionsEditorSettings(props: HistogramChartOptionsEditorProps): ReactElement {\n const { onChange, value } = props;\n\n const handleUnitChange: FormatControlsProps['onChange'] = (newFormat) => {\n onChange(\n produce(value, (draft: HistogramChartOptions) => {\n draft.format = newFormat;\n })\n );\n };\n\n const handleThresholdsChange: ThresholdsEditorProps['onChange'] = (thresholds) => {\n onChange(\n produce(value, (draft: HistogramChartOptions) => {\n draft.thresholds = thresholds;\n })\n );\n };\n\n // ensures decimalPlaces defaults to correct value\n const format = merge({}, DEFAULT_FORMAT, value.format);\n const thresholds = merge({}, DEFAULT_THRESHOLDS, value.thresholds);\n\n // Get the current log base configuration\n const logBase = value.logBase ? LOG_BASE_CONFIG[value.logBase] : LOG_BASE_CONFIG['none'];\n\n // max only needs to be set explicitly for units other than percent and percent-decimal\n let minPlaceholder = 'Enter value';\n if (format.unit === 'percent') {\n minPlaceholder = DEFAULT_MIN_PERCENT.toString();\n } else if (format.unit === 'percent-decimal') {\n minPlaceholder = DEFAULT_MIN_PERCENT_DECIMAL.toString();\n }\n\n // max only needs to be set explicitly for units other than percent and percent-decimal\n let maxPlaceholder = 'Enter value';\n if (format.unit === 'percent') {\n maxPlaceholder = DEFAULT_MAX_PERCENT.toString();\n } else if (format.unit === 'percent-decimal') {\n maxPlaceholder = DEFAULT_MAX_PERCENT_DECIMAL.toString();\n }\n\n return (\n <OptionsEditorGrid>\n <OptionsEditorColumn>\n <OptionsEditorGroup title=\"Misc\">\n <FormatControls value={format} onChange={handleUnitChange} />\n <OptionsEditorControl\n label=\"Min\"\n control={\n <TextField\n type=\"number\"\n value={value.min ?? ''}\n onChange={(e) => {\n // ensure empty value resets to undef to allow chart to calculate max\n const newValue = e.target.value ? Number(e.target.value) : undefined;\n onChange(\n produce(value, (draft: HistogramChartOptions) => {\n draft.min = newValue;\n })\n );\n }}\n placeholder={minPlaceholder}\n sx={{ width: '100%' }}\n />\n }\n />\n <OptionsEditorControl\n label=\"Max\"\n control={\n <TextField\n type=\"number\"\n value={value.max ?? ''}\n onChange={(e) => {\n // ensure empty value resets to undef to allow chart to calculate max\n const newValue = e.target.value ? Number(e.target.value) : undefined;\n onChange(\n produce(value, (draft: HistogramChartOptions) => {\n draft.max = newValue;\n })\n );\n }}\n placeholder={maxPlaceholder}\n sx={{ width: '100%' }}\n />\n }\n />\n <OptionsEditorControl\n label=\"Log Base\"\n control={\n <SettingsAutocomplete\n value={{\n ...logBase,\n id: logBase?.label ?? 'None',\n }}\n options={LOG_BASE_OPTIONS}\n onChange={(__, newValue) => {\n onChange(\n produce(value, (draft: HistogramChartOptions) => {\n draft.logBase = newValue.log;\n })\n );\n }}\n disableClearable\n />\n }\n />\n </OptionsEditorGroup>\n </OptionsEditorColumn>\n <OptionsEditorColumn>\n <ThresholdsEditor thresholds={thresholds} onChange={handleThresholdsChange} />\n </OptionsEditorColumn>\n </OptionsEditorGrid>\n );\n}\n"],"names":["TextField","FormatControls","OptionsEditorColumn","OptionsEditorControl","OptionsEditorGrid","OptionsEditorGroup","ThresholdsEditor","SettingsAutocomplete","produce","merge","DEFAULT_FORMAT","DEFAULT_MAX_PERCENT","DEFAULT_MAX_PERCENT_DECIMAL","DEFAULT_MIN_PERCENT","DEFAULT_MIN_PERCENT_DECIMAL","DEFAULT_THRESHOLDS","LOG_BASE_CONFIG","LOG_BASE_OPTIONS","HistogramChartOptionsEditorSettings","props","onChange","value","handleUnitChange","newFormat","draft","format","handleThresholdsChange","thresholds","logBase","minPlaceholder","unit","toString","maxPlaceholder","title","label","control","type","min","e","newValue","target","Number","undefined","placeholder","sx","width","max","id","options","__","log","disableClearable"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HistogramChartPanel.d.ts","sourceRoot":"","sources":["../../../src/components/HistogramChartPanel.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAsC,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAKrG,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,qBAAqB,EAAE,cAAc,CAAC,CAAC;AAEzF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,YAAY,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"HistogramChartPanel.d.ts","sourceRoot":"","sources":["../../../src/components/HistogramChartPanel.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAsC,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAKrG,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,qBAAqB,EAAE,cAAc,CAAC,CAAC;AAEzF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,YAAY,GAAG,IAAI,CA2ExF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright The Perses Authors
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
5
5
|
// You may obtain a copy of the License at
|
|
@@ -80,7 +80,8 @@ export function HistogramChartPanel(props) {
|
|
|
80
80
|
format: format,
|
|
81
81
|
min: min,
|
|
82
82
|
max: max,
|
|
83
|
-
thresholds: thresholds
|
|
83
|
+
thresholds: thresholds,
|
|
84
|
+
logBase: pluginSpec.logBase
|
|
84
85
|
})
|
|
85
86
|
}, `histogram-series-${seriesIndex}`);
|
|
86
87
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/HistogramChartPanel.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../../src/components/HistogramChartPanel.tsx"],"sourcesContent":["// Copyright 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, Stack, Typography } from '@mui/material';\nimport { TimeSeriesData } from '@perses-dev/core';\nimport { PanelProps } from '@perses-dev/plugin-system';\nimport merge from 'lodash/merge';\nimport { ReactElement, useMemo } from 'react';\nimport { useChartsTheme } from '@perses-dev/components';\nimport { DEFAULT_FORMAT, DEFAULT_THRESHOLDS, HistogramChartOptions } from '../histogram-chart-model';\nimport { HistogramChart, HistogramChartData } from './HistogramChart';\n\nconst HISTOGRAM_MIN_WIDTH = 90;\n\nexport type HistogramChartPanelProps = PanelProps<HistogramChartOptions, TimeSeriesData>;\n\nexport function HistogramChartPanel(props: HistogramChartPanelProps): ReactElement | null {\n const { spec: pluginSpec, contentDimensions, queryResults } = props;\n const { min, max } = pluginSpec;\n\n const chartsTheme = useChartsTheme();\n // ensures all default format properties set if undef\n const format = merge({}, DEFAULT_FORMAT, pluginSpec.format);\n const thresholds = merge({}, DEFAULT_THRESHOLDS, pluginSpec.thresholds);\n\n const histogramData: HistogramChartData[] = useMemo(() => {\n const histograms: HistogramChartData[] = [];\n\n for (const result of queryResults) {\n for (const timeSeries of result.data.series) {\n if (!timeSeries.histograms || timeSeries.histograms.length === 0) {\n continue;\n }\n\n const [, histoBuckets] = timeSeries.histograms[0]!;\n if (histoBuckets && histoBuckets.buckets) {\n histograms.push({ buckets: histoBuckets.buckets });\n }\n }\n }\n return histograms;\n }, [queryResults]);\n\n // no data message handled inside chart component\n if (histogramData.length === 0) {\n return (\n <Stack justifyContent=\"center\" height=\"100%\">\n <Typography variant=\"body2\" textAlign=\"center\">\n No data available (only native histograms are supported for now)\n </Typography>\n </Stack>\n );\n }\n\n if (contentDimensions === undefined) return null;\n\n // accounts for showing a separate chart for each time series\n let chartWidth = contentDimensions.width / histogramData.length - chartsTheme.container.padding.default;\n if (chartWidth < HISTOGRAM_MIN_WIDTH && histogramData.length > 1) {\n // enables horizontal scroll when charts overflow outside of panel\n chartWidth = HISTOGRAM_MIN_WIDTH;\n }\n\n return (\n <Stack\n direction=\"row\"\n justifyContent=\"center\"\n alignItems=\"center\"\n sx={{\n // so scrollbar only shows when necessary\n overflowX: histogramData.length > 1 ? 'scroll' : 'auto',\n }}\n >\n {histogramData.map((series, seriesIndex) => {\n return (\n <Box key={`histogram-series-${seriesIndex}`}>\n <HistogramChart\n width={chartWidth}\n height={contentDimensions.height}\n data={series}\n format={format}\n min={min}\n max={max}\n thresholds={thresholds}\n logBase={pluginSpec.logBase}\n />\n </Box>\n );\n })}\n </Stack>\n );\n}\n"],"names":["Box","Stack","Typography","merge","useMemo","useChartsTheme","DEFAULT_FORMAT","DEFAULT_THRESHOLDS","HistogramChart","HISTOGRAM_MIN_WIDTH","HistogramChartPanel","props","spec","pluginSpec","contentDimensions","queryResults","min","max","chartsTheme","format","thresholds","histogramData","histograms","result","timeSeries","data","series","length","histoBuckets","buckets","push","justifyContent","height","variant","textAlign","undefined","chartWidth","width","container","padding","default","direction","alignItems","sx","overflowX","map","seriesIndex","logBase"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,GAAG,EAAEC,KAAK,EAAEC,UAAU,QAAQ,gBAAgB;AAGvD,OAAOC,WAAW,eAAe;AACjC,SAAuBC,OAAO,QAAQ,QAAQ;AAC9C,SAASC,cAAc,QAAQ,yBAAyB;AACxD,SAASC,cAAc,EAAEC,kBAAkB,QAA+B,2BAA2B;AACrG,SAASC,cAAc,QAA4B,mBAAmB;AAEtE,MAAMC,sBAAsB;AAI5B,OAAO,SAASC,oBAAoBC,KAA+B;IACjE,MAAM,EAAEC,MAAMC,UAAU,EAAEC,iBAAiB,EAAEC,YAAY,EAAE,GAAGJ;IAC9D,MAAM,EAAEK,GAAG,EAAEC,GAAG,EAAE,GAAGJ;IAErB,MAAMK,cAAcb;IACpB,qDAAqD;IACrD,MAAMc,SAAShB,MAAM,CAAC,GAAGG,gBAAgBO,WAAWM,MAAM;IAC1D,MAAMC,aAAajB,MAAM,CAAC,GAAGI,oBAAoBM,WAAWO,UAAU;IAEtE,MAAMC,gBAAsCjB,QAAQ;QAClD,MAAMkB,aAAmC,EAAE;QAE3C,KAAK,MAAMC,UAAUR,aAAc;YACjC,KAAK,MAAMS,cAAcD,OAAOE,IAAI,CAACC,MAAM,CAAE;gBAC3C,IAAI,CAACF,WAAWF,UAAU,IAAIE,WAAWF,UAAU,CAACK,MAAM,KAAK,GAAG;oBAChE;gBACF;gBAEA,MAAM,GAAGC,aAAa,GAAGJ,WAAWF,UAAU,CAAC,EAAE;gBACjD,IAAIM,gBAAgBA,aAAaC,OAAO,EAAE;oBACxCP,WAAWQ,IAAI,CAAC;wBAAED,SAASD,aAAaC,OAAO;oBAAC;gBAClD;YACF;QACF;QACA,OAAOP;IACT,GAAG;QAACP;KAAa;IAEjB,iDAAiD;IACjD,IAAIM,cAAcM,MAAM,KAAK,GAAG;QAC9B,qBACE,KAAC1B;YAAM8B,gBAAe;YAASC,QAAO;sBACpC,cAAA,KAAC9B;gBAAW+B,SAAQ;gBAAQC,WAAU;0BAAS;;;IAKrD;IAEA,IAAIpB,sBAAsBqB,WAAW,OAAO;IAE5C,6DAA6D;IAC7D,IAAIC,aAAatB,kBAAkBuB,KAAK,GAAGhB,cAAcM,MAAM,GAAGT,YAAYoB,SAAS,CAACC,OAAO,CAACC,OAAO;IACvG,IAAIJ,aAAa3B,uBAAuBY,cAAcM,MAAM,GAAG,GAAG;QAChE,kEAAkE;QAClES,aAAa3B;IACf;IAEA,qBACE,KAACR;QACCwC,WAAU;QACVV,gBAAe;QACfW,YAAW;QACXC,IAAI;YACF,yCAAyC;YACzCC,WAAWvB,cAAcM,MAAM,GAAG,IAAI,WAAW;QACnD;kBAECN,cAAcwB,GAAG,CAAC,CAACnB,QAAQoB;YAC1B,qBACE,KAAC9C;0BACC,cAAA,KAACQ;oBACC6B,OAAOD;oBACPJ,QAAQlB,kBAAkBkB,MAAM;oBAChCP,MAAMC;oBACNP,QAAQA;oBACRH,KAAKA;oBACLC,KAAKA;oBACLG,YAAYA;oBACZ2B,SAASlC,WAAWkC,OAAO;;eATrB,CAAC,iBAAiB,EAAED,aAAa;QAa/C;;AAGN"}
|
package/lib/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["// Copyright 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 './HistogramChartOptionsEditorSettings';\nexport * from './HistogramChartPanel';\nexport * from './HistogramChart';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,wCAAwC;AACtD,cAAc,wBAAwB;AACtC,cAAc,mBAAmB"}
|
package/lib/env.d.js
CHANGED
package/lib/env.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/env.d.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/env.d.ts"],"sourcesContent":["// Copyright 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,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,6CAA6C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPluginModule.d.ts","sourceRoot":"","sources":["../../src/getPluginModule.ts"],"names":[],"mappings":"
|
|
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"}
|
package/lib/getPluginModule.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the \"License\");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an \"AS IS\" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
1
13
|
import packageJson from '../package.json';
|
|
2
14
|
/**
|
|
3
15
|
* Returns the plugin module information from package.json
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/getPluginModule.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../src/getPluginModule.ts"],"sourcesContent":["// Copyright 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 { 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":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,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"}
|
|
@@ -6,6 +6,16 @@ export declare const DEFAULT_MIN_PERCENT = 0;
|
|
|
6
6
|
export declare const DEFAULT_MAX_PERCENT = 100;
|
|
7
7
|
export declare const DEFAULT_MIN_PERCENT_DECIMAL = 0;
|
|
8
8
|
export declare const DEFAULT_MAX_PERCENT_DECIMAL = 1;
|
|
9
|
+
export type LOG_BASE = undefined | 2 | 10;
|
|
10
|
+
export declare const LOG_BASE_CONFIG: Record<string, {
|
|
11
|
+
label: string;
|
|
12
|
+
log: LOG_BASE;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const LOG_BASE_OPTIONS: {
|
|
15
|
+
label: string;
|
|
16
|
+
log: LOG_BASE;
|
|
17
|
+
id: string;
|
|
18
|
+
}[];
|
|
9
19
|
/**
|
|
10
20
|
* The schema for a HistogramChart panel.
|
|
11
21
|
*/
|
|
@@ -20,6 +30,7 @@ export interface HistogramChartOptions {
|
|
|
20
30
|
min?: number;
|
|
21
31
|
max?: number;
|
|
22
32
|
thresholds?: ThresholdOptions;
|
|
33
|
+
logBase?: LOG_BASE;
|
|
23
34
|
}
|
|
24
35
|
export type HistogramChartOptionsEditorProps = OptionsEditorProps<HistogramChartOptions>;
|
|
25
36
|
/**
|
|
@@ -1 +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;
|
|
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;AAG7C,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,CAAC,GAAG,EAAE,CAAC;AAE1C,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,QAAQ,CAAA;CAAE,CAI5E,CAAC;AAGF,eAAO,MAAM,gBAAgB;WAPyB,MAAM;SAAO,QAAQ;QAQ/D,MAAM;GAEf,CAAC;AAEJ;;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;IAC9B,OAAO,CAAC,EAAE,QAAQ,CAAC;CACpB;AAED,MAAM,MAAM,gCAAgC,GAAG,kBAAkB,CAAC,qBAAqB,CAAC,CAAC;AAEzF;;GAEG;AACH,wBAAgB,kCAAkC,IAAI,qBAAqB,CAI1E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -20,6 +20,25 @@ export const DEFAULT_MIN_PERCENT = 0;
|
|
|
20
20
|
export const DEFAULT_MAX_PERCENT = 100;
|
|
21
21
|
export const DEFAULT_MIN_PERCENT_DECIMAL = 0;
|
|
22
22
|
export const DEFAULT_MAX_PERCENT_DECIMAL = 1;
|
|
23
|
+
export const LOG_BASE_CONFIG = {
|
|
24
|
+
none: {
|
|
25
|
+
label: 'None',
|
|
26
|
+
log: undefined
|
|
27
|
+
},
|
|
28
|
+
'2': {
|
|
29
|
+
label: '2',
|
|
30
|
+
log: 2
|
|
31
|
+
},
|
|
32
|
+
'10': {
|
|
33
|
+
label: '10',
|
|
34
|
+
log: 10
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
// Options array for SettingsAutocomplete
|
|
38
|
+
export const LOG_BASE_OPTIONS = Object.entries(LOG_BASE_CONFIG).map(([id, config])=>({
|
|
39
|
+
id: id,
|
|
40
|
+
...config
|
|
41
|
+
}));
|
|
23
42
|
/**
|
|
24
43
|
* Creates the initial/empty options for a HistogramChart panel.
|
|
25
44
|
*/ export function createInitialHistogramChartOptions() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/histogram-chart-model.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/histogram-chart-model.ts"],"sourcesContent":["// Copyright 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// LogBase outlines the allowed log bases for the histogram x-axis.\nexport type LOG_BASE = undefined | 2 | 10;\n\nexport const LOG_BASE_CONFIG: Record<string, { label: string; log: LOG_BASE }> = {\n none: { label: 'None', log: undefined },\n '2': { label: '2', log: 2 },\n '10': { label: '10', log: 10 },\n};\n\n// Options array for SettingsAutocomplete\nexport const LOG_BASE_OPTIONS = Object.entries(LOG_BASE_CONFIG).map(([id, config]) => ({\n id: id as string,\n ...config,\n}));\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 logBase?: LOG_BASE;\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","LOG_BASE_CONFIG","none","label","log","undefined","LOG_BASE_OPTIONS","Object","entries","map","id","config","createInitialHistogramChartOptions","format"],"mappings":"AAAA,+BAA+B;AAC/B,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;AAK7C,OAAO,MAAMC,kBAAoE;IAC/EC,MAAM;QAAEC,OAAO;QAAQC,KAAKC;IAAU;IACtC,KAAK;QAAEF,OAAO;QAAKC,KAAK;IAAE;IAC1B,MAAM;QAAED,OAAO;QAAMC,KAAK;IAAG;AAC/B,EAAE;AAEF,yCAAyC;AACzC,OAAO,MAAME,mBAAmBC,OAAOC,OAAO,CAACP,iBAAiBQ,GAAG,CAAC,CAAC,CAACC,IAAIC,OAAO,GAAM,CAAA;QACrFD,IAAIA;QACJ,GAAGC,MAAM;IACX,CAAA,GAAI;AAsBJ;;CAEC,GACD,OAAO,SAASC;IACd,OAAO;QACLC,QAAQpB;IACV;AACF"}
|
package/lib/index-federation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index-federation.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/index-federation.ts"],"sourcesContent":["// Copyright 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,+BAA+B;AAC/B,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.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// Copyright 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,+BAA+B;AAC/B,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"}
|
package/lib/setup-tests.js
CHANGED
package/lib/setup-tests.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/setup-tests.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/setup-tests.ts"],"sourcesContent":["// Copyright 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,+BAA+B;AAC/B,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"}
|
package/lib/utils/index.js
CHANGED
package/lib/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/index.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/index.ts"],"sourcesContent":["// Copyright 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,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thresholds.d.ts","sourceRoot":"","sources":["../../../src/utils/thresholds.ts"],"names":[],"mappings":"
|
|
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"}
|
package/lib/utils/thresholds.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the \"License\");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an \"AS IS\" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
1
13
|
export function getColorFromThresholds(value, thresholds, chartsTheme, defaultColor) {
|
|
2
14
|
if (thresholds?.steps) {
|
|
3
15
|
const matchingColors = thresholds.steps.map((step, index)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/thresholds.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/thresholds.ts"],"sourcesContent":["// Copyright 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 { 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":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAKjC,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
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"name": "HistogramChart",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.11.0
|
|
8
|
+
"buildVersion": "0.11.0",
|
|
9
9
|
"buildName": "@perses-dev/histogram-chart-plugin"
|
|
10
10
|
},
|
|
11
11
|
"remoteEntry": {
|
|
12
|
-
"name": "__mf/js/HistogramChart.
|
|
12
|
+
"name": "__mf/js/HistogramChart.f6bd8f08.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
{
|
|
29
29
|
"id": "HistogramChart:@perses-dev/components",
|
|
30
30
|
"name": "@perses-dev/components",
|
|
31
|
-
"version": "0.53.0
|
|
31
|
+
"version": "0.53.0",
|
|
32
32
|
"singleton": true,
|
|
33
|
-
"requiredVersion": "^0.53.0
|
|
33
|
+
"requiredVersion": "^0.53.0",
|
|
34
34
|
"assets": {
|
|
35
35
|
"js": {
|
|
36
36
|
"async": [],
|
|
37
37
|
"sync": [
|
|
38
|
-
"__mf/js/async/
|
|
38
|
+
"__mf/js/async/161.565de0af.js"
|
|
39
39
|
]
|
|
40
40
|
},
|
|
41
41
|
"css": {
|
|
@@ -47,14 +47,14 @@
|
|
|
47
47
|
{
|
|
48
48
|
"id": "HistogramChart:@perses-dev/core",
|
|
49
49
|
"name": "@perses-dev/core",
|
|
50
|
-
"version": "0.53.0-
|
|
50
|
+
"version": "0.53.0-rc.2",
|
|
51
51
|
"singleton": true,
|
|
52
|
-
"requiredVersion": "^0.53.0-
|
|
52
|
+
"requiredVersion": "^0.53.0-rc.2",
|
|
53
53
|
"assets": {
|
|
54
54
|
"js": {
|
|
55
55
|
"async": [],
|
|
56
56
|
"sync": [
|
|
57
|
-
"__mf/js/async/12.
|
|
57
|
+
"__mf/js/async/12.97ac25db.js"
|
|
58
58
|
]
|
|
59
59
|
},
|
|
60
60
|
"css": {
|
|
@@ -85,14 +85,14 @@
|
|
|
85
85
|
{
|
|
86
86
|
"id": "HistogramChart:lodash",
|
|
87
87
|
"name": "lodash",
|
|
88
|
-
"version": "4.17.
|
|
88
|
+
"version": "4.17.23",
|
|
89
89
|
"singleton": true,
|
|
90
|
-
"requiredVersion": "^4.17.
|
|
90
|
+
"requiredVersion": "^4.17.23",
|
|
91
91
|
"assets": {
|
|
92
92
|
"js": {
|
|
93
93
|
"async": [],
|
|
94
94
|
"sync": [
|
|
95
|
-
"__mf/js/async/392.
|
|
95
|
+
"__mf/js/async/392.712ee0cf.js"
|
|
96
96
|
]
|
|
97
97
|
},
|
|
98
98
|
"css": {
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"js": {
|
|
150
150
|
"sync": [
|
|
151
151
|
"__mf/js/async/953.aa8a7194.js",
|
|
152
|
-
"__mf/js/async/__federation_expose_HistogramChart.
|
|
152
|
+
"__mf/js/async/__federation_expose_HistogramChart.721e2e2a.js"
|
|
153
153
|
],
|
|
154
154
|
"async": []
|
|
155
155
|
},
|
package/mf-stats.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"name": "HistogramChart",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.11.0
|
|
8
|
+
"buildVersion": "0.11.0",
|
|
9
9
|
"buildName": "@perses-dev/histogram-chart-plugin"
|
|
10
10
|
},
|
|
11
11
|
"remoteEntry": {
|
|
12
|
-
"name": "__mf/js/HistogramChart.
|
|
12
|
+
"name": "__mf/js/HistogramChart.f6bd8f08.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -27,17 +27,17 @@
|
|
|
27
27
|
"shared": [
|
|
28
28
|
{
|
|
29
29
|
"singleton": true,
|
|
30
|
-
"requiredVersion": "^0.53.0
|
|
30
|
+
"requiredVersion": "^0.53.0",
|
|
31
31
|
"shareScope": "default",
|
|
32
32
|
"name": "@perses-dev/components",
|
|
33
|
-
"version": "0.53.0
|
|
33
|
+
"version": "0.53.0",
|
|
34
34
|
"eager": false,
|
|
35
35
|
"id": "HistogramChart:@perses-dev/components",
|
|
36
36
|
"assets": {
|
|
37
37
|
"js": {
|
|
38
38
|
"async": [],
|
|
39
39
|
"sync": [
|
|
40
|
-
"__mf/js/async/
|
|
40
|
+
"__mf/js/async/161.565de0af.js"
|
|
41
41
|
]
|
|
42
42
|
},
|
|
43
43
|
"css": {
|
|
@@ -51,17 +51,17 @@
|
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
"singleton": true,
|
|
54
|
-
"requiredVersion": "^0.53.0-
|
|
54
|
+
"requiredVersion": "^0.53.0-rc.2",
|
|
55
55
|
"shareScope": "default",
|
|
56
56
|
"name": "@perses-dev/core",
|
|
57
|
-
"version": "0.53.0-
|
|
57
|
+
"version": "0.53.0-rc.2",
|
|
58
58
|
"eager": false,
|
|
59
59
|
"id": "HistogramChart:@perses-dev/core",
|
|
60
60
|
"assets": {
|
|
61
61
|
"js": {
|
|
62
62
|
"async": [],
|
|
63
63
|
"sync": [
|
|
64
|
-
"__mf/js/async/12.
|
|
64
|
+
"__mf/js/async/12.97ac25db.js"
|
|
65
65
|
]
|
|
66
66
|
},
|
|
67
67
|
"css": {
|
|
@@ -97,17 +97,17 @@
|
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
"singleton": true,
|
|
100
|
-
"requiredVersion": "^4.17.
|
|
100
|
+
"requiredVersion": "^4.17.23",
|
|
101
101
|
"shareScope": "default",
|
|
102
102
|
"name": "lodash",
|
|
103
|
-
"version": "4.17.
|
|
103
|
+
"version": "4.17.23",
|
|
104
104
|
"eager": false,
|
|
105
105
|
"id": "HistogramChart:lodash",
|
|
106
106
|
"assets": {
|
|
107
107
|
"js": {
|
|
108
108
|
"async": [],
|
|
109
109
|
"sync": [
|
|
110
|
-
"__mf/js/async/392.
|
|
110
|
+
"__mf/js/async/392.712ee0cf.js"
|
|
111
111
|
]
|
|
112
112
|
},
|
|
113
113
|
"css": {
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
"js": {
|
|
181
181
|
"sync": [
|
|
182
182
|
"__mf/js/async/953.aa8a7194.js",
|
|
183
|
-
"__mf/js/async/__federation_expose_HistogramChart.
|
|
183
|
+
"__mf/js/async/__federation_expose_HistogramChart.721e2e2a.js"
|
|
184
184
|
],
|
|
185
185
|
"async": []
|
|
186
186
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perses-dev/histogram-chart-plugin",
|
|
3
|
-
"version": "0.11.0
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"homepage": "https://github.com/perses/plugins/blob/main/README.md",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"module": "lib/index.js",
|
|
25
25
|
"types": "lib/index.d.ts",
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@perses-dev/components": "^0.53.0
|
|
28
|
-
"@perses-dev/core": "^0.53.0-
|
|
29
|
-
"@perses-dev/plugin-system": "^0.53.0
|
|
27
|
+
"@perses-dev/components": "^0.53.0",
|
|
28
|
+
"@perses-dev/core": "^0.53.0-rc.2",
|
|
29
|
+
"@perses-dev/plugin-system": "^0.53.0",
|
|
30
30
|
"echarts": "5.5.0",
|
|
31
31
|
"lodash": "^4.17.21",
|
|
32
32
|
"react": "^17.0.2 || ^18.0.0",
|