@perses-dev/bar-chart-plugin 0.9.1 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__mf/css/async/442.d3010b86.css +1 -0
- package/__mf/css/async/61.d3010b86.css +1 -0
- package/__mf/css/async/823.d3010b86.css +1 -0
- package/__mf/js/BarChart.fd19299c.js +6 -0
- package/__mf/js/async/102.b7abdc1f.js +1 -0
- package/__mf/js/async/{964.1b58e06a.js → 121.517e00e8.js} +2 -2
- package/__mf/js/async/160.0b10468b.js +1 -0
- package/__mf/js/async/{488.b4de54ee.js → 177.91621efa.js} +1 -1
- package/__mf/js/async/192.73182890.js +1 -0
- package/__mf/js/async/204.d6cc804e.js +1 -0
- package/__mf/js/async/235.951938a6.js +1 -0
- package/__mf/js/async/252.3ffb7009.js +22 -0
- package/__mf/js/async/255.41e8af2d.js +10 -0
- package/__mf/js/async/274.9bfff28e.js +2 -0
- package/__mf/js/async/350.d8b63400.js +1 -0
- package/__mf/js/async/356.6146b01c.js +1 -0
- package/__mf/js/async/{930.2949d883.js → 377.5b9c90dc.js} +1 -1
- package/__mf/js/async/392.7bfcf9f9.js +2 -0
- package/__mf/js/async/458.cffba90f.js +1 -0
- package/__mf/js/async/470.82e9b967.js +2 -0
- package/__mf/js/async/{296.78a77608.js → 496.b35b3a0a.js} +1 -1
- package/__mf/js/async/554.82e03ea5.js +38 -0
- package/__mf/js/async/582.9dfe893c.js +102 -0
- package/__mf/js/async/{214.c9488f88.js → 587.bcc920f1.js} +1 -1
- package/__mf/js/async/588.680cfad0.js +1 -0
- package/__mf/js/async/616.302bdae0.js +1 -0
- package/__mf/js/async/703.16dd2eaa.js +2 -0
- package/__mf/js/async/71.dab9ec76.js +1 -0
- package/__mf/js/async/{553.846194ff.js → 77.f584b802.js} +1 -1
- package/__mf/js/async/790.847088e2.js +7 -0
- package/__mf/js/async/854.63eee34f.js +1 -0
- package/__mf/js/async/873.fa6a97f2.js +1 -0
- package/__mf/js/async/941.4efdb193.js +2 -0
- package/__mf/js/async/963.85d5346b.js +1 -0
- package/__mf/js/async/{738.7c9852d4.js → 968.d562d0d2.js} +1 -1
- package/__mf/js/async/978.458b6e7d.js +1 -0
- package/__mf/js/async/__federation_expose_BarChart.13bf419c.js +1 -0
- package/__mf/js/async/lib-router.4740fed2.js +2 -0
- package/__mf/js/main.bb6f9165.js +6 -0
- package/lib/BarChartBase.js +2 -2
- package/lib/BarChartBase.js.map +1 -1
- package/lib/BarChartOptionsEditorSettings.js +1 -1
- package/lib/BarChartOptionsEditorSettings.js.map +1 -1
- package/lib/BarChartPanel.js +1 -1
- package/lib/BarChartPanel.js.map +1 -1
- package/lib/bootstrap.js +1 -1
- package/lib/bootstrap.js.map +1 -1
- package/lib/cjs/BarChartBase.js +1 -1
- package/lib/cjs/bar-chart-model.js +5 -5
- package/lib/cjs/index-federation.js +12 -12
- package/lib/cjs/tresholds.js +3 -3
- package/lib/cjs/utils.js +3 -3
- package/mf-manifest.json +40 -40
- package/mf-stats.json +40 -40
- package/package.json +5 -5
- package/__mf/css/async/263.1f61a808.css +0 -1
- package/__mf/css/async/341.1f61a808.css +0 -1
- package/__mf/css/async/759.1f61a808.css +0 -1
- package/__mf/js/BarChart.f638b0dc.js +0 -5
- package/__mf/js/async/109.b86d041e.js +0 -73
- package/__mf/js/async/173.3531997c.js +0 -2
- package/__mf/js/async/224.5f9af696.js +0 -1
- package/__mf/js/async/238.45a5ec9c.js +0 -1
- package/__mf/js/async/288.70b237a6.js +0 -7
- package/__mf/js/async/292.faabc281.js +0 -1
- package/__mf/js/async/298.e67cf440.js +0 -1
- package/__mf/js/async/409.fdf96221.js +0 -1
- package/__mf/js/async/45.7ccf6b51.js +0 -38
- package/__mf/js/async/623.e68b6216.js +0 -1
- package/__mf/js/async/656.14ae7fea.js +0 -1
- package/__mf/js/async/679.6fb75801.js +0 -2
- package/__mf/js/async/69.3c81e152.js +0 -10
- package/__mf/js/async/694.beb18780.js +0 -1
- package/__mf/js/async/740.6d6370ec.js +0 -1
- package/__mf/js/async/75.c086bb12.js +0 -1
- package/__mf/js/async/770.ece8043c.js +0 -1
- package/__mf/js/async/774.aec5dd0e.js +0 -1
- package/__mf/js/async/790.219148ac.js +0 -1
- package/__mf/js/async/838.bc0c4131.js +0 -102
- package/__mf/js/async/863.134f9f3b.js +0 -2
- package/__mf/js/async/922.2ce525ff.js +0 -1
- package/__mf/js/async/929.80797c45.js +0 -1
- package/__mf/js/async/960.33cdf4ef.js +0 -2
- package/__mf/js/async/981.5c1d40ce.js +0 -2
- package/__mf/js/async/__federation_expose_BarChart.ea2eb1bc.js +0 -1
- package/__mf/js/async/lib-router.10c5a0f9.js +0 -2
- package/__mf/js/main.22e71e47.js +0 -5
- /package/__mf/js/async/{964.1b58e06a.js.LICENSE.txt → 121.517e00e8.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{109.b86d041e.js.LICENSE.txt → 252.3ffb7009.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{69.3c81e152.js.LICENSE.txt → 255.41e8af2d.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{960.33cdf4ef.js.LICENSE.txt → 274.9bfff28e.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{981.5c1d40ce.js.LICENSE.txt → 392.7bfcf9f9.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{173.3531997c.js.LICENSE.txt → 470.82e9b967.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{838.bc0c4131.js.LICENSE.txt → 582.9dfe893c.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{679.6fb75801.js.LICENSE.txt → 703.16dd2eaa.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{288.70b237a6.js.LICENSE.txt → 790.847088e2.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{863.134f9f3b.js.LICENSE.txt → 941.4efdb193.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{lib-router.10c5a0f9.js.LICENSE.txt → lib-router.4740fed2.js.LICENSE.txt} +0 -0
package/lib/BarChartBase.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/BarChartBase.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement, useMemo } from 'react';\nimport { EChart, ModeOption, getFormattedAxis, useChartsTheme } from '@perses-dev/components';\nimport { FormatOptions, formatValue } from '@perses-dev/core';\nimport { use, EChartsCoreOption } from 'echarts/core';\nimport { BarChart as EChartsBarChart } from 'echarts/charts';\nimport { GridComponent, DatasetComponent, TitleComponent, TooltipComponent } from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { Box } from '@mui/material';\n\nuse([EChartsBarChart, GridComponent, DatasetComponent, TitleComponent, TooltipComponent, CanvasRenderer]);\n\nconst BAR_WIN_WIDTH = 14;\nconst BAR_GAP = 6;\n\nexport interface BarChartData {\n label: string;\n value: number | null;\n}\n\nexport interface BarChartBaseProps {\n width: number;\n height: number;\n data: BarChartData[] | null;\n format?: FormatOptions;\n mode?: ModeOption;\n}\n\nexport function BarChartBase(props: BarChartBaseProps): ReactElement {\n const { width, height, data, format = { unit: 'decimal' }, mode = 'value' } = props;\n const chartsTheme = useChartsTheme();\n\n const option: EChartsCoreOption = useMemo(() => {\n if (!data || !data.length) return chartsTheme.noDataOption;\n\n const source: Array<Array<BarChartData['label'] | BarChartData['value']>> = [];\n data.map((d) => {\n source.push([d.label, d.value]);\n });\n\n return {\n title: {\n show: false,\n },\n dataset: [\n {\n dimensions: ['label', 'value'],\n source: source,\n },\n ],\n xAxis: getFormattedAxis({}, format),\n yAxis: {\n type: 'category',\n splitLine: {\n show: false,\n },\n axisLabel: {\n overflow: 'truncate',\n width: width / 3,\n },\n },\n series: {\n type: 'bar',\n label: {\n show: true,\n position: 'right',\n formatter: (params: { data: number[] }): string | undefined => {\n if (!params.data[1]) {\n return undefined;\n }\n\n if (mode === 'percentage') {\n return formatValue(params.data[1]!, {\n unit: 'percent',\n decimalPlaces: format.decimalPlaces,\n });\n }\n return formatValue(params.data[1], format);\n },\n barMinWidth: BAR_WIN_WIDTH,\n barCategoryGap: BAR_GAP,\n },\n itemStyle: {\n borderRadius: 4,\n color: chartsTheme.echartsTheme[0],\n },\n },\n tooltip: {\n appendToBody: true,\n confine: true,\n formatter: (params: { name: string; data: number[] }) =>\n params.data[1] && `<b>${params.name}</b>   ${formatValue(params.data[1], format)}`,\n },\n // increase distance between grid and container to prevent y axis labels from getting cut off\n grid: {\n left: '5%',\n right: '5%',\n },\n };\n }, [data, chartsTheme, width, mode, format]);\n\n return (\n <Box\n style={{\n width: width,\n height: height,\n }}\n sx={{ overflow: 'auto' }}\n >\n <EChart\n
|
|
1
|
+
{"version":3,"sources":["../../src/BarChartBase.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement, useMemo } from 'react';\nimport { EChart, ModeOption, getFormattedAxis, useChartsTheme } from '@perses-dev/components';\nimport { FormatOptions, formatValue } from '@perses-dev/core';\nimport { use, EChartsCoreOption } from 'echarts/core';\nimport { BarChart as EChartsBarChart } from 'echarts/charts';\nimport { GridComponent, DatasetComponent, TitleComponent, TooltipComponent } from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { Box } from '@mui/material';\n\nuse([EChartsBarChart, GridComponent, DatasetComponent, TitleComponent, TooltipComponent, CanvasRenderer]);\n\nconst BAR_WIN_WIDTH = 14;\nconst BAR_GAP = 6;\n\nexport interface BarChartData {\n label: string;\n value: number | null;\n}\n\nexport interface BarChartBaseProps {\n width: number;\n height: number;\n data: BarChartData[] | null;\n format?: FormatOptions;\n mode?: ModeOption;\n}\n\nexport function BarChartBase(props: BarChartBaseProps): ReactElement {\n const { width, height, data, format = { unit: 'decimal' }, mode = 'value' } = props;\n const chartsTheme = useChartsTheme();\n\n const option: EChartsCoreOption = useMemo(() => {\n if (!data || !data.length) return chartsTheme.noDataOption;\n\n const source: Array<Array<BarChartData['label'] | BarChartData['value']>> = [];\n data.map((d) => {\n source.push([d.label, d.value]);\n });\n\n return {\n title: {\n show: false,\n },\n dataset: [\n {\n dimensions: ['label', 'value'],\n source: source,\n },\n ],\n xAxis: getFormattedAxis({}, format),\n yAxis: {\n type: 'category',\n splitLine: {\n show: false,\n },\n axisLabel: {\n overflow: 'truncate',\n width: width / 3,\n },\n },\n series: {\n type: 'bar',\n label: {\n show: true,\n position: 'right',\n formatter: (params: { data: number[] }): string | undefined => {\n if (!params.data[1]) {\n return undefined;\n }\n\n if (mode === 'percentage') {\n return formatValue(params.data[1]!, {\n unit: 'percent',\n decimalPlaces: format.decimalPlaces,\n });\n }\n return formatValue(params.data[1], format);\n },\n barMinWidth: BAR_WIN_WIDTH,\n barCategoryGap: BAR_GAP,\n },\n itemStyle: {\n borderRadius: 4,\n color: chartsTheme.echartsTheme[0],\n },\n },\n tooltip: {\n appendToBody: true,\n confine: true,\n formatter: (params: { name: string; data: number[] }) =>\n params.data[1] && `<b>${params.name}</b>   ${formatValue(params.data[1], format)}`,\n },\n // increase distance between grid and container to prevent y axis labels from getting cut off\n grid: {\n left: '5%',\n right: '5%',\n },\n };\n }, [data, chartsTheme, width, mode, format]);\n\n return (\n <Box\n style={{\n width: width,\n height: height,\n }}\n sx={{ overflow: 'auto' }}\n >\n <EChart\n style={{\n minHeight: height,\n height: data ? data.length * (BAR_WIN_WIDTH + BAR_GAP) : '100%',\n }}\n option={option}\n theme={chartsTheme.echartsTheme}\n />\n </Box>\n );\n}\n"],"names":["useMemo","EChart","getFormattedAxis","useChartsTheme","formatValue","use","BarChart","EChartsBarChart","GridComponent","DatasetComponent","TitleComponent","TooltipComponent","CanvasRenderer","Box","BAR_WIN_WIDTH","BAR_GAP","BarChartBase","props","width","height","data","format","unit","mode","chartsTheme","option","length","noDataOption","source","map","d","push","label","value","title","show","dataset","dimensions","xAxis","yAxis","type","splitLine","axisLabel","overflow","series","position","formatter","params","undefined","decimalPlaces","barMinWidth","barCategoryGap","itemStyle","borderRadius","color","echartsTheme","tooltip","appendToBody","confine","name","grid","left","right","style","sx","minHeight","theme"],"mappings":"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"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
// Copyright 2023 The Perses Authors
|
|
2
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -10,7 +11,6 @@
|
|
|
10
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
12
|
// See the License for the specific language governing permissions and
|
|
12
13
|
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { Button } from '@mui/material';
|
|
15
15
|
import { FormatControls, ModeSelector, OptionsEditorColumn, OptionsEditorGrid, OptionsEditorGroup, SortSelector } from '@perses-dev/components';
|
|
16
16
|
import { DEFAULT_CALCULATION, isPercentUnit } from '@perses-dev/core';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/BarChartOptionsEditorSettings.tsx"],"sourcesContent":["// Copyright 2023 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 { Button } from '@mui/material';\nimport {\n FormatControls,\n FormatControlsProps,\n ModeOption,\n ModeSelector,\n ModeSelectorProps,\n OptionsEditorColumn,\n OptionsEditorGrid,\n OptionsEditorGroup,\n SortOption,\n SortSelector,\n SortSelectorProps,\n} from '@perses-dev/components';\nimport { CalculationType, DEFAULT_CALCULATION, FormatOptions, isPercentUnit } from '@perses-dev/core';\nimport { CalculationSelector, CalculationSelectorProps } from '@perses-dev/plugin-system';\nimport { produce } from 'immer';\nimport merge from 'lodash/merge';\nimport { MouseEventHandler, ReactElement } from 'react';\nimport {\n BarChartOptions,\n BarChartOptionsEditorProps,\n DEFAULT_FORMAT,\n DEFAULT_MODE,\n DEFAULT_SORT,\n} from './bar-chart-model';\n\nexport function BarChartOptionsEditorSettings(props: BarChartOptionsEditorProps): ReactElement {\n const { onChange, value } = props;\n\n const handleCalculationChange: CalculationSelectorProps['onChange'] = (newCalculation: CalculationType) => {\n onChange(\n produce(value, (draft: BarChartOptions) => {\n draft.calculation = newCalculation;\n })\n );\n };\n\n const handleUnitChange: FormatControlsProps['onChange'] = (newFormat: FormatOptions) => {\n onChange(\n produce(value, (draft: BarChartOptions) => {\n draft.format = newFormat;\n })\n );\n };\n\n const handleSortChange: SortSelectorProps['onChange'] = (newSort: SortOption) => {\n onChange(\n produce(value, (draft: BarChartOptions) => {\n draft.sort = newSort;\n })\n );\n };\n\n const handleModeChange: ModeSelectorProps['onChange'] = (newMode: ModeOption) => {\n onChange(\n produce(value, (draft: BarChartOptions) => {\n draft.mode = newMode;\n })\n );\n };\n\n const handleResetSettings: MouseEventHandler<HTMLButtonElement> = () => {\n onChange(\n produce(value, (draft: BarChartOptions) => {\n draft.calculation = DEFAULT_CALCULATION;\n draft.format = DEFAULT_FORMAT;\n draft.sort = DEFAULT_SORT;\n draft.mode = DEFAULT_MODE;\n })\n );\n };\n\n // ensures decimalPlaces defaults to correct value\n const format = merge({}, DEFAULT_FORMAT, value.format);\n\n return (\n <OptionsEditorGrid>\n <OptionsEditorColumn>\n <OptionsEditorGroup title=\"Misc\">\n <FormatControls value={format} onChange={handleUnitChange} disabled={value.mode === 'percentage'} />\n <CalculationSelector value={value.calculation} onChange={handleCalculationChange} />\n <SortSelector value={value.sort} onChange={handleSortChange} />\n <ModeSelector value={value.mode} onChange={handleModeChange} disablePercentageMode={isPercentUnit(format)} />\n </OptionsEditorGroup>\n </OptionsEditorColumn>\n <OptionsEditorColumn>\n <OptionsEditorGroup title=\"Reset Settings\">\n <Button variant=\"outlined\" color=\"secondary\" onClick={handleResetSettings}>\n Reset To Defaults\n </Button>\n </OptionsEditorGroup>\n </OptionsEditorColumn>\n </OptionsEditorGrid>\n );\n}\n"],"names":["Button","FormatControls","ModeSelector","OptionsEditorColumn","OptionsEditorGrid","OptionsEditorGroup","SortSelector","DEFAULT_CALCULATION","isPercentUnit","CalculationSelector","produce","merge","DEFAULT_FORMAT","DEFAULT_MODE","DEFAULT_SORT","BarChartOptionsEditorSettings","props","onChange","value","handleCalculationChange","newCalculation","draft","calculation","handleUnitChange","newFormat","format","handleSortChange","newSort","sort","handleModeChange","newMode","mode","handleResetSettings","title","disabled","disablePercentageMode","variant","color","onClick"],"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
|
|
1
|
+
{"version":3,"sources":["../../src/BarChartOptionsEditorSettings.tsx"],"sourcesContent":["// Copyright 2023 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 { Button } from '@mui/material';\nimport {\n FormatControls,\n FormatControlsProps,\n ModeOption,\n ModeSelector,\n ModeSelectorProps,\n OptionsEditorColumn,\n OptionsEditorGrid,\n OptionsEditorGroup,\n SortOption,\n SortSelector,\n SortSelectorProps,\n} from '@perses-dev/components';\nimport { CalculationType, DEFAULT_CALCULATION, FormatOptions, isPercentUnit } from '@perses-dev/core';\nimport { CalculationSelector, CalculationSelectorProps } from '@perses-dev/plugin-system';\nimport { produce } from 'immer';\nimport merge from 'lodash/merge';\nimport { MouseEventHandler, ReactElement } from 'react';\nimport {\n BarChartOptions,\n BarChartOptionsEditorProps,\n DEFAULT_FORMAT,\n DEFAULT_MODE,\n DEFAULT_SORT,\n} from './bar-chart-model';\n\nexport function BarChartOptionsEditorSettings(props: BarChartOptionsEditorProps): ReactElement {\n const { onChange, value } = props;\n\n const handleCalculationChange: CalculationSelectorProps['onChange'] = (newCalculation: CalculationType) => {\n onChange(\n produce(value, (draft: BarChartOptions) => {\n draft.calculation = newCalculation;\n })\n );\n };\n\n const handleUnitChange: FormatControlsProps['onChange'] = (newFormat: FormatOptions) => {\n onChange(\n produce(value, (draft: BarChartOptions) => {\n draft.format = newFormat;\n })\n );\n };\n\n const handleSortChange: SortSelectorProps['onChange'] = (newSort: SortOption) => {\n onChange(\n produce(value, (draft: BarChartOptions) => {\n draft.sort = newSort;\n })\n );\n };\n\n const handleModeChange: ModeSelectorProps['onChange'] = (newMode: ModeOption) => {\n onChange(\n produce(value, (draft: BarChartOptions) => {\n draft.mode = newMode;\n })\n );\n };\n\n const handleResetSettings: MouseEventHandler<HTMLButtonElement> = () => {\n onChange(\n produce(value, (draft: BarChartOptions) => {\n draft.calculation = DEFAULT_CALCULATION;\n draft.format = DEFAULT_FORMAT;\n draft.sort = DEFAULT_SORT;\n draft.mode = DEFAULT_MODE;\n })\n );\n };\n\n // ensures decimalPlaces defaults to correct value\n const format = merge({}, DEFAULT_FORMAT, value.format);\n\n return (\n <OptionsEditorGrid>\n <OptionsEditorColumn>\n <OptionsEditorGroup title=\"Misc\">\n <FormatControls value={format} onChange={handleUnitChange} disabled={value.mode === 'percentage'} />\n <CalculationSelector value={value.calculation} onChange={handleCalculationChange} />\n <SortSelector value={value.sort} onChange={handleSortChange} />\n <ModeSelector value={value.mode} onChange={handleModeChange} disablePercentageMode={isPercentUnit(format)} />\n </OptionsEditorGroup>\n </OptionsEditorColumn>\n <OptionsEditorColumn>\n <OptionsEditorGroup title=\"Reset Settings\">\n <Button variant=\"outlined\" color=\"secondary\" onClick={handleResetSettings}>\n Reset To Defaults\n </Button>\n </OptionsEditorGroup>\n </OptionsEditorColumn>\n </OptionsEditorGrid>\n );\n}\n"],"names":["Button","FormatControls","ModeSelector","OptionsEditorColumn","OptionsEditorGrid","OptionsEditorGroup","SortSelector","DEFAULT_CALCULATION","isPercentUnit","CalculationSelector","produce","merge","DEFAULT_FORMAT","DEFAULT_MODE","DEFAULT_SORT","BarChartOptionsEditorSettings","props","onChange","value","handleCalculationChange","newCalculation","draft","calculation","handleUnitChange","newFormat","format","handleSortChange","newSort","sort","handleModeChange","newMode","mode","handleResetSettings","title","disabled","disablePercentageMode","variant","color","onClick"],"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,MAAM,QAAQ,gBAAgB;AACvC,SACEC,cAAc,EAGdC,YAAY,EAEZC,mBAAmB,EACnBC,iBAAiB,EACjBC,kBAAkB,EAElBC,YAAY,QAEP,yBAAyB;AAChC,SAA0BC,mBAAmB,EAAiBC,aAAa,QAAQ,mBAAmB;AACtG,SAASC,mBAAmB,QAAkC,4BAA4B;AAC1F,SAASC,OAAO,QAAQ,QAAQ;AAChC,OAAOC,WAAW,eAAe;AAEjC,SAGEC,cAAc,EACdC,YAAY,EACZC,YAAY,QACP,oBAAoB;AAE3B,OAAO,SAASC,8BAA8BC,KAAiC;IAC7E,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAE5B,MAAMG,0BAAgE,CAACC;QACrEH,SACEP,QAAQQ,OAAO,CAACG;YACdA,MAAMC,WAAW,GAAGF;QACtB;IAEJ;IAEA,MAAMG,mBAAoD,CAACC;QACzDP,SACEP,QAAQQ,OAAO,CAACG;YACdA,MAAMI,MAAM,GAAGD;QACjB;IAEJ;IAEA,MAAME,mBAAkD,CAACC;QACvDV,SACEP,QAAQQ,OAAO,CAACG;YACdA,MAAMO,IAAI,GAAGD;QACf;IAEJ;IAEA,MAAME,mBAAkD,CAACC;QACvDb,SACEP,QAAQQ,OAAO,CAACG;YACdA,MAAMU,IAAI,GAAGD;QACf;IAEJ;IAEA,MAAME,sBAA4D;QAChEf,SACEP,QAAQQ,OAAO,CAACG;YACdA,MAAMC,WAAW,GAAGf;YACpBc,MAAMI,MAAM,GAAGb;YACfS,MAAMO,IAAI,GAAGd;YACbO,MAAMU,IAAI,GAAGlB;QACf;IAEJ;IAEA,kDAAkD;IAClD,MAAMY,SAASd,MAAM,CAAC,GAAGC,gBAAgBM,MAAMO,MAAM;IAErD,qBACE,MAACrB;;0BACC,KAACD;0BACC,cAAA,MAACE;oBAAmB4B,OAAM;;sCACxB,KAAChC;4BAAeiB,OAAOO;4BAAQR,UAAUM;4BAAkBW,UAAUhB,MAAMa,IAAI,KAAK;;sCACpF,KAACtB;4BAAoBS,OAAOA,MAAMI,WAAW;4BAAEL,UAAUE;;sCACzD,KAACb;4BAAaY,OAAOA,MAAMU,IAAI;4BAAEX,UAAUS;;sCAC3C,KAACxB;4BAAagB,OAAOA,MAAMa,IAAI;4BAAEd,UAAUY;4BAAkBM,uBAAuB3B,cAAciB;;;;;0BAGtG,KAACtB;0BACC,cAAA,KAACE;oBAAmB4B,OAAM;8BACxB,cAAA,KAACjC;wBAAOoC,SAAQ;wBAAWC,OAAM;wBAAYC,SAASN;kCAAqB;;;;;;AAOrF"}
|
package/lib/BarChartPanel.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
// Copyright 2023 The Perses Authors
|
|
2
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -10,7 +11,6 @@
|
|
|
10
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
12
|
// See the License for the specific language governing permissions and
|
|
12
13
|
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { useChartsTheme } from '@perses-dev/components';
|
|
15
15
|
import { Box } from '@mui/material';
|
|
16
16
|
import { useMemo } from 'react';
|
package/lib/BarChartPanel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/BarChartPanel.tsx"],"sourcesContent":["// Copyright 2023 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 { useChartsTheme } from '@perses-dev/components';\nimport { Box } from '@mui/material';\nimport { ReactElement, useMemo } from 'react';\nimport { CalculationType, CalculationsMap, TimeSeriesData } from '@perses-dev/core';\nimport { PanelProps } from '@perses-dev/plugin-system';\nimport { BarChartOptions } from './bar-chart-model';\nimport { calculatePercentages, sortSeriesData } from './utils';\nimport { BarChartBase, BarChartData } from './BarChartBase';\n\nexport type BarChartPanelProps = PanelProps<BarChartOptions, TimeSeriesData>;\n\nexport function BarChartPanel(props: BarChartPanelProps): ReactElement | null {\n const {\n spec: { calculation, format, sort, mode },\n contentDimensions,\n queryResults,\n } = props;\n\n const chartsTheme = useChartsTheme();\n const PADDING = chartsTheme.container.padding.default;\n\n const barChartData: BarChartData[] = useMemo(() => {\n const calculate = CalculationsMap[calculation as CalculationType];\n const barChartData: BarChartData[] = [];\n for (const result of queryResults) {\n for (const seriesData of result.data.series) {\n const series = {\n value: calculate(seriesData.values) ?? null,\n label: seriesData.formattedName ?? '',\n };\n barChartData.push(series);\n }\n }\n\n const sortedBarChartData = sortSeriesData(barChartData, sort);\n if (mode === 'percentage') {\n return calculatePercentages(sortedBarChartData);\n } else {\n return sortedBarChartData;\n }\n }, [queryResults, sort, mode, calculation]);\n\n if (contentDimensions === undefined) return null;\n\n return (\n <Box sx={{ padding: `${PADDING}px` }}>\n <BarChartBase\n width={contentDimensions.width - PADDING * 2}\n height={contentDimensions.height - PADDING * 2}\n data={barChartData}\n format={format}\n mode={mode}\n />\n </Box>\n );\n}\n"],"names":["useChartsTheme","Box","useMemo","CalculationsMap","calculatePercentages","sortSeriesData","BarChartBase","BarChartPanel","props","spec","calculation","format","sort","mode","contentDimensions","queryResults","chartsTheme","PADDING","container","padding","default","barChartData","calculate","result","seriesData","data","series","value","values","label","formattedName","push","sortedBarChartData","undefined","sx","width","height"],"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
|
|
1
|
+
{"version":3,"sources":["../../src/BarChartPanel.tsx"],"sourcesContent":["// Copyright 2023 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 { useChartsTheme } from '@perses-dev/components';\nimport { Box } from '@mui/material';\nimport { ReactElement, useMemo } from 'react';\nimport { CalculationType, CalculationsMap, TimeSeriesData } from '@perses-dev/core';\nimport { PanelProps } from '@perses-dev/plugin-system';\nimport { BarChartOptions } from './bar-chart-model';\nimport { calculatePercentages, sortSeriesData } from './utils';\nimport { BarChartBase, BarChartData } from './BarChartBase';\n\nexport type BarChartPanelProps = PanelProps<BarChartOptions, TimeSeriesData>;\n\nexport function BarChartPanel(props: BarChartPanelProps): ReactElement | null {\n const {\n spec: { calculation, format, sort, mode },\n contentDimensions,\n queryResults,\n } = props;\n\n const chartsTheme = useChartsTheme();\n const PADDING = chartsTheme.container.padding.default;\n\n const barChartData: BarChartData[] = useMemo(() => {\n const calculate = CalculationsMap[calculation as CalculationType];\n const barChartData: BarChartData[] = [];\n for (const result of queryResults) {\n for (const seriesData of result.data.series) {\n const series = {\n value: calculate(seriesData.values) ?? null,\n label: seriesData.formattedName ?? '',\n };\n barChartData.push(series);\n }\n }\n\n const sortedBarChartData = sortSeriesData(barChartData, sort);\n if (mode === 'percentage') {\n return calculatePercentages(sortedBarChartData);\n } else {\n return sortedBarChartData;\n }\n }, [queryResults, sort, mode, calculation]);\n\n if (contentDimensions === undefined) return null;\n\n return (\n <Box sx={{ padding: `${PADDING}px` }}>\n <BarChartBase\n width={contentDimensions.width - PADDING * 2}\n height={contentDimensions.height - PADDING * 2}\n data={barChartData}\n format={format}\n mode={mode}\n />\n </Box>\n );\n}\n"],"names":["useChartsTheme","Box","useMemo","CalculationsMap","calculatePercentages","sortSeriesData","BarChartBase","BarChartPanel","props","spec","calculation","format","sort","mode","contentDimensions","queryResults","chartsTheme","PADDING","container","padding","default","barChartData","calculate","result","seriesData","data","series","value","values","label","formattedName","push","sortedBarChartData","undefined","sx","width","height"],"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,cAAc,QAAQ,yBAAyB;AACxD,SAASC,GAAG,QAAQ,gBAAgB;AACpC,SAAuBC,OAAO,QAAQ,QAAQ;AAC9C,SAA0BC,eAAe,QAAwB,mBAAmB;AAGpF,SAASC,oBAAoB,EAAEC,cAAc,QAAQ,UAAU;AAC/D,SAASC,YAAY,QAAsB,iBAAiB;AAI5D,OAAO,SAASC,cAAcC,KAAyB;IACrD,MAAM,EACJC,MAAM,EAAEC,WAAW,EAAEC,MAAM,EAAEC,IAAI,EAAEC,IAAI,EAAE,EACzCC,iBAAiB,EACjBC,YAAY,EACb,GAAGP;IAEJ,MAAMQ,cAAchB;IACpB,MAAMiB,UAAUD,YAAYE,SAAS,CAACC,OAAO,CAACC,OAAO;IAErD,MAAMC,eAA+BnB,QAAQ;QAC3C,MAAMoB,YAAYnB,eAAe,CAACO,YAA+B;QACjE,MAAMW,eAA+B,EAAE;QACvC,KAAK,MAAME,UAAUR,aAAc;YACjC,KAAK,MAAMS,cAAcD,OAAOE,IAAI,CAACC,MAAM,CAAE;gBAC3C,MAAMA,SAAS;oBACbC,OAAOL,UAAUE,WAAWI,MAAM,KAAK;oBACvCC,OAAOL,WAAWM,aAAa,IAAI;gBACrC;gBACAT,aAAaU,IAAI,CAACL;YACpB;QACF;QAEA,MAAMM,qBAAqB3B,eAAegB,cAAcT;QACxD,IAAIC,SAAS,cAAc;YACzB,OAAOT,qBAAqB4B;QAC9B,OAAO;YACL,OAAOA;QACT;IACF,GAAG;QAACjB;QAAcH;QAAMC;QAAMH;KAAY;IAE1C,IAAII,sBAAsBmB,WAAW,OAAO;IAE5C,qBACE,KAAChC;QAAIiC,IAAI;YAAEf,SAAS,GAAGF,QAAQ,EAAE,CAAC;QAAC;kBACjC,cAAA,KAACX;YACC6B,OAAOrB,kBAAkBqB,KAAK,GAAGlB,UAAU;YAC3CmB,QAAQtB,kBAAkBsB,MAAM,GAAGnB,UAAU;YAC7CQ,MAAMJ;YACNV,QAAQA;YACRE,MAAMA;;;AAId"}
|
package/lib/bootstrap.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
// Copyright 2024 The Perses Authors
|
|
2
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -10,7 +11,6 @@
|
|
|
10
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
12
|
// See the License for the specific language governing permissions and
|
|
12
13
|
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import ReactDOM from 'react-dom/client';
|
|
16
16
|
const root = ReactDOM.createRoot(document.getElementById('root'));
|
package/lib/bootstrap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bootstrap.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React from 'react';\nimport ReactDOM from 'react-dom/client';\n\nconst root = ReactDOM.createRoot(document.getElementById('root')!);\nroot.render(<React.StrictMode></React.StrictMode>);\n"],"names":["React","ReactDOM","root","createRoot","document","getElementById","render","StrictMode"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC
|
|
1
|
+
{"version":3,"sources":["../../src/bootstrap.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React from 'react';\nimport ReactDOM from 'react-dom/client';\n\nconst root = ReactDOM.createRoot(document.getElementById('root')!);\nroot.render(<React.StrictMode></React.StrictMode>);\n"],"names":["React","ReactDOM","root","createRoot","document","getElementById","render","StrictMode"],"mappings":";AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAOA,WAAW,QAAQ;AAC1B,OAAOC,cAAc,mBAAmB;AAExC,MAAMC,OAAOD,SAASE,UAAU,CAACC,SAASC,cAAc,CAAC;AACzDH,KAAKI,MAAM,eAAC,KAACN,MAAMO,UAAU"}
|
package/lib/cjs/BarChartBase.js
CHANGED
|
@@ -17,20 +17,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
function _export(target, all) {
|
|
18
18
|
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
DEFAULT_FORMAT
|
|
24
|
+
get DEFAULT_FORMAT () {
|
|
25
25
|
return DEFAULT_FORMAT;
|
|
26
26
|
},
|
|
27
|
-
DEFAULT_MODE
|
|
27
|
+
get DEFAULT_MODE () {
|
|
28
28
|
return DEFAULT_MODE;
|
|
29
29
|
},
|
|
30
|
-
DEFAULT_SORT
|
|
30
|
+
get DEFAULT_SORT () {
|
|
31
31
|
return DEFAULT_SORT;
|
|
32
32
|
},
|
|
33
|
-
createInitialBarChartOptions
|
|
33
|
+
get createInitialBarChartOptions () {
|
|
34
34
|
return createInitialBarChartOptions;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
// Copyright 2024 The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
1
|
"use strict";
|
|
14
2
|
function _getRequireWildcardCache(nodeInterop) {
|
|
15
3
|
if (typeof WeakMap !== "function") return null;
|
|
@@ -52,4 +40,16 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
52
40
|
}
|
|
53
41
|
return newObj;
|
|
54
42
|
}
|
|
43
|
+
// Copyright 2024 The Perses Authors
|
|
44
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
45
|
+
// you may not use this file except in compliance with the License.
|
|
46
|
+
// You may obtain a copy of the License at
|
|
47
|
+
//
|
|
48
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
49
|
+
//
|
|
50
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
51
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
52
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
53
|
+
// See the License for the specific language governing permissions and
|
|
54
|
+
// limitations under the License.
|
|
55
55
|
Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./bootstrap")));
|
package/lib/cjs/tresholds.js
CHANGED
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
convertThresholds
|
|
12
|
+
get convertThresholds () {
|
|
13
13
|
return convertThresholds;
|
|
14
14
|
},
|
|
15
|
-
defaultThresholdInput
|
|
15
|
+
get defaultThresholdInput () {
|
|
16
16
|
return defaultThresholdInput;
|
|
17
17
|
}
|
|
18
18
|
});
|
package/lib/cjs/utils.js
CHANGED
|
@@ -17,14 +17,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
function _export(target, all) {
|
|
18
18
|
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
calculatePercentages
|
|
24
|
+
get calculatePercentages () {
|
|
25
25
|
return calculatePercentages;
|
|
26
26
|
},
|
|
27
|
-
sortSeriesData
|
|
27
|
+
get sortSeriesData () {
|
|
28
28
|
return sortSeriesData;
|
|
29
29
|
}
|
|
30
30
|
});
|
package/mf-manifest.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"name": "BarChart",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.
|
|
8
|
+
"buildVersion": "0.10.1",
|
|
9
9
|
"buildName": "@perses-dev/bar-chart-plugin"
|
|
10
10
|
},
|
|
11
11
|
"remoteEntry": {
|
|
12
|
-
"name": "__mf/js/BarChart.
|
|
12
|
+
"name": "__mf/js/BarChart.fd19299c.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"api": ""
|
|
21
21
|
},
|
|
22
22
|
"globalName": "BarChart",
|
|
23
|
-
"pluginVersion": "0.
|
|
23
|
+
"pluginVersion": "0.21.6",
|
|
24
24
|
"prefetchInterface": false,
|
|
25
|
-
"
|
|
25
|
+
"getPublicPath": "function() { const prefix = window.PERSES_PLUGIN_ASSETS_PATH || window.PERSES_APP_CONFIG?.api_prefix || \"\"; return prefix + \"/plugins/BarChart/\"; }"
|
|
26
26
|
},
|
|
27
27
|
"shared": [
|
|
28
28
|
{
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"js": {
|
|
36
36
|
"async": [],
|
|
37
37
|
"sync": [
|
|
38
|
-
"__mf/js/async/
|
|
38
|
+
"__mf/js/async/274.9bfff28e.js"
|
|
39
39
|
]
|
|
40
40
|
},
|
|
41
41
|
"css": {
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"js": {
|
|
55
55
|
"async": [],
|
|
56
56
|
"sync": [
|
|
57
|
-
"__mf/js/async/
|
|
58
|
-
"__mf/js/async/
|
|
59
|
-
"__mf/js/async/
|
|
57
|
+
"__mf/js/async/235.951938a6.js",
|
|
58
|
+
"__mf/js/async/616.302bdae0.js",
|
|
59
|
+
"__mf/js/async/854.63eee34f.js"
|
|
60
60
|
]
|
|
61
61
|
},
|
|
62
62
|
"css": {
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"js": {
|
|
76
76
|
"async": [],
|
|
77
77
|
"sync": [
|
|
78
|
-
"__mf/js/async/
|
|
79
|
-
"__mf/js/async/
|
|
78
|
+
"__mf/js/async/587.bcc920f1.js",
|
|
79
|
+
"__mf/js/async/968.d562d0d2.js"
|
|
80
80
|
]
|
|
81
81
|
},
|
|
82
82
|
"css": {
|
|
@@ -88,14 +88,14 @@
|
|
|
88
88
|
{
|
|
89
89
|
"id": "BarChart:@perses-dev/components",
|
|
90
90
|
"name": "@perses-dev/components",
|
|
91
|
-
"version": "0.
|
|
91
|
+
"version": "0.53.0-beta.2",
|
|
92
92
|
"singleton": true,
|
|
93
|
-
"requiredVersion": "^0.
|
|
93
|
+
"requiredVersion": "^0.53.0-beta.2",
|
|
94
94
|
"assets": {
|
|
95
95
|
"js": {
|
|
96
96
|
"async": [],
|
|
97
97
|
"sync": [
|
|
98
|
-
"__mf/js/async/
|
|
98
|
+
"__mf/js/async/790.847088e2.js"
|
|
99
99
|
]
|
|
100
100
|
},
|
|
101
101
|
"css": {
|
|
@@ -107,14 +107,14 @@
|
|
|
107
107
|
{
|
|
108
108
|
"id": "BarChart:@perses-dev/plugin-system",
|
|
109
109
|
"name": "@perses-dev/plugin-system",
|
|
110
|
-
"version": "0.
|
|
110
|
+
"version": "0.53.0-beta.2",
|
|
111
111
|
"singleton": true,
|
|
112
|
-
"requiredVersion": "^0.
|
|
112
|
+
"requiredVersion": "^0.53.0-beta.2",
|
|
113
113
|
"assets": {
|
|
114
114
|
"js": {
|
|
115
115
|
"async": [],
|
|
116
116
|
"sync": [
|
|
117
|
-
"__mf/js/async/
|
|
117
|
+
"__mf/js/async/252.3ffb7009.js"
|
|
118
118
|
]
|
|
119
119
|
},
|
|
120
120
|
"css": {
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"js": {
|
|
134
134
|
"async": [],
|
|
135
135
|
"sync": [
|
|
136
|
-
"__mf/js/async/
|
|
136
|
+
"__mf/js/async/192.73182890.js"
|
|
137
137
|
]
|
|
138
138
|
},
|
|
139
139
|
"css": {
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"js": {
|
|
153
153
|
"async": [],
|
|
154
154
|
"sync": [
|
|
155
|
-
"__mf/js/async/
|
|
155
|
+
"__mf/js/async/873.fa6a97f2.js"
|
|
156
156
|
]
|
|
157
157
|
},
|
|
158
158
|
"css": {
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
"js": {
|
|
172
172
|
"async": [],
|
|
173
173
|
"sync": [
|
|
174
|
-
"__mf/js/async/
|
|
174
|
+
"__mf/js/async/963.85d5346b.js"
|
|
175
175
|
]
|
|
176
176
|
},
|
|
177
177
|
"css": {
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
"js": {
|
|
191
191
|
"async": [],
|
|
192
192
|
"sync": [
|
|
193
|
-
"__mf/js/async/
|
|
193
|
+
"__mf/js/async/392.7bfcf9f9.js"
|
|
194
194
|
]
|
|
195
195
|
},
|
|
196
196
|
"css": {
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
"js": {
|
|
210
210
|
"async": [],
|
|
211
211
|
"sync": [
|
|
212
|
-
"__mf/js/async/
|
|
212
|
+
"__mf/js/async/496.b35b3a0a.js"
|
|
213
213
|
]
|
|
214
214
|
},
|
|
215
215
|
"css": {
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
"js": {
|
|
229
229
|
"async": [],
|
|
230
230
|
"sync": [
|
|
231
|
-
"__mf/js/async/
|
|
231
|
+
"__mf/js/async/470.82e9b967.js"
|
|
232
232
|
]
|
|
233
233
|
},
|
|
234
234
|
"css": {
|
|
@@ -247,7 +247,7 @@
|
|
|
247
247
|
"js": {
|
|
248
248
|
"async": [],
|
|
249
249
|
"sync": [
|
|
250
|
-
"__mf/js/async/
|
|
250
|
+
"__mf/js/async/121.517e00e8.js"
|
|
251
251
|
]
|
|
252
252
|
},
|
|
253
253
|
"css": {
|
|
@@ -266,8 +266,8 @@
|
|
|
266
266
|
"js": {
|
|
267
267
|
"async": [],
|
|
268
268
|
"sync": [
|
|
269
|
-
"__mf/js/async/
|
|
270
|
-
"__mf/js/async/
|
|
269
|
+
"__mf/js/async/458.cffba90f.js",
|
|
270
|
+
"__mf/js/async/77.f584b802.js"
|
|
271
271
|
]
|
|
272
272
|
},
|
|
273
273
|
"css": {
|
|
@@ -286,7 +286,7 @@
|
|
|
286
286
|
"js": {
|
|
287
287
|
"async": [],
|
|
288
288
|
"sync": [
|
|
289
|
-
"__mf/js/async/
|
|
289
|
+
"__mf/js/async/978.458b6e7d.js"
|
|
290
290
|
]
|
|
291
291
|
},
|
|
292
292
|
"css": {
|
|
@@ -304,27 +304,27 @@
|
|
|
304
304
|
"assets": {
|
|
305
305
|
"js": {
|
|
306
306
|
"sync": [
|
|
307
|
-
"__mf/js/async/
|
|
308
|
-
"__mf/js/async/
|
|
309
|
-
"__mf/js/async/
|
|
310
|
-
"__mf/js/async/
|
|
311
|
-
"__mf/js/async/__federation_expose_BarChart.
|
|
307
|
+
"__mf/js/async/703.16dd2eaa.js",
|
|
308
|
+
"__mf/js/async/255.41e8af2d.js",
|
|
309
|
+
"__mf/js/async/582.9dfe893c.js",
|
|
310
|
+
"__mf/js/async/102.b7abdc1f.js",
|
|
311
|
+
"__mf/js/async/__federation_expose_BarChart.13bf419c.js"
|
|
312
312
|
],
|
|
313
313
|
"async": [
|
|
314
|
-
"__mf/js/async/
|
|
315
|
-
"__mf/js/async/
|
|
316
|
-
"__mf/js/async/
|
|
317
|
-
"__mf/js/async/
|
|
318
|
-
"__mf/js/async/
|
|
319
|
-
"__mf/js/async/lib-router.
|
|
320
|
-
"__mf/js/async/
|
|
314
|
+
"__mf/js/async/588.680cfad0.js",
|
|
315
|
+
"__mf/js/async/71.dab9ec76.js",
|
|
316
|
+
"__mf/js/async/356.6146b01c.js",
|
|
317
|
+
"__mf/js/async/160.0b10468b.js",
|
|
318
|
+
"__mf/js/async/554.82e03ea5.js",
|
|
319
|
+
"__mf/js/async/lib-router.4740fed2.js",
|
|
320
|
+
"__mf/js/async/177.91621efa.js"
|
|
321
321
|
]
|
|
322
322
|
},
|
|
323
323
|
"css": {
|
|
324
324
|
"sync": [],
|
|
325
325
|
"async": [
|
|
326
|
-
"__mf/css/async/
|
|
327
|
-
"__mf/css/async/
|
|
326
|
+
"__mf/css/async/61.d3010b86.css",
|
|
327
|
+
"__mf/css/async/823.d3010b86.css"
|
|
328
328
|
]
|
|
329
329
|
}
|
|
330
330
|
},
|