@mui/x-charts 8.5.3 → 8.7.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/AnimatedBarElement.js +3 -1
- package/BarChart/BarLabel/BarLabelPlot.d.ts +2 -2
- package/BarChart/BarLabel/BarLabelPlot.js +33 -25
- package/BarChart/BarPlot.js +59 -183
- package/BarChart/barClasses.d.ts +12 -0
- package/BarChart/barClasses.js +25 -0
- package/BarChart/index.d.ts +3 -1
- package/BarChart/index.js +23 -1
- package/BarChart/types.d.ts +5 -1
- package/BarChart/useBarPlotData.d.ts +8 -0
- package/BarChart/useBarPlotData.js +146 -0
- package/CHANGELOG.md +210 -0
- package/ChartContainer/ChartContainer.d.ts +1 -21
- package/ChartContainer/ChartContainer.js +0 -8
- package/ChartContainer/index.d.ts +8 -1
- package/ChartsLegend/ChartsLegend.js +1 -0
- 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/ChartsXAxis/ChartsXAxis.js +4 -108
- package/ChartsXAxis/getVisibleLabels.d.ts +14 -0
- package/ChartsXAxis/getVisibleLabels.js +71 -0
- package/ChartsXAxis/shortenLabels.d.ts +4 -0
- package/ChartsXAxis/shortenLabels.js +48 -0
- package/ChartsYAxis/ChartsYAxis.js +2 -39
- package/ChartsYAxis/shortenLabels.d.ts +4 -0
- package/ChartsYAxis/shortenLabels.js +46 -0
- package/LineChart/AnimatedArea.js +4 -1
- package/LineChart/AnimatedLine.js +4 -1
- package/LineChart/AreaPlot.js +5 -115
- package/LineChart/CircleMarkElement.js +4 -1
- package/LineChart/LinePlot.js +5 -99
- package/LineChart/MarkElement.js +4 -1
- package/LineChart/MarkPlot.js +1 -0
- package/LineChart/useAreaPlotData.d.ts +12 -0
- package/LineChart/useAreaPlotData.js +125 -0
- package/LineChart/useLinePlotData.d.ts +11 -0
- package/LineChart/useLinePlotData.js +108 -0
- package/PieChart/PieArc.js +3 -1
- package/PieChart/PiePlot.js +6 -0
- package/PieChart/index.d.ts +3 -1
- package/PieChart/index.js +18 -1
- package/PieChart/pieClasses.d.ts +12 -0
- package/PieChart/pieClasses.js +24 -0
- package/ScatterChart/Scatter.js +22 -48
- package/ScatterChart/useScatterPlotData.d.ts +8 -0
- package/ScatterChart/useScatterPlotData.js +33 -0
- package/Toolbar/ToolbarButton.js +2 -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/AnimatedBarElement.js +3 -1
- package/esm/BarChart/BarLabel/BarLabelPlot.d.ts +2 -2
- package/esm/BarChart/BarLabel/BarLabelPlot.js +33 -25
- package/esm/BarChart/BarPlot.js +60 -185
- package/esm/BarChart/barClasses.d.ts +12 -0
- package/esm/BarChart/barClasses.js +15 -0
- package/esm/BarChart/index.d.ts +3 -1
- package/esm/BarChart/index.js +2 -1
- package/esm/BarChart/types.d.ts +5 -1
- 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 +0 -8
- package/esm/ChartContainer/index.d.ts +8 -1
- package/esm/ChartContainer/index.js +6 -1
- package/esm/ChartsLegend/ChartsLegend.js +1 -0
- 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/ChartsXAxis/ChartsXAxis.js +2 -106
- package/esm/ChartsXAxis/getVisibleLabels.d.ts +14 -0
- package/esm/ChartsXAxis/getVisibleLabels.js +67 -0
- package/esm/ChartsXAxis/shortenLabels.d.ts +4 -0
- package/esm/ChartsXAxis/shortenLabels.js +42 -0
- package/esm/ChartsYAxis/ChartsYAxis.js +1 -38
- package/esm/ChartsYAxis/shortenLabels.d.ts +4 -0
- package/esm/ChartsYAxis/shortenLabels.js +41 -0
- package/esm/LineChart/AnimatedArea.js +4 -1
- package/esm/LineChart/AnimatedLine.js +4 -1
- package/esm/LineChart/AreaPlot.js +5 -115
- package/esm/LineChart/CircleMarkElement.js +4 -1
- package/esm/LineChart/LinePlot.js +5 -99
- package/esm/LineChart/MarkElement.js +4 -1
- package/esm/LineChart/MarkPlot.js +1 -0
- package/esm/LineChart/useAreaPlotData.d.ts +12 -0
- package/esm/LineChart/useAreaPlotData.js +118 -0
- package/esm/LineChart/useLinePlotData.d.ts +11 -0
- package/esm/LineChart/useLinePlotData.js +101 -0
- package/esm/PieChart/PieArc.js +3 -1
- package/esm/PieChart/PiePlot.js +6 -0
- package/esm/PieChart/index.d.ts +3 -1
- package/esm/PieChart/index.js +2 -1
- package/esm/PieChart/pieClasses.d.ts +12 -0
- package/esm/PieChart/pieClasses.js +15 -0
- package/esm/ScatterChart/Scatter.js +23 -49
- package/esm/ScatterChart/useScatterPlotData.d.ts +8 -0
- package/esm/ScatterChart/useScatterPlotData.js +26 -0
- package/esm/Toolbar/ToolbarButton.js +2 -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/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/components/NotRendered.d.ts +9 -0
- package/esm/internals/components/NotRendered.js +10 -0
- package/esm/internals/index.d.ts +6 -0
- package/esm/internals/index.js +6 -0
- package/esm/internals/plugins/corePlugins/corePlugins.d.ts +3 -2
- package/esm/internals/plugins/corePlugins/corePlugins.js +2 -1
- package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +1 -1
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +1 -1
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +3 -3
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +2 -2
- 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/useChartAxisSize.selectors.d.ts +4 -4
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +44 -33
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +5 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +7 -7
- 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 +52 -36
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -5
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +6 -6
- 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/store/useCharts.d.ts +1 -1
- package/esm/locales/elGR.d.ts +19 -0
- package/esm/locales/elGR.js +15 -0
- package/esm/locales/enUS.d.ts +3 -0
- package/esm/locales/enUS.js +8 -2
- package/esm/locales/frFR.d.ts +3 -0
- package/esm/locales/frFR.js +7 -0
- package/esm/locales/index.d.ts +1 -0
- package/esm/locales/index.js +1 -0
- package/esm/locales/ptBR.d.ts +3 -0
- package/esm/locales/ptBR.js +7 -1
- package/esm/locales/ptPT.d.ts +3 -0
- package/esm/locales/ptPT.js +7 -1
- package/esm/locales/utils/chartsLocaleTextApi.d.ts +17 -0
- package/esm/locales/utils/getChartsLocalization.d.ts +3 -0
- package/esm/locales/utils/imageMimeTypes.d.ts +2 -0
- package/esm/locales/utils/imageMimeTypes.js +5 -0
- package/esm/models/slots/chartsBaseSlotProps.d.ts +4 -0
- 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/components/NotRendered.d.ts +9 -0
- package/internals/components/NotRendered.js +16 -0
- package/internals/index.d.ts +6 -0
- package/internals/index.js +56 -0
- package/internals/plugins/corePlugins/corePlugins.d.ts +3 -2
- package/internals/plugins/corePlugins/corePlugins.js +2 -1
- package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +1 -1
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +3 -3
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +2 -2
- 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/useChartAxisSize.selectors.d.ts +4 -4
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +44 -33
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +5 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +7 -7
- 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 +52 -36
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -5
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +6 -6
- 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/store/useCharts.d.ts +1 -1
- package/locales/elGR.d.ts +19 -0
- package/locales/elGR.js +21 -0
- package/locales/enUS.d.ts +3 -0
- package/locales/enUS.js +8 -2
- package/locales/frFR.d.ts +3 -0
- package/locales/frFR.js +7 -0
- package/locales/index.d.ts +1 -0
- package/locales/index.js +11 -0
- package/locales/ptBR.d.ts +3 -0
- package/locales/ptBR.js +7 -1
- package/locales/ptPT.d.ts +3 -0
- package/locales/ptPT.js +7 -1
- package/locales/utils/chartsLocaleTextApi.d.ts +17 -0
- package/locales/utils/getChartsLocalization.d.ts +3 -0
- package/locales/utils/imageMimeTypes.d.ts +2 -0
- package/locales/utils/imageMimeTypes.js +11 -0
- package/models/slots/chartsBaseSlotProps.d.ts +4 -0
- package/package.json +3 -2
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
@@ -130,12 +132,28 @@ export const useChartVoronoi = ({
|
|
|
130
132
|
dataIndex
|
|
131
133
|
};
|
|
132
134
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
|
|
136
|
+
// Clean the interaction when the mouse leaves the chart.
|
|
137
|
+
const moveEndHandler = instance.addInteractionListener('moveEnd', event => {
|
|
138
|
+
if (!event.detail.activeGestures.pan) {
|
|
139
|
+
instance.cleanInteraction?.();
|
|
140
|
+
instance.clearHighlight?.();
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
const panEndHandler = instance.addInteractionListener('panEnd', event => {
|
|
144
|
+
if (!event.detail.activeGestures.move) {
|
|
145
|
+
instance.cleanInteraction?.();
|
|
146
|
+
instance.clearHighlight?.();
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
const pressEndHandler = instance.addInteractionListener('quickPressEnd', event => {
|
|
150
|
+
if (!event.detail.activeGestures.move && !event.detail.activeGestures.pan) {
|
|
151
|
+
instance.cleanInteraction?.();
|
|
152
|
+
instance.clearHighlight?.();
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
const gestureHandler = event => {
|
|
156
|
+
const closestPoint = getClosestPoint(event.detail.srcEvent);
|
|
139
157
|
if (closestPoint === 'outside-chart') {
|
|
140
158
|
instance.cleanInteraction?.();
|
|
141
159
|
instance.clearHighlight?.();
|
|
@@ -160,32 +178,31 @@ export const useChartVoronoi = ({
|
|
|
160
178
|
dataIndex
|
|
161
179
|
});
|
|
162
180
|
};
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
181
|
+
const tapHandler = instance.addInteractionListener('tap', event => {
|
|
182
|
+
const closestPoint = getClosestPoint(event.detail.srcEvent);
|
|
183
|
+
if (typeof closestPoint !== 'string' && onItemClick) {
|
|
184
|
+
const {
|
|
185
|
+
seriesId,
|
|
186
|
+
dataIndex
|
|
187
|
+
} = closestPoint;
|
|
188
|
+
onItemClick(event.detail.srcEvent, {
|
|
189
|
+
type: 'scatter',
|
|
190
|
+
seriesId,
|
|
191
|
+
dataIndex
|
|
192
|
+
});
|
|
171
193
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
onItemClick(event, {
|
|
177
|
-
type: 'scatter',
|
|
178
|
-
seriesId,
|
|
179
|
-
dataIndex
|
|
180
|
-
});
|
|
181
|
-
};
|
|
182
|
-
element.addEventListener('pointerleave', handleMouseLeave);
|
|
183
|
-
element.addEventListener('pointermove', handleMouseMove);
|
|
184
|
-
element.addEventListener('click', handleMouseClick);
|
|
194
|
+
});
|
|
195
|
+
const moveHandler = instance.addInteractionListener('move', gestureHandler);
|
|
196
|
+
const panHandler = instance.addInteractionListener('pan', gestureHandler);
|
|
197
|
+
const pressHandler = instance.addInteractionListener('quickPress', gestureHandler);
|
|
185
198
|
return () => {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
199
|
+
tapHandler.cleanup();
|
|
200
|
+
moveHandler.cleanup();
|
|
201
|
+
moveEndHandler.cleanup();
|
|
202
|
+
panHandler.cleanup();
|
|
203
|
+
panEndHandler.cleanup();
|
|
204
|
+
pressHandler.cleanup();
|
|
205
|
+
pressEndHandler.cleanup();
|
|
189
206
|
};
|
|
190
207
|
}, [svgRef, yAxis, xAxis, voronoiMaxRadius, onItemClick, disableVoronoi, drawingArea, instance]);
|
|
191
208
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const selectorChartsVoronoiIsVoronoiEnabled: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("./useChartVoronoi.types.js").UseChartVoronoiState & Partial<{}> & {
|
|
1
|
+
export declare const selectorChartsVoronoiIsVoronoiEnabled: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & import("./useChartVoronoi.types.js").UseChartVoronoiState & Partial<{}> & {
|
|
2
2
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
3
3
|
} & {
|
|
4
4
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const selectorChartZAxis: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("./useChartZAxis.types.js").UseChartZAxisState & Partial<{}> & {
|
|
1
|
+
export declare const selectorChartZAxis: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & import("./useChartZAxis.types.js").UseChartZAxisState & Partial<{}> & {
|
|
2
2
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
3
3
|
} & {
|
|
4
4
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -16,7 +16,7 @@ import { ChartSeriesConfig } from "../plugins/models/seriesConfig/index.js";
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function useCharts<TSeriesType extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[]>(inPlugins: ConvertSignaturesIntoPlugins<TSignatures>, props: Partial<UseChartBaseProps<TSignatures>>, seriesConfig: ChartSeriesConfig<TSeriesType>): {
|
|
18
18
|
contextValue: {
|
|
19
|
-
store: ChartStore<readonly [import("../index.js").UseChartIdSignature, import("../index.js").UseChartDimensionsSignature, import("../index.js").UseChartSeriesSignature, import("../plugins/corePlugins/useChartAnimation/index.js").UseChartAnimationSignature, ...TSignatures]> & UseChartInteractionState;
|
|
19
|
+
store: ChartStore<readonly [import("../index.js").UseChartIdSignature, import("../index.js").UseChartDimensionsSignature, import("../index.js").UseChartSeriesSignature, import("../plugins/corePlugins/useChartAnimation/index.js").UseChartAnimationSignature, import("../index.js").UseChartInteractionListenerSignature, ...TSignatures]> & UseChartInteractionState;
|
|
20
20
|
publicAPI: ChartPublicAPI<TSignatures>;
|
|
21
21
|
instance: ChartInstance<TSignatures>;
|
|
22
22
|
svgRef: React.RefObject<SVGSVGElement | null>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ChartsLocaleText } from "./utils/chartsLocaleTextApi.js";
|
|
2
|
+
export declare const elGRLocaleText: Partial<ChartsLocaleText>;
|
|
3
|
+
export declare const elGR: {
|
|
4
|
+
components: {
|
|
5
|
+
MuiChartsLocalizationProvider: {
|
|
6
|
+
defaultProps: {
|
|
7
|
+
localeText: {
|
|
8
|
+
loading?: string | undefined;
|
|
9
|
+
noData?: string | undefined;
|
|
10
|
+
zoomIn?: string | undefined;
|
|
11
|
+
zoomOut?: string | undefined;
|
|
12
|
+
toolbarExport?: string | undefined;
|
|
13
|
+
toolbarExportPrint?: string | undefined;
|
|
14
|
+
toolbarExportImage?: ((mimeType: import("./utils/imageMimeTypes.js").ChartImageExportMimeType | (string & {})) => string) | undefined;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { imageMimeTypes } from "./utils/imageMimeTypes.js";
|
|
2
|
+
import { getChartsLocalization } from "./utils/getChartsLocalization.js";
|
|
3
|
+
export const elGRLocaleText = {
|
|
4
|
+
// Overlay
|
|
5
|
+
loading: 'Φόρτωση δεδομένων…',
|
|
6
|
+
noData: 'Δεν υπάρχουν δεδομένα για εμφάνιση',
|
|
7
|
+
// Toolbar
|
|
8
|
+
zoomIn: 'Μεγέθυνση',
|
|
9
|
+
zoomOut: 'Σμίκρυνση',
|
|
10
|
+
toolbarExport: 'Εξαγωγή',
|
|
11
|
+
// Toolbar Export Menu
|
|
12
|
+
toolbarExportPrint: 'Εκτύπωση',
|
|
13
|
+
toolbarExportImage: mimeType => `Εξαγωγή ως ${imageMimeTypes[mimeType] ?? mimeType}`
|
|
14
|
+
};
|
|
15
|
+
export const elGR = getChartsLocalization(elGRLocaleText);
|
package/esm/locales/enUS.d.ts
CHANGED
|
@@ -10,6 +10,9 @@ export declare const enUS: {
|
|
|
10
10
|
noData?: string | undefined;
|
|
11
11
|
zoomIn?: string | undefined;
|
|
12
12
|
zoomOut?: string | undefined;
|
|
13
|
+
toolbarExport?: string | undefined;
|
|
14
|
+
toolbarExportPrint?: string | undefined;
|
|
15
|
+
toolbarExportImage?: ((mimeType: import("./utils/imageMimeTypes.js").ChartImageExportMimeType | (string & {})) => string) | undefined;
|
|
13
16
|
};
|
|
14
17
|
};
|
|
15
18
|
};
|
package/esm/locales/enUS.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
import { imageMimeTypes } from "./utils/imageMimeTypes.js";
|
|
1
2
|
import { getChartsLocalization } from "./utils/getChartsLocalization.js";
|
|
2
3
|
|
|
3
4
|
// This object is not Partial<ChartsLocaleText> because it is the default values
|
|
4
5
|
|
|
5
6
|
export const enUSLocaleText = {
|
|
6
|
-
|
|
7
|
+
/* Overlay */
|
|
7
8
|
loading: 'Loading data…',
|
|
8
9
|
noData: 'No data to display',
|
|
10
|
+
/* Toolbar */
|
|
9
11
|
zoomIn: 'Zoom in',
|
|
10
|
-
zoomOut: 'Zoom out'
|
|
12
|
+
zoomOut: 'Zoom out',
|
|
13
|
+
toolbarExport: 'Export',
|
|
14
|
+
/* Toolbar Export Menu */
|
|
15
|
+
toolbarExportPrint: 'Print',
|
|
16
|
+
toolbarExportImage: mimeType => `Export as ${imageMimeTypes[mimeType] ?? mimeType}`
|
|
11
17
|
};
|
|
12
18
|
export const DEFAULT_LOCALE = enUSLocaleText;
|
|
13
19
|
export const enUS = getChartsLocalization(enUSLocaleText);
|
package/esm/locales/frFR.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ export declare const frFR: {
|
|
|
9
9
|
noData?: string | undefined;
|
|
10
10
|
zoomIn?: string | undefined;
|
|
11
11
|
zoomOut?: string | undefined;
|
|
12
|
+
toolbarExport?: string | undefined;
|
|
13
|
+
toolbarExportPrint?: string | undefined;
|
|
14
|
+
toolbarExportImage?: ((mimeType: import("./utils/imageMimeTypes.js").ChartImageExportMimeType | (string & {})) => string) | undefined;
|
|
12
15
|
};
|
|
13
16
|
};
|
|
14
17
|
};
|
package/esm/locales/frFR.js
CHANGED
|
@@ -3,7 +3,14 @@ export const frFRLocalText = {
|
|
|
3
3
|
// Overlay
|
|
4
4
|
loading: 'Chargement…',
|
|
5
5
|
noData: 'Pas de données'
|
|
6
|
+
|
|
7
|
+
// Toolbar
|
|
6
8
|
// zoomIn: 'Zoom in',
|
|
7
9
|
// zoomOut: 'Zoom out',
|
|
10
|
+
// toolbarExport: 'Export',
|
|
11
|
+
|
|
12
|
+
// Toolbar Export Menu
|
|
13
|
+
// toolbarExportPrint: 'Print',
|
|
14
|
+
// toolbarExportImage: mimeType => `Export as ${imageMimeTypes[mimeType] ?? mimeType}`,
|
|
8
15
|
};
|
|
9
16
|
export const frFR = getChartsLocalization(frFRLocalText);
|
package/esm/locales/index.d.ts
CHANGED
package/esm/locales/index.js
CHANGED
package/esm/locales/ptBR.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ export declare const ptBR: {
|
|
|
9
9
|
noData?: string | undefined;
|
|
10
10
|
zoomIn?: string | undefined;
|
|
11
11
|
zoomOut?: string | undefined;
|
|
12
|
+
toolbarExport?: string | undefined;
|
|
13
|
+
toolbarExportPrint?: string | undefined;
|
|
14
|
+
toolbarExportImage?: ((mimeType: import("./utils/imageMimeTypes.js").ChartImageExportMimeType | (string & {})) => string) | undefined;
|
|
12
15
|
};
|
|
13
16
|
};
|
|
14
17
|
};
|
package/esm/locales/ptBR.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import { imageMimeTypes } from "./utils/imageMimeTypes.js";
|
|
1
2
|
import { getChartsLocalization } from "./utils/getChartsLocalization.js";
|
|
2
3
|
export const ptBRLocaleText = {
|
|
3
4
|
// Overlay
|
|
4
5
|
loading: 'Carregando dados…',
|
|
5
6
|
noData: 'Sem dados para exibir',
|
|
7
|
+
// Toolbar
|
|
6
8
|
zoomIn: 'Aumentar zoom',
|
|
7
|
-
zoomOut: 'Diminuir zoom'
|
|
9
|
+
zoomOut: 'Diminuir zoom',
|
|
10
|
+
toolbarExport: 'Exportar',
|
|
11
|
+
// Toolbar Export Menu
|
|
12
|
+
toolbarExportPrint: 'Imprimir',
|
|
13
|
+
toolbarExportImage: mimeType => `Exportar como ${imageMimeTypes[mimeType] ?? mimeType}`
|
|
8
14
|
};
|
|
9
15
|
export const ptBR = getChartsLocalization(ptBRLocaleText);
|
package/esm/locales/ptPT.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ export declare const ptPT: {
|
|
|
9
9
|
noData?: string | undefined;
|
|
10
10
|
zoomIn?: string | undefined;
|
|
11
11
|
zoomOut?: string | undefined;
|
|
12
|
+
toolbarExport?: string | undefined;
|
|
13
|
+
toolbarExportPrint?: string | undefined;
|
|
14
|
+
toolbarExportImage?: ((mimeType: import("./utils/imageMimeTypes.js").ChartImageExportMimeType | (string & {})) => string) | undefined;
|
|
12
15
|
};
|
|
13
16
|
};
|
|
14
17
|
};
|
package/esm/locales/ptPT.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import { imageMimeTypes } from "./utils/imageMimeTypes.js";
|
|
1
2
|
import { getChartsLocalization } from "./utils/getChartsLocalization.js";
|
|
2
3
|
export const ptPTLocaleText = {
|
|
3
4
|
// Overlay
|
|
4
5
|
loading: 'Carregando dados…',
|
|
5
6
|
noData: 'Sem dados para mostrar',
|
|
7
|
+
// Toolbar
|
|
6
8
|
zoomIn: 'Aumentar zoom',
|
|
7
|
-
zoomOut: 'Diminuir zoom'
|
|
9
|
+
zoomOut: 'Diminuir zoom',
|
|
10
|
+
toolbarExport: 'Exportar',
|
|
11
|
+
// Toolbar Export Menu
|
|
12
|
+
toolbarExportPrint: 'Imprimir',
|
|
13
|
+
toolbarExportImage: mimeType => `Exportar como ${imageMimeTypes[mimeType] ?? mimeType}`
|
|
8
14
|
};
|
|
9
15
|
export const ptPT = getChartsLocalization(ptPTLocaleText);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ChartImageExportMimeType } from "./imageMimeTypes.js";
|
|
1
2
|
export interface ChartsLocaleText {
|
|
2
3
|
/**
|
|
3
4
|
* Title displayed in the overlay if `loading` is `true`.
|
|
@@ -15,5 +16,21 @@ export interface ChartsLocaleText {
|
|
|
15
16
|
* Tooltip text shown when hovering over the zoom out button.
|
|
16
17
|
*/
|
|
17
18
|
zoomOut: string;
|
|
19
|
+
/**
|
|
20
|
+
* Text for the export button tooltip in the toolbar.
|
|
21
|
+
*/
|
|
22
|
+
toolbarExport: string;
|
|
23
|
+
/**
|
|
24
|
+
* Text for the print button in the toolbar's export menu.
|
|
25
|
+
*/
|
|
26
|
+
toolbarExportPrint: string;
|
|
27
|
+
/**
|
|
28
|
+
* Text for an "Export as {image type}" button in the toolbar's export menu.
|
|
29
|
+
* The only format supported in all browsers is 'image/png'.
|
|
30
|
+
*
|
|
31
|
+
* @param {string} mimeType The MIME type of the image to export, e.g., 'image/png'.
|
|
32
|
+
* @returns {string} The localized string for an export image button.
|
|
33
|
+
*/
|
|
34
|
+
toolbarExportImage: (mimeType: ChartImageExportMimeType | (string & {})) => string;
|
|
18
35
|
}
|
|
19
36
|
export type ChartsTranslationKeys = keyof ChartsLocaleText;
|
|
@@ -13,6 +13,9 @@ export declare const getChartsLocalization: (chartsTranslations: Partial<ChartsL
|
|
|
13
13
|
noData?: string | undefined;
|
|
14
14
|
zoomIn?: string | undefined;
|
|
15
15
|
zoomOut?: string | undefined;
|
|
16
|
+
toolbarExport?: string | undefined;
|
|
17
|
+
toolbarExportPrint?: string | undefined;
|
|
18
|
+
toolbarExportImage?: ((mimeType: import("./imageMimeTypes.js").ChartImageExportMimeType | (string & {})) => string) | undefined;
|
|
16
19
|
};
|
|
17
20
|
};
|
|
18
21
|
};
|
|
@@ -7,14 +7,18 @@ export type ChartBaseCommonProps<T = HTMLElement> = React.DOMAttributes<T> & {
|
|
|
7
7
|
};
|
|
8
8
|
export type ChartBaseIconProps = ChartBaseCommonProps<SVGSVGElement> & {
|
|
9
9
|
titleAccess?: string;
|
|
10
|
+
fontSize?: 'small' | 'medium' | 'large' | 'inherit';
|
|
10
11
|
};
|
|
11
12
|
export type ChartBaseButtonProps = ChartBaseCommonProps & {
|
|
12
13
|
ref?: React.Ref<HTMLButtonElement>;
|
|
14
|
+
id?: string;
|
|
13
15
|
disabled?: boolean;
|
|
14
16
|
tabIndex?: number;
|
|
15
17
|
};
|
|
16
18
|
export type ChartBaseIconButtonProps = ChartBaseCommonProps & {
|
|
17
19
|
ref?: React.Ref<HTMLButtonElement>;
|
|
20
|
+
id?: string;
|
|
18
21
|
disabled?: boolean;
|
|
19
22
|
tabIndex?: number;
|
|
23
|
+
size?: 'small' | 'medium' | 'large';
|
|
20
24
|
};
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SeriesItemIdentifier } from "../models/index.js";
|
|
3
|
+
import { UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
4
|
+
import { UseChartInteractionSignature } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
5
|
+
import { ChartItemIdentifier, ChartSeriesType } from "../models/seriesType/config.js";
|
|
6
|
+
import { ChartInstance } from "../internals/plugins/models/index.js";
|
|
3
7
|
export declare const useInteractionItemProps: (data: SeriesItemIdentifier, skip?: boolean) => {
|
|
4
8
|
onPointerEnter?: () => void;
|
|
5
9
|
onPointerLeave?: () => void;
|
|
6
10
|
onPointerDown?: (event: React.PointerEvent) => void;
|
|
7
11
|
};
|
|
8
|
-
export declare const useInteractionAllItemProps: (data: SeriesItemIdentifier[], skip?: boolean) =>
|
|
9
|
-
onPointerEnter?:
|
|
10
|
-
onPointerLeave?:
|
|
11
|
-
onPointerDown?:
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
export declare const useInteractionAllItemProps: (data: SeriesItemIdentifier[], skip?: boolean) => {
|
|
13
|
+
onPointerEnter?: () => void;
|
|
14
|
+
onPointerLeave?: () => void;
|
|
15
|
+
onPointerDown?: (event: React.PointerEvent) => void;
|
|
16
|
+
}[];
|
|
17
|
+
export declare function getInteractionItemProps(instance: ChartInstance<[UseChartInteractionSignature, UseChartHighlightSignature]>, item: ChartItemIdentifier<ChartSeriesType>): {
|
|
18
|
+
onPointerEnter?: () => void;
|
|
19
|
+
onPointerLeave?: () => void;
|
|
20
|
+
onPointerDown?: (event: React.PointerEvent) => void;
|
|
21
|
+
};
|
|
@@ -5,14 +5,15 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
exports.getInteractionItemProps = getInteractionItemProps;
|
|
8
9
|
exports.useInteractionItemProps = exports.useInteractionAllItemProps = void 0;
|
|
9
10
|
var React = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _ChartProvider = require("../context/ChartProvider");
|
|
11
|
-
|
|
12
|
+
function onPointerDown(event) {
|
|
12
13
|
if ('hasPointerCapture' in event.currentTarget && event.currentTarget.hasPointerCapture(event.pointerId)) {
|
|
13
14
|
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
14
15
|
}
|
|
15
|
-
}
|
|
16
|
+
}
|
|
16
17
|
const useInteractionItemProps = (data, skip) => {
|
|
17
18
|
const {
|
|
18
19
|
instance
|
|
@@ -63,33 +64,33 @@ const useInteractionAllItemProps = (data, skip) => {
|
|
|
63
64
|
} = (0, _ChartProvider.useChartContext)();
|
|
64
65
|
const results = React.useMemo(() => {
|
|
65
66
|
return data.map(item => {
|
|
66
|
-
|
|
67
|
-
return {};
|
|
68
|
-
}
|
|
69
|
-
const onPointerEnter = () => {
|
|
70
|
-
if (!item) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
instance.setItemInteraction(item);
|
|
74
|
-
instance.setHighlight({
|
|
75
|
-
seriesId: item.seriesId,
|
|
76
|
-
dataIndex: item.dataIndex
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
const onPointerLeave = () => {
|
|
80
|
-
if (!item) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
instance.removeItemInteraction(item);
|
|
84
|
-
instance.clearHighlight();
|
|
85
|
-
};
|
|
86
|
-
return {
|
|
87
|
-
onPointerEnter,
|
|
88
|
-
onPointerLeave,
|
|
89
|
-
onPointerDown
|
|
90
|
-
};
|
|
67
|
+
return skip ? {} : getInteractionItemProps(instance, item);
|
|
91
68
|
});
|
|
92
69
|
}, [data, instance, skip]);
|
|
93
70
|
return results;
|
|
94
71
|
};
|
|
95
|
-
exports.useInteractionAllItemProps = useInteractionAllItemProps;
|
|
72
|
+
exports.useInteractionAllItemProps = useInteractionAllItemProps;
|
|
73
|
+
function getInteractionItemProps(instance, item) {
|
|
74
|
+
function onPointerEnter() {
|
|
75
|
+
if (!item) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
instance.setItemInteraction(item);
|
|
79
|
+
instance.setHighlight({
|
|
80
|
+
seriesId: item.seriesId,
|
|
81
|
+
dataIndex: item.dataIndex
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function onPointerLeave() {
|
|
85
|
+
if (!item) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
instance.removeItemInteraction(item);
|
|
89
|
+
instance.clearHighlight();
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
onPointerEnter,
|
|
93
|
+
onPointerLeave,
|
|
94
|
+
onPointerDown
|
|
95
|
+
};
|
|
96
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export * from "./SparkLineChart/index.js";
|
|
|
23
23
|
export * from "./Gauge/index.js";
|
|
24
24
|
export * from "./RadarChart/index.js";
|
|
25
25
|
export * from "./ChartsSurface/index.js";
|
|
26
|
-
export
|
|
26
|
+
export { ChartContainer } from "./ChartContainer/index.js";
|
|
27
|
+
export type { ChartContainerProps } from "./ChartContainer/index.js";
|
|
27
28
|
export * from "./ChartDataProvider/index.js";
|
|
28
29
|
export * from "./Toolbar/index.js";
|