@mui/x-charts-pro 8.0.0-alpha.9 → 8.0.0-beta.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/BarChartPro/BarChartPro.d.ts +4 -4
- package/BarChartPro/BarChartPro.js +240 -284
- package/BarChartPro/BarChartPro.plugins.d.ts +4 -0
- package/BarChartPro/BarChartPro.plugins.js +9 -0
- package/BarChartPro/index.d.ts +1 -1
- package/BarChartPro/index.js +16 -1
- package/CHANGELOG.md +1523 -0
- package/ChartContainerPro/ChartContainerPro.d.ts +8 -9
- package/ChartContainerPro/ChartContainerPro.js +181 -174
- package/ChartContainerPro/index.d.ts +2 -1
- package/ChartContainerPro/index.js +17 -1
- package/ChartContainerPro/useChartContainerProProps.d.ts +5 -5
- package/ChartContainerPro/useChartContainerProProps.js +28 -19
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +7 -7
- package/ChartDataProviderPro/ChartDataProviderPro.js +40 -220
- package/ChartDataProviderPro/index.d.ts +2 -1
- package/ChartDataProviderPro/index.js +17 -1
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +7 -7
- package/ChartDataProviderPro/useChartDataProviderProProps.js +10 -6
- package/FunnelChart/FunnelChart.d.ts +37 -0
- package/FunnelChart/FunnelChart.js +218 -0
- package/FunnelChart/FunnelPlot.d.ts +16 -0
- package/FunnelChart/FunnelPlot.js +191 -0
- package/FunnelChart/FunnelSection.d.ts +15 -0
- package/FunnelChart/FunnelSection.js +62 -0
- package/FunnelChart/categoryAxis.types.d.ts +24 -0
- package/FunnelChart/funnel.types.d.ts +124 -0
- package/FunnelChart/funnelPlotSlots.types.d.ts +20 -0
- package/FunnelChart/funnelSectionClasses.d.ts +13 -0
- package/FunnelChart/funnelSectionClasses.js +28 -0
- package/FunnelChart/funnelSlots.types.d.ts +19 -0
- package/FunnelChart/funnelStepCurve.d.ts +4 -0
- package/FunnelChart/funnelStepCurve.js +74 -0
- package/FunnelChart/index.d.ts +7 -0
- package/FunnelChart/index.js +59 -0
- package/FunnelChart/labelUtils.d.ts +42 -0
- package/FunnelChart/labelUtils.js +174 -0
- package/FunnelChart/seriesConfig/extremums.d.ts +3 -0
- package/FunnelChart/seriesConfig/extremums.js +50 -0
- package/FunnelChart/seriesConfig/getColor.d.ts +3 -0
- package/FunnelChart/seriesConfig/getColor.js +10 -0
- package/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +18 -0
- package/FunnelChart/seriesConfig/index.d.ts +2 -0
- package/FunnelChart/seriesConfig/index.js +22 -0
- package/FunnelChart/seriesConfig/legend.d.ts +3 -0
- package/FunnelChart/seriesConfig/legend.js +31 -0
- package/FunnelChart/seriesConfig/seriesProcessor.d.ts +3 -0
- package/FunnelChart/seriesConfig/seriesProcessor.js +96 -0
- package/FunnelChart/seriesConfig/tooltip.d.ts +3 -0
- package/FunnelChart/seriesConfig/tooltip.js +36 -0
- package/FunnelChart/useFunnelChartProps.d.ts +30 -0
- package/FunnelChart/useFunnelChartProps.js +168 -0
- package/Heatmap/Heatmap.d.ts +45 -45
- package/Heatmap/Heatmap.js +236 -244
- package/Heatmap/Heatmap.plugins.d.ts +3 -0
- package/Heatmap/Heatmap.plugins.js +8 -0
- package/Heatmap/HeatmapItem.d.ts +33 -33
- package/Heatmap/HeatmapItem.js +43 -36
- package/Heatmap/HeatmapPlot.d.ts +4 -5
- package/Heatmap/HeatmapPlot.js +22 -16
- package/Heatmap/HeatmapTooltip.d.ts +9 -2
- package/Heatmap/HeatmapTooltip.js +110 -90
- package/Heatmap/heatmapClasses.d.ts +7 -7
- package/Heatmap/heatmapClasses.js +15 -7
- package/Heatmap/index.d.ts +4 -4
- package/Heatmap/index.js +47 -4
- package/Heatmap/{extremums.d.ts → seriesConfig/extremums.d.ts} +1 -1
- package/Heatmap/{getColor.d.ts → seriesConfig/getColor.d.ts} +1 -1
- package/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +15 -0
- package/Heatmap/seriesConfig/index.d.ts +2 -0
- package/Heatmap/seriesConfig/index.js +21 -0
- package/Heatmap/seriesConfig/seriesProcessor.d.ts +3 -0
- package/{node/Heatmap/formatter.js → Heatmap/seriesConfig/seriesProcessor.js} +2 -2
- package/Heatmap/seriesConfig/tooltip.d.ts +3 -0
- package/Heatmap/seriesConfig/tooltip.js +31 -0
- package/LineChartPro/LineChartPro.d.ts +4 -4
- package/LineChartPro/LineChartPro.js +242 -340
- package/LineChartPro/LineChartPro.plugins.d.ts +4 -0
- package/LineChartPro/LineChartPro.plugins.js +9 -0
- package/LineChartPro/index.d.ts +1 -1
- package/LineChartPro/index.js +16 -1
- package/README.md +1 -1
- package/ScatterChartPro/ScatterChartPro.d.ts +4 -4
- package/ScatterChartPro/ScatterChartPro.js +244 -235
- package/ScatterChartPro/ScatterChartPro.plugins.d.ts +4 -0
- package/ScatterChartPro/ScatterChartPro.plugins.js +9 -0
- package/ScatterChartPro/index.d.ts +1 -1
- package/ScatterChartPro/index.js +16 -1
- package/esm/BarChartPro/BarChartPro.d.ts +18 -0
- package/esm/BarChartPro/BarChartPro.js +404 -0
- package/esm/BarChartPro/BarChartPro.plugins.d.ts +4 -0
- package/esm/BarChartPro/BarChartPro.plugins.js +3 -0
- package/esm/BarChartPro/index.d.ts +1 -0
- package/esm/BarChartPro/index.js +1 -0
- package/esm/ChartContainerPro/ChartContainerPro.d.ts +35 -0
- package/esm/ChartContainerPro/ChartContainerPro.js +290 -0
- package/esm/ChartContainerPro/index.d.ts +2 -0
- package/esm/ChartContainerPro/index.js +2 -0
- package/esm/ChartContainerPro/useChartContainerProProps.d.ts +9 -0
- package/esm/ChartContainerPro/useChartContainerProProps.js +35 -0
- package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +106 -0
- package/esm/ChartDataProviderPro/index.d.ts +2 -0
- package/esm/ChartDataProviderPro/index.js +2 -0
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +8 -0
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.js +15 -0
- package/esm/FunnelChart/FunnelChart.d.ts +37 -0
- package/esm/FunnelChart/FunnelChart.js +212 -0
- package/esm/FunnelChart/FunnelPlot.d.ts +16 -0
- package/esm/FunnelChart/FunnelPlot.js +184 -0
- package/esm/FunnelChart/FunnelSection.d.ts +15 -0
- package/esm/FunnelChart/FunnelSection.js +56 -0
- package/esm/FunnelChart/categoryAxis.types.d.ts +24 -0
- package/esm/FunnelChart/funnel.types.d.ts +124 -0
- package/esm/FunnelChart/funnelPlotSlots.types.d.ts +20 -0
- package/esm/FunnelChart/funnelPlotSlots.types.js +1 -0
- package/esm/FunnelChart/funnelSectionClasses.d.ts +13 -0
- package/esm/FunnelChart/funnelSectionClasses.js +20 -0
- package/esm/FunnelChart/funnelSlots.types.d.ts +19 -0
- package/esm/FunnelChart/funnelSlots.types.js +1 -0
- package/esm/FunnelChart/funnelStepCurve.d.ts +4 -0
- package/esm/FunnelChart/funnelStepCurve.js +67 -0
- package/esm/FunnelChart/index.d.ts +7 -0
- package/esm/FunnelChart/index.js +5 -0
- package/esm/FunnelChart/labelUtils.d.ts +42 -0
- package/esm/FunnelChart/labelUtils.js +166 -0
- package/esm/FunnelChart/seriesConfig/extremums.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/extremums.js +42 -0
- package/esm/FunnelChart/seriesConfig/getColor.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/getColor.js +4 -0
- package/esm/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +11 -0
- package/esm/FunnelChart/seriesConfig/index.d.ts +2 -0
- package/esm/FunnelChart/seriesConfig/index.js +15 -0
- package/esm/FunnelChart/seriesConfig/legend.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/legend.js +25 -0
- package/esm/FunnelChart/seriesConfig/seriesProcessor.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/seriesProcessor.js +89 -0
- package/esm/FunnelChart/seriesConfig/tooltip.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/tooltip.js +29 -0
- package/esm/FunnelChart/useFunnelChartProps.d.ts +30 -0
- package/esm/FunnelChart/useFunnelChartProps.js +161 -0
- package/esm/Heatmap/Heatmap.d.ts +57 -0
- package/esm/Heatmap/Heatmap.js +387 -0
- package/esm/Heatmap/Heatmap.plugins.d.ts +3 -0
- package/esm/Heatmap/Heatmap.plugins.js +2 -0
- package/esm/Heatmap/HeatmapItem.d.ts +49 -0
- package/esm/Heatmap/HeatmapItem.js +106 -0
- package/esm/Heatmap/HeatmapPlot.d.ts +8 -0
- package/{node → esm}/Heatmap/HeatmapPlot.js +16 -22
- package/esm/Heatmap/HeatmapTooltip.d.ts +16 -0
- package/esm/Heatmap/HeatmapTooltip.js +288 -0
- package/esm/Heatmap/heatmapClasses.d.ts +11 -0
- package/esm/Heatmap/heatmapClasses.js +14 -0
- package/esm/Heatmap/index.d.ts +4 -0
- package/esm/Heatmap/index.js +4 -0
- package/esm/Heatmap/seriesConfig/extremums.d.ts +2 -0
- package/esm/Heatmap/seriesConfig/getColor.d.ts +3 -0
- package/esm/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/esm/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +8 -0
- package/esm/Heatmap/seriesConfig/index.d.ts +2 -0
- package/esm/Heatmap/seriesConfig/index.js +14 -0
- package/esm/Heatmap/seriesConfig/seriesProcessor.d.ts +3 -0
- package/{Heatmap/formatter.js → esm/Heatmap/seriesConfig/seriesProcessor.js} +2 -2
- package/esm/Heatmap/seriesConfig/tooltip.d.ts +3 -0
- package/esm/Heatmap/seriesConfig/tooltip.js +25 -0
- package/esm/LineChartPro/LineChartPro.d.ts +17 -0
- package/esm/LineChartPro/LineChartPro.js +401 -0
- package/esm/LineChartPro/LineChartPro.plugins.d.ts +4 -0
- package/esm/LineChartPro/LineChartPro.plugins.js +3 -0
- package/esm/LineChartPro/index.d.ts +1 -0
- package/esm/LineChartPro/index.js +1 -0
- package/esm/ScatterChartPro/ScatterChartPro.d.ts +17 -0
- package/esm/ScatterChartPro/ScatterChartPro.js +395 -0
- package/esm/ScatterChartPro/ScatterChartPro.plugins.d.ts +4 -0
- package/esm/ScatterChartPro/ScatterChartPro.plugins.js +3 -0
- package/esm/ScatterChartPro/index.d.ts +1 -0
- package/esm/ScatterChartPro/index.js +1 -0
- package/esm/hooks/index.d.ts +2 -0
- package/esm/hooks/index.js +2 -0
- package/esm/hooks/useFunnelSeries.d.ts +33 -0
- package/esm/hooks/useFunnelSeries.js +42 -0
- package/esm/hooks/useHeatmapSeries.d.ts +33 -0
- package/esm/hooks/useHeatmapSeries.js +42 -0
- package/esm/hooks/zoom/index.d.ts +1 -0
- package/esm/hooks/zoom/index.js +1 -0
- package/esm/hooks/zoom/useIsZoomInteracting.d.ts +6 -0
- package/esm/hooks/zoom/useIsZoomInteracting.js +14 -0
- package/esm/index.d.ts +34 -0
- package/esm/index.js +45 -0
- package/esm/internals/plugins/allPlugins.d.ts +8 -0
- package/esm/internals/plugins/allPlugins.js +6 -0
- package/esm/internals/plugins/useChartProZoom/index.d.ts +3 -0
- package/esm/internals/plugins/useChartProZoom/index.js +3 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.d.ts +3 -0
- package/{node → esm}/internals/plugins/useChartProZoom/useChartProZoom.js +94 -54
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +203 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +4 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +53 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.types.js +1 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +45 -0
- package/{node → esm}/internals/plugins/useChartProZoom/useChartProZoom.utils.js +8 -22
- package/esm/internals/utils/releaseInfo.d.ts +1 -0
- package/esm/internals/utils/releaseInfo.js +13 -0
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.js +2 -0
- package/esm/models/seriesType/heatmap.d.ts +28 -0
- package/esm/models/seriesType/heatmap.js +1 -0
- package/esm/models/seriesType/index.d.ts +1 -0
- package/esm/models/seriesType/index.js +1 -0
- package/esm/package.json +1 -0
- package/esm/themeAugmentation/components.d.ts +23 -0
- package/esm/themeAugmentation/index.d.ts +4 -0
- package/esm/themeAugmentation/index.js +0 -0
- package/esm/themeAugmentation/overrides.d.ts +11 -0
- package/esm/themeAugmentation/props.d.ts +20 -0
- package/esm/typeOverloads/index.d.ts +1 -0
- package/esm/typeOverloads/index.js +1 -0
- package/esm/typeOverloads/modules.d.ts +33 -0
- package/esm/typeOverloads/modules.js +1 -0
- package/hooks/index.d.ts +2 -2
- package/hooks/index.js +27 -2
- package/hooks/useFunnelSeries.d.ts +33 -0
- package/hooks/useFunnelSeries.js +48 -0
- package/hooks/useHeatmapSeries.d.ts +33 -0
- package/hooks/useHeatmapSeries.js +48 -0
- package/hooks/zoom/index.d.ts +1 -1
- package/hooks/zoom/index.js +16 -1
- package/hooks/zoom/useIsZoomInteracting.d.ts +1 -1
- package/hooks/zoom/useIsZoomInteracting.js +10 -5
- package/index.d.ts +10 -8
- package/index.js +369 -37
- package/internals/plugins/allPlugins.d.ts +7 -9
- package/internals/plugins/allPlugins.js +10 -3
- package/internals/plugins/useChartProZoom/index.d.ts +3 -3
- package/internals/plugins/useChartProZoom/index.js +38 -3
- package/internals/plugins/useChartProZoom/useChartProZoom.d.ts +2 -2
- package/internals/plugins/useChartProZoom/useChartProZoom.js +101 -47
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +154 -328
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +11 -10
- package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +42 -39
- package/internals/plugins/useChartProZoom/useChartProZoom.types.js +5 -1
- package/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +13 -13
- package/internals/plugins/useChartProZoom/useChartProZoom.utils.js +22 -8
- package/internals/utils/releaseInfo.d.ts +1 -1
- package/internals/utils/releaseInfo.js +13 -5
- package/models/index.d.ts +1 -1
- package/models/index.js +16 -2
- package/models/seriesType/heatmap.d.ts +18 -19
- package/models/seriesType/heatmap.js +5 -1
- package/models/seriesType/index.d.ts +1 -1
- package/models/seriesType/index.js +16 -1
- package/modern/BarChartPro/BarChartPro.d.ts +18 -0
- package/modern/BarChartPro/BarChartPro.js +35 -85
- package/modern/BarChartPro/BarChartPro.plugins.d.ts +4 -0
- package/modern/BarChartPro/BarChartPro.plugins.js +3 -0
- package/modern/BarChartPro/index.d.ts +1 -0
- package/modern/ChartContainerPro/ChartContainerPro.d.ts +35 -0
- package/modern/ChartContainerPro/ChartContainerPro.js +4 -3
- package/modern/ChartContainerPro/index.d.ts +2 -0
- package/modern/ChartContainerPro/index.js +1 -0
- package/modern/ChartContainerPro/useChartContainerProProps.d.ts +9 -0
- package/modern/ChartContainerPro/useChartContainerProProps.js +15 -13
- package/modern/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
- package/modern/ChartDataProviderPro/ChartDataProviderPro.js +18 -204
- package/modern/ChartDataProviderPro/index.d.ts +2 -0
- package/modern/ChartDataProviderPro/index.js +1 -0
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.d.ts +8 -0
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.js +0 -2
- package/modern/FunnelChart/FunnelChart.d.ts +37 -0
- package/modern/FunnelChart/FunnelChart.js +212 -0
- package/modern/FunnelChart/FunnelPlot.d.ts +16 -0
- package/modern/FunnelChart/FunnelPlot.js +184 -0
- package/modern/FunnelChart/FunnelSection.d.ts +15 -0
- package/modern/FunnelChart/FunnelSection.js +56 -0
- package/modern/FunnelChart/categoryAxis.types.d.ts +24 -0
- package/modern/FunnelChart/categoryAxis.types.js +1 -0
- package/modern/FunnelChart/funnel.types.d.ts +124 -0
- package/modern/FunnelChart/funnel.types.js +1 -0
- package/modern/FunnelChart/funnelPlotSlots.types.d.ts +20 -0
- package/modern/FunnelChart/funnelPlotSlots.types.js +1 -0
- package/modern/FunnelChart/funnelSectionClasses.d.ts +13 -0
- package/modern/FunnelChart/funnelSectionClasses.js +20 -0
- package/modern/FunnelChart/funnelSlots.types.d.ts +19 -0
- package/modern/FunnelChart/funnelSlots.types.js +1 -0
- package/modern/FunnelChart/funnelStepCurve.d.ts +4 -0
- package/modern/FunnelChart/funnelStepCurve.js +67 -0
- package/modern/FunnelChart/index.d.ts +7 -0
- package/modern/FunnelChart/index.js +5 -0
- package/modern/FunnelChart/labelUtils.d.ts +42 -0
- package/modern/FunnelChart/labelUtils.js +166 -0
- package/modern/FunnelChart/seriesConfig/extremums.d.ts +3 -0
- package/modern/FunnelChart/seriesConfig/extremums.js +42 -0
- package/modern/FunnelChart/seriesConfig/getColor.d.ts +3 -0
- package/modern/FunnelChart/seriesConfig/getColor.js +4 -0
- package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +11 -0
- package/modern/FunnelChart/seriesConfig/index.d.ts +2 -0
- package/modern/FunnelChart/seriesConfig/index.js +15 -0
- package/modern/FunnelChart/seriesConfig/legend.d.ts +3 -0
- package/modern/FunnelChart/seriesConfig/legend.js +25 -0
- package/modern/FunnelChart/seriesConfig/seriesProcessor.d.ts +3 -0
- package/modern/FunnelChart/seriesConfig/seriesProcessor.js +89 -0
- package/modern/FunnelChart/seriesConfig/tooltip.d.ts +3 -0
- package/modern/FunnelChart/seriesConfig/tooltip.js +29 -0
- package/modern/FunnelChart/useFunnelChartProps.d.ts +30 -0
- package/modern/FunnelChart/useFunnelChartProps.js +161 -0
- package/modern/Heatmap/Heatmap.d.ts +57 -0
- package/modern/Heatmap/Heatmap.js +47 -61
- package/modern/Heatmap/Heatmap.plugins.d.ts +3 -0
- package/modern/Heatmap/Heatmap.plugins.js +2 -0
- package/modern/Heatmap/HeatmapItem.d.ts +49 -0
- package/modern/Heatmap/HeatmapItem.js +7 -7
- package/modern/Heatmap/HeatmapPlot.d.ts +8 -0
- package/modern/Heatmap/HeatmapPlot.js +2 -2
- package/modern/Heatmap/HeatmapTooltip.d.ts +16 -0
- package/modern/Heatmap/HeatmapTooltip.js +21 -7
- package/modern/Heatmap/heatmapClasses.d.ts +11 -0
- package/modern/Heatmap/index.d.ts +4 -0
- package/modern/Heatmap/seriesConfig/extremums.d.ts +2 -0
- package/modern/Heatmap/seriesConfig/getColor.d.ts +3 -0
- package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +8 -0
- package/modern/Heatmap/seriesConfig/index.d.ts +2 -0
- package/modern/Heatmap/seriesConfig/index.js +14 -0
- package/modern/Heatmap/seriesConfig/seriesProcessor.d.ts +3 -0
- package/modern/Heatmap/{formatter.js → seriesConfig/seriesProcessor.js} +2 -2
- package/modern/Heatmap/seriesConfig/tooltip.d.ts +3 -0
- package/modern/Heatmap/seriesConfig/tooltip.js +25 -0
- package/modern/LineChartPro/LineChartPro.d.ts +17 -0
- package/modern/LineChartPro/LineChartPro.js +36 -140
- package/modern/LineChartPro/LineChartPro.plugins.d.ts +4 -0
- package/modern/LineChartPro/LineChartPro.plugins.js +3 -0
- package/modern/LineChartPro/index.d.ts +1 -0
- package/modern/ScatterChartPro/ScatterChartPro.d.ts +17 -0
- package/modern/ScatterChartPro/ScatterChartPro.js +40 -37
- package/modern/ScatterChartPro/ScatterChartPro.plugins.d.ts +4 -0
- package/modern/ScatterChartPro/ScatterChartPro.plugins.js +3 -0
- package/modern/ScatterChartPro/index.d.ts +1 -0
- package/modern/hooks/index.d.ts +2 -0
- package/modern/hooks/index.js +1 -1
- package/modern/hooks/useFunnelSeries.d.ts +33 -0
- package/modern/hooks/useFunnelSeries.js +42 -0
- package/modern/hooks/useHeatmapSeries.d.ts +33 -0
- package/modern/hooks/useHeatmapSeries.js +42 -0
- package/modern/hooks/zoom/index.d.ts +1 -0
- package/modern/hooks/zoom/useIsZoomInteracting.d.ts +6 -0
- package/modern/index.d.ts +34 -0
- package/modern/index.js +5 -4
- package/modern/internals/plugins/allPlugins.d.ts +8 -0
- package/modern/internals/plugins/allPlugins.js +3 -2
- package/modern/internals/plugins/useChartProZoom/index.d.ts +3 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.d.ts +3 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +65 -18
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +203 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +1 -7
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +53 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +45 -0
- package/modern/internals/utils/releaseInfo.d.ts +1 -0
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/models/index.d.ts +2 -0
- package/modern/models/seriesType/heatmap.d.ts +28 -0
- package/modern/models/seriesType/index.d.ts +1 -0
- package/modern/package.json +1 -0
- package/modern/themeAugmentation/components.d.ts +23 -0
- package/modern/themeAugmentation/index.d.ts +4 -0
- package/modern/themeAugmentation/overrides.d.ts +11 -0
- package/modern/themeAugmentation/props.d.ts +20 -0
- package/modern/typeOverloads/index.d.ts +1 -0
- package/modern/typeOverloads/modules.d.ts +33 -0
- package/package.json +44 -11
- package/themeAugmentation/components.d.ts +1 -3
- package/themeAugmentation/index.d.ts +1 -1
- package/themeAugmentation/index.js +1 -0
- package/themeAugmentation/overrides.d.ts +2 -4
- package/themeAugmentation/props.d.ts +5 -7
- package/tsconfig.build.tsbuildinfo +1 -0
- package/typeOverloads/index.d.ts +1 -1
- package/typeOverloads/index.js +6 -1
- package/typeOverloads/modules.d.ts +32 -24
- package/typeOverloads/modules.js +5 -1
- package/BarChartPro/package.json +0 -6
- package/ChartContainerPro/package.json +0 -6
- package/ChartDataProviderPro/package.json +0 -6
- package/Heatmap/formatter.d.ts +0 -3
- package/Heatmap/package.json +0 -6
- package/Heatmap/plugin.d.ts +0 -2
- package/Heatmap/plugin.js +0 -10
- package/LineChartPro/package.json +0 -6
- package/ScatterChartPro/package.json +0 -6
- package/hooks/package.json +0 -6
- package/hooks/useSeries.d.ts +0 -11
- package/hooks/useSeries.js +0 -16
- package/internals/plugins/useChartProZoom/creatZoomLookup.d.ts +0 -3
- package/internals/plugins/useChartProZoom/creatZoomLookup.js +0 -12
- package/internals/plugins/useChartProZoom/defaultizeZoom.d.ts +0 -2
- package/internals/plugins/useChartProZoom/defaultizeZoom.js +0 -25
- package/internals/plugins/useChartProZoom/zoom.types.d.ts +0 -53
- package/models/package.json +0 -6
- package/modern/Heatmap/plugin.js +0 -10
- package/modern/hooks/useSeries.js +0 -16
- package/modern/internals/plugins/useChartProZoom/creatZoomLookup.js +0 -12
- package/modern/internals/plugins/useChartProZoom/defaultizeZoom.js +0 -25
- package/node/BarChartPro/BarChartPro.js +0 -460
- package/node/BarChartPro/index.js +0 -16
- package/node/ChartContainerPro/ChartContainerPro.js +0 -295
- package/node/ChartContainerPro/index.js +0 -16
- package/node/ChartContainerPro/useChartContainerProProps.js +0 -40
- package/node/ChartDataProviderPro/ChartDataProviderPro.js +0 -298
- package/node/ChartDataProviderPro/index.js +0 -16
- package/node/ChartDataProviderPro/useChartDataProviderProProps.js +0 -23
- package/node/Heatmap/Heatmap.js +0 -407
- package/node/Heatmap/HeatmapItem.js +0 -113
- package/node/Heatmap/HeatmapTooltip.js +0 -280
- package/node/Heatmap/heatmapClasses.js +0 -22
- package/node/Heatmap/index.js +0 -47
- package/node/Heatmap/plugin.js +0 -17
- package/node/LineChartPro/LineChartPro.js +0 -511
- package/node/LineChartPro/index.js +0 -16
- package/node/ScatterChartPro/ScatterChartPro.js +0 -398
- package/node/ScatterChartPro/index.js +0 -16
- package/node/hooks/index.js +0 -27
- package/node/hooks/useSeries.js +0 -21
- package/node/hooks/zoom/index.js +0 -16
- package/node/hooks/zoom/useIsZoomInteracting.js +0 -19
- package/node/index.js +0 -365
- package/node/internals/plugins/allPlugins.js +0 -11
- package/node/internals/plugins/useChartProZoom/creatZoomLookup.js +0 -19
- package/node/internals/plugins/useChartProZoom/defaultizeZoom.js +0 -33
- package/node/internals/plugins/useChartProZoom/index.js +0 -38
- package/node/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +0 -18
- package/node/internals/utils/releaseInfo.js +0 -21
- package/node/models/index.js +0 -16
- package/node/models/seriesType/index.js +0 -16
- package/node/themeAugmentation/index.js +0 -1
- package/node/typeOverloads/index.js +0 -6
- package/themeAugmentation/package.json +0 -6
- package/typeOverloads/package.json +0 -6
- /package/{node/internals/plugins/useChartProZoom/useChartProZoom.types.js → FunnelChart/categoryAxis.types.js} +0 -0
- /package/{node/internals/plugins/useChartProZoom/zoom.types.js → FunnelChart/funnel.types.js} +0 -0
- /package/{node/models/seriesType/heatmap.js → FunnelChart/funnelPlotSlots.types.js} +0 -0
- /package/{node/typeOverloads/modules.js → FunnelChart/funnelSlots.types.js} +0 -0
- /package/{node/Heatmap → Heatmap/seriesConfig}/extremums.js +0 -0
- /package/{node/Heatmap → Heatmap/seriesConfig}/getColor.js +0 -0
- /package/{internals/plugins/useChartProZoom/zoom.types.js → esm/FunnelChart/categoryAxis.types.js} +0 -0
- /package/{modern/internals/plugins/useChartProZoom/zoom.types.js → esm/FunnelChart/funnel.types.js} +0 -0
- /package/{Heatmap → esm/Heatmap/seriesConfig}/extremums.js +0 -0
- /package/{Heatmap → esm/Heatmap/seriesConfig}/getColor.js +0 -0
- /package/modern/Heatmap/{extremums.js → seriesConfig/extremums.js} +0 -0
- /package/modern/Heatmap/{getColor.js → seriesConfig/getColor.js} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
2
|
+
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
3
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
4
|
+
function getFunnelSectionUtilityClass(slot) {
|
|
5
|
+
return generateUtilityClass('MuiFunnelSection', slot);
|
|
6
|
+
}
|
|
7
|
+
export const useUtilityClasses = props => {
|
|
8
|
+
const {
|
|
9
|
+
classes,
|
|
10
|
+
seriesId
|
|
11
|
+
} = props;
|
|
12
|
+
const slots = {
|
|
13
|
+
root: ['root', `series-${seriesId}`],
|
|
14
|
+
highlighted: ['highlighted'],
|
|
15
|
+
faded: ['faded'],
|
|
16
|
+
label: ['label']
|
|
17
|
+
};
|
|
18
|
+
return composeClasses(slots, getFunnelSectionUtilityClass, classes);
|
|
19
|
+
};
|
|
20
|
+
export const funnelSectionClasses = generateUtilityClasses('MuiFunnelSection', ['root', 'highlighted', 'faded', 'label']);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ChartsOverlaySlotProps, ChartsOverlaySlots } from '@mui/x-charts/ChartsOverlay';
|
|
2
|
+
import { ChartsTooltipSlotProps, ChartsTooltipSlots } from '@mui/x-charts/ChartsTooltip';
|
|
3
|
+
import { ChartsAxisSlotProps, ChartsAxisSlots } from '@mui/x-charts/internals';
|
|
4
|
+
import { ChartsLegendSlotProps, ChartsLegendSlots } from '@mui/x-charts/ChartsLegend';
|
|
5
|
+
import { FunnelPlotSlotProps, FunnelPlotSlots } from "./funnelPlotSlots.types.js";
|
|
6
|
+
export interface FunnelChartSlots extends ChartsAxisSlots, FunnelPlotSlots, ChartsLegendSlots, ChartsTooltipSlots, ChartsOverlaySlots, ChartsAxisSlots {}
|
|
7
|
+
export interface FunnelChartSlotProps extends ChartsAxisSlotProps, FunnelPlotSlotProps, ChartsLegendSlotProps, ChartsTooltipSlotProps, ChartsOverlaySlotProps, ChartsAxisSlotProps {}
|
|
8
|
+
export interface FunnelChartSlotExtension {
|
|
9
|
+
/**
|
|
10
|
+
* Overridable component slots.
|
|
11
|
+
* @default {}
|
|
12
|
+
*/
|
|
13
|
+
slots?: FunnelChartSlots;
|
|
14
|
+
/**
|
|
15
|
+
* The props used for each component slot.
|
|
16
|
+
* @default {}
|
|
17
|
+
*/
|
|
18
|
+
slotProps?: FunnelChartSlotProps;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a custom "step" curve generator for the funnel chart.
|
|
3
|
+
* It is used to draw the funnel using "rectangles" without having to rework the rendering logic.
|
|
4
|
+
*
|
|
5
|
+
* It is based on the d3-shape step curve generator.
|
|
6
|
+
* https://github.com/d3/d3-shape/blob/a82254af78f08799c71d7ab25df557c4872a3c51/src/curve/step.js
|
|
7
|
+
*/
|
|
8
|
+
class FunnelStep {
|
|
9
|
+
constructor(context, isHorizontal) {
|
|
10
|
+
this.context = void 0;
|
|
11
|
+
this.line = NaN;
|
|
12
|
+
this.x = NaN;
|
|
13
|
+
this.y = NaN;
|
|
14
|
+
this.currentPoint = 0;
|
|
15
|
+
this.isHorizontal = false;
|
|
16
|
+
this.context = context;
|
|
17
|
+
this.isHorizontal = isHorizontal;
|
|
18
|
+
}
|
|
19
|
+
areaStart() {
|
|
20
|
+
this.line = 0;
|
|
21
|
+
}
|
|
22
|
+
areaEnd() {
|
|
23
|
+
this.line = NaN;
|
|
24
|
+
}
|
|
25
|
+
lineStart() {
|
|
26
|
+
this.x = NaN;
|
|
27
|
+
this.y = NaN;
|
|
28
|
+
this.currentPoint = 0;
|
|
29
|
+
}
|
|
30
|
+
lineEnd() {
|
|
31
|
+
if (this.currentPoint === 2) {
|
|
32
|
+
this.context.lineTo(this.x, this.y);
|
|
33
|
+
}
|
|
34
|
+
if (this.line || this.line !== 0 && this.currentPoint === 1) {
|
|
35
|
+
this.context.closePath();
|
|
36
|
+
}
|
|
37
|
+
if (this.line >= 0) {
|
|
38
|
+
this.line = 1 - this.line;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
point(x, y) {
|
|
42
|
+
x = +x;
|
|
43
|
+
y = +y;
|
|
44
|
+
if (this.currentPoint === 0) {
|
|
45
|
+
this.context.moveTo(x, y);
|
|
46
|
+
} else if (this.isHorizontal && (this.currentPoint === 2 || this.currentPoint === 1)) {
|
|
47
|
+
this.context.lineTo(x, this.y);
|
|
48
|
+
this.context.lineTo(x, y);
|
|
49
|
+
} else if (this.currentPoint === 3 && !this.isHorizontal) {
|
|
50
|
+
this.context.lineTo(x, this.y);
|
|
51
|
+
this.context.lineTo(x, y);
|
|
52
|
+
} else {
|
|
53
|
+
this.context.lineTo(this.x, y);
|
|
54
|
+
this.context.lineTo(x, y);
|
|
55
|
+
}
|
|
56
|
+
this.currentPoint += 1;
|
|
57
|
+
this.x = x;
|
|
58
|
+
this.y = y;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const funnelHorizontalStepCurve = context => {
|
|
62
|
+
return new FunnelStep(context, true);
|
|
63
|
+
};
|
|
64
|
+
const funnelVerticalStepCurve = context => {
|
|
65
|
+
return new FunnelStep(context, false);
|
|
66
|
+
};
|
|
67
|
+
export { funnelHorizontalStepCurve, funnelVerticalStepCurve };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { FunnelChart as Unstable_FunnelChart } from "./FunnelChart.js";
|
|
2
|
+
export type { FunnelChartProps } from './FunnelChart';
|
|
3
|
+
export * from "./FunnelPlot.js";
|
|
4
|
+
export * from "./funnel.types.js";
|
|
5
|
+
export * from "./funnelSlots.types.js";
|
|
6
|
+
export { funnelSectionClasses } from "./funnelSectionClasses.js";
|
|
7
|
+
export type { FunnelSectionClasses } from './funnelSectionClasses';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { FunnelDataPoints, FunnelLabelOptions } from "./funnel.types.js";
|
|
2
|
+
/**
|
|
3
|
+
* It tries to keep the label inside the bounds of the section based on the position.
|
|
4
|
+
*
|
|
5
|
+
* @returns The text anchor and dominant baseline of the label.
|
|
6
|
+
*/
|
|
7
|
+
export declare const alignLabel: ({
|
|
8
|
+
position,
|
|
9
|
+
textAnchor,
|
|
10
|
+
dominantBaseline
|
|
11
|
+
}: Omit<FunnelLabelOptions, "margin">) => {
|
|
12
|
+
textAnchor: string;
|
|
13
|
+
dominantBaseline: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* This function calculates the position of the label based on the position and margin.
|
|
17
|
+
*
|
|
18
|
+
* It is quite complex, because it needs to calculate the position based on the position of the points of a rectangle.
|
|
19
|
+
* And we are manually calculating each possible position of the label.
|
|
20
|
+
*
|
|
21
|
+
* @returns The x and y position of the label.
|
|
22
|
+
*/
|
|
23
|
+
export declare const positionLabel: ({
|
|
24
|
+
position,
|
|
25
|
+
offset,
|
|
26
|
+
xPosition,
|
|
27
|
+
yPosition,
|
|
28
|
+
isHorizontal,
|
|
29
|
+
values,
|
|
30
|
+
dataIndex,
|
|
31
|
+
baseScaleData
|
|
32
|
+
}: Omit<FunnelLabelOptions, "textAnchor" | "dominantBaseline"> & {
|
|
33
|
+
xPosition: (value: number, bandIndex: number, stackOffset?: number, useBand?: boolean) => number | undefined;
|
|
34
|
+
yPosition: (value: number, bandIndex: number, stackOffset?: number, useBand?: boolean) => number | undefined;
|
|
35
|
+
isHorizontal: boolean;
|
|
36
|
+
values: readonly FunnelDataPoints[];
|
|
37
|
+
dataIndex: number;
|
|
38
|
+
baseScaleData: readonly number[];
|
|
39
|
+
}) => {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
};
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* It tries to keep the label inside the bounds of the section based on the position.
|
|
3
|
+
*
|
|
4
|
+
* @returns The text anchor and dominant baseline of the label.
|
|
5
|
+
*/
|
|
6
|
+
export const alignLabel = ({
|
|
7
|
+
position,
|
|
8
|
+
textAnchor,
|
|
9
|
+
dominantBaseline
|
|
10
|
+
}) => {
|
|
11
|
+
const vertical = position?.vertical ?? 'middle';
|
|
12
|
+
const horizontal = position?.horizontal ?? 'center';
|
|
13
|
+
let anchor = 'middle';
|
|
14
|
+
let baseline = 'central';
|
|
15
|
+
if (vertical === 'top') {
|
|
16
|
+
baseline = 'hanging';
|
|
17
|
+
} else if (vertical === 'bottom') {
|
|
18
|
+
baseline = 'baseline';
|
|
19
|
+
}
|
|
20
|
+
if (horizontal === 'start') {
|
|
21
|
+
anchor = 'start';
|
|
22
|
+
} else if (horizontal === 'end') {
|
|
23
|
+
anchor = 'end';
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
textAnchor: textAnchor ?? anchor,
|
|
27
|
+
dominantBaseline: dominantBaseline ?? baseline
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* This function calculates the position of the label based on the position and margin.
|
|
33
|
+
*
|
|
34
|
+
* It is quite complex, because it needs to calculate the position based on the position of the points of a rectangle.
|
|
35
|
+
* And we are manually calculating each possible position of the label.
|
|
36
|
+
*
|
|
37
|
+
* @returns The x and y position of the label.
|
|
38
|
+
*/
|
|
39
|
+
export const positionLabel = ({
|
|
40
|
+
position,
|
|
41
|
+
offset,
|
|
42
|
+
xPosition,
|
|
43
|
+
yPosition,
|
|
44
|
+
isHorizontal,
|
|
45
|
+
values,
|
|
46
|
+
dataIndex,
|
|
47
|
+
baseScaleData
|
|
48
|
+
}) => {
|
|
49
|
+
const vertical = position?.vertical ?? 'middle';
|
|
50
|
+
const horizontal = position?.horizontal ?? 'center';
|
|
51
|
+
let x = 0;
|
|
52
|
+
let y = 0;
|
|
53
|
+
let minTop = 0;
|
|
54
|
+
let maxTop = 0;
|
|
55
|
+
let minBottom = 0;
|
|
56
|
+
let maxBottom = 0;
|
|
57
|
+
let minLeft = 0;
|
|
58
|
+
let maxLeft = 0;
|
|
59
|
+
let minRight = 0;
|
|
60
|
+
let maxRight = 0;
|
|
61
|
+
let center = 0;
|
|
62
|
+
let leftCenter = 0;
|
|
63
|
+
let rightCenter = 0;
|
|
64
|
+
let middle = 0;
|
|
65
|
+
let topMiddle = 0;
|
|
66
|
+
let bottomMiddle = 0;
|
|
67
|
+
const mv = typeof offset === 'number' ? offset : offset?.y ?? 0;
|
|
68
|
+
const mh = typeof offset === 'number' ? offset : offset?.x ?? 0;
|
|
69
|
+
const stackOffset = values[0].stackOffset;
|
|
70
|
+
if (isHorizontal) {
|
|
71
|
+
maxTop = yPosition(values[0].y, baseScaleData[dataIndex], stackOffset) - mv;
|
|
72
|
+
minTop = yPosition(values[1].y, baseScaleData[dataIndex], stackOffset) - mv;
|
|
73
|
+
minBottom = yPosition(values[2].y, baseScaleData[dataIndex], stackOffset) + mv;
|
|
74
|
+
maxBottom = yPosition(values[3].y, baseScaleData[dataIndex], stackOffset) + mv;
|
|
75
|
+
minRight = 0;
|
|
76
|
+
maxRight = xPosition(Math.min(...values.map(v => v.x)), baseScaleData[dataIndex], stackOffset, true) + mh;
|
|
77
|
+
minLeft = 0;
|
|
78
|
+
maxLeft = xPosition(Math.max(...values.map(v => v.x)), baseScaleData[dataIndex], stackOffset) + mh;
|
|
79
|
+
center = maxRight - (maxRight - maxLeft) / 2;
|
|
80
|
+
leftCenter = 0;
|
|
81
|
+
rightCenter = 0;
|
|
82
|
+
middle = yPosition(0, baseScaleData[dataIndex], stackOffset) - mv;
|
|
83
|
+
topMiddle = yPosition(values[0].y - (values[0].y - values[1].y) / 2, baseScaleData[dataIndex], stackOffset) - mv;
|
|
84
|
+
bottomMiddle = yPosition(values[3].y - (values[3].y - values[2].y) / 2, baseScaleData[dataIndex], stackOffset) + mv;
|
|
85
|
+
} else {
|
|
86
|
+
minTop = 0;
|
|
87
|
+
maxTop = yPosition(Math.max(...values.map(v => v.y)), baseScaleData[dataIndex], stackOffset) - mv;
|
|
88
|
+
minBottom = 0;
|
|
89
|
+
maxBottom = yPosition(Math.min(...values.map(v => v.y)), baseScaleData[dataIndex], stackOffset, true) - mv;
|
|
90
|
+
maxRight = xPosition(values[0].x, baseScaleData[dataIndex], stackOffset) + mh;
|
|
91
|
+
minRight = xPosition(values[1].x, baseScaleData[dataIndex], stackOffset) + mh;
|
|
92
|
+
minLeft = xPosition(values[2].x, baseScaleData[dataIndex], stackOffset) - mh;
|
|
93
|
+
maxLeft = xPosition(values[3].x, baseScaleData[dataIndex], stackOffset) - mh;
|
|
94
|
+
center = xPosition(0, baseScaleData[dataIndex], stackOffset) - mh;
|
|
95
|
+
rightCenter = xPosition(values[0].x - (values[0].x - values[1].x) / 2, baseScaleData[dataIndex], stackOffset) + mh;
|
|
96
|
+
leftCenter = xPosition(values[3].x - (values[3].x - values[2].x) / 2, baseScaleData[dataIndex], stackOffset) - mh;
|
|
97
|
+
middle = yPosition(values[0].y - (values[0].y - values[1].y) / 2, baseScaleData[dataIndex], stackOffset);
|
|
98
|
+
middle = maxTop - (maxTop - maxBottom) / 2;
|
|
99
|
+
topMiddle = 0;
|
|
100
|
+
bottomMiddle = 0;
|
|
101
|
+
}
|
|
102
|
+
if (isHorizontal) {
|
|
103
|
+
if (horizontal === 'center') {
|
|
104
|
+
x = center;
|
|
105
|
+
if (vertical === 'top') {
|
|
106
|
+
y = topMiddle;
|
|
107
|
+
} else if (vertical === 'middle') {
|
|
108
|
+
y = middle;
|
|
109
|
+
} else if (vertical === 'bottom') {
|
|
110
|
+
y = bottomMiddle;
|
|
111
|
+
}
|
|
112
|
+
} else if (horizontal === 'start') {
|
|
113
|
+
x = maxLeft;
|
|
114
|
+
if (vertical === 'top') {
|
|
115
|
+
y = maxTop;
|
|
116
|
+
} else if (vertical === 'middle') {
|
|
117
|
+
y = middle;
|
|
118
|
+
} else if (vertical === 'bottom') {
|
|
119
|
+
y = maxBottom;
|
|
120
|
+
}
|
|
121
|
+
} else if (horizontal === 'end') {
|
|
122
|
+
x = maxRight;
|
|
123
|
+
if (vertical === 'top') {
|
|
124
|
+
y = minTop;
|
|
125
|
+
} else if (vertical === 'middle') {
|
|
126
|
+
y = middle;
|
|
127
|
+
} else if (vertical === 'bottom') {
|
|
128
|
+
y = minBottom;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (!isHorizontal) {
|
|
133
|
+
if (vertical === 'middle') {
|
|
134
|
+
y = middle;
|
|
135
|
+
if (horizontal === 'start') {
|
|
136
|
+
x = leftCenter;
|
|
137
|
+
} else if (horizontal === 'center') {
|
|
138
|
+
x = center;
|
|
139
|
+
} else if (horizontal === 'end') {
|
|
140
|
+
x = rightCenter;
|
|
141
|
+
}
|
|
142
|
+
} else if (vertical === 'top') {
|
|
143
|
+
y = maxTop;
|
|
144
|
+
if (horizontal === 'start') {
|
|
145
|
+
x = maxLeft;
|
|
146
|
+
} else if (horizontal === 'center') {
|
|
147
|
+
x = center;
|
|
148
|
+
} else if (horizontal === 'end') {
|
|
149
|
+
x = maxRight;
|
|
150
|
+
}
|
|
151
|
+
} else if (vertical === 'bottom') {
|
|
152
|
+
y = maxBottom;
|
|
153
|
+
if (horizontal === 'start') {
|
|
154
|
+
x = minLeft;
|
|
155
|
+
} else if (horizontal === 'center') {
|
|
156
|
+
x = center;
|
|
157
|
+
} else if (horizontal === 'end') {
|
|
158
|
+
x = minRight;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
x,
|
|
164
|
+
y
|
|
165
|
+
};
|
|
166
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const getValueExtremum = (direction, isHorizontal, params) => {
|
|
2
|
+
const {
|
|
3
|
+
series,
|
|
4
|
+
axis,
|
|
5
|
+
isDefaultAxis
|
|
6
|
+
} = params;
|
|
7
|
+
return Object.keys(series)
|
|
8
|
+
// Keep only series that are associated with the current axis
|
|
9
|
+
.reduce((acc, seriesId) => {
|
|
10
|
+
const yAxisId = series[seriesId].yAxisId;
|
|
11
|
+
const xAxisId = series[seriesId].xAxisId;
|
|
12
|
+
const {
|
|
13
|
+
dataPoints
|
|
14
|
+
} = series[seriesId];
|
|
15
|
+
if (
|
|
16
|
+
// We skip except if the axis id is not defined for the direction and we are on the default one.
|
|
17
|
+
!(isDefaultAxis && yAxisId === undefined && direction === 'y') && !(isDefaultAxis && xAxisId === undefined && direction === 'x')) {
|
|
18
|
+
return acc;
|
|
19
|
+
}
|
|
20
|
+
if (axis.scaleType === 'band' || !isHorizontal && direction === 'x' || isHorizontal && direction === 'y') {
|
|
21
|
+
const [seriesMin, seriesMax] = dataPoints.map(v => v.map(t => t[direction]))?.reduce((seriesAcc, values) => {
|
|
22
|
+
return [Math.min(...values, seriesAcc[0]), Math.max(...values, seriesAcc[1])];
|
|
23
|
+
}, [Infinity, -Infinity]) ?? [Infinity, -Infinity];
|
|
24
|
+
return [Math.min(seriesMin, acc[0]), Math.max(seriesMax, acc[1])];
|
|
25
|
+
}
|
|
26
|
+
const seriesMin = dataPoints.flatMap(v => v.map(t => t[direction]).reduce((min, value) => Math.min(value, min), Infinity)).reduce((sumAcc, value) => sumAcc + value, 0);
|
|
27
|
+
const seriesMax = dataPoints.flatMap(v => v.map(t => t[direction]).reduce((max, value) => Math.max(value, max), -Infinity)).reduce((sumAcc, value) => sumAcc + value, 0);
|
|
28
|
+
return [Math.min(seriesMin, acc[0]), Math.max(seriesMax, acc[1])];
|
|
29
|
+
}, [Infinity, -Infinity]);
|
|
30
|
+
};
|
|
31
|
+
export const getExtremumX = params => {
|
|
32
|
+
const isHorizontal = Object.keys(params.series).some(seriesId => params.series[seriesId].layout === 'horizontal');
|
|
33
|
+
if (isHorizontal) {
|
|
34
|
+
const [min, max] = getValueExtremum('x', isHorizontal, params);
|
|
35
|
+
return [max, min];
|
|
36
|
+
}
|
|
37
|
+
return getValueExtremum('x', isHorizontal, params);
|
|
38
|
+
};
|
|
39
|
+
export const getExtremumY = params => {
|
|
40
|
+
const isHorizontal = Object.keys(params.series).some(seriesId => params.series[seriesId].layout === 'horizontal');
|
|
41
|
+
return getValueExtremum('y', isHorizontal, params);
|
|
42
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
const getSeriesWithDefaultValues = (seriesData, seriesIndex, colors) => {
|
|
3
|
+
return _extends({
|
|
4
|
+
id: seriesData.id ?? `auto-generated-id-${seriesIndex}`
|
|
5
|
+
}, seriesData, {
|
|
6
|
+
data: seriesData.data.map((d, index) => _extends({
|
|
7
|
+
color: colors[index % colors.length]
|
|
8
|
+
}, d))
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
export default getSeriesWithDefaultValues;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { getExtremumX, getExtremumY } from "./extremums.js";
|
|
2
|
+
import seriesProcessor from "./seriesProcessor.js";
|
|
3
|
+
import getColor from "./getColor.js";
|
|
4
|
+
import legendGetter from "./legend.js";
|
|
5
|
+
import tooltipGetter from "./tooltip.js";
|
|
6
|
+
import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.js";
|
|
7
|
+
export const seriesConfig = {
|
|
8
|
+
seriesProcessor,
|
|
9
|
+
colorProcessor: getColor,
|
|
10
|
+
legendGetter,
|
|
11
|
+
tooltipGetter,
|
|
12
|
+
xExtremumGetter: getExtremumX,
|
|
13
|
+
yExtremumGetter: getExtremumY,
|
|
14
|
+
getSeriesWithDefaultValues
|
|
15
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getLabel } from '@mui/x-charts/internals';
|
|
2
|
+
const legendGetter = params => {
|
|
3
|
+
const {
|
|
4
|
+
seriesOrder,
|
|
5
|
+
series
|
|
6
|
+
} = params;
|
|
7
|
+
return seriesOrder.reduce((acc, seriesId) => {
|
|
8
|
+
series[seriesId].data.forEach(item => {
|
|
9
|
+
const formattedLabel = getLabel(item.label, 'legend');
|
|
10
|
+
if (formattedLabel === undefined) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
acc.push({
|
|
14
|
+
markType: item.labelMarkType ?? series[seriesId].labelMarkType,
|
|
15
|
+
seriesId,
|
|
16
|
+
id: item.id,
|
|
17
|
+
itemId: item.id,
|
|
18
|
+
color: item.color,
|
|
19
|
+
label: formattedLabel
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
return acc;
|
|
23
|
+
}, []);
|
|
24
|
+
};
|
|
25
|
+
export default legendGetter;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
const createPoint = ({
|
|
3
|
+
main,
|
|
4
|
+
other,
|
|
5
|
+
inverse,
|
|
6
|
+
useBandWidth,
|
|
7
|
+
stackOffset
|
|
8
|
+
}) => inverse ? {
|
|
9
|
+
x: other,
|
|
10
|
+
y: main,
|
|
11
|
+
useBandWidth,
|
|
12
|
+
stackOffset
|
|
13
|
+
} : {
|
|
14
|
+
x: main,
|
|
15
|
+
y: other,
|
|
16
|
+
useBandWidth,
|
|
17
|
+
stackOffset
|
|
18
|
+
};
|
|
19
|
+
const seriesProcessor = params => {
|
|
20
|
+
const {
|
|
21
|
+
seriesOrder,
|
|
22
|
+
series
|
|
23
|
+
} = params;
|
|
24
|
+
const completedSeries = {};
|
|
25
|
+
const isHorizontal = seriesOrder.some(seriesId => series[seriesId].layout === 'horizontal');
|
|
26
|
+
seriesOrder.forEach(seriesId => {
|
|
27
|
+
const currentSeries = series[seriesId];
|
|
28
|
+
completedSeries[seriesId] = _extends({
|
|
29
|
+
labelMarkType: 'square',
|
|
30
|
+
layout: isHorizontal ? 'horizontal' : 'vertical',
|
|
31
|
+
valueFormatter: item => item == null ? '' : item.value.toLocaleString()
|
|
32
|
+
}, currentSeries, {
|
|
33
|
+
data: currentSeries.data.map((v, i) => _extends({
|
|
34
|
+
id: `${seriesId}-funnel-item-${v.id ?? i}`
|
|
35
|
+
}, v)),
|
|
36
|
+
dataPoints: []
|
|
37
|
+
});
|
|
38
|
+
const stackOffsets = completedSeries[seriesId].data.toReversed().map((_, i, array) => array.slice(0, i).reduce((acc, item) => acc + item.value, 0)).toReversed();
|
|
39
|
+
completedSeries[seriesId].dataPoints = completedSeries[seriesId].data.map((item, dataIndex, array) => {
|
|
40
|
+
// Main = main axis, Other = other axis
|
|
41
|
+
// For horizontal layout, main is y, other is x
|
|
42
|
+
// For vertical layout, main is x, other is y
|
|
43
|
+
const currentMaxMain = item.value;
|
|
44
|
+
const nextDataIndex = dataIndex === array.length - 1 ? dataIndex : dataIndex + 1;
|
|
45
|
+
const nextMaxMain = array[nextDataIndex].value ?? 0;
|
|
46
|
+
const nextMaxOther = 0;
|
|
47
|
+
const currentMaxOther = completedSeries[seriesId].data[dataIndex].value;
|
|
48
|
+
const stackOffset = stackOffsets[dataIndex];
|
|
49
|
+
return [
|
|
50
|
+
// Top right (vertical) or Top left (horizontal)
|
|
51
|
+
createPoint({
|
|
52
|
+
main: currentMaxMain,
|
|
53
|
+
other: currentMaxOther,
|
|
54
|
+
inverse: isHorizontal,
|
|
55
|
+
useBandWidth: false,
|
|
56
|
+
stackOffset
|
|
57
|
+
}),
|
|
58
|
+
// Bottom right (vertical) or Top right (horizontal)
|
|
59
|
+
createPoint({
|
|
60
|
+
main: nextMaxMain,
|
|
61
|
+
other: nextMaxOther,
|
|
62
|
+
inverse: isHorizontal,
|
|
63
|
+
useBandWidth: true,
|
|
64
|
+
stackOffset
|
|
65
|
+
}),
|
|
66
|
+
// Bottom left (vertical) or Bottom right (horizontal)
|
|
67
|
+
createPoint({
|
|
68
|
+
main: -nextMaxMain,
|
|
69
|
+
other: nextMaxOther,
|
|
70
|
+
inverse: isHorizontal,
|
|
71
|
+
useBandWidth: true,
|
|
72
|
+
stackOffset
|
|
73
|
+
}),
|
|
74
|
+
// Top left (vertical) or Bottom left (horizontal)
|
|
75
|
+
createPoint({
|
|
76
|
+
main: -currentMaxMain,
|
|
77
|
+
other: currentMaxOther,
|
|
78
|
+
inverse: isHorizontal,
|
|
79
|
+
useBandWidth: false,
|
|
80
|
+
stackOffset
|
|
81
|
+
})];
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
return {
|
|
85
|
+
seriesOrder,
|
|
86
|
+
series: completedSeries
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
export default seriesProcessor;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { getLabel } from '@mui/x-charts/internals';
|
|
3
|
+
const tooltipGetter = params => {
|
|
4
|
+
const {
|
|
5
|
+
series,
|
|
6
|
+
getColor,
|
|
7
|
+
identifier
|
|
8
|
+
} = params;
|
|
9
|
+
if (!identifier || identifier.dataIndex === undefined) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const point = series.data[identifier.dataIndex];
|
|
13
|
+
const label = getLabel(point.label, 'tooltip');
|
|
14
|
+
const value = _extends({}, point, {
|
|
15
|
+
label
|
|
16
|
+
});
|
|
17
|
+
const formattedValue = series.valueFormatter(value, {
|
|
18
|
+
dataIndex: identifier.dataIndex
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
identifier,
|
|
22
|
+
color: getColor(identifier.dataIndex),
|
|
23
|
+
label,
|
|
24
|
+
value,
|
|
25
|
+
formattedValue,
|
|
26
|
+
markType: point.labelMarkType ?? series.labelMarkType
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export default tooltipGetter;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ChartsOverlayProps } from '@mui/x-charts/ChartsOverlay';
|
|
2
|
+
import { ChartsAxisProps } from '@mui/x-charts/ChartsAxis';
|
|
3
|
+
import { ChartsLegendSlotExtension } from '@mui/x-charts/ChartsLegend';
|
|
4
|
+
import { ChartsClipPathProps } from '@mui/x-charts/ChartsClipPath';
|
|
5
|
+
import { ChartsWrapperProps } from '@mui/x-charts/internals';
|
|
6
|
+
import { ChartsAxisHighlightProps } from '@mui/x-charts/ChartsAxisHighlight';
|
|
7
|
+
import { FunnelPlotProps } from "./FunnelPlot.js";
|
|
8
|
+
import type { FunnelChartProps } from './FunnelChart';
|
|
9
|
+
import { ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
10
|
+
/**
|
|
11
|
+
* A helper function that extracts FunnelChartProps from the input props
|
|
12
|
+
* and returns an object with props for the children components of FunnelChart.
|
|
13
|
+
*
|
|
14
|
+
* @param props The input props for FunnelChart
|
|
15
|
+
* @returns An object with props for the children components of FunnelChart
|
|
16
|
+
*/
|
|
17
|
+
export declare const useFunnelChartProps: (props: FunnelChartProps) => {
|
|
18
|
+
chartContainerProps: ChartContainerProProps<"funnel">;
|
|
19
|
+
funnelPlotProps: FunnelPlotProps;
|
|
20
|
+
overlayProps: ChartsOverlayProps;
|
|
21
|
+
chartsAxisProps: ChartsAxisProps;
|
|
22
|
+
legendProps: ChartsLegendSlotExtension;
|
|
23
|
+
clipPathGroupProps: {
|
|
24
|
+
clipPath: string;
|
|
25
|
+
};
|
|
26
|
+
clipPathProps: ChartsClipPathProps;
|
|
27
|
+
chartsWrapperProps: Omit<ChartsWrapperProps, "children">;
|
|
28
|
+
axisHighlightProps: ChartsAxisHighlightProps;
|
|
29
|
+
children: import("react").ReactNode;
|
|
30
|
+
};
|