@mui/x-charts 8.6.0 → 8.8.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/BarChart/BarChart.d.ts +1 -1
- package/BarChart/BarChart.js +16 -0
- package/BarChart/BarPlot.js +11 -150
- package/BarChart/useBarPlotData.d.ts +8 -0
- package/BarChart/useBarPlotData.js +146 -0
- package/CHANGELOG.md +202 -1
- package/ChartContainer/ChartContainer.d.ts +1 -21
- package/ChartContainer/ChartContainer.js +22 -8
- package/ChartContainer/index.d.ts +8 -1
- package/ChartContainer/useChartContainerProps.js +8 -2
- package/ChartDataProvider/ChartDataProvider.js +6 -0
- package/ChartDataProvider/useChartDataProviderProps.d.ts +1 -1
- package/ChartDataProvider/useChartDataProviderProps.js +6 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +1 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +34 -24
- package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +1 -1
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +34 -24
- package/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +3 -0
- package/ChartsReferenceLine/ChartsXReferenceLine.js +48 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +3 -0
- package/ChartsReferenceLine/ChartsYReferenceLine.js +48 -1
- package/ChartsReferenceLine/index.d.ts +3 -1
- package/ChartsSurface/ChartsSurface.js +2 -1
- package/ChartsTooltip/ChartsTooltipContainer.js +6 -3
- package/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
- package/ChartsTooltip/utils.js +18 -29
- package/Gauge/GaugeContainer.d.ts +1 -1
- package/LineChart/AreaPlot.js +5 -115
- package/LineChart/LineChart.js +22 -0
- package/LineChart/LineHighlightPlot.js +10 -4
- package/LineChart/LinePlot.js +5 -99
- package/LineChart/MarkPlot.js +17 -3
- package/LineChart/useAreaPlotData.d.ts +12 -0
- package/LineChart/useAreaPlotData.js +126 -0
- package/LineChart/useLinePlotData.d.ts +11 -0
- package/LineChart/useLinePlotData.js +108 -0
- package/PieChart/PieChart.d.ts +1 -1
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +1 -1
- package/ScatterChart/Scatter.js +22 -48
- package/ScatterChart/ScatterChart.d.ts +1 -1
- package/ScatterChart/ScatterPlot.js +2 -2
- package/ScatterChart/seriesConfig/seriesProcessor.js +3 -0
- package/ScatterChart/useScatterPlotData.d.ts +8 -0
- package/ScatterChart/useScatterPlotData.js +33 -0
- package/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/SparkLineChart/SparkLineChart.js +16 -0
- package/context/ChartApi.d.ts +22 -0
- package/context/ChartApi.js +5 -0
- package/context/ChartProvider/ChartContext.js +1 -0
- package/context/index.d.ts +2 -1
- package/context/useChartApiContext.d.ts +1 -1
- package/esm/BarChart/BarChart.d.ts +1 -1
- package/esm/BarChart/BarChart.js +16 -0
- package/esm/BarChart/BarPlot.js +12 -152
- package/esm/BarChart/useBarPlotData.d.ts +8 -0
- package/esm/BarChart/useBarPlotData.js +139 -0
- package/esm/ChartContainer/ChartContainer.d.ts +1 -21
- package/esm/ChartContainer/ChartContainer.js +22 -8
- package/esm/ChartContainer/index.d.ts +8 -1
- package/esm/ChartContainer/index.js +6 -1
- package/esm/ChartContainer/useChartContainerProps.js +8 -2
- package/esm/ChartDataProvider/ChartDataProvider.js +6 -0
- package/esm/ChartDataProvider/useChartDataProviderProps.d.ts +1 -1
- package/esm/ChartDataProvider/useChartDataProviderProps.js +7 -2
- package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +1 -1
- package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +36 -26
- package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +1 -1
- package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +36 -26
- package/esm/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -1
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.d.ts +3 -0
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +47 -0
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.d.ts +3 -0
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +47 -0
- package/esm/ChartsReferenceLine/index.d.ts +3 -1
- package/esm/ChartsReferenceLine/index.js +2 -1
- package/esm/ChartsSurface/ChartsSurface.js +2 -1
- package/esm/ChartsTooltip/ChartsTooltipContainer.js +6 -3
- package/esm/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
- package/esm/ChartsTooltip/utils.js +18 -29
- package/esm/Gauge/GaugeContainer.d.ts +1 -1
- package/esm/LineChart/AreaPlot.js +5 -115
- package/esm/LineChart/LineChart.js +22 -0
- package/esm/LineChart/LineHighlightPlot.js +11 -5
- package/esm/LineChart/LinePlot.js +5 -99
- package/esm/LineChart/MarkPlot.js +17 -3
- package/esm/LineChart/useAreaPlotData.d.ts +12 -0
- package/esm/LineChart/useAreaPlotData.js +119 -0
- package/esm/LineChart/useLinePlotData.d.ts +11 -0
- package/esm/LineChart/useLinePlotData.js +101 -0
- package/esm/PieChart/PieChart.d.ts +1 -1
- package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +1 -1
- package/esm/ScatterChart/Scatter.js +23 -49
- package/esm/ScatterChart/ScatterChart.d.ts +1 -1
- package/esm/ScatterChart/ScatterPlot.js +2 -2
- package/esm/ScatterChart/seriesConfig/seriesProcessor.js +3 -0
- package/esm/ScatterChart/useScatterPlotData.d.ts +8 -0
- package/esm/ScatterChart/useScatterPlotData.js +26 -0
- package/esm/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/esm/SparkLineChart/SparkLineChart.js +16 -0
- package/esm/context/ChartApi.d.ts +22 -0
- package/esm/context/ChartApi.js +1 -0
- package/esm/context/ChartProvider/ChartContext.js +2 -0
- package/esm/context/index.d.ts +2 -1
- package/esm/context/useChartApiContext.d.ts +1 -1
- package/esm/hooks/useAxis.d.ts +2 -2
- package/esm/hooks/useInteractionItemProps.d.ts +14 -9
- package/esm/hooks/useInteractionItemProps.js +28 -28
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -2
- package/esm/internals/constants.d.ts +3 -0
- package/esm/internals/constants.js +4 -0
- package/esm/internals/getLabel.d.ts +1 -1
- package/esm/internals/index.d.ts +6 -0
- package/esm/internals/index.js +6 -0
- package/esm/internals/plugins/corePlugins/corePlugins.d.ts +4 -2
- package/esm/internals/plugins/corePlugins/corePlugins.js +3 -1
- package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +1 -1
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +1 -29
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +3 -3
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +0 -6
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/index.d.ts +3 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/index.js +2 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.d.ts +3 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js +27 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +8 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +3 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +21 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js +1 -0
- package/esm/internals/plugins/corePlugins/useChartId/useChartId.js +2 -0
- package/esm/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/index.d.ts +2 -0
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/index.js +1 -0
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.d.ts +3 -0
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +77 -0
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +31 -0
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.js +1 -0
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +5 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +4 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +1 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +5 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +7 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.js +14 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +2 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +4 -4
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +90 -36
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +18 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +76 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +8 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +47 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +48 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +18 -12
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +16 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +6 -1
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +5 -5
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -6
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +34 -34
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -5
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +7 -8
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.js +47 -30
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +1 -1
- package/esm/internals/plugins/utils/useLazySelectorEffect.d.ts +7 -0
- package/esm/internals/plugins/utils/useLazySelectorEffect.js +70 -0
- package/esm/internals/store/useCharts.d.ts +1 -1
- package/esm/locales/elGR.d.ts +19 -0
- package/esm/locales/elGR.js +15 -0
- package/esm/locales/index.d.ts +1 -0
- package/esm/locales/index.js +1 -0
- package/esm/models/axis.d.ts +15 -0
- package/esm/models/axis.js +4 -0
- package/esm/models/index.d.ts +1 -1
- package/esm/models/seriesType/scatter.d.ts +11 -2
- package/esm/themeAugmentation/components.d.ts +3 -0
- package/esm/themeAugmentation/props.d.ts +2 -0
- package/hooks/useAxis.d.ts +2 -2
- package/hooks/useInteractionItemProps.d.ts +14 -9
- package/hooks/useInteractionItemProps.js +29 -28
- package/index.d.ts +2 -1
- package/index.js +37 -11
- package/internals/constants.d.ts +3 -0
- package/internals/constants.js +5 -1
- package/internals/getLabel.d.ts +1 -1
- package/internals/index.d.ts +6 -0
- package/internals/index.js +52 -0
- package/internals/plugins/corePlugins/corePlugins.d.ts +4 -2
- package/internals/plugins/corePlugins/corePlugins.js +3 -1
- package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +1 -29
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +3 -3
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +0 -6
- package/internals/plugins/corePlugins/useChartExperimentalFeature/index.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/index.js +27 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js +34 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +8 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +10 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +21 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js +5 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.js +1 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartInteractionListener/index.d.ts +2 -0
- package/internals/plugins/corePlugins/useChartInteractionListener/index.js +12 -0
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +84 -0
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +31 -0
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.js +5 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +5 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +4 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +1 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +4 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +7 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.js +21 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +24 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +4 -4
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +90 -36
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +18 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +82 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +9 -6
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +47 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +55 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +18 -12
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +18 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +6 -1
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +5 -5
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -6
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +34 -34
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -5
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +7 -8
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.js +46 -30
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +1 -1
- package/internals/plugins/utils/useLazySelectorEffect.d.ts +7 -0
- package/internals/plugins/utils/useLazySelectorEffect.js +77 -0
- package/internals/store/useCharts.d.ts +1 -1
- package/locales/elGR.d.ts +19 -0
- package/locales/elGR.js +21 -0
- package/locales/index.d.ts +1 -0
- package/locales/index.js +11 -0
- package/models/axis.d.ts +15 -0
- package/models/axis.js +4 -0
- package/models/index.d.ts +1 -1
- package/models/seriesType/scatter.d.ts +11 -2
- package/package.json +4 -3
- package/themeAugmentation/components.d.ts +3 -0
- package/themeAugmentation/props.d.ts +2 -0
package/internals/index.d.ts
CHANGED
|
@@ -6,8 +6,13 @@ export { useSeries } from "../hooks/useSeries.js";
|
|
|
6
6
|
export { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
7
7
|
export { useDrawingArea } from "../hooks/useDrawingArea.js";
|
|
8
8
|
export { useScatterChartProps } from "../ScatterChart/useScatterChartProps.js";
|
|
9
|
+
export { useScatterPlotData } from "../ScatterChart/useScatterPlotData.js";
|
|
10
|
+
export { seriesConfig as scatterSeriesConfig } from "../ScatterChart/seriesConfig/index.js";
|
|
9
11
|
export { useLineChartProps } from "../LineChart/useLineChartProps.js";
|
|
12
|
+
export { useAreaPlotData } from "../LineChart/useAreaPlotData.js";
|
|
13
|
+
export { useLinePlotData } from "../LineChart/useLinePlotData.js";
|
|
10
14
|
export { useBarChartProps } from "../BarChart/useBarChartProps.js";
|
|
15
|
+
export { useBarPlotData } from "../BarChart/useBarPlotData.js";
|
|
11
16
|
export { useRadarChartProps } from "../RadarChart/useRadarChartProps.js";
|
|
12
17
|
export * from "../ChartContainer/useChartContainerProps.js";
|
|
13
18
|
export * from "../ChartDataProvider/useChartDataProviderProps.js";
|
|
@@ -15,6 +20,7 @@ export * from "./createSeriesSelectorOfType.js";
|
|
|
15
20
|
export * from "./plugins/corePlugins/useChartId/index.js";
|
|
16
21
|
export * from "./plugins/corePlugins/useChartSeries/index.js";
|
|
17
22
|
export * from "./plugins/corePlugins/useChartDimensions/index.js";
|
|
23
|
+
export * from "./plugins/corePlugins/useChartInteractionListener/index.js";
|
|
18
24
|
export * from "./plugins/featurePlugins/useChartZAxis/index.js";
|
|
19
25
|
export * from "./plugins/featurePlugins/useChartCartesianAxis/index.js";
|
|
20
26
|
export * from "./plugins/featurePlugins/useChartPolarAxis/index.js";
|
package/internals/index.js
CHANGED
|
@@ -8,8 +8,13 @@ var _exportNames = {
|
|
|
8
8
|
useInteractionItemProps: true,
|
|
9
9
|
useDrawingArea: true,
|
|
10
10
|
useScatterChartProps: true,
|
|
11
|
+
useScatterPlotData: true,
|
|
12
|
+
scatterSeriesConfig: true,
|
|
11
13
|
useLineChartProps: true,
|
|
14
|
+
useAreaPlotData: true,
|
|
15
|
+
useLinePlotData: true,
|
|
12
16
|
useBarChartProps: true,
|
|
17
|
+
useBarPlotData: true,
|
|
13
18
|
useRadarChartProps: true,
|
|
14
19
|
getCartesianAxisTriggerTooltip: true,
|
|
15
20
|
getCartesianAxisIndex: true,
|
|
@@ -33,12 +38,30 @@ Object.defineProperty(exports, "getCartesianAxisTriggerTooltip", {
|
|
|
33
38
|
return _getAxisTriggerTooltip.getAxisTriggerTooltip;
|
|
34
39
|
}
|
|
35
40
|
});
|
|
41
|
+
Object.defineProperty(exports, "scatterSeriesConfig", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () {
|
|
44
|
+
return _seriesConfig.seriesConfig;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(exports, "useAreaPlotData", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function () {
|
|
50
|
+
return _useAreaPlotData.useAreaPlotData;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
36
53
|
Object.defineProperty(exports, "useBarChartProps", {
|
|
37
54
|
enumerable: true,
|
|
38
55
|
get: function () {
|
|
39
56
|
return _useBarChartProps.useBarChartProps;
|
|
40
57
|
}
|
|
41
58
|
});
|
|
59
|
+
Object.defineProperty(exports, "useBarPlotData", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
get: function () {
|
|
62
|
+
return _useBarPlotData.useBarPlotData;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
42
65
|
Object.defineProperty(exports, "useDrawingArea", {
|
|
43
66
|
enumerable: true,
|
|
44
67
|
get: function () {
|
|
@@ -57,6 +80,12 @@ Object.defineProperty(exports, "useLineChartProps", {
|
|
|
57
80
|
return _useLineChartProps.useLineChartProps;
|
|
58
81
|
}
|
|
59
82
|
});
|
|
83
|
+
Object.defineProperty(exports, "useLinePlotData", {
|
|
84
|
+
enumerable: true,
|
|
85
|
+
get: function () {
|
|
86
|
+
return _useLinePlotData.useLinePlotData;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
60
89
|
Object.defineProperty(exports, "useRadarChartProps", {
|
|
61
90
|
enumerable: true,
|
|
62
91
|
get: function () {
|
|
@@ -69,6 +98,12 @@ Object.defineProperty(exports, "useScatterChartProps", {
|
|
|
69
98
|
return _useScatterChartProps.useScatterChartProps;
|
|
70
99
|
}
|
|
71
100
|
});
|
|
101
|
+
Object.defineProperty(exports, "useScatterPlotData", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
get: function () {
|
|
104
|
+
return _useScatterPlotData.useScatterPlotData;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
72
107
|
Object.defineProperty(exports, "useSeries", {
|
|
73
108
|
enumerable: true,
|
|
74
109
|
get: function () {
|
|
@@ -127,8 +162,13 @@ var _useSeries = require("../hooks/useSeries");
|
|
|
127
162
|
var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
128
163
|
var _useDrawingArea = require("../hooks/useDrawingArea");
|
|
129
164
|
var _useScatterChartProps = require("../ScatterChart/useScatterChartProps");
|
|
165
|
+
var _useScatterPlotData = require("../ScatterChart/useScatterPlotData");
|
|
166
|
+
var _seriesConfig = require("../ScatterChart/seriesConfig");
|
|
130
167
|
var _useLineChartProps = require("../LineChart/useLineChartProps");
|
|
168
|
+
var _useAreaPlotData = require("../LineChart/useAreaPlotData");
|
|
169
|
+
var _useLinePlotData = require("../LineChart/useLinePlotData");
|
|
131
170
|
var _useBarChartProps = require("../BarChart/useBarChartProps");
|
|
171
|
+
var _useBarPlotData = require("../BarChart/useBarPlotData");
|
|
132
172
|
var _useRadarChartProps = require("../RadarChart/useRadarChartProps");
|
|
133
173
|
var _useChartContainerProps = require("../ChartContainer/useChartContainerProps");
|
|
134
174
|
Object.keys(_useChartContainerProps).forEach(function (key) {
|
|
@@ -202,6 +242,18 @@ Object.keys(_useChartDimensions).forEach(function (key) {
|
|
|
202
242
|
}
|
|
203
243
|
});
|
|
204
244
|
});
|
|
245
|
+
var _useChartInteractionListener = require("./plugins/corePlugins/useChartInteractionListener");
|
|
246
|
+
Object.keys(_useChartInteractionListener).forEach(function (key) {
|
|
247
|
+
if (key === "default" || key === "__esModule") return;
|
|
248
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
249
|
+
if (key in exports && exports[key] === _useChartInteractionListener[key]) return;
|
|
250
|
+
Object.defineProperty(exports, key, {
|
|
251
|
+
enumerable: true,
|
|
252
|
+
get: function () {
|
|
253
|
+
return _useChartInteractionListener[key];
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
});
|
|
205
257
|
var _useChartZAxis = require("./plugins/featurePlugins/useChartZAxis");
|
|
206
258
|
Object.keys(_useChartZAxis).forEach(function (key) {
|
|
207
259
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type UseChartAnimationSignature } from "./useChartAnimation/index.js";
|
|
2
2
|
import { type UseChartDimensionsSignature } from "./useChartDimensions/index.js";
|
|
3
|
+
import { type UseChartExperimentalFeaturesSignature } from "./useChartExperimentalFeature/index.js";
|
|
3
4
|
import { type UseChartIdSignature, UseChartIdParameters } from "./useChartId/index.js";
|
|
4
5
|
import { type UseChartSeriesSignature } from "./useChartSeries/index.js";
|
|
6
|
+
import { type UseChartInteractionListenerSignature } from "./useChartInteractionListener/index.js";
|
|
5
7
|
/**
|
|
6
8
|
* Internal plugins that create the tools used by the other plugins.
|
|
7
9
|
* These plugins are used by the Charts components.
|
|
8
10
|
*/
|
|
9
|
-
export declare const CHART_CORE_PLUGINS: readonly [import("../models/index.js").ChartPlugin<UseChartIdSignature>, import("../models/index.js").ChartPlugin<UseChartDimensionsSignature>, import("../models/index.js").ChartPlugin<UseChartSeriesSignature>, import("../models/index.js").ChartPlugin<UseChartAnimationSignature>];
|
|
10
|
-
export type ChartCorePluginSignatures = [UseChartIdSignature, UseChartDimensionsSignature, UseChartSeriesSignature, UseChartAnimationSignature];
|
|
11
|
+
export declare const CHART_CORE_PLUGINS: readonly [import("../models/index.js").ChartPlugin<UseChartIdSignature>, import("../models/index.js").ChartPlugin<UseChartExperimentalFeaturesSignature>, import("../models/index.js").ChartPlugin<UseChartDimensionsSignature>, import("../models/index.js").ChartPlugin<UseChartSeriesSignature>, import("../models/index.js").ChartPlugin<UseChartInteractionListenerSignature>, import("../models/index.js").ChartPlugin<UseChartAnimationSignature>];
|
|
12
|
+
export type ChartCorePluginSignatures = [UseChartIdSignature, UseChartExperimentalFeaturesSignature, UseChartDimensionsSignature, UseChartSeriesSignature, UseChartAnimationSignature, UseChartInteractionListenerSignature];
|
|
11
13
|
export interface ChartCorePluginParameters extends UseChartIdParameters {}
|
|
@@ -6,10 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.CHART_CORE_PLUGINS = void 0;
|
|
7
7
|
var _useChartAnimation = require("./useChartAnimation");
|
|
8
8
|
var _useChartDimensions = require("./useChartDimensions");
|
|
9
|
+
var _useChartExperimentalFeature = require("./useChartExperimentalFeature");
|
|
9
10
|
var _useChartId = require("./useChartId");
|
|
10
11
|
var _useChartSeries = require("./useChartSeries");
|
|
12
|
+
var _useChartInteractionListener = require("./useChartInteractionListener");
|
|
11
13
|
/**
|
|
12
14
|
* Internal plugins that create the tools used by the other plugins.
|
|
13
15
|
* These plugins are used by the Charts components.
|
|
14
16
|
*/
|
|
15
|
-
const CHART_CORE_PLUGINS = exports.CHART_CORE_PLUGINS = [_useChartId.useChartId, _useChartDimensions.useChartDimensions, _useChartSeries.useChartSeries, _useChartAnimation.useChartAnimation];
|
|
17
|
+
const CHART_CORE_PLUGINS = exports.CHART_CORE_PLUGINS = [_useChartId.useChartId, _useChartExperimentalFeature.useChartExperimentalFeatures, _useChartDimensions.useChartDimensions, _useChartSeries.useChartSeries, _useChartInteractionListener.useChartInteractionListener, _useChartAnimation.useChartAnimation];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const selectorChartSkipAnimation: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("./useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
|
|
1
|
+
export declare const selectorChartSkipAnimation: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("./useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
2
2
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
3
3
|
} & {
|
|
4
4
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -15,7 +15,6 @@ var _useSelector = require("../../../store/useSelector");
|
|
|
15
15
|
var _constants = require("../../../../constants");
|
|
16
16
|
var _useChartDimensions = require("./useChartDimensions.selectors");
|
|
17
17
|
var _defaultizeMargin = require("../../../defaultizeMargin");
|
|
18
|
-
var _getSVGPoint = require("../../../getSVGPoint");
|
|
19
18
|
const MAX_COMPUTE_RUN = 10;
|
|
20
19
|
const useChartDimensions = ({
|
|
21
20
|
params,
|
|
@@ -162,38 +161,11 @@ const useChartDimensions = ({
|
|
|
162
161
|
}
|
|
163
162
|
return isXInside(x) && isYInside(y);
|
|
164
163
|
}, [isXInside, isYInside]);
|
|
165
|
-
const isElementInside = React.useCallback(element => {
|
|
166
|
-
const svgElement = svgRef.current;
|
|
167
|
-
if (!element || !(element instanceof Element) || !svgElement) {
|
|
168
|
-
return false;
|
|
169
|
-
}
|
|
170
|
-
// For element allowed to overflow, wrapping them in <g data-drawing-container /> make them fully part of the drawing area.
|
|
171
|
-
if (element.closest('[data-drawing-container]')) {
|
|
172
|
-
return true;
|
|
173
|
-
}
|
|
174
|
-
const rect = element.getBoundingClientRect();
|
|
175
|
-
const {
|
|
176
|
-
x: left,
|
|
177
|
-
y: top
|
|
178
|
-
} = (0, _getSVGPoint.getSVGPoint)(svgElement, {
|
|
179
|
-
clientX: rect.left,
|
|
180
|
-
clientY: rect.top
|
|
181
|
-
});
|
|
182
|
-
const {
|
|
183
|
-
x: right,
|
|
184
|
-
y: bottom
|
|
185
|
-
} = (0, _getSVGPoint.getSVGPoint)(svgElement, {
|
|
186
|
-
clientX: rect.right,
|
|
187
|
-
clientY: rect.bottom
|
|
188
|
-
});
|
|
189
|
-
return isXInside(left) && isXInside(right) && isYInside(top) && isYInside(bottom);
|
|
190
|
-
}, [isXInside, isYInside, svgRef]);
|
|
191
164
|
return {
|
|
192
165
|
instance: {
|
|
193
166
|
isPointInside,
|
|
194
167
|
isXInside,
|
|
195
|
-
isYInside
|
|
196
|
-
isElementInside
|
|
168
|
+
isYInside
|
|
197
169
|
}
|
|
198
170
|
};
|
|
199
171
|
};
|
|
@@ -3,7 +3,7 @@ import type { UseChartDimensionsSignature } from "./useChartDimensions.types.js"
|
|
|
3
3
|
import { ChartState } from "../../models/chart.js";
|
|
4
4
|
export declare const selectorChartDimensionsState: ChartRootSelector<UseChartDimensionsSignature>;
|
|
5
5
|
export declare const selectorChartMargin: (state: ChartState<[UseChartDimensionsSignature]>) => import("./useChartDimensions.types.js").ChartMargin;
|
|
6
|
-
export declare const selectorChartDrawingArea: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
|
|
6
|
+
export declare const selectorChartDrawingArea: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
7
7
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
8
8
|
} & Partial<import("../../../index.js").UseChartCartesianAxisState> & {
|
|
9
9
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -15,7 +15,7 @@ export declare const selectorChartDrawingArea: import("reselect").Selector<impor
|
|
|
15
15
|
top: number;
|
|
16
16
|
bottom: number;
|
|
17
17
|
}, []>;
|
|
18
|
-
export declare const selectorChartPropsSize: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
|
|
18
|
+
export declare const selectorChartPropsSize: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
19
19
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
20
20
|
} & {
|
|
21
21
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -23,7 +23,7 @@ export declare const selectorChartPropsSize: import("reselect").Selector<import(
|
|
|
23
23
|
width: number | undefined;
|
|
24
24
|
height: number | undefined;
|
|
25
25
|
}, any[]>;
|
|
26
|
-
export declare const selectorChartContainerSize: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
|
|
26
|
+
export declare const selectorChartContainerSize: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
27
27
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
28
28
|
} & {
|
|
29
29
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -63,12 +63,6 @@ export interface UseChartDimensionsState {
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
export interface UseChartDimensionsInstance {
|
|
66
|
-
/**
|
|
67
|
-
* Checks if an element is inside the drawing area.
|
|
68
|
-
* @param {Element | EventTarget | null} element The element to check.
|
|
69
|
-
* @returns {boolean} `true` if the element is inside the drawing area, `false` otherwise.
|
|
70
|
-
*/
|
|
71
|
-
isElementInside: (element: Element | EventTarget | null | undefined) => boolean;
|
|
72
66
|
/**
|
|
73
67
|
* Checks if a point is inside the drawing area.
|
|
74
68
|
* @param {number} x The x coordinate of the point.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { useChartExperimentalFeatures } from "./useChartExperimentalFeature.js";
|
|
2
|
+
export type { UseChartExperimentalFeaturesSignature, UseChartExperimentalFeaturesParameters } from "./useChartExperimentalFeature.types.js";
|
|
3
|
+
export * from "./useChartExperimentalFeature.selectors.js";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
useChartExperimentalFeatures: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "useChartExperimentalFeatures", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _useChartExperimentalFeature.useChartExperimentalFeatures;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
var _useChartExperimentalFeature = require("./useChartExperimentalFeature");
|
|
16
|
+
var _useChartExperimentalFeature2 = require("./useChartExperimentalFeature.selectors");
|
|
17
|
+
Object.keys(_useChartExperimentalFeature2).forEach(function (key) {
|
|
18
|
+
if (key === "default" || key === "__esModule") return;
|
|
19
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
20
|
+
if (key in exports && exports[key] === _useChartExperimentalFeature2[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _useChartExperimentalFeature2[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useChartExperimentalFeatures = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
11
|
+
const useChartExperimentalFeatures = ({
|
|
12
|
+
params,
|
|
13
|
+
store
|
|
14
|
+
}) => {
|
|
15
|
+
(0, _useEnhancedEffect.default)(() => {
|
|
16
|
+
store.update(prevState => {
|
|
17
|
+
return (0, _extends2.default)({}, prevState, {
|
|
18
|
+
experimentalFeatures: params.experimentalFeatures
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
}, [store, params.experimentalFeatures]);
|
|
22
|
+
return {};
|
|
23
|
+
};
|
|
24
|
+
exports.useChartExperimentalFeatures = useChartExperimentalFeatures;
|
|
25
|
+
useChartExperimentalFeatures.params = {
|
|
26
|
+
experimentalFeatures: true
|
|
27
|
+
};
|
|
28
|
+
useChartExperimentalFeatures.getInitialState = ({
|
|
29
|
+
experimentalFeatures
|
|
30
|
+
}) => {
|
|
31
|
+
return {
|
|
32
|
+
experimentalFeatures
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChartRootSelector } from "../../utils/selectors.js";
|
|
2
|
+
import type { UseChartExperimentalFeaturesSignature } from "./useChartExperimentalFeature.types.js";
|
|
3
|
+
export declare const selectorChartExperimentalFeaturesState: ChartRootSelector<UseChartExperimentalFeaturesSignature>;
|
|
4
|
+
export declare const selectorPreferStrictDomainInLineCharts: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
5
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
6
|
+
} & {
|
|
7
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
8
|
+
}, boolean, any[]>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.selectorPreferStrictDomainInLineCharts = exports.selectorChartExperimentalFeaturesState = void 0;
|
|
7
|
+
var _selectors = require("../../utils/selectors");
|
|
8
|
+
const selectorChartExperimentalFeaturesState = state => state.experimentalFeatures;
|
|
9
|
+
exports.selectorChartExperimentalFeaturesState = selectorChartExperimentalFeaturesState;
|
|
10
|
+
const selectorPreferStrictDomainInLineCharts = exports.selectorPreferStrictDomainInLineCharts = (0, _selectors.createSelector)([selectorChartExperimentalFeaturesState], features => Boolean(features?.preferStrictDomainInLineCharts));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChartPluginSignature } from "../../models/index.js";
|
|
2
|
+
export interface ChartExperimentalFeatures {
|
|
3
|
+
/**
|
|
4
|
+
* Default domainLimit to strict for line chart x-axis.
|
|
5
|
+
*/
|
|
6
|
+
preferStrictDomainInLineCharts?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface UseChartExperimentalFeaturesParameters {
|
|
9
|
+
/**
|
|
10
|
+
* Options to enable features planned for the next major.
|
|
11
|
+
*/
|
|
12
|
+
experimentalFeatures?: ChartExperimentalFeatures;
|
|
13
|
+
}
|
|
14
|
+
export interface UseChartExperimentalFeaturesState {
|
|
15
|
+
experimentalFeatures?: ChartExperimentalFeatures;
|
|
16
|
+
}
|
|
17
|
+
export type UseChartExperimentalFeaturesSignature = ChartPluginSignature<{
|
|
18
|
+
params: UseChartExperimentalFeaturesParameters;
|
|
19
|
+
defaultizedParams: UseChartExperimentalFeaturesParameters;
|
|
20
|
+
state: UseChartExperimentalFeaturesState;
|
|
21
|
+
}>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @param {ChartState<[UseChartIdSignature]>} state The state of the chart.
|
|
4
4
|
* @returns {string} The id attribute of the chart.
|
|
5
5
|
*/
|
|
6
|
-
export declare const selectorChartId: import("reselect").Selector<import("./useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
|
|
6
|
+
export declare const selectorChartId: import("reselect").Selector<import("./useChartId.types.js").UseChartIdState & import("../useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
7
7
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
8
8
|
} & {
|
|
9
9
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { useChartInteractionListener } from "./useChartInteractionListener.js";
|
|
2
|
+
export type { UseChartInteractionListenerParameters, UseChartInteractionListenerState, UseChartInteractionListenerInstance, UseChartInteractionListenerSignature, ChartInteraction } from "./useChartInteractionListener.types.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "useChartInteractionListener", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _useChartInteractionListener.useChartInteractionListener;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _useChartInteractionListener = require("./useChartInteractionListener");
|
package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useChartInteractionListener = void 0;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _core = require("@mui/x-internal-gestures/core");
|
|
11
|
+
const preventDefault = event => event.preventDefault();
|
|
12
|
+
const useChartInteractionListener = ({
|
|
13
|
+
svgRef
|
|
14
|
+
}) => {
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
const svg = svgRef.current;
|
|
17
|
+
if (!svg) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
const gestureManager = new _core.GestureManager({
|
|
21
|
+
gestures: [new _core.PanGesture({
|
|
22
|
+
name: 'pan',
|
|
23
|
+
threshold: 0,
|
|
24
|
+
maxPointers: 1
|
|
25
|
+
}), new _core.MoveGesture({
|
|
26
|
+
name: 'move',
|
|
27
|
+
preventIf: ['pan', 'pinch'] // Prevent move gesture when pan is active
|
|
28
|
+
}), new _core.PinchGesture({
|
|
29
|
+
name: 'pinch',
|
|
30
|
+
threshold: 5,
|
|
31
|
+
preventIf: ['pan']
|
|
32
|
+
}), new _core.TurnWheelGesture({
|
|
33
|
+
name: 'turnWheel',
|
|
34
|
+
sensitivity: 0.01,
|
|
35
|
+
initialDelta: 1
|
|
36
|
+
}), new _core.TapGesture({
|
|
37
|
+
name: 'tap',
|
|
38
|
+
maxDistance: 10,
|
|
39
|
+
preventIf: ['pan', 'pinch']
|
|
40
|
+
}), new _core.PressGesture({
|
|
41
|
+
name: 'quickPress',
|
|
42
|
+
duration: 50,
|
|
43
|
+
maxDistance: 10
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
gestureManager.registerElement(['pan', 'move', 'pinch', 'turnWheel', 'tap', 'quickPress'], svg);
|
|
47
|
+
return () => {
|
|
48
|
+
// Cleanup gesture manager
|
|
49
|
+
gestureManager.destroy();
|
|
50
|
+
};
|
|
51
|
+
}, [svgRef]);
|
|
52
|
+
const addInteractionListener = React.useCallback((interaction, callback, options) => {
|
|
53
|
+
// Forcefully cast the svgRef to any, it is annoying to fix the types.
|
|
54
|
+
const svg = svgRef.current;
|
|
55
|
+
svg?.addEventListener(interaction, callback, options);
|
|
56
|
+
return {
|
|
57
|
+
cleanup: () => svg?.removeEventListener(interaction, callback)
|
|
58
|
+
};
|
|
59
|
+
}, [svgRef]);
|
|
60
|
+
React.useEffect(() => {
|
|
61
|
+
const svg = svgRef.current;
|
|
62
|
+
|
|
63
|
+
// Disable gesture on safari
|
|
64
|
+
// https://use-gesture.netlify.app/docs/gestures/#about-the-pinch-gesture
|
|
65
|
+
svg?.addEventListener('gesturestart', preventDefault);
|
|
66
|
+
svg?.addEventListener('gesturechange', preventDefault);
|
|
67
|
+
svg?.addEventListener('gestureend', preventDefault);
|
|
68
|
+
return () => {
|
|
69
|
+
svg?.removeEventListener('gesturestart', preventDefault);
|
|
70
|
+
svg?.removeEventListener('gesturechange', preventDefault);
|
|
71
|
+
svg?.removeEventListener('gestureend', preventDefault);
|
|
72
|
+
};
|
|
73
|
+
}, [svgRef]);
|
|
74
|
+
return {
|
|
75
|
+
instance: {
|
|
76
|
+
addInteractionListener
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
exports.useChartInteractionListener = useChartInteractionListener;
|
|
81
|
+
useChartInteractionListener.params = {};
|
|
82
|
+
useChartInteractionListener.getInitialState = () => {
|
|
83
|
+
return {};
|
|
84
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { MoveEvent, PanEvent, PinchEvent, PressEvent, TapEvent, TurnWheelEvent } from '@mui/x-internal-gestures/core';
|
|
2
|
+
import { ChartPluginSignature } from "../../models/index.js";
|
|
3
|
+
export type ChartInteraction = 'pan' | 'panStart' | 'panEnd' | 'pinch' | 'pinchStart' | 'pinchEnd' | 'move' | 'moveStart' | 'moveEnd' | 'quickPress' | 'quickPressEnd' | 'turnWheel' | 'tap';
|
|
4
|
+
export type InteractionListenerResult = {
|
|
5
|
+
cleanup: () => void;
|
|
6
|
+
};
|
|
7
|
+
export type AddInteractionListener = {
|
|
8
|
+
<CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'pan' | 'panStart' | 'panEnd', callback: (event: PanEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
|
|
9
|
+
<CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'pinch' | 'pinchStart' | 'pinchEnd', callback: (event: PinchEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
|
|
10
|
+
<CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'turnWheel', callback: (event: TurnWheelEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
|
|
11
|
+
<CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'move' | 'moveStart' | 'moveEnd', callback: (event: MoveEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
|
|
12
|
+
<CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'tap', callback: (event: TapEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
|
|
13
|
+
<CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'quickPress' | 'quickPressEnd', callback: (event: PressEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
|
|
14
|
+
};
|
|
15
|
+
export interface UseChartInteractionListenerParameters {}
|
|
16
|
+
export interface UseChartInteractionListenerState {}
|
|
17
|
+
export interface UseChartInteractionListenerInstance {
|
|
18
|
+
/**
|
|
19
|
+
* Adds an interaction listener to the SVG element.
|
|
20
|
+
*
|
|
21
|
+
* @param interaction The interaction to listen to.
|
|
22
|
+
* @param callback The callback to call when the interaction occurs.
|
|
23
|
+
*/
|
|
24
|
+
addInteractionListener: AddInteractionListener;
|
|
25
|
+
}
|
|
26
|
+
export type UseChartInteractionListenerSignature = ChartPluginSignature<{
|
|
27
|
+
params: UseChartInteractionListenerParameters;
|
|
28
|
+
defaultizedParams: UseChartInteractionListenerParameters;
|
|
29
|
+
state: UseChartInteractionListenerState;
|
|
30
|
+
instance: UseChartInteractionListenerInstance;
|
|
31
|
+
}>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ChartRootSelector } from "../../utils/selectors.js";
|
|
2
2
|
import { UseChartSeriesSignature } from "./useChartSeries.types.js";
|
|
3
3
|
export declare const selectorChartSeriesState: ChartRootSelector<UseChartSeriesSignature>;
|
|
4
|
-
export declare const selectorChartSeriesProcessed: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("./useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
|
|
4
|
+
export declare const selectorChartSeriesProcessed: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("./useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
5
5
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
6
6
|
} & {
|
|
7
7
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
8
8
|
}, import("./useChartSeries.types.js").ProcessedSeries<keyof import("../../../index.js").ChartsSeriesConfig>, any[]>;
|
|
9
|
-
export declare const selectorChartSeriesConfig: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("./useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
|
|
9
|
+
export declare const selectorChartSeriesConfig: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("./useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
10
10
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
11
11
|
} & {
|
|
12
12
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -7,7 +7,7 @@ import { ProcessedSeries } from "../../corePlugins/useChartSeries/useChartSeries
|
|
|
7
7
|
import { GetZoomAxisFilters, ZoomData } from "./zoom.types.js";
|
|
8
8
|
export type ComputeResult<T extends ChartsAxisProps> = {
|
|
9
9
|
axis: ComputedAxisConfig<T>;
|
|
10
|
-
axisIds:
|
|
10
|
+
axisIds: AxisId[];
|
|
11
11
|
};
|
|
12
12
|
type ComputeCommonParams<T extends ChartSeriesType = ChartSeriesType> = {
|
|
13
13
|
drawingArea: ChartDrawingArea;
|
|
@@ -16,6 +16,10 @@ type ComputeCommonParams<T extends ChartSeriesType = ChartSeriesType> = {
|
|
|
16
16
|
zoomMap?: Map<AxisId, ZoomData>;
|
|
17
17
|
zoomOptions?: Record<AxisId, DefaultizedZoomOptions>;
|
|
18
18
|
getFilters?: GetZoomAxisFilters;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated To remove in v9. This is an experimental feature to avoid breaking change.
|
|
21
|
+
*/
|
|
22
|
+
preferStrictDomainInLineCharts?: boolean;
|
|
19
23
|
};
|
|
20
24
|
export declare function computeAxisValue<T extends ChartSeriesType>(options: ComputeCommonParams<T> & {
|
|
21
25
|
axis?: DefaultedYAxis[];
|
|
@@ -16,6 +16,7 @@ var _dateHelpers = require("../../../dateHelpers");
|
|
|
16
16
|
var _zoom = require("./zoom");
|
|
17
17
|
var _getAxisExtremum = require("./getAxisExtremum");
|
|
18
18
|
var _getAxisTriggerTooltip = require("./getAxisTriggerTooltip");
|
|
19
|
+
var _getAxisDomainLimit = require("./getAxisDomainLimit");
|
|
19
20
|
function getRange(drawingArea, axisDirection,
|
|
20
21
|
// | 'rotation' | 'radius',
|
|
21
22
|
axis) {
|
|
@@ -32,7 +33,8 @@ function computeAxisValue({
|
|
|
32
33
|
axisDirection,
|
|
33
34
|
zoomMap,
|
|
34
35
|
zoomOptions,
|
|
35
|
-
getFilters
|
|
36
|
+
getFilters,
|
|
37
|
+
preferStrictDomainInLineCharts
|
|
36
38
|
}) {
|
|
37
39
|
if (allAxis === undefined) {
|
|
38
40
|
return {
|
|
@@ -102,7 +104,7 @@ function computeAxisValue({
|
|
|
102
104
|
return;
|
|
103
105
|
}
|
|
104
106
|
const scaleType = axis.scaleType ?? 'linear';
|
|
105
|
-
const domainLimit = axis.domainLimit ?? 'nice';
|
|
107
|
+
const domainLimit = preferStrictDomainInLineCharts ? (0, _getAxisDomainLimit.getAxisDomainLimit)(axis, axisDirection, axisIndex, formattedSeries) : axis.domainLimit ?? 'nice';
|
|
106
108
|
const axisExtremums = [axis.min ?? minData, axis.max ?? maxData];
|
|
107
109
|
if (typeof domainLimit === 'function') {
|
|
108
110
|
const {
|