@mui/x-charts-pro 8.26.0 → 9.0.0-alpha.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 +1 -1
- package/BarChartPro/BarChartPro.js +9 -4
- package/CHANGELOG.md +355 -3
- package/ChartContainerPro/ChartContainerPro.d.ts +17 -31
- package/ChartContainerPro/ChartContainerPro.js +14 -287
- package/ChartContainerPro/useChartContainerProProps.d.ts +9 -5
- package/ChartContainerPro/useChartContainerProProps.js +9 -34
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +5 -3
- package/ChartDataProviderPro/ChartDataProviderPro.js +2 -2
- package/ChartDataProviderPro/index.d.ts +1 -1
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +3 -3
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +8 -6
- package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +6 -4
- package/ChartZoomSlider/internals/previews/AreaPreviewPlot.d.ts +1 -1
- package/ChartZoomSlider/internals/previews/AreaPreviewPlot.js +4 -4
- package/ChartZoomSlider/internals/previews/BarPreviewPlot.js +1 -1
- package/ChartZoomSlider/internals/previews/LinePreviewPlot.d.ts +1 -1
- package/ChartZoomSlider/internals/previews/LinePreviewPlot.js +4 -4
- package/ChartsContainer/index.d.ts +1 -0
- package/ChartsContainer/index.js +16 -0
- package/ChartsContainerPro/ChartsContainerPro.d.ts +37 -0
- package/ChartsContainerPro/ChartsContainerPro.js +187 -0
- package/ChartsContainerPro/index.d.ts +9 -0
- package/ChartsContainerPro/index.js +17 -0
- package/ChartsContainerPro/useChartsContainerProProps.d.ts +9 -0
- package/ChartsContainerPro/useChartsContainerProProps.js +44 -0
- package/FunnelChart/FunnelChart.js +4 -4
- package/FunnelChart/FunnelSection.d.ts +1 -1
- package/FunnelChart/funnel.types.d.ts +1 -1
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.js +12 -9
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.d.ts +3 -2
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +3 -3
- package/FunnelChart/index.d.ts +1 -0
- package/FunnelChart/index.js +12 -0
- package/FunnelChart/seriesConfig/index.js +2 -1
- package/FunnelChart/seriesConfig/legend.js +0 -1
- package/Heatmap/Heatmap.d.ts +14 -2
- package/Heatmap/Heatmap.js +36 -130
- package/Heatmap/Heatmap.plugins.d.ts +2 -2
- package/Heatmap/Heatmap.plugins.js +1 -1
- package/Heatmap/Heatmap.types.d.ts +19 -0
- package/Heatmap/Heatmap.types.js +5 -0
- package/Heatmap/HeatmapItem.d.ts +6 -0
- package/Heatmap/HeatmapItem.js +11 -3
- package/Heatmap/HeatmapPlot.d.ts +7 -3
- package/Heatmap/HeatmapPlot.js +16 -54
- package/Heatmap/HeatmapSVGPlot.d.ts +2 -0
- package/Heatmap/HeatmapSVGPlot.js +70 -0
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.types.d.ts +5 -1
- package/Heatmap/HeatmapTooltip/index.d.ts +1 -1
- package/Heatmap/index.d.ts +3 -2
- package/Heatmap/seriesConfig/getItemAtPosition.d.ts +6 -0
- package/Heatmap/seriesConfig/getItemAtPosition.js +45 -0
- package/Heatmap/seriesConfig/index.js +3 -0
- package/Heatmap/useHeatmapProps.d.ts +24 -0
- package/Heatmap/useHeatmapProps.js +159 -0
- package/LineChartPro/LineChartPro.d.ts +1 -1
- package/LineChartPro/LineChartPro.js +9 -4
- package/PieChartPro/PieChartPro.d.ts +1 -1
- package/PieChartPro/PieChartPro.js +4 -4
- package/RadarChartPro/RadarChartPro.d.ts +1 -1
- package/RadarChartPro/RadarChartPro.js +4 -4
- package/RadarChartPro/RadarChartPro.plugins.d.ts +2 -2
- package/RadarChartPro/RadarChartPro.plugins.js +1 -1
- package/SankeyChart/SankeyChart.js +4 -4
- package/SankeyChart/SankeyTooltip/SankeyTooltip.types.d.ts +5 -1
- package/SankeyChart/SankeyTooltip/index.d.ts +1 -1
- package/SankeyChart/index.d.ts +1 -1
- package/SankeyChart/plugins/useSankeyHighlight.selectors.d.ts +7 -7
- package/SankeyChart/sankey.highlight.types.d.ts +4 -0
- package/SankeyChart/sankey.types.d.ts +6 -3
- package/SankeyChart/seriesConfig/getSeriesWithDefaultValues.js +13 -1
- package/SankeyChart/seriesConfig/identifierCleaner.d.ts +3 -0
- package/SankeyChart/seriesConfig/identifierCleaner.js +24 -0
- package/SankeyChart/seriesConfig/index.js +3 -1
- package/ScatterChartPro/ScatterChartPro.d.ts +1 -1
- package/ScatterChartPro/ScatterChartPro.js +9 -4
- package/esm/BarChartPro/BarChartPro.d.ts +1 -1
- package/esm/BarChartPro/BarChartPro.js +9 -4
- package/esm/ChartContainerPro/ChartContainerPro.d.ts +17 -31
- package/esm/ChartContainerPro/ChartContainerPro.js +15 -286
- package/esm/ChartContainerPro/useChartContainerProProps.d.ts +9 -5
- package/esm/ChartContainerPro/useChartContainerProProps.js +10 -33
- package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +5 -3
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +2 -2
- package/esm/ChartDataProviderPro/index.d.ts +1 -1
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +3 -3
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +9 -7
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +7 -5
- package/esm/ChartZoomSlider/internals/previews/AreaPreviewPlot.d.ts +1 -1
- package/esm/ChartZoomSlider/internals/previews/AreaPreviewPlot.js +4 -4
- package/esm/ChartZoomSlider/internals/previews/BarPreviewPlot.js +1 -1
- package/esm/ChartZoomSlider/internals/previews/LinePreviewPlot.d.ts +1 -1
- package/esm/ChartZoomSlider/internals/previews/LinePreviewPlot.js +4 -4
- package/esm/ChartsContainer/index.d.ts +1 -0
- package/esm/ChartsContainer/index.js +2 -0
- package/esm/ChartsContainerPro/ChartsContainerPro.d.ts +37 -0
- package/esm/ChartsContainerPro/ChartsContainerPro.js +181 -0
- package/esm/ChartsContainerPro/index.d.ts +9 -0
- package/esm/ChartsContainerPro/index.js +6 -0
- package/esm/ChartsContainerPro/useChartsContainerProProps.d.ts +9 -0
- package/esm/ChartsContainerPro/useChartsContainerProProps.js +37 -0
- package/esm/FunnelChart/FunnelChart.js +4 -4
- package/esm/FunnelChart/FunnelSection.d.ts +1 -1
- package/esm/FunnelChart/funnel.types.d.ts +1 -1
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.js +13 -10
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.d.ts +3 -2
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +3 -3
- package/esm/FunnelChart/index.d.ts +1 -0
- package/esm/FunnelChart/index.js +1 -0
- package/esm/FunnelChart/seriesConfig/index.js +3 -2
- package/esm/FunnelChart/seriesConfig/legend.js +0 -1
- package/esm/Heatmap/Heatmap.d.ts +14 -2
- package/esm/Heatmap/Heatmap.js +37 -131
- package/esm/Heatmap/Heatmap.plugins.d.ts +2 -2
- package/esm/Heatmap/Heatmap.plugins.js +2 -2
- package/esm/Heatmap/Heatmap.types.d.ts +19 -0
- package/esm/Heatmap/Heatmap.types.js +1 -0
- package/esm/Heatmap/HeatmapItem.d.ts +6 -0
- package/esm/Heatmap/HeatmapItem.js +11 -3
- package/esm/Heatmap/HeatmapPlot.d.ts +7 -3
- package/esm/Heatmap/HeatmapPlot.js +17 -56
- package/esm/Heatmap/HeatmapSVGPlot.d.ts +2 -0
- package/esm/Heatmap/HeatmapSVGPlot.js +64 -0
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.types.d.ts +5 -1
- package/esm/Heatmap/HeatmapTooltip/index.d.ts +1 -1
- package/esm/Heatmap/index.d.ts +3 -2
- package/esm/Heatmap/seriesConfig/getItemAtPosition.d.ts +6 -0
- package/esm/Heatmap/seriesConfig/getItemAtPosition.js +39 -0
- package/esm/Heatmap/seriesConfig/index.js +4 -1
- package/esm/Heatmap/useHeatmapProps.d.ts +24 -0
- package/esm/Heatmap/useHeatmapProps.js +151 -0
- package/esm/LineChartPro/LineChartPro.d.ts +1 -1
- package/esm/LineChartPro/LineChartPro.js +9 -4
- package/esm/PieChartPro/PieChartPro.d.ts +1 -1
- package/esm/PieChartPro/PieChartPro.js +4 -4
- package/esm/RadarChartPro/RadarChartPro.d.ts +1 -1
- package/esm/RadarChartPro/RadarChartPro.js +4 -4
- package/esm/RadarChartPro/RadarChartPro.plugins.d.ts +2 -2
- package/esm/RadarChartPro/RadarChartPro.plugins.js +2 -2
- package/esm/SankeyChart/SankeyChart.js +4 -4
- package/esm/SankeyChart/SankeyTooltip/SankeyTooltip.types.d.ts +5 -1
- package/esm/SankeyChart/SankeyTooltip/index.d.ts +1 -1
- package/esm/SankeyChart/index.d.ts +1 -1
- package/esm/SankeyChart/plugins/useSankeyHighlight.selectors.d.ts +7 -7
- package/esm/SankeyChart/sankey.highlight.types.d.ts +4 -0
- package/esm/SankeyChart/sankey.types.d.ts +6 -3
- package/esm/SankeyChart/seriesConfig/getSeriesWithDefaultValues.js +13 -1
- package/esm/SankeyChart/seriesConfig/identifierCleaner.d.ts +3 -0
- package/esm/SankeyChart/seriesConfig/identifierCleaner.js +18 -0
- package/esm/SankeyChart/seriesConfig/index.js +3 -1
- package/esm/ScatterChartPro/ScatterChartPro.d.ts +1 -1
- package/esm/ScatterChartPro/ScatterChartPro.js +9 -4
- package/esm/index.d.ts +3 -1
- package/esm/index.js +2 -1
- package/esm/internals/index.d.ts +8 -1
- package/esm/internals/index.js +6 -1
- package/esm/internals/plugins/useChartProExport/common.d.ts +5 -1
- package/esm/internals/plugins/useChartProExport/common.js +36 -0
- package/esm/internals/plugins/useChartProExport/exportImage.d.ts +1 -1
- package/esm/internals/plugins/useChartProExport/exportImage.js +10 -1
- package/esm/internals/plugins/useChartProExport/print.d.ts +1 -1
- package/esm/internals/plugins/useChartProExport/print.js +2 -1
- package/esm/internals/plugins/useChartProExport/useChartProExport.js +4 -2
- package/esm/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.d.ts +2 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +4 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +4 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.js +6 -4
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +7 -5
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.js +4 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +6 -4
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.js +6 -4
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +6 -4
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +5 -5
- package/esm/models/seriesType/heatmap.d.ts +3 -3
- package/esm/plugins/selectors/useChartHeatmapPosition.selectors.d.ts +1 -1
- package/esm/plugins/selectors/useChartHeatmapPosition.selectors.js +3 -1
- package/esm/typeOverloads/modules.d.ts +9 -5
- package/index.d.ts +3 -1
- package/index.js +9 -1
- package/internals/index.d.ts +8 -1
- package/internals/index.js +50 -1
- package/internals/plugins/useChartProExport/common.d.ts +5 -1
- package/internals/plugins/useChartProExport/common.js +37 -0
- package/internals/plugins/useChartProExport/exportImage.d.ts +1 -1
- package/internals/plugins/useChartProExport/exportImage.js +9 -0
- package/internals/plugins/useChartProExport/print.d.ts +1 -1
- package/internals/plugins/useChartProExport/print.js +1 -0
- package/internals/plugins/useChartProExport/useChartProExport.js +4 -2
- package/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.d.ts +2 -2
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +4 -2
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +4 -2
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.js +5 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +6 -4
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.js +4 -2
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +5 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.js +5 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +5 -3
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +5 -5
- package/models/seriesType/heatmap.d.ts +3 -3
- package/package.json +8 -8
- package/plugins/selectors/useChartHeatmapPosition.selectors.d.ts +1 -1
- package/plugins/selectors/useChartHeatmapPosition.selectors.js +3 -1
- package/typeOverloads/modules.d.ts +9 -5
|
@@ -96,6 +96,11 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
96
96
|
setZoomData: PropTypes.func.isRequired
|
|
97
97
|
})
|
|
98
98
|
}),
|
|
99
|
+
/**
|
|
100
|
+
* A gap added between axes when multiple axes are rendered on the same side of the chart.
|
|
101
|
+
* @default 0
|
|
102
|
+
*/
|
|
103
|
+
axesGap: PropTypes.number,
|
|
99
104
|
/**
|
|
100
105
|
* The configuration of axes highlight.
|
|
101
106
|
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
@@ -170,7 +175,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
170
175
|
*/
|
|
171
176
|
hiddenItems: PropTypes.arrayOf(PropTypes.shape({
|
|
172
177
|
dataIndex: PropTypes.number,
|
|
173
|
-
seriesId: PropTypes.
|
|
178
|
+
seriesId: PropTypes.string,
|
|
174
179
|
type: PropTypes.oneOf(['scatter']).isRequired
|
|
175
180
|
})),
|
|
176
181
|
/**
|
|
@@ -183,7 +188,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
183
188
|
*/
|
|
184
189
|
highlightedItem: PropTypes.shape({
|
|
185
190
|
dataIndex: PropTypes.number,
|
|
186
|
-
seriesId: PropTypes.
|
|
191
|
+
seriesId: PropTypes.string.isRequired
|
|
187
192
|
}),
|
|
188
193
|
/**
|
|
189
194
|
* This prop is used to help implement the accessibility logic.
|
|
@@ -213,7 +218,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
213
218
|
*/
|
|
214
219
|
initialHiddenItems: PropTypes.arrayOf(PropTypes.shape({
|
|
215
220
|
dataIndex: PropTypes.number,
|
|
216
|
-
seriesId: PropTypes.
|
|
221
|
+
seriesId: PropTypes.string,
|
|
217
222
|
type: PropTypes.oneOf(['scatter']).isRequired
|
|
218
223
|
})),
|
|
219
224
|
/**
|
|
@@ -325,7 +330,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
325
330
|
*/
|
|
326
331
|
tooltipItem: PropTypes.shape({
|
|
327
332
|
dataIndex: PropTypes.number.isRequired,
|
|
328
|
-
seriesId: PropTypes.
|
|
333
|
+
seriesId: PropTypes.string.isRequired,
|
|
329
334
|
type: PropTypes.oneOf(['scatter']).isRequired
|
|
330
335
|
}),
|
|
331
336
|
/**
|
package/esm/index.d.ts
CHANGED
|
@@ -29,8 +29,10 @@ export * from "./models/index.js";
|
|
|
29
29
|
export * from "./plugins/index.js";
|
|
30
30
|
export * from "./colorPalettes/index.js";
|
|
31
31
|
export * from "./Heatmap/index.js";
|
|
32
|
+
export { ChartsContainerPro } from "./ChartsContainerPro/index.js";
|
|
33
|
+
export type { ChartsContainerProProps, ChartsContainerProSlots, ChartsContainerProSlotProps } from "./ChartsContainerPro/index.js";
|
|
32
34
|
export { ChartContainerPro } from "./ChartContainerPro/index.js";
|
|
33
|
-
export type { ChartContainerProProps } from "./ChartContainerPro/index.js";
|
|
35
|
+
export type { ChartContainerProProps, ChartContainerProSlots, ChartContainerProSlotProps } from "./ChartContainerPro/index.js";
|
|
34
36
|
export * from "./ChartDataProviderPro/index.js";
|
|
35
37
|
export * from "./ScatterChartPro/index.js";
|
|
36
38
|
export * from "./SankeyChart/index.js";
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-charts-pro
|
|
2
|
+
* @mui/x-charts-pro v9.0.0-alpha.0
|
|
3
3
|
*
|
|
4
4
|
* @license SEE LICENSE IN LICENSE
|
|
5
5
|
* This source code is licensed under the SEE LICENSE IN LICENSE license found in the
|
|
@@ -44,6 +44,7 @@ export * from "./colorPalettes/index.js";
|
|
|
44
44
|
|
|
45
45
|
// Pro components
|
|
46
46
|
export * from "./Heatmap/index.js";
|
|
47
|
+
export { ChartsContainerPro } from "./ChartsContainerPro/index.js";
|
|
47
48
|
export { ChartContainerPro } from "./ChartContainerPro/index.js";
|
|
48
49
|
export * from "./ChartDataProviderPro/index.js";
|
|
49
50
|
export * from "./ScatterChartPro/index.js";
|
package/esm/internals/index.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
export { useChartsContainerProProps } from "../ChartsContainerPro/useChartsContainerProProps.js";
|
|
2
|
+
export type { UseChartsContainerProPropsReturnValue } from "../ChartsContainerPro/useChartsContainerProProps.js";
|
|
1
3
|
export { useChartContainerProProps } from "../ChartContainerPro/useChartContainerProProps.js";
|
|
2
4
|
export type { ChartsSlotsPro, ChartsSlotPropsPro } from "./material/index.js";
|
|
3
5
|
export { seriesPreviewPlotMap } from "../ChartZoomSlider/internals/seriesPreviewPlotMap.js";
|
|
4
6
|
export type { PreviewPlotProps } from "../ChartZoomSlider/internals/previews/PreviewPlot.types.js";
|
|
5
7
|
export { defaultSeriesConfigPro } from "../ChartDataProviderPro/ChartDataProviderPro.js";
|
|
6
|
-
export type { ProPluginsPerSeriesType } from "../context/ChartProApi.js";
|
|
8
|
+
export type { ProPluginsPerSeriesType } from "../context/ChartProApi.js";
|
|
9
|
+
export { useHeatmapProps } from "../Heatmap/useHeatmapProps.js";
|
|
10
|
+
export { defaultSlotsMaterial } from "./material/index.js";
|
|
11
|
+
export * from "../Heatmap/HeatmapSVGPlot.js";
|
|
12
|
+
export type * from "../Heatmap/Heatmap.types.js";
|
|
13
|
+
export { selectorHeatmapItemAtPosition } from "../plugins/selectors/useChartHeatmapPosition.selectors.js";
|
package/esm/internals/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export { useChartsContainerProProps } from "../ChartsContainerPro/useChartsContainerProProps.js";
|
|
1
2
|
export { useChartContainerProProps } from "../ChartContainerPro/useChartContainerProProps.js";
|
|
2
3
|
export { seriesPreviewPlotMap } from "../ChartZoomSlider/internals/seriesPreviewPlotMap.js";
|
|
3
|
-
export { defaultSeriesConfigPro } from "../ChartDataProviderPro/ChartDataProviderPro.js";
|
|
4
|
+
export { defaultSeriesConfigPro } from "../ChartDataProviderPro/ChartDataProviderPro.js";
|
|
5
|
+
export { useHeatmapProps } from "../Heatmap/useHeatmapProps.js";
|
|
6
|
+
export { defaultSlotsMaterial } from "./material/index.js";
|
|
7
|
+
export * from "../Heatmap/HeatmapSVGPlot.js";
|
|
8
|
+
export { selectorHeatmapItemAtPosition } from "../plugins/selectors/useChartHeatmapPosition.selectors.js";
|
|
@@ -2,4 +2,8 @@ export declare function createExportIframe(title?: string): HTMLIFrameElement;
|
|
|
2
2
|
/**
|
|
3
3
|
* Applies styles to an element and returns the previous styles.
|
|
4
4
|
*/
|
|
5
|
-
export declare function applyStyles(element: HTMLElement | SVGElement, styles: Record<string, string | null>): Record<string, string | null>;
|
|
5
|
+
export declare function applyStyles(element: HTMLElement | SVGElement, styles: Record<string, string | null>): Record<string, string | null>;
|
|
6
|
+
/**
|
|
7
|
+
* Copies the content of all canvases from the original element to the cloned element.
|
|
8
|
+
*/
|
|
9
|
+
export declare function copyCanvasesContent(original: Element, clone: Element): Promise<void[]>;
|
|
@@ -18,4 +18,40 @@ export function applyStyles(element, styles) {
|
|
|
18
18
|
element.style.setProperty(key, value);
|
|
19
19
|
});
|
|
20
20
|
return previousStyles;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Copies the content of all canvases from the original element to the cloned element.
|
|
25
|
+
*/
|
|
26
|
+
export function copyCanvasesContent(original, clone) {
|
|
27
|
+
const originalCanvases = original.querySelectorAll('canvas');
|
|
28
|
+
const cloneCanvases = clone.querySelectorAll('canvas');
|
|
29
|
+
const promises = Array.from(originalCanvases).map(async (originalCanvas, index) => {
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
const cloneCanvas = cloneCanvases[index];
|
|
32
|
+
if (cloneCanvas) {
|
|
33
|
+
const dataURL = originalCanvas.toDataURL();
|
|
34
|
+
const img = cloneCanvas.ownerDocument.createElement('img');
|
|
35
|
+
img.src = dataURL;
|
|
36
|
+
img.width = cloneCanvas.width;
|
|
37
|
+
img.height = cloneCanvas.height;
|
|
38
|
+
for (const styleKey in cloneCanvas.style) {
|
|
39
|
+
if (!Object.hasOwn(img.style, styleKey) || !Object.hasOwn(cloneCanvas.style, styleKey)) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
img.style[styleKey] = cloneCanvas.style[styleKey];
|
|
43
|
+
}
|
|
44
|
+
cloneCanvas.replaceWith(img);
|
|
45
|
+
img.onload = () => {
|
|
46
|
+
resolve();
|
|
47
|
+
};
|
|
48
|
+
img.onerror = event => {
|
|
49
|
+
reject(event);
|
|
50
|
+
};
|
|
51
|
+
} else {
|
|
52
|
+
resolve();
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
return Promise.all(promises);
|
|
21
57
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ChartImageExportOptions } from "./useChartProExport.types.js";
|
|
2
2
|
export declare const getDrawDocument: () => Promise<typeof import("rasterizehtml").drawDocument>;
|
|
3
|
-
export declare function exportImage(element:
|
|
3
|
+
export declare function exportImage(element: Element, svg: SVGElement, params?: ChartImageExportOptions): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ownerDocument from '@mui/utils/ownerDocument';
|
|
2
2
|
import { loadStyleSheets } from '@mui/x-internals/export';
|
|
3
|
-
import { applyStyles, createExportIframe } from "./common.js";
|
|
3
|
+
import { applyStyles, copyCanvasesContent, createExportIframe } from "./common.js";
|
|
4
4
|
import { defaultOnBeforeExport } from "./defaults.js";
|
|
5
5
|
export const getDrawDocument = async () => {
|
|
6
6
|
try {
|
|
@@ -40,6 +40,10 @@ export async function exportImage(element, svg, params) {
|
|
|
40
40
|
applyStyles(svg, previousStyles);
|
|
41
41
|
exportDoc.body.replaceChildren(elementClone);
|
|
42
42
|
exportDoc.body.style.margin = '0px';
|
|
43
|
+
/* Set display block through styles to ensure that CSS rules that target `body` don't accidentally target this
|
|
44
|
+
* iframe's body, which might cause the body to have no intrinsic width or height, leading to the canvas having a
|
|
45
|
+
* size of 0px, which causes the `toBlob` call to return null. */
|
|
46
|
+
exportDoc.body.style.display = 'block';
|
|
43
47
|
/* The body's parent has a width of 0, so we use fit-content to ensure that the body adjusts its width to the width
|
|
44
48
|
* of its children. */
|
|
45
49
|
exportDoc.body.style.width = 'fit-content';
|
|
@@ -48,6 +52,7 @@ export async function exportImage(element, svg, params) {
|
|
|
48
52
|
if (copyStyles) {
|
|
49
53
|
await Promise.all(loadStyleSheets(exportDoc, root, nonce));
|
|
50
54
|
}
|
|
55
|
+
await copyCanvasesContent(element, elementClone);
|
|
51
56
|
resolve();
|
|
52
57
|
};
|
|
53
58
|
doc.body.appendChild(iframe);
|
|
@@ -63,6 +68,10 @@ export async function exportImage(element, svg, params) {
|
|
|
63
68
|
canvas.height = exportDocBodySize.height * ratio;
|
|
64
69
|
canvas.style.width = `${exportDocBodySize.width}px`;
|
|
65
70
|
canvas.style.height = `${exportDocBodySize.height}px`;
|
|
71
|
+
if (canvas.width === 0 || canvas.height === 0) {
|
|
72
|
+
doc.body.removeChild(iframe);
|
|
73
|
+
throw new Error(`MUI X Charts: Cannot export an image with zero width or height. Width: ${canvas.width}px. Height: ${canvas.height}px.`);
|
|
74
|
+
}
|
|
66
75
|
try {
|
|
67
76
|
await drawDocument(iframe.contentDocument, canvas, {
|
|
68
77
|
// Handle retina displays: https://github.com/cburgmer/rasterizeHTML.js/blob/262b3404d1c469ce4a7750a2976dec09b8ae2d6c/examples/retina.html#L71
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ownerDocument from '@mui/utils/ownerDocument';
|
|
2
2
|
import { loadStyleSheets } from '@mui/x-internals/export';
|
|
3
|
-
import { createExportIframe } from "./common.js";
|
|
3
|
+
import { copyCanvasesContent, createExportIframe } from "./common.js";
|
|
4
4
|
import { defaultOnBeforeExport } from "./defaults.js";
|
|
5
5
|
export function printChart(element, {
|
|
6
6
|
fileName,
|
|
@@ -20,6 +20,7 @@ export function printChart(element, {
|
|
|
20
20
|
if (copyStyles) {
|
|
21
21
|
await Promise.all(loadStyleSheets(printDoc, root, nonce));
|
|
22
22
|
}
|
|
23
|
+
await copyCanvasesContent(element, elementClone);
|
|
23
24
|
const mediaQueryList = printWindow.contentWindow.matchMedia('print');
|
|
24
25
|
mediaQueryList.addEventListener('change', mql => {
|
|
25
26
|
const isAfterPrint = mql.matches === false;
|
|
@@ -12,10 +12,12 @@ function waitForAnimationFrame() {
|
|
|
12
12
|
return promise;
|
|
13
13
|
}
|
|
14
14
|
export const useChartProExport = ({
|
|
15
|
-
chartRootRef,
|
|
16
|
-
svgRef,
|
|
17
15
|
instance
|
|
18
16
|
}) => {
|
|
17
|
+
const {
|
|
18
|
+
chartRootRef,
|
|
19
|
+
svgRef
|
|
20
|
+
} = instance;
|
|
19
21
|
const exportAsPrint = async options => {
|
|
20
22
|
const chartRoot = chartRootRef.current;
|
|
21
23
|
if (chartRoot) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const selectorZoomInteractionConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & import("./useChartProZoom.types.js").UseChartProZoomState & Partial<{}> & {
|
|
1
|
+
export declare const selectorZoomInteractionConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & import("./useChartProZoom.types.js").UseChartProZoomState & Partial<{}> & {
|
|
2
2
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
3
3
|
}, interactionName: "wheel" | "pinch" | "tapAndDrag" | "doubleTapReset" | "brush") => (Omit<import("./ZoomInteractionConfig.types.js").ZoomInteraction, "pointerMode"> & {
|
|
4
4
|
mouse: {
|
|
@@ -10,7 +10,7 @@ export declare const selectorZoomInteractionConfig: (args_0: import("@mui/x-char
|
|
|
10
10
|
pointerMode?: import("@mui/x-internal-gestures/core").PointerMode[];
|
|
11
11
|
allowedDirection?: "x" | "y" | "xy";
|
|
12
12
|
}) | null;
|
|
13
|
-
export declare const selectorPanInteractionConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & import("./useChartProZoom.types.js").UseChartProZoomState & Partial<{}> & {
|
|
13
|
+
export declare const selectorPanInteractionConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & import("./useChartProZoom.types.js").UseChartProZoomState & Partial<{}> & {
|
|
14
14
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
15
15
|
}, interactionName: "wheel" | "drag" | "pressAndDrag") => (Omit<import("./ZoomInteractionConfig.types.js").PanInteraction, "pointerMode"> & {
|
|
16
16
|
mouse: {
|
|
@@ -3,6 +3,5 @@ import { type ChartPlugin, type ZoomData } from '@mui/x-charts/internals';
|
|
|
3
3
|
import { type UseChartProZoomSignature } from "../useChartProZoom.types.js";
|
|
4
4
|
export declare const usePanOnDrag: ({
|
|
5
5
|
store,
|
|
6
|
-
instance
|
|
7
|
-
|
|
8
|
-
}: Pick<Parameters<ChartPlugin<UseChartProZoomSignature>>[0], "store" | "instance" | "svgRef">, setZoomDataCallback: React.Dispatch<ZoomData[] | ((prev: ZoomData[]) => ZoomData[])>) => void;
|
|
6
|
+
instance
|
|
7
|
+
}: Pick<Parameters<ChartPlugin<UseChartProZoomSignature>>[0], "store" | "instance">, setZoomDataCallback: React.Dispatch<ZoomData[] | ((prev: ZoomData[]) => ZoomData[])>) => void;
|
|
@@ -7,9 +7,11 @@ import { translateZoom } from "./useZoom.utils.js";
|
|
|
7
7
|
import { selectorPanInteractionConfig } from "../ZoomInteractionConfig.selectors.js";
|
|
8
8
|
export const usePanOnDrag = ({
|
|
9
9
|
store,
|
|
10
|
-
instance
|
|
11
|
-
svgRef
|
|
10
|
+
instance
|
|
12
11
|
}, setZoomDataCallback) => {
|
|
12
|
+
const {
|
|
13
|
+
svgRef
|
|
14
|
+
} = instance;
|
|
13
15
|
const drawingArea = store.use(selectorChartDrawingArea);
|
|
14
16
|
const optionsLookup = store.use(selectorChartZoomOptionsLookup);
|
|
15
17
|
const config = store.use(selectorPanInteractionConfig, 'drag');
|
|
@@ -3,6 +3,5 @@ import { type ChartPlugin, type ZoomData } from '@mui/x-charts/internals';
|
|
|
3
3
|
import { type UseChartProZoomSignature } from "../useChartProZoom.types.js";
|
|
4
4
|
export declare const usePanOnPressAndDrag: ({
|
|
5
5
|
store,
|
|
6
|
-
instance
|
|
7
|
-
|
|
8
|
-
}: Pick<Parameters<ChartPlugin<UseChartProZoomSignature>>[0], "store" | "instance" | "svgRef">, setZoomDataCallback: React.Dispatch<ZoomData[] | ((prev: ZoomData[]) => ZoomData[])>) => void;
|
|
6
|
+
instance
|
|
7
|
+
}: Pick<Parameters<ChartPlugin<UseChartProZoomSignature>>[0], "store" | "instance">, setZoomDataCallback: React.Dispatch<ZoomData[] | ((prev: ZoomData[]) => ZoomData[])>) => void;
|
|
@@ -7,9 +7,11 @@ import { translateZoom } from "./useZoom.utils.js";
|
|
|
7
7
|
import { selectorPanInteractionConfig } from "../ZoomInteractionConfig.selectors.js";
|
|
8
8
|
export const usePanOnPressAndDrag = ({
|
|
9
9
|
store,
|
|
10
|
-
instance
|
|
11
|
-
svgRef
|
|
10
|
+
instance
|
|
12
11
|
}, setZoomDataCallback) => {
|
|
12
|
+
const {
|
|
13
|
+
svgRef
|
|
14
|
+
} = instance;
|
|
13
15
|
const drawingArea = store.use(selectorChartDrawingArea);
|
|
14
16
|
const optionsLookup = store.use(selectorChartZoomOptionsLookup);
|
|
15
17
|
const isInteracting = React.useRef(false);
|
|
@@ -3,6 +3,5 @@ import { type ChartPlugin, type ZoomData } from '@mui/x-charts/internals';
|
|
|
3
3
|
import { type UseChartProZoomSignature } from "../useChartProZoom.types.js";
|
|
4
4
|
export declare const usePanOnWheel: ({
|
|
5
5
|
store,
|
|
6
|
-
instance
|
|
7
|
-
|
|
8
|
-
}: Pick<Parameters<ChartPlugin<UseChartProZoomSignature>>[0], "store" | "instance" | "svgRef">, setZoomDataCallback: React.Dispatch<ZoomData[] | ((prev: ZoomData[]) => ZoomData[])>) => void;
|
|
6
|
+
instance
|
|
7
|
+
}: Pick<Parameters<ChartPlugin<UseChartProZoomSignature>>[0], "store" | "instance">, setZoomDataCallback: React.Dispatch<ZoomData[] | ((prev: ZoomData[]) => ZoomData[])>) => void;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { getChartPoint, selectorChartDrawingArea, selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
|
|
5
5
|
import { rafThrottle } from '@mui/x-internals/rafThrottle';
|
|
6
6
|
import { translateZoom } from "./useZoom.utils.js";
|
|
7
7
|
import { selectorPanInteractionConfig } from "../ZoomInteractionConfig.selectors.js";
|
|
8
8
|
export const usePanOnWheel = ({
|
|
9
9
|
store,
|
|
10
|
-
instance
|
|
11
|
-
svgRef
|
|
10
|
+
instance
|
|
12
11
|
}, setZoomDataCallback) => {
|
|
12
|
+
const {
|
|
13
|
+
svgRef
|
|
14
|
+
} = instance;
|
|
13
15
|
const drawingArea = store.use(selectorChartDrawingArea);
|
|
14
16
|
const optionsLookup = store.use(selectorChartZoomOptionsLookup);
|
|
15
17
|
const startedOutsideRef = React.useRef(false);
|
|
@@ -37,7 +39,7 @@ export const usePanOnWheel = ({
|
|
|
37
39
|
}
|
|
38
40
|
const rafThrottledSetZoomData = rafThrottle(setZoomDataCallback);
|
|
39
41
|
const wheelHandler = instance.addInteractionListener('panTurnWheel', event => {
|
|
40
|
-
const point =
|
|
42
|
+
const point = getChartPoint(element, {
|
|
41
43
|
clientX: event.detail.centroid.x,
|
|
42
44
|
clientY: event.detail.centroid.y
|
|
43
45
|
});
|
|
@@ -3,6 +3,5 @@ import { type ChartPlugin, type ZoomData } from '@mui/x-charts/internals';
|
|
|
3
3
|
import { type UseChartProZoomSignature } from "../useChartProZoom.types.js";
|
|
4
4
|
export declare const useZoomOnBrush: ({
|
|
5
5
|
store,
|
|
6
|
-
instance
|
|
7
|
-
|
|
8
|
-
}: Pick<Parameters<ChartPlugin<UseChartProZoomSignature>>[0], "store" | "instance" | "svgRef">, setZoomDataCallback: React.Dispatch<(prev: ZoomData[]) => ZoomData[]>) => void;
|
|
6
|
+
instance
|
|
7
|
+
}: Pick<Parameters<ChartPlugin<UseChartProZoomSignature>>[0], "store" | "instance">, setZoomDataCallback: React.Dispatch<(prev: ZoomData[]) => ZoomData[]>) => void;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { getChartPoint, selectorChartDrawingArea, selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
|
|
5
5
|
import { getHorizontalCenterRatio, getVerticalCenterRatio, isSpanValid } from "./useZoom.utils.js";
|
|
6
6
|
import { selectorZoomInteractionConfig } from "../ZoomInteractionConfig.selectors.js";
|
|
7
7
|
export const useZoomOnBrush = ({
|
|
8
8
|
store,
|
|
9
|
-
instance
|
|
10
|
-
svgRef
|
|
9
|
+
instance
|
|
11
10
|
}, setZoomDataCallback) => {
|
|
11
|
+
const {
|
|
12
|
+
svgRef
|
|
13
|
+
} = instance;
|
|
12
14
|
const drawingArea = store.use(selectorChartDrawingArea);
|
|
13
15
|
const optionsLookup = store.use(selectorChartZoomOptionsLookup);
|
|
14
16
|
const config = store.use(selectorZoomInteractionConfig, 'brush');
|
|
@@ -26,11 +28,11 @@ export const useZoomOnBrush = ({
|
|
|
26
28
|
const handleBrushEnd = event => {
|
|
27
29
|
// Convert the brush rectangle to zoom percentages for each axis
|
|
28
30
|
setZoomDataCallback(prev => {
|
|
29
|
-
const startPoint =
|
|
31
|
+
const startPoint = getChartPoint(element, {
|
|
30
32
|
clientX: event.detail.initialCentroid.x,
|
|
31
33
|
clientY: event.detail.initialCentroid.y
|
|
32
34
|
});
|
|
33
|
-
const endPoint =
|
|
35
|
+
const endPoint = getChartPoint(element, {
|
|
34
36
|
clientX: event.detail.centroid.x,
|
|
35
37
|
clientY: event.detail.centroid.y
|
|
36
38
|
});
|
|
@@ -3,6 +3,5 @@ import { type ChartPlugin, type ZoomData } from '@mui/x-charts/internals';
|
|
|
3
3
|
import { type UseChartProZoomSignature } from "../useChartProZoom.types.js";
|
|
4
4
|
export declare const useZoomOnDoubleTapReset: ({
|
|
5
5
|
store,
|
|
6
|
-
instance
|
|
7
|
-
|
|
8
|
-
}: Pick<Parameters<ChartPlugin<UseChartProZoomSignature>>[0], "store" | "instance" | "svgRef">, setZoomDataCallback: React.Dispatch<ZoomData[] | ((prev: ZoomData[]) => ZoomData[])>) => void;
|
|
6
|
+
instance
|
|
7
|
+
}: Pick<Parameters<ChartPlugin<UseChartProZoomSignature>>[0], "store" | "instance">, setZoomDataCallback: React.Dispatch<ZoomData[] | ((prev: ZoomData[]) => ZoomData[])>) => void;
|
|
@@ -5,9 +5,11 @@ import { selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
|
|
|
5
5
|
import { selectorZoomInteractionConfig } from "../ZoomInteractionConfig.selectors.js";
|
|
6
6
|
export const useZoomOnDoubleTapReset = ({
|
|
7
7
|
store,
|
|
8
|
-
instance
|
|
9
|
-
svgRef
|
|
8
|
+
instance
|
|
10
9
|
}, setZoomDataCallback) => {
|
|
10
|
+
const {
|
|
11
|
+
svgRef
|
|
12
|
+
} = instance;
|
|
11
13
|
const optionsLookup = store.use(selectorChartZoomOptionsLookup);
|
|
12
14
|
const config = store.use(selectorZoomInteractionConfig, 'doubleTapReset');
|
|
13
15
|
const isZoomOnDoubleTapResetEnabled = Object.keys(optionsLookup).length > 0 && Boolean(config);
|
|
@@ -3,6 +3,5 @@ import { type ChartPlugin, type ZoomData } from '@mui/x-charts/internals';
|
|
|
3
3
|
import { type UseChartProZoomSignature } from "../useChartProZoom.types.js";
|
|
4
4
|
export declare const useZoomOnPinch: ({
|
|
5
5
|
store,
|
|
6
|
-
instance
|
|
7
|
-
|
|
8
|
-
}: Pick<Parameters<ChartPlugin<UseChartProZoomSignature>>[0], "store" | "instance" | "svgRef">, setZoomDataCallback: React.Dispatch<ZoomData[] | ((prev: ZoomData[]) => ZoomData[])>) => void;
|
|
6
|
+
instance
|
|
7
|
+
}: Pick<Parameters<ChartPlugin<UseChartProZoomSignature>>[0], "store" | "instance">, setZoomDataCallback: React.Dispatch<ZoomData[] | ((prev: ZoomData[]) => ZoomData[])>) => void;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { getChartPoint, selectorChartDrawingArea, selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
|
|
5
5
|
import { rafThrottle } from '@mui/x-internals/rafThrottle';
|
|
6
6
|
import { getHorizontalCenterRatio, getVerticalCenterRatio, isSpanValid, zoomAtPoint } from "./useZoom.utils.js";
|
|
7
7
|
import { selectorZoomInteractionConfig } from "../ZoomInteractionConfig.selectors.js";
|
|
8
8
|
export const useZoomOnPinch = ({
|
|
9
9
|
store,
|
|
10
|
-
instance
|
|
11
|
-
svgRef
|
|
10
|
+
instance
|
|
12
11
|
}, setZoomDataCallback) => {
|
|
12
|
+
const {
|
|
13
|
+
svgRef
|
|
14
|
+
} = instance;
|
|
13
15
|
const drawingArea = store.use(selectorChartDrawingArea);
|
|
14
16
|
const optionsLookup = store.use(selectorChartZoomOptionsLookup);
|
|
15
17
|
const config = store.use(selectorZoomInteractionConfig, 'pinch');
|
|
@@ -42,7 +44,7 @@ export const useZoomOnPinch = ({
|
|
|
42
44
|
}
|
|
43
45
|
const isZoomIn = event.detail.direction > 0;
|
|
44
46
|
const scaleRatio = 1 + event.detail.deltaScale;
|
|
45
|
-
const point =
|
|
47
|
+
const point = getChartPoint(element, {
|
|
46
48
|
clientX: event.detail.centroid.x,
|
|
47
49
|
clientY: event.detail.centroid.y
|
|
48
50
|
});
|
|
@@ -3,6 +3,5 @@ import { type ChartPlugin, type ZoomData } from '@mui/x-charts/internals';
|
|
|
3
3
|
import { type UseChartProZoomSignature } from "../useChartProZoom.types.js";
|
|
4
4
|
export declare const useZoomOnTapAndDrag: ({
|
|
5
5
|
store,
|
|
6
|
-
instance
|
|
7
|
-
|
|
8
|
-
}: Pick<Parameters<ChartPlugin<UseChartProZoomSignature>>[0], "store" | "instance" | "svgRef">, setZoomDataCallback: React.Dispatch<ZoomData[] | ((prev: ZoomData[]) => ZoomData[])>) => void;
|
|
6
|
+
instance
|
|
7
|
+
}: Pick<Parameters<ChartPlugin<UseChartProZoomSignature>>[0], "store" | "instance">, setZoomDataCallback: React.Dispatch<ZoomData[] | ((prev: ZoomData[]) => ZoomData[])>) => void;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { getChartPoint, selectorChartDrawingArea, selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
|
|
5
5
|
import { rafThrottle } from '@mui/x-internals/rafThrottle';
|
|
6
6
|
import { getHorizontalCenterRatio, getVerticalCenterRatio, isSpanValid, zoomAtPoint } from "./useZoom.utils.js";
|
|
7
7
|
import { selectorZoomInteractionConfig } from "../ZoomInteractionConfig.selectors.js";
|
|
8
8
|
export const useZoomOnTapAndDrag = ({
|
|
9
9
|
store,
|
|
10
|
-
instance
|
|
11
|
-
svgRef
|
|
10
|
+
instance
|
|
12
11
|
}, setZoomDataCallback) => {
|
|
12
|
+
const {
|
|
13
|
+
svgRef
|
|
14
|
+
} = instance;
|
|
13
15
|
const drawingArea = store.use(selectorChartDrawingArea);
|
|
14
16
|
const optionsLookup = store.use(selectorChartZoomOptionsLookup);
|
|
15
17
|
const config = store.use(selectorZoomInteractionConfig, 'tapAndDrag');
|
|
@@ -47,7 +49,7 @@ export const useZoomOnTapAndDrag = ({
|
|
|
47
49
|
}
|
|
48
50
|
const isZoomIn = event.detail.deltaY > 0;
|
|
49
51
|
const scaleRatio = 1 + event.detail.deltaY / 100;
|
|
50
|
-
const point =
|
|
52
|
+
const point = getChartPoint(element, {
|
|
51
53
|
clientX: event.detail.initialCentroid.x,
|
|
52
54
|
clientY: event.detail.initialCentroid.y
|
|
53
55
|
});
|
|
@@ -3,6 +3,5 @@ import { type ChartPlugin, type ZoomData } from '@mui/x-charts/internals';
|
|
|
3
3
|
import { type UseChartProZoomSignature } from "../useChartProZoom.types.js";
|
|
4
4
|
export declare const useZoomOnWheel: ({
|
|
5
5
|
store,
|
|
6
|
-
instance
|
|
7
|
-
|
|
8
|
-
}: Pick<Parameters<ChartPlugin<UseChartProZoomSignature>>[0], "store" | "instance" | "svgRef">, setZoomDataCallback: React.Dispatch<ZoomData[] | ((prev: ZoomData[]) => ZoomData[])>) => void;
|
|
6
|
+
instance
|
|
7
|
+
}: Pick<Parameters<ChartPlugin<UseChartProZoomSignature>>[0], "store" | "instance">, setZoomDataCallback: React.Dispatch<ZoomData[] | ((prev: ZoomData[]) => ZoomData[])>) => void;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { getChartPoint, selectorChartDrawingArea, selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
|
|
5
5
|
import { rafThrottle } from '@mui/x-internals/rafThrottle';
|
|
6
6
|
import { getHorizontalCenterRatio, getVerticalCenterRatio, getWheelScaleRatio, isSpanValid, zoomAtPoint } from "./useZoom.utils.js";
|
|
7
7
|
import { selectorZoomInteractionConfig } from "../ZoomInteractionConfig.selectors.js";
|
|
8
8
|
export const useZoomOnWheel = ({
|
|
9
9
|
store,
|
|
10
|
-
instance
|
|
11
|
-
svgRef
|
|
10
|
+
instance
|
|
12
11
|
}, setZoomDataCallback) => {
|
|
12
|
+
const {
|
|
13
|
+
svgRef
|
|
14
|
+
} = instance;
|
|
13
15
|
const drawingArea = store.use(selectorChartDrawingArea);
|
|
14
16
|
const optionsLookup = store.use(selectorChartZoomOptionsLookup);
|
|
15
17
|
const startedOutsideRef = React.useRef(false);
|
|
@@ -33,7 +35,7 @@ export const useZoomOnWheel = ({
|
|
|
33
35
|
}
|
|
34
36
|
const rafThrottledSetZoomData = rafThrottle(setZoomDataCallback);
|
|
35
37
|
const zoomOnWheelHandler = instance.addInteractionListener('zoomTurnWheel', event => {
|
|
36
|
-
const point =
|
|
38
|
+
const point = getChartPoint(element, {
|
|
37
39
|
clientX: event.detail.centroid.x,
|
|
38
40
|
clientY: event.detail.centroid.y
|
|
39
41
|
});
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { type AxisId, type ChartRootSelector } from '@mui/x-charts/internals';
|
|
2
2
|
import { type UseChartProZoomSignature } from "./useChartProZoom.types.js";
|
|
3
3
|
export declare const selectorChartZoomState: ChartRootSelector<UseChartProZoomSignature, 'zoom'>;
|
|
4
|
-
export declare const selectorChartZoomIsInteracting: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & import("./useChartProZoom.types.js").UseChartProZoomState & Partial<{}> & {
|
|
4
|
+
export declare const selectorChartZoomIsInteracting: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & import("./useChartProZoom.types.js").UseChartProZoomState & Partial<{}> & {
|
|
5
5
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
6
6
|
}) => boolean;
|
|
7
|
-
export declare const selectorChartZoomIsEnabled: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
7
|
+
export declare const selectorChartZoomIsEnabled: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
8
8
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
9
9
|
}) => boolean;
|
|
10
|
-
export declare const selectorChartAxisZoomData: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
10
|
+
export declare const selectorChartAxisZoomData: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
11
11
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
12
12
|
}, axisId: AxisId) => import("@mui/x-charts/internals").ZoomData | undefined;
|
|
13
|
-
export declare const selectorChartCanZoomOut: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & import("./useChartProZoom.types.js").UseChartProZoomState & Partial<{}> & {
|
|
13
|
+
export declare const selectorChartCanZoomOut: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & import("./useChartProZoom.types.js").UseChartProZoomState & Partial<{}> & {
|
|
14
14
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
15
15
|
}) => boolean;
|
|
16
|
-
export declare const selectorChartCanZoomIn: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & import("./useChartProZoom.types.js").UseChartProZoomState & Partial<{}> & {
|
|
16
|
+
export declare const selectorChartCanZoomIn: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & import("./useChartProZoom.types.js").UseChartProZoomState & Partial<{}> & {
|
|
17
17
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
18
18
|
}) => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type DefaultizedProps } from '@mui/x-internals/types';
|
|
2
2
|
import { type CommonDefaultizedProps, type CommonSeriesType, type CartesianSeriesType } from '@mui/x-charts/internals';
|
|
3
3
|
export type HeatmapValueType = readonly [number, number, number];
|
|
4
|
-
export interface HeatmapSeriesType extends Omit<CommonSeriesType<HeatmapValueType>, 'color' | 'colorGetter'>, CartesianSeriesType {
|
|
4
|
+
export interface HeatmapSeriesType extends Omit<CommonSeriesType<HeatmapValueType, 'heatmap'>, 'color' | 'colorGetter'>, CartesianSeriesType {
|
|
5
5
|
type: 'heatmap';
|
|
6
6
|
/**
|
|
7
7
|
* Data associated to each bar.
|
|
@@ -34,10 +34,10 @@ export type HeatmapItemIdentifier = {
|
|
|
34
34
|
/**
|
|
35
35
|
* The x index of the cell. Useful to identify the cell position in the heatmap even if there is no data.
|
|
36
36
|
*/
|
|
37
|
-
xIndex
|
|
37
|
+
xIndex: number;
|
|
38
38
|
/**
|
|
39
39
|
* The y index of the cell. Useful to identify the cell position in the heatmap even if there is no data.
|
|
40
40
|
*/
|
|
41
|
-
yIndex
|
|
41
|
+
yIndex: number;
|
|
42
42
|
};
|
|
43
43
|
export interface DefaultizedHeatmapSeriesType extends DefaultizedProps<HeatmapSeriesType, CommonDefaultizedProps> {}
|