@mui/x-charts-pro 8.0.0-alpha.8 → 8.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChartPro/BarChartPro.d.ts +4 -4
- package/BarChartPro/BarChartPro.js +242 -287
- 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 +2566 -687
- package/ChartContainerPro/ChartContainerPro.d.ts +12 -12
- package/ChartContainerPro/ChartContainerPro.js +185 -188
- package/ChartContainerPro/index.d.ts +2 -1
- package/ChartContainerPro/index.js +17 -1
- package/ChartContainerPro/useChartContainerProProps.d.ts +6 -5
- package/ChartContainerPro/useChartContainerProProps.js +28 -19
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
- package/ChartDataProviderPro/ChartDataProviderPro.js +112 -0
- package/ChartDataProviderPro/index.d.ts +2 -0
- package/ChartDataProviderPro/index.js +17 -0
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +8 -0
- package/ChartDataProviderPro/useChartDataProviderProProps.js +21 -0
- 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 +3 -4
- package/Heatmap/HeatmapTooltip.js +101 -89
- 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 +244 -353
- 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 +246 -238
- 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 +8 -0
- package/esm/Heatmap/HeatmapTooltip.js +280 -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 -75
- 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 +12 -7
- package/index.js +369 -34
- 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 -68
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +165 -111
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +11 -6
- package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +42 -43
- 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 +39 -90
- 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 +12 -21
- 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 +106 -0
- package/modern/ChartDataProviderPro/index.d.ts +2 -0
- package/modern/ChartDataProviderPro/index.js +2 -0
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.d.ts +8 -0
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.js +15 -0
- 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 +8 -0
- package/modern/Heatmap/HeatmapTooltip.js +10 -4
- 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 +40 -155
- 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 +44 -42
- 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 +8 -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 -39
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +203 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +1 -3
- 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/Heatmap/formatter.d.ts +0 -3
- package/Heatmap/package.json +0 -6
- package/Heatmap/plugin.d.ts +0 -2
- package/Heatmap/plugin.js +0 -9
- 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/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 -9
- package/modern/hooks/useSeries.js +0 -16
- package/modern/internals/plugins/useChartProZoom/defaultizeZoom.js +0 -25
- package/node/BarChartPro/BarChartPro.js +0 -461
- package/node/BarChartPro/index.js +0 -16
- package/node/ChartContainerPro/ChartContainerPro.js +0 -305
- package/node/ChartContainerPro/index.js +0 -16
- package/node/ChartContainerPro/useChartContainerProProps.js +0 -40
- 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 -16
- package/node/LineChartPro/LineChartPro.js +0 -522
- package/node/LineChartPro/index.js +0 -16
- package/node/ScatterChartPro/ScatterChartPro.js +0 -399
- 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 -332
- package/node/internals/plugins/allPlugins.js +0 -11
- 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 -13
- 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,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.FunnelPlot = FunnelPlot;
|
|
9
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var React = _react;
|
|
13
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
+
var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
15
|
+
var _internals = require("@mui/x-charts/internals");
|
|
16
|
+
var _hooks = require("@mui/x-charts/hooks");
|
|
17
|
+
var _styles = require("@mui/material/styles");
|
|
18
|
+
var _FunnelSection = require("./FunnelSection");
|
|
19
|
+
var _labelUtils = require("./labelUtils");
|
|
20
|
+
var _funnelStepCurve = require("./funnelStepCurve");
|
|
21
|
+
var _useFunnelSeries = require("../hooks/useFunnelSeries");
|
|
22
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
+
const _excluded = ["onItemClick"];
|
|
24
|
+
_internals.cartesianSeriesTypes.addType('funnel');
|
|
25
|
+
const getFunnelCurve = (curve, isHorizontal) => {
|
|
26
|
+
if (curve === 'step') {
|
|
27
|
+
return isHorizontal ? _funnelStepCurve.funnelHorizontalStepCurve : _funnelStepCurve.funnelVerticalStepCurve;
|
|
28
|
+
}
|
|
29
|
+
if (curve === 'bump') {
|
|
30
|
+
return isHorizontal ? (0, _internals.getCurveFactory)('bumpX') : (0, _internals.getCurveFactory)('bumpY');
|
|
31
|
+
}
|
|
32
|
+
return (0, _internals.getCurveFactory)(curve ?? 'linear');
|
|
33
|
+
};
|
|
34
|
+
const useAggregatedData = () => {
|
|
35
|
+
const seriesData = (0, _useFunnelSeries.useFunnelSeriesContext)();
|
|
36
|
+
const {
|
|
37
|
+
xAxis,
|
|
38
|
+
xAxisIds
|
|
39
|
+
} = (0, _hooks.useXAxes)();
|
|
40
|
+
const {
|
|
41
|
+
yAxis,
|
|
42
|
+
yAxisIds
|
|
43
|
+
} = (0, _hooks.useYAxes)();
|
|
44
|
+
const allData = React.useMemo(() => {
|
|
45
|
+
if (seriesData === undefined) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
const {
|
|
49
|
+
series,
|
|
50
|
+
seriesOrder
|
|
51
|
+
} = seriesData;
|
|
52
|
+
const defaultXAxisId = xAxisIds[0];
|
|
53
|
+
const defaultYAxisId = yAxisIds[0];
|
|
54
|
+
const isHorizontal = Object.values(series).some(s => s.layout === 'horizontal');
|
|
55
|
+
const result = seriesOrder.map(seriesId => {
|
|
56
|
+
const currentSeries = series[seriesId];
|
|
57
|
+
const xAxisId = currentSeries.xAxisId ?? defaultXAxisId;
|
|
58
|
+
const yAxisId = currentSeries.yAxisId ?? defaultYAxisId;
|
|
59
|
+
const valueFormatter = currentSeries.valueFormatter;
|
|
60
|
+
const baseScaleConfig = isHorizontal ? xAxis[xAxisId] : yAxis[yAxisId];
|
|
61
|
+
const isXAxisBand = xAxis[xAxisId].scaleType === 'band';
|
|
62
|
+
const isYAxisBand = yAxis[yAxisId].scaleType === 'band';
|
|
63
|
+
const bandWidth = (isXAxisBand || isYAxisBand) && baseScaleConfig.scale?.bandwidth() || 0;
|
|
64
|
+
const xScale = xAxis[xAxisId].scale;
|
|
65
|
+
const yScale = yAxis[yAxisId].scale;
|
|
66
|
+
const curve = getFunnelCurve(currentSeries.curve, isHorizontal);
|
|
67
|
+
const xPosition = (value, bandIndex, stackOffset, useBand) => {
|
|
68
|
+
if (isXAxisBand) {
|
|
69
|
+
const position = xScale(bandIndex);
|
|
70
|
+
return useBand ? position + bandWidth : position;
|
|
71
|
+
}
|
|
72
|
+
return xScale(isHorizontal ? value + (stackOffset || 0) : value);
|
|
73
|
+
};
|
|
74
|
+
const yPosition = (value, bandIndex, stackOffset, useBand) => {
|
|
75
|
+
if (isYAxisBand) {
|
|
76
|
+
const position = yScale(bandIndex);
|
|
77
|
+
return useBand ? position + bandWidth : position;
|
|
78
|
+
}
|
|
79
|
+
return yScale(isHorizontal ? value : value + (stackOffset || 0));
|
|
80
|
+
};
|
|
81
|
+
return currentSeries.dataPoints.map((values, dataIndex) => {
|
|
82
|
+
const color = currentSeries.data[dataIndex].color;
|
|
83
|
+
const id = `${seriesId}-${dataIndex}`;
|
|
84
|
+
const sectionLabel = typeof currentSeries.sectionLabel === 'function' ? currentSeries.sectionLabel({
|
|
85
|
+
dataIndex,
|
|
86
|
+
seriesId,
|
|
87
|
+
value: currentSeries.data[dataIndex].value
|
|
88
|
+
}) : currentSeries.sectionLabel;
|
|
89
|
+
const line = (0, _d3Shape.line)().x(d => xPosition(d.x, baseScaleConfig.data?.[dataIndex], d.stackOffset, d.useBandWidth)).y(d => yPosition(d.y, baseScaleConfig.data?.[dataIndex], d.stackOffset, d.useBandWidth)).curve(curve);
|
|
90
|
+
return {
|
|
91
|
+
d: line(values),
|
|
92
|
+
color,
|
|
93
|
+
id,
|
|
94
|
+
seriesId,
|
|
95
|
+
dataIndex,
|
|
96
|
+
label: sectionLabel !== false && (0, _extends2.default)({}, (0, _labelUtils.positionLabel)((0, _extends2.default)({}, sectionLabel, {
|
|
97
|
+
xPosition,
|
|
98
|
+
yPosition,
|
|
99
|
+
isHorizontal,
|
|
100
|
+
values,
|
|
101
|
+
dataIndex,
|
|
102
|
+
baseScaleData: baseScaleConfig.data ?? []
|
|
103
|
+
})), (0, _labelUtils.alignLabel)(sectionLabel ?? {}), {
|
|
104
|
+
value: valueFormatter ? valueFormatter(currentSeries.data[dataIndex], {
|
|
105
|
+
dataIndex
|
|
106
|
+
}) : currentSeries.data[dataIndex].value?.toLocaleString()
|
|
107
|
+
})
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
return result.flat();
|
|
112
|
+
}, [seriesData, xAxis, xAxisIds, yAxis, yAxisIds]);
|
|
113
|
+
return allData;
|
|
114
|
+
};
|
|
115
|
+
function FunnelPlot(props) {
|
|
116
|
+
const {
|
|
117
|
+
onItemClick
|
|
118
|
+
} = props,
|
|
119
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
120
|
+
const theme = (0, _styles.useTheme)();
|
|
121
|
+
const data = useAggregatedData();
|
|
122
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
123
|
+
children: [data.map(({
|
|
124
|
+
d,
|
|
125
|
+
color,
|
|
126
|
+
id,
|
|
127
|
+
seriesId,
|
|
128
|
+
dataIndex
|
|
129
|
+
}) => /*#__PURE__*/(0, _react.createElement)(_FunnelSection.FunnelSection, (0, _extends2.default)({}, other, {
|
|
130
|
+
d: d,
|
|
131
|
+
color: color,
|
|
132
|
+
key: id,
|
|
133
|
+
dataIndex: dataIndex,
|
|
134
|
+
seriesId: seriesId,
|
|
135
|
+
onClick: onItemClick && (event => {
|
|
136
|
+
onItemClick(event, {
|
|
137
|
+
type: 'funnel',
|
|
138
|
+
seriesId,
|
|
139
|
+
dataIndex
|
|
140
|
+
});
|
|
141
|
+
})
|
|
142
|
+
}))), data.map(({
|
|
143
|
+
id,
|
|
144
|
+
label
|
|
145
|
+
}) => {
|
|
146
|
+
if (!label) {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("text", {
|
|
150
|
+
x: label.x,
|
|
151
|
+
y: label.y,
|
|
152
|
+
textAnchor: label.textAnchor,
|
|
153
|
+
dominantBaseline: label.dominantBaseline,
|
|
154
|
+
stroke: "none",
|
|
155
|
+
pointerEvents: "none",
|
|
156
|
+
fontFamily: theme.typography.body2.fontFamily,
|
|
157
|
+
fontSize: theme.typography.body2.fontSize,
|
|
158
|
+
fontSizeAdjust: theme.typography.body2.fontSizeAdjust,
|
|
159
|
+
fontWeight: theme.typography.body2.fontWeight,
|
|
160
|
+
letterSpacing: theme.typography.body2.letterSpacing,
|
|
161
|
+
fontStretch: theme.typography.body2.fontStretch,
|
|
162
|
+
fontStyle: theme.typography.body2.fontStyle,
|
|
163
|
+
fontVariant: theme.typography.body2.fontVariant,
|
|
164
|
+
fill: (theme.vars || theme)?.palette?.text?.primary,
|
|
165
|
+
children: label.value
|
|
166
|
+
}, id);
|
|
167
|
+
})]
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
process.env.NODE_ENV !== "production" ? FunnelPlot.propTypes = {
|
|
171
|
+
// ----------------------------- Warning --------------------------------
|
|
172
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
173
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
174
|
+
// ----------------------------------------------------------------------
|
|
175
|
+
/**
|
|
176
|
+
* Callback fired when a funnel item is clicked.
|
|
177
|
+
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
178
|
+
* @param {FunnelItemIdentifier} funnelItemIdentifier The funnel item identifier.
|
|
179
|
+
*/
|
|
180
|
+
onItemClick: _propTypes.default.func,
|
|
181
|
+
/**
|
|
182
|
+
* The props used for each component slot.
|
|
183
|
+
* @default {}
|
|
184
|
+
*/
|
|
185
|
+
slotProps: _propTypes.default.object,
|
|
186
|
+
/**
|
|
187
|
+
* Overridable component slots.
|
|
188
|
+
* @default {}
|
|
189
|
+
*/
|
|
190
|
+
slots: _propTypes.default.object
|
|
191
|
+
} : void 0;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SeriesId } from '@mui/x-charts/internals';
|
|
3
|
+
import { FunnelSectionClasses } from "./funnelSectionClasses.js";
|
|
4
|
+
export interface FunnelSectionProps extends Omit<React.SVGProps<SVGPathElement>, 'ref' | 'id'> {
|
|
5
|
+
seriesId: SeriesId;
|
|
6
|
+
dataIndex: number;
|
|
7
|
+
color: string;
|
|
8
|
+
classes?: Partial<FunnelSectionClasses>;
|
|
9
|
+
}
|
|
10
|
+
export declare const FunnelSectionPath: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, React.SVGProps<SVGPathElement>, {}>;
|
|
11
|
+
/**
|
|
12
|
+
* @ignore - internal component.
|
|
13
|
+
*/
|
|
14
|
+
declare const FunnelSection: React.ForwardRefExoticComponent<FunnelSectionProps & React.RefAttributes<{}>>;
|
|
15
|
+
export { FunnelSection };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.FunnelSectionPath = exports.FunnelSection = void 0;
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
12
|
+
var React = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _styles = require("@mui/material/styles");
|
|
14
|
+
var _internals = require("@mui/x-charts/internals");
|
|
15
|
+
var _hooks = require("@mui/x-charts/hooks");
|
|
16
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
17
|
+
var _funnelSectionClasses = require("./funnelSectionClasses");
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
const _excluded = ["seriesId", "dataIndex", "classes", "color", "onClick", "className"];
|
|
20
|
+
const FunnelSectionPath = exports.FunnelSectionPath = (0, _styles.styled)('path')(() => ({
|
|
21
|
+
transition: 'opacity 0.2s ease-in, fill 0.2s ease-in'
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @ignore - internal component.
|
|
26
|
+
*/
|
|
27
|
+
const FunnelSection = exports.FunnelSection = (0, _internals.consumeSlots)('MuiFunnelSection', 'funnelSection', {
|
|
28
|
+
classesResolver: _funnelSectionClasses.useUtilityClasses
|
|
29
|
+
}, /*#__PURE__*/React.forwardRef(function FunnelSection(props, ref) {
|
|
30
|
+
const {
|
|
31
|
+
seriesId,
|
|
32
|
+
dataIndex,
|
|
33
|
+
classes,
|
|
34
|
+
color,
|
|
35
|
+
onClick,
|
|
36
|
+
className
|
|
37
|
+
} = props,
|
|
38
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
39
|
+
const interactionProps = (0, _internals.useInteractionItemProps)({
|
|
40
|
+
type: 'funnel',
|
|
41
|
+
seriesId,
|
|
42
|
+
dataIndex
|
|
43
|
+
});
|
|
44
|
+
const {
|
|
45
|
+
isFaded,
|
|
46
|
+
isHighlighted
|
|
47
|
+
} = (0, _hooks.useItemHighlighted)({
|
|
48
|
+
seriesId,
|
|
49
|
+
dataIndex
|
|
50
|
+
});
|
|
51
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FunnelSectionPath, (0, _extends2.default)({}, interactionProps, {
|
|
52
|
+
filter: isHighlighted ? 'brightness(120%)' : undefined,
|
|
53
|
+
opacity: isFaded ? 0.3 : 1,
|
|
54
|
+
fill: color,
|
|
55
|
+
stroke: "none",
|
|
56
|
+
cursor: onClick ? 'pointer' : 'unset',
|
|
57
|
+
onClick: onClick,
|
|
58
|
+
className: (0, _clsx.default)(classes?.root, className, isHighlighted && classes?.highlighted, isFaded && classes?.faded)
|
|
59
|
+
}, other, {
|
|
60
|
+
ref: ref
|
|
61
|
+
}));
|
|
62
|
+
}));
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AxisConfig, ScaleName } from '@mui/x-charts/models';
|
|
2
|
+
import { MakeOptional } from '@mui/x-internals/types';
|
|
3
|
+
export type CategoryAxis = {
|
|
4
|
+
/**
|
|
5
|
+
* The categories to be displayed on the axis.
|
|
6
|
+
* The order of the categories is the order in which they are displayed.
|
|
7
|
+
*/
|
|
8
|
+
categories?: string[];
|
|
9
|
+
/**
|
|
10
|
+
* The position of the axis.
|
|
11
|
+
* - 'left' - The axis is positioned on the left side of the chart.
|
|
12
|
+
* - 'right' - The axis is positioned on the right side of the chart.
|
|
13
|
+
* - 'top' - The axis is positioned on the top side of the chart.
|
|
14
|
+
* - 'bottom' - The axis is positioned on the bottom side of the chart.
|
|
15
|
+
* - 'none' - The axis is not displayed.
|
|
16
|
+
*/
|
|
17
|
+
position?: 'left' | 'right' | 'top' | 'bottom' | 'none';
|
|
18
|
+
/**
|
|
19
|
+
* The size of the axis.
|
|
20
|
+
* - If the axis is horizontal, the size is the height of the axis.
|
|
21
|
+
* - If the axis is vertical, the size is the width of the axis.
|
|
22
|
+
*/
|
|
23
|
+
size?: number;
|
|
24
|
+
} & MakeOptional<Pick<AxisConfig<ScaleName, any>, 'disableLine' | 'disableTicks' | 'scaleType' | 'tickLabelStyle' | 'tickSize' | 'id'>, 'id'>;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { ChartsLabelMarkProps } from '@mui/x-charts/ChartsLabel';
|
|
2
|
+
import { CommonSeriesType, CartesianSeriesType, CommonDefaultizedProps, SeriesId } from '@mui/x-charts/internals';
|
|
3
|
+
import { CurveType, Position } from '@mui/x-charts/models';
|
|
4
|
+
import { DefaultizedProps, MakeRequired } from '@mui/x-internals/types';
|
|
5
|
+
export type FunnelItemId = string | number;
|
|
6
|
+
export type FunnelCurveType = Extract<CurveType, 'linear' | 'step'> | 'bump';
|
|
7
|
+
export type FunnelValueType = {
|
|
8
|
+
/**
|
|
9
|
+
* A unique identifier of the funnel section.
|
|
10
|
+
*/
|
|
11
|
+
id?: FunnelItemId;
|
|
12
|
+
/**
|
|
13
|
+
* The value of the funnel section.
|
|
14
|
+
*/
|
|
15
|
+
value: number;
|
|
16
|
+
/**
|
|
17
|
+
* The label to display on the tooltip, funnel section, or the legend. It can be a string or a function.
|
|
18
|
+
*/
|
|
19
|
+
label?: string | ((location: 'tooltip' | 'legend' | 'section') => string);
|
|
20
|
+
/**
|
|
21
|
+
* The color of the funnel section
|
|
22
|
+
*/
|
|
23
|
+
color?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Defines the mark type for the funnel item.
|
|
26
|
+
* @default 'square'
|
|
27
|
+
*/
|
|
28
|
+
labelMarkType?: ChartsLabelMarkProps['type'];
|
|
29
|
+
};
|
|
30
|
+
export interface FunnelSeriesType extends Omit<CommonSeriesType<FunnelValueType>, 'color'>, CartesianSeriesType {
|
|
31
|
+
type: 'funnel';
|
|
32
|
+
/**
|
|
33
|
+
* Data associated to the funnel section.
|
|
34
|
+
*/
|
|
35
|
+
data: Readonly<FunnelValueType[]>;
|
|
36
|
+
/**
|
|
37
|
+
* The label to display on the tooltip or the legend. It can be a string or a function.
|
|
38
|
+
*/
|
|
39
|
+
label?: string | ((location: 'tooltip' | 'legend') => string);
|
|
40
|
+
/**
|
|
41
|
+
* Layout of the funnel.
|
|
42
|
+
* @default 'vertical'
|
|
43
|
+
*/
|
|
44
|
+
layout?: 'horizontal' | 'vertical';
|
|
45
|
+
/**
|
|
46
|
+
* The type of curve to use for the line. Read more about curves at
|
|
47
|
+
* [line interpolation](https://mui.com/x/react-charts/lines/#interpolation).
|
|
48
|
+
* @default 'linear'
|
|
49
|
+
*/
|
|
50
|
+
curve?: FunnelCurveType;
|
|
51
|
+
/**
|
|
52
|
+
* The label configuration for the funnel plot.
|
|
53
|
+
* Allows to customize the position and margin of the label that is displayed on the funnel sections.
|
|
54
|
+
*
|
|
55
|
+
* If set to `false`, the label will not be displayed.
|
|
56
|
+
* @default { vertical: 'middle', horizontal: 'center' }
|
|
57
|
+
*/
|
|
58
|
+
sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => FunnelLabelOptions | false) | false;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* An object that allows to identify a funnel item.
|
|
62
|
+
* Used for item interaction
|
|
63
|
+
*/
|
|
64
|
+
export type FunnelItemIdentifier = {
|
|
65
|
+
type: 'funnel';
|
|
66
|
+
/**
|
|
67
|
+
* The series id of the funnel.
|
|
68
|
+
*/
|
|
69
|
+
seriesId: SeriesId;
|
|
70
|
+
/**
|
|
71
|
+
* The index of the data point in the series.
|
|
72
|
+
*/
|
|
73
|
+
dataIndex: number;
|
|
74
|
+
};
|
|
75
|
+
export type FunnelItem = {
|
|
76
|
+
/**
|
|
77
|
+
* The series id of the funnel.
|
|
78
|
+
*/
|
|
79
|
+
seriesId: SeriesId;
|
|
80
|
+
/**
|
|
81
|
+
* The index of the data point in the series.
|
|
82
|
+
*/
|
|
83
|
+
dataIndex: number;
|
|
84
|
+
/**
|
|
85
|
+
* The value of the data point.
|
|
86
|
+
*/
|
|
87
|
+
value: number;
|
|
88
|
+
};
|
|
89
|
+
export interface DefaultizedFunnelSeriesType extends DefaultizedProps<FunnelSeriesType, CommonDefaultizedProps | 'layout'> {
|
|
90
|
+
dataPoints: FunnelDataPoints[][];
|
|
91
|
+
data: Readonly<MakeRequired<FunnelValueType, 'id' | 'color'>[]>;
|
|
92
|
+
}
|
|
93
|
+
export type FunnelDataPoints = Record<'x' | 'y', number> & {
|
|
94
|
+
useBandWidth: boolean;
|
|
95
|
+
stackOffset: number;
|
|
96
|
+
};
|
|
97
|
+
export type FunnelLabelOptions = {
|
|
98
|
+
/**
|
|
99
|
+
* The position of the label.
|
|
100
|
+
* @default { vertical: 'middle', horizontal: 'center' }
|
|
101
|
+
*/
|
|
102
|
+
position?: Position;
|
|
103
|
+
/**
|
|
104
|
+
* The text anchor of the label. Affects the horizontal alignment of the text.
|
|
105
|
+
*
|
|
106
|
+
* Default value depends on the position.
|
|
107
|
+
*/
|
|
108
|
+
textAnchor?: 'start' | 'middle' | 'end';
|
|
109
|
+
/**
|
|
110
|
+
* The dominant baseline of the label. Affects the vertical alignment of the text.
|
|
111
|
+
*
|
|
112
|
+
* Default value depends on the position.
|
|
113
|
+
*/
|
|
114
|
+
dominantBaseline?: 'auto' | 'baseline' | 'hanging' | 'middle' | 'central' | 'text-after-edge' | 'text-before-edge';
|
|
115
|
+
/**
|
|
116
|
+
* The offset of the label from the anchor point.
|
|
117
|
+
* If a single number is provided, the offset will be applied in both directions.
|
|
118
|
+
* @default 0
|
|
119
|
+
*/
|
|
120
|
+
offset?: number | {
|
|
121
|
+
x?: number;
|
|
122
|
+
y?: number;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { FunnelSectionProps } from './FunnelSection';
|
|
3
|
+
export interface FunnelPlotSlots {
|
|
4
|
+
funnelSection?: React.ElementType<FunnelSectionProps>;
|
|
5
|
+
}
|
|
6
|
+
export interface FunnelPlotSlotProps {
|
|
7
|
+
funnelSection?: FunnelSectionProps;
|
|
8
|
+
}
|
|
9
|
+
export interface FunnelPlotSlotExtension {
|
|
10
|
+
/**
|
|
11
|
+
* Overridable component slots.
|
|
12
|
+
* @default {}
|
|
13
|
+
*/
|
|
14
|
+
slots?: FunnelPlotSlots;
|
|
15
|
+
/**
|
|
16
|
+
* The props used for each component slot.
|
|
17
|
+
* @default {}
|
|
18
|
+
*/
|
|
19
|
+
slotProps?: FunnelPlotSlotProps;
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FunnelSectionProps } from './FunnelSection';
|
|
2
|
+
export interface FunnelSectionClasses {
|
|
3
|
+
/** Styles applied to the root element. */
|
|
4
|
+
root: string;
|
|
5
|
+
/** Styles applied to the root element if `highlighted={true}`. */
|
|
6
|
+
highlighted: string;
|
|
7
|
+
/** Styles applied to the root element if `faded={true}`. */
|
|
8
|
+
faded: string;
|
|
9
|
+
/** Styles applied to the label element. */
|
|
10
|
+
label: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const useUtilityClasses: (props: FunnelSectionProps) => Record<"label" | "highlighted" | "faded" | "root", string>;
|
|
13
|
+
export declare const funnelSectionClasses: FunnelSectionClasses;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useUtilityClasses = exports.funnelSectionClasses = void 0;
|
|
8
|
+
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
|
|
9
|
+
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
|
|
10
|
+
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
11
|
+
function getFunnelSectionUtilityClass(slot) {
|
|
12
|
+
return (0, _generateUtilityClass.default)('MuiFunnelSection', slot);
|
|
13
|
+
}
|
|
14
|
+
const useUtilityClasses = props => {
|
|
15
|
+
const {
|
|
16
|
+
classes,
|
|
17
|
+
seriesId
|
|
18
|
+
} = props;
|
|
19
|
+
const slots = {
|
|
20
|
+
root: ['root', `series-${seriesId}`],
|
|
21
|
+
highlighted: ['highlighted'],
|
|
22
|
+
faded: ['faded'],
|
|
23
|
+
label: ['label']
|
|
24
|
+
};
|
|
25
|
+
return (0, _composeClasses.default)(slots, getFunnelSectionUtilityClass, classes);
|
|
26
|
+
};
|
|
27
|
+
exports.useUtilityClasses = useUtilityClasses;
|
|
28
|
+
const funnelSectionClasses = exports.funnelSectionClasses = (0, _generateUtilityClasses.default)('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,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.funnelVerticalStepCurve = exports.funnelHorizontalStepCurve = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* This is a custom "step" curve generator for the funnel chart.
|
|
9
|
+
* It is used to draw the funnel using "rectangles" without having to rework the rendering logic.
|
|
10
|
+
*
|
|
11
|
+
* It is based on the d3-shape step curve generator.
|
|
12
|
+
* https://github.com/d3/d3-shape/blob/a82254af78f08799c71d7ab25df557c4872a3c51/src/curve/step.js
|
|
13
|
+
*/
|
|
14
|
+
class FunnelStep {
|
|
15
|
+
constructor(context, isHorizontal) {
|
|
16
|
+
this.context = void 0;
|
|
17
|
+
this.line = NaN;
|
|
18
|
+
this.x = NaN;
|
|
19
|
+
this.y = NaN;
|
|
20
|
+
this.currentPoint = 0;
|
|
21
|
+
this.isHorizontal = false;
|
|
22
|
+
this.context = context;
|
|
23
|
+
this.isHorizontal = isHorizontal;
|
|
24
|
+
}
|
|
25
|
+
areaStart() {
|
|
26
|
+
this.line = 0;
|
|
27
|
+
}
|
|
28
|
+
areaEnd() {
|
|
29
|
+
this.line = NaN;
|
|
30
|
+
}
|
|
31
|
+
lineStart() {
|
|
32
|
+
this.x = NaN;
|
|
33
|
+
this.y = NaN;
|
|
34
|
+
this.currentPoint = 0;
|
|
35
|
+
}
|
|
36
|
+
lineEnd() {
|
|
37
|
+
if (this.currentPoint === 2) {
|
|
38
|
+
this.context.lineTo(this.x, this.y);
|
|
39
|
+
}
|
|
40
|
+
if (this.line || this.line !== 0 && this.currentPoint === 1) {
|
|
41
|
+
this.context.closePath();
|
|
42
|
+
}
|
|
43
|
+
if (this.line >= 0) {
|
|
44
|
+
this.line = 1 - this.line;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
point(x, y) {
|
|
48
|
+
x = +x;
|
|
49
|
+
y = +y;
|
|
50
|
+
if (this.currentPoint === 0) {
|
|
51
|
+
this.context.moveTo(x, y);
|
|
52
|
+
} else if (this.isHorizontal && (this.currentPoint === 2 || this.currentPoint === 1)) {
|
|
53
|
+
this.context.lineTo(x, this.y);
|
|
54
|
+
this.context.lineTo(x, y);
|
|
55
|
+
} else if (this.currentPoint === 3 && !this.isHorizontal) {
|
|
56
|
+
this.context.lineTo(x, this.y);
|
|
57
|
+
this.context.lineTo(x, y);
|
|
58
|
+
} else {
|
|
59
|
+
this.context.lineTo(this.x, y);
|
|
60
|
+
this.context.lineTo(x, y);
|
|
61
|
+
}
|
|
62
|
+
this.currentPoint += 1;
|
|
63
|
+
this.x = x;
|
|
64
|
+
this.y = y;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const funnelHorizontalStepCurve = context => {
|
|
68
|
+
return new FunnelStep(context, true);
|
|
69
|
+
};
|
|
70
|
+
exports.funnelHorizontalStepCurve = funnelHorizontalStepCurve;
|
|
71
|
+
const funnelVerticalStepCurve = context => {
|
|
72
|
+
return new FunnelStep(context, false);
|
|
73
|
+
};
|
|
74
|
+
exports.funnelVerticalStepCurve = 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,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
Unstable_FunnelChart: true,
|
|
8
|
+
funnelSectionClasses: true
|
|
9
|
+
};
|
|
10
|
+
Object.defineProperty(exports, "Unstable_FunnelChart", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _FunnelChart.FunnelChart;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "funnelSectionClasses", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return _funnelSectionClasses.funnelSectionClasses;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
var _FunnelChart = require("./FunnelChart");
|
|
23
|
+
var _FunnelPlot = require("./FunnelPlot");
|
|
24
|
+
Object.keys(_FunnelPlot).forEach(function (key) {
|
|
25
|
+
if (key === "default" || key === "__esModule") return;
|
|
26
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
27
|
+
if (key in exports && exports[key] === _FunnelPlot[key]) return;
|
|
28
|
+
Object.defineProperty(exports, key, {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () {
|
|
31
|
+
return _FunnelPlot[key];
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
var _funnel = require("./funnel.types");
|
|
36
|
+
Object.keys(_funnel).forEach(function (key) {
|
|
37
|
+
if (key === "default" || key === "__esModule") return;
|
|
38
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
39
|
+
if (key in exports && exports[key] === _funnel[key]) return;
|
|
40
|
+
Object.defineProperty(exports, key, {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () {
|
|
43
|
+
return _funnel[key];
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
var _funnelSlots = require("./funnelSlots.types");
|
|
48
|
+
Object.keys(_funnelSlots).forEach(function (key) {
|
|
49
|
+
if (key === "default" || key === "__esModule") return;
|
|
50
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
51
|
+
if (key in exports && exports[key] === _funnelSlots[key]) return;
|
|
52
|
+
Object.defineProperty(exports, key, {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function () {
|
|
55
|
+
return _funnelSlots[key];
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
var _funnelSectionClasses = require("./funnelSectionClasses");
|