@mui/x-charts-pro 8.0.0-alpha.12 → 8.0.0-alpha.14
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 +2 -1
- package/BarChartPro/BarChartPro.js +25 -30
- package/CHANGELOG.md +430 -0
- package/ChartContainerPro/ChartContainerPro.d.ts +1 -1
- package/ChartContainerPro/ChartContainerPro.js +1 -1
- package/ChartContainerPro/useChartContainerProProps.d.ts +1 -1
- package/ChartContainerPro/useChartContainerProProps.js +3 -1
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
- package/ChartDataProviderPro/ChartDataProviderPro.js +3 -2
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -1
- package/FunnelChart/FunnelChart.d.ts +37 -0
- package/FunnelChart/FunnelChart.js +218 -0
- package/FunnelChart/FunnelPlot.d.ts +16 -0
- package/FunnelChart/FunnelPlot.js +191 -0
- package/FunnelChart/FunnelSection.d.ts +15 -0
- package/FunnelChart/FunnelSection.js +62 -0
- package/FunnelChart/categoryAxis.types.d.ts +24 -0
- package/FunnelChart/categoryAxis.types.js +5 -0
- package/FunnelChart/funnel.types.d.ts +124 -0
- package/FunnelChart/funnel.types.js +5 -0
- package/FunnelChart/funnelPlotSlots.types.d.ts +20 -0
- package/FunnelChart/funnelPlotSlots.types.js +5 -0
- package/FunnelChart/funnelSectionClasses.d.ts +13 -0
- package/FunnelChart/funnelSectionClasses.js +28 -0
- package/FunnelChart/funnelSlots.types.d.ts +19 -0
- package/FunnelChart/funnelSlots.types.js +5 -0
- package/FunnelChart/funnelStepCurve.d.ts +4 -0
- package/FunnelChart/funnelStepCurve.js +74 -0
- package/FunnelChart/index.d.ts +7 -0
- package/FunnelChart/index.js +59 -0
- package/FunnelChart/labelUtils.d.ts +42 -0
- package/FunnelChart/labelUtils.js +174 -0
- package/FunnelChart/seriesConfig/extremums.d.ts +3 -0
- package/FunnelChart/seriesConfig/extremums.js +50 -0
- package/FunnelChart/seriesConfig/getColor.d.ts +3 -0
- package/FunnelChart/seriesConfig/getColor.js +10 -0
- package/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +18 -0
- package/FunnelChart/seriesConfig/index.d.ts +2 -0
- package/FunnelChart/seriesConfig/index.js +22 -0
- package/FunnelChart/seriesConfig/legend.d.ts +3 -0
- package/FunnelChart/seriesConfig/legend.js +31 -0
- package/FunnelChart/seriesConfig/seriesProcessor.d.ts +3 -0
- package/FunnelChart/seriesConfig/seriesProcessor.js +96 -0
- package/FunnelChart/seriesConfig/tooltip.d.ts +3 -0
- package/FunnelChart/seriesConfig/tooltip.js +36 -0
- package/FunnelChart/useFunnelChartProps.d.ts +30 -0
- package/FunnelChart/useFunnelChartProps.js +168 -0
- package/Heatmap/Heatmap.d.ts +5 -4
- package/Heatmap/Heatmap.js +37 -52
- package/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +15 -0
- package/Heatmap/seriesConfig/index.js +3 -1
- package/LineChartPro/LineChartPro.d.ts +2 -1
- package/LineChartPro/LineChartPro.js +25 -30
- package/ScatterChartPro/ScatterChartPro.js +25 -30
- package/esm/BarChartPro/BarChartPro.d.ts +2 -1
- package/esm/BarChartPro/BarChartPro.js +25 -30
- package/esm/ChartContainerPro/ChartContainerPro.d.ts +1 -1
- package/esm/ChartContainerPro/ChartContainerPro.js +1 -1
- package/esm/ChartContainerPro/useChartContainerProProps.d.ts +1 -1
- package/esm/ChartContainerPro/useChartContainerProProps.js +3 -1
- package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +3 -2
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -1
- package/esm/FunnelChart/FunnelChart.d.ts +37 -0
- package/esm/FunnelChart/FunnelChart.js +212 -0
- package/esm/FunnelChart/FunnelPlot.d.ts +16 -0
- package/esm/FunnelChart/FunnelPlot.js +184 -0
- package/esm/FunnelChart/FunnelSection.d.ts +15 -0
- package/esm/FunnelChart/FunnelSection.js +56 -0
- package/esm/FunnelChart/categoryAxis.types.d.ts +24 -0
- package/esm/FunnelChart/categoryAxis.types.js +1 -0
- package/esm/FunnelChart/funnel.types.d.ts +124 -0
- package/esm/FunnelChart/funnel.types.js +1 -0
- package/esm/FunnelChart/funnelPlotSlots.types.d.ts +20 -0
- package/esm/FunnelChart/funnelPlotSlots.types.js +1 -0
- package/esm/FunnelChart/funnelSectionClasses.d.ts +13 -0
- package/esm/FunnelChart/funnelSectionClasses.js +20 -0
- package/esm/FunnelChart/funnelSlots.types.d.ts +19 -0
- package/esm/FunnelChart/funnelSlots.types.js +1 -0
- package/esm/FunnelChart/funnelStepCurve.d.ts +4 -0
- package/esm/FunnelChart/funnelStepCurve.js +67 -0
- package/esm/FunnelChart/index.d.ts +7 -0
- package/esm/FunnelChart/index.js +5 -0
- package/esm/FunnelChart/labelUtils.d.ts +42 -0
- package/esm/FunnelChart/labelUtils.js +166 -0
- package/esm/FunnelChart/seriesConfig/extremums.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/extremums.js +42 -0
- package/esm/FunnelChart/seriesConfig/getColor.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/getColor.js +4 -0
- package/esm/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +11 -0
- package/esm/FunnelChart/seriesConfig/index.d.ts +2 -0
- package/esm/FunnelChart/seriesConfig/index.js +15 -0
- package/esm/FunnelChart/seriesConfig/legend.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/legend.js +25 -0
- package/esm/FunnelChart/seriesConfig/seriesProcessor.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/seriesProcessor.js +89 -0
- package/esm/FunnelChart/seriesConfig/tooltip.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/tooltip.js +29 -0
- package/esm/FunnelChart/useFunnelChartProps.d.ts +30 -0
- package/esm/FunnelChart/useFunnelChartProps.js +161 -0
- package/esm/Heatmap/Heatmap.d.ts +5 -4
- package/esm/Heatmap/Heatmap.js +37 -52
- package/esm/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/esm/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +8 -0
- package/esm/Heatmap/seriesConfig/index.js +3 -1
- package/esm/LineChartPro/LineChartPro.d.ts +2 -1
- package/esm/LineChartPro/LineChartPro.js +25 -30
- package/esm/ScatterChartPro/ScatterChartPro.js +25 -30
- package/esm/hooks/useFunnelSeries.d.ts +33 -0
- package/esm/hooks/useFunnelSeries.js +42 -0
- package/esm/index.d.ts +3 -1
- package/esm/index.js +4 -2
- package/esm/internals/plugins/allPlugins.d.ts +3 -3
- package/esm/internals/plugins/allPlugins.js +2 -2
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +63 -12
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +26 -24
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +12 -3
- package/esm/internals/utils/releaseInfo.js +1 -1
- package/esm/models/seriesType/heatmap.d.ts +2 -2
- package/esm/typeOverloads/modules.d.ts +13 -2
- package/hooks/useFunnelSeries.d.ts +33 -0
- package/hooks/useFunnelSeries.js +48 -0
- package/index.d.ts +3 -1
- package/index.js +23 -1
- package/internals/plugins/allPlugins.d.ts +3 -3
- package/internals/plugins/allPlugins.js +1 -1
- package/internals/plugins/useChartProZoom/useChartProZoom.js +63 -12
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +26 -24
- package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +12 -3
- package/internals/utils/releaseInfo.js +1 -1
- package/models/seriesType/heatmap.d.ts +2 -2
- package/modern/BarChartPro/BarChartPro.d.ts +2 -1
- package/modern/BarChartPro/BarChartPro.js +25 -30
- package/modern/ChartContainerPro/ChartContainerPro.d.ts +1 -1
- package/modern/ChartContainerPro/ChartContainerPro.js +1 -1
- package/modern/ChartContainerPro/useChartContainerProProps.d.ts +1 -1
- package/modern/ChartContainerPro/useChartContainerProProps.js +3 -1
- package/modern/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
- package/modern/ChartDataProviderPro/ChartDataProviderPro.js +3 -2
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -1
- package/modern/FunnelChart/FunnelChart.d.ts +37 -0
- package/modern/FunnelChart/FunnelChart.js +212 -0
- package/modern/FunnelChart/FunnelPlot.d.ts +16 -0
- package/modern/FunnelChart/FunnelPlot.js +184 -0
- package/modern/FunnelChart/FunnelSection.d.ts +15 -0
- package/modern/FunnelChart/FunnelSection.js +56 -0
- package/modern/FunnelChart/categoryAxis.types.d.ts +24 -0
- package/modern/FunnelChart/categoryAxis.types.js +1 -0
- package/modern/FunnelChart/funnel.types.d.ts +124 -0
- package/modern/FunnelChart/funnel.types.js +1 -0
- package/modern/FunnelChart/funnelPlotSlots.types.d.ts +20 -0
- package/modern/FunnelChart/funnelPlotSlots.types.js +1 -0
- package/modern/FunnelChart/funnelSectionClasses.d.ts +13 -0
- package/modern/FunnelChart/funnelSectionClasses.js +20 -0
- package/modern/FunnelChart/funnelSlots.types.d.ts +19 -0
- package/modern/FunnelChart/funnelSlots.types.js +1 -0
- package/modern/FunnelChart/funnelStepCurve.d.ts +4 -0
- package/modern/FunnelChart/funnelStepCurve.js +67 -0
- package/modern/FunnelChart/index.d.ts +7 -0
- package/modern/FunnelChart/index.js +5 -0
- package/modern/FunnelChart/labelUtils.d.ts +42 -0
- package/modern/FunnelChart/labelUtils.js +166 -0
- package/modern/FunnelChart/seriesConfig/extremums.d.ts +3 -0
- package/modern/FunnelChart/seriesConfig/extremums.js +42 -0
- package/modern/FunnelChart/seriesConfig/getColor.d.ts +3 -0
- package/modern/FunnelChart/seriesConfig/getColor.js +4 -0
- package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +11 -0
- package/modern/FunnelChart/seriesConfig/index.d.ts +2 -0
- package/modern/FunnelChart/seriesConfig/index.js +15 -0
- package/modern/FunnelChart/seriesConfig/legend.d.ts +3 -0
- package/modern/FunnelChart/seriesConfig/legend.js +25 -0
- package/modern/FunnelChart/seriesConfig/seriesProcessor.d.ts +3 -0
- package/modern/FunnelChart/seriesConfig/seriesProcessor.js +89 -0
- package/modern/FunnelChart/seriesConfig/tooltip.d.ts +3 -0
- package/modern/FunnelChart/seriesConfig/tooltip.js +29 -0
- package/modern/FunnelChart/useFunnelChartProps.d.ts +30 -0
- package/modern/FunnelChart/useFunnelChartProps.js +161 -0
- package/modern/Heatmap/Heatmap.d.ts +5 -4
- package/modern/Heatmap/Heatmap.js +37 -52
- package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +8 -0
- package/modern/Heatmap/seriesConfig/index.js +3 -1
- package/modern/LineChartPro/LineChartPro.d.ts +2 -1
- package/modern/LineChartPro/LineChartPro.js +25 -30
- package/modern/ScatterChartPro/ScatterChartPro.js +25 -30
- package/modern/hooks/useFunnelSeries.d.ts +33 -0
- package/modern/hooks/useFunnelSeries.js +42 -0
- package/modern/index.d.ts +3 -1
- package/modern/index.js +4 -2
- package/modern/internals/plugins/allPlugins.d.ts +3 -3
- package/modern/internals/plugins/allPlugins.js +2 -2
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +63 -12
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +26 -24
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +12 -3
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/models/seriesType/heatmap.d.ts +2 -2
- package/modern/typeOverloads/modules.d.ts +13 -2
- package/package.json +5 -5
- package/tsconfig.build.tsbuildinfo +1 -1
- package/typeOverloads/modules.d.ts +13 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
const _excluded = ["initialZoom", "onZoomChange", "apiRef"];
|
|
5
|
+
const _excluded = ["initialZoom", "zoomData", "onZoomChange", "apiRef"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { useThemeProps } from '@mui/material/styles';
|
|
@@ -84,6 +84,7 @@ const BarChartPro = /*#__PURE__*/React.forwardRef(function BarChartPro(inProps,
|
|
|
84
84
|
});
|
|
85
85
|
const {
|
|
86
86
|
initialZoom,
|
|
87
|
+
zoomData,
|
|
87
88
|
onZoomChange,
|
|
88
89
|
apiRef
|
|
89
90
|
} = props,
|
|
@@ -106,6 +107,7 @@ const BarChartPro = /*#__PURE__*/React.forwardRef(function BarChartPro(inProps,
|
|
|
106
107
|
chartsSurfaceProps
|
|
107
108
|
} = useChartContainerProProps(_extends({}, chartContainerProps, {
|
|
108
109
|
initialZoom,
|
|
110
|
+
zoomData,
|
|
109
111
|
onZoomChange,
|
|
110
112
|
apiRef,
|
|
111
113
|
plugins: BAR_CHART_PRO_PLUGINS
|
|
@@ -153,12 +155,6 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
153
155
|
* Defines the border radius of the bar element.
|
|
154
156
|
*/
|
|
155
157
|
borderRadius: PropTypes.number,
|
|
156
|
-
/**
|
|
157
|
-
* Indicate which axis to display the bottom of the charts.
|
|
158
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
159
|
-
* @default xAxisIds[0] The id of the first provided axis
|
|
160
|
-
*/
|
|
161
|
-
bottomAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
162
158
|
children: PropTypes.node,
|
|
163
159
|
className: PropTypes.string,
|
|
164
160
|
/**
|
|
@@ -207,6 +203,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
207
203
|
id: PropTypes.string,
|
|
208
204
|
/**
|
|
209
205
|
* The list of zoom data related to each axis.
|
|
206
|
+
* Used to initialize the zoom in a specific configuration without controlling it.
|
|
210
207
|
*/
|
|
211
208
|
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
212
209
|
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
@@ -218,12 +215,6 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
218
215
|
* @default 'vertical'
|
|
219
216
|
*/
|
|
220
217
|
layout: PropTypes.oneOf(['horizontal', 'vertical']),
|
|
221
|
-
/**
|
|
222
|
-
* Indicate which axis to display the left of the charts.
|
|
223
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
224
|
-
* @default yAxisIds[0] The id of the first provided axis
|
|
225
|
-
*/
|
|
226
|
-
leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
227
218
|
/**
|
|
228
219
|
* If `true`, a loading overlay is displayed.
|
|
229
220
|
* @default false
|
|
@@ -232,14 +223,15 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
232
223
|
/**
|
|
233
224
|
* The margin between the SVG and the drawing area.
|
|
234
225
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
235
|
-
*
|
|
226
|
+
*
|
|
227
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
236
228
|
*/
|
|
237
|
-
margin: PropTypes.shape({
|
|
229
|
+
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
238
230
|
bottom: PropTypes.number,
|
|
239
231
|
left: PropTypes.number,
|
|
240
232
|
right: PropTypes.number,
|
|
241
233
|
top: PropTypes.number
|
|
242
|
-
}),
|
|
234
|
+
})]),
|
|
243
235
|
/**
|
|
244
236
|
* The function called for onClick events.
|
|
245
237
|
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
@@ -265,12 +257,6 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
265
257
|
* @param {ZoomData[]} zoomData Updated zoom data.
|
|
266
258
|
*/
|
|
267
259
|
onZoomChange: PropTypes.func,
|
|
268
|
-
/**
|
|
269
|
-
* Indicate which axis to display the right of the charts.
|
|
270
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
271
|
-
* @default null
|
|
272
|
-
*/
|
|
273
|
-
rightAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
274
260
|
/**
|
|
275
261
|
* The series to display in the bar chart.
|
|
276
262
|
* An array of [[BarSeriesType]] objects.
|
|
@@ -294,12 +280,6 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
294
280
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
295
281
|
theme: PropTypes.oneOf(['dark', 'light']),
|
|
296
282
|
title: PropTypes.string,
|
|
297
|
-
/**
|
|
298
|
-
* Indicate which axis to display the top of the charts.
|
|
299
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
300
|
-
* @default null
|
|
301
|
-
*/
|
|
302
|
-
topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
303
283
|
/**
|
|
304
284
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
305
285
|
*/
|
|
@@ -310,6 +290,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
310
290
|
* An array of [[AxisConfig]] objects.
|
|
311
291
|
*/
|
|
312
292
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
293
|
+
axis: PropTypes.oneOf(['x']),
|
|
313
294
|
classes: PropTypes.object,
|
|
314
295
|
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
315
296
|
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
@@ -332,13 +313,15 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
332
313
|
disableTicks: PropTypes.bool,
|
|
333
314
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
334
315
|
fill: PropTypes.string,
|
|
316
|
+
height: PropTypes.number,
|
|
335
317
|
hideTooltip: PropTypes.bool,
|
|
336
318
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
337
319
|
label: PropTypes.string,
|
|
338
320
|
labelStyle: PropTypes.object,
|
|
339
321
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
340
322
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
341
|
-
|
|
323
|
+
offset: PropTypes.number,
|
|
324
|
+
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
342
325
|
reverse: PropTypes.bool,
|
|
343
326
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
344
327
|
slotProps: PropTypes.object,
|
|
@@ -347,6 +330,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
347
330
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
348
331
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
349
332
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
333
|
+
tickLabelMinGap: PropTypes.number,
|
|
350
334
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
351
335
|
tickLabelStyle: PropTypes.object,
|
|
352
336
|
tickMaxStep: PropTypes.number,
|
|
@@ -371,6 +355,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
371
355
|
* An array of [[AxisConfig]] objects.
|
|
372
356
|
*/
|
|
373
357
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
358
|
+
axis: PropTypes.oneOf(['y']),
|
|
374
359
|
classes: PropTypes.object,
|
|
375
360
|
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
376
361
|
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
@@ -399,7 +384,8 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
399
384
|
labelStyle: PropTypes.object,
|
|
400
385
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
401
386
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
402
|
-
|
|
387
|
+
offset: PropTypes.number,
|
|
388
|
+
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
403
389
|
reverse: PropTypes.bool,
|
|
404
390
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
405
391
|
slotProps: PropTypes.object,
|
|
@@ -416,6 +402,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
416
402
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
417
403
|
tickSize: PropTypes.number,
|
|
418
404
|
valueFormatter: PropTypes.func,
|
|
405
|
+
width: PropTypes.number,
|
|
419
406
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
420
407
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
421
408
|
maxEnd: PropTypes.number,
|
|
@@ -450,6 +437,14 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
450
437
|
id: PropTypes.string,
|
|
451
438
|
max: PropTypes.number,
|
|
452
439
|
min: PropTypes.number
|
|
440
|
+
})),
|
|
441
|
+
/**
|
|
442
|
+
* The list of zoom data related to each axis.
|
|
443
|
+
*/
|
|
444
|
+
zoomData: PropTypes.arrayOf(PropTypes.shape({
|
|
445
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
446
|
+
end: PropTypes.number.isRequired,
|
|
447
|
+
start: PropTypes.number.isRequired
|
|
453
448
|
}))
|
|
454
449
|
} : void 0;
|
|
455
450
|
export { BarChartPro };
|
|
@@ -27,7 +27,7 @@ type ChartContainerProComponent = <TSeries extends ChartSeriesType = ChartSeries
|
|
|
27
27
|
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
28
28
|
* >
|
|
29
29
|
* <BarPlot />
|
|
30
|
-
* <ChartsXAxis
|
|
30
|
+
* <ChartsXAxis axisId="x-axis" />
|
|
31
31
|
* </ChartContainerPro>
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
@@ -27,7 +27,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
27
27
|
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
28
28
|
* >
|
|
29
29
|
* <BarPlot />
|
|
30
|
-
* <ChartsXAxis
|
|
30
|
+
* <ChartsXAxis axisId="x-axis" />
|
|
31
31
|
* </ChartContainerPro>
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
@@ -6,4 +6,4 @@ import { AllPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
|
6
6
|
export type UseChartContainerProPropsReturnValue<TSeries extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[]> = Pick<UseChartContainerPropsReturnValue<TSeries, TSignatures>, 'chartsSurfaceProps' | 'children'> & {
|
|
7
7
|
chartDataProviderProProps: ChartDataProviderProps<TSeries, TSignatures>;
|
|
8
8
|
};
|
|
9
|
-
export declare const useChartContainerProProps: <TSeries extends ChartSeriesType =
|
|
9
|
+
export declare const useChartContainerProProps: <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartContainerProProps<TSeries, TSignatures>, ref: React.Ref<SVGSVGElement>) => UseChartContainerProPropsReturnValue<TSeries, TSignatures>;
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["initialZoom", "onZoomChange", "plugins", "apiRef"];
|
|
5
|
+
const _excluded = ["initialZoom", "zoomData", "onZoomChange", "plugins", "apiRef"];
|
|
6
6
|
import { useChartContainerProps } from '@mui/x-charts/internals';
|
|
7
7
|
import { ALL_PLUGINS } from "../internals/plugins/allPlugins.js";
|
|
8
8
|
export const useChartContainerProProps = (props, ref) => {
|
|
9
9
|
const _ref = props,
|
|
10
10
|
{
|
|
11
11
|
initialZoom,
|
|
12
|
+
zoomData,
|
|
12
13
|
onZoomChange,
|
|
13
14
|
plugins,
|
|
14
15
|
apiRef
|
|
@@ -21,6 +22,7 @@ export const useChartContainerProProps = (props, ref) => {
|
|
|
21
22
|
} = useChartContainerProps(baseProps, ref);
|
|
22
23
|
const chartDataProviderProProps = _extends({}, chartDataProviderProps, {
|
|
23
24
|
initialZoom,
|
|
25
|
+
zoomData,
|
|
24
26
|
onZoomChange,
|
|
25
27
|
apiRef,
|
|
26
28
|
plugins: plugins ?? ALL_PLUGINS
|
|
@@ -24,7 +24,7 @@ export type ChartDataProviderProProps<TSeries extends ChartSeriesType = ChartSer
|
|
|
24
24
|
* >
|
|
25
25
|
* <ChartsSurface>
|
|
26
26
|
* <BarPlot />
|
|
27
|
-
* <ChartsXAxis
|
|
27
|
+
* <ChartsXAxis axisId="x-axis" />
|
|
28
28
|
* </ChartsSurface>
|
|
29
29
|
* {'Custom Legend Component'}
|
|
30
30
|
* </ChartDataProviderPro>
|
|
@@ -32,7 +32,7 @@ const packageIdentifier = 'x-charts-pro';
|
|
|
32
32
|
* >
|
|
33
33
|
* <ChartsSurface>
|
|
34
34
|
* <BarPlot />
|
|
35
|
-
* <ChartsXAxis
|
|
35
|
+
* <ChartsXAxis axisId="x-axis" />
|
|
36
36
|
* </ChartsSurface>
|
|
37
37
|
* {'Custom Legend Component'}
|
|
38
38
|
* </ChartDataProviderPro>
|
|
@@ -82,7 +82,8 @@ process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
|
|
|
82
82
|
/**
|
|
83
83
|
* The margin between the SVG and the drawing area.
|
|
84
84
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
85
|
-
*
|
|
85
|
+
*
|
|
86
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
86
87
|
*/
|
|
87
88
|
margin: PropTypes.any,
|
|
88
89
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChartAnyPluginSignature, ChartSeriesType } from '@mui/x-charts/internals';
|
|
2
2
|
import type { ChartDataProviderProProps } from './ChartDataProviderPro';
|
|
3
3
|
import type { AllPluginSignatures } from '../internals/plugins/allPlugins';
|
|
4
|
-
export declare const useChartDataProviderProProps: <TSeries extends ChartSeriesType =
|
|
4
|
+
export declare const useChartDataProviderProProps: <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartDataProviderProProps<TSeries, TSignatures>) => {
|
|
5
5
|
children: import("react").ReactNode;
|
|
6
6
|
animationProviderProps: Omit<import("@mui/x-charts/internals").AnimationProviderProps, "children">;
|
|
7
7
|
chartProviderProps: Omit<import("@mui/x-charts/internals").ChartProviderProps<TSeries, TSignatures>, "children">;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChartsOverlayProps } from '@mui/x-charts/ChartsOverlay';
|
|
3
|
+
import { MakeOptional } from '@mui/x-internals/types';
|
|
4
|
+
import { ChartsAxisHighlightProps } from '@mui/x-charts/ChartsAxisHighlight';
|
|
5
|
+
import { FunnelPlotProps } from "./FunnelPlot.js";
|
|
6
|
+
import { FunnelSeriesType } from "./funnel.types.js";
|
|
7
|
+
import { ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
8
|
+
import { FunnelChartSlotExtension } from "./funnelSlots.types.js";
|
|
9
|
+
import { CategoryAxis } from "./categoryAxis.types.js";
|
|
10
|
+
export interface FunnelChartProps extends Omit<ChartContainerProProps<'funnel'>, 'series' | 'plugins' | 'zAxis' | 'zoom' | 'onZoomChange' | 'dataset' | 'yAxis' | 'xAxis' | 'rotationAxis' | 'radiusAxis'>, Omit<FunnelPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, FunnelChartSlotExtension {
|
|
11
|
+
/**
|
|
12
|
+
* The series to display in the funnel chart.
|
|
13
|
+
* An array of [[FunnelSeriesType]] objects.
|
|
14
|
+
*/
|
|
15
|
+
series: Readonly<MakeOptional<FunnelSeriesType, 'type'>[]>;
|
|
16
|
+
/**
|
|
17
|
+
* The configuration of the category axis.
|
|
18
|
+
*
|
|
19
|
+
* @default { position: 'none' }
|
|
20
|
+
*/
|
|
21
|
+
categoryAxis?: CategoryAxis;
|
|
22
|
+
/**
|
|
23
|
+
* If `true`, the legend is not rendered.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
hideLegend?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The configuration of axes highlight.
|
|
29
|
+
* Default is set to 'band' in the bar direction.
|
|
30
|
+
* Depends on `layout` prop.
|
|
31
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
axisHighlight?: ChartsAxisHighlightProps;
|
|
35
|
+
}
|
|
36
|
+
declare const FunnelChart: React.ForwardRefExoticComponent<FunnelChartProps & React.RefAttributes<SVGSVGElement>>;
|
|
37
|
+
export { FunnelChart };
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { useThemeProps } from '@mui/material/styles';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { ChartsOverlay } from '@mui/x-charts/ChartsOverlay';
|
|
8
|
+
import { ChartsTooltip } from '@mui/x-charts/ChartsTooltip';
|
|
9
|
+
import { ChartsWrapper } from '@mui/x-charts/internals';
|
|
10
|
+
import { ChartsLegend } from '@mui/x-charts/ChartsLegend';
|
|
11
|
+
import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
|
|
12
|
+
import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
13
|
+
import { ChartsAxisHighlight } from '@mui/x-charts/ChartsAxisHighlight';
|
|
14
|
+
import { ChartsAxis } from '@mui/x-charts/ChartsAxis';
|
|
15
|
+
import { FunnelPlot } from "./FunnelPlot.js";
|
|
16
|
+
import { useFunnelChartProps } from "./useFunnelChartProps.js";
|
|
17
|
+
import { seriesConfig as funnelSeriesConfig } from "./seriesConfig/index.js";
|
|
18
|
+
import { useChartContainerProProps } from "../ChartContainerPro/useChartContainerProProps.js";
|
|
19
|
+
import { ChartDataProviderPro } from "../ChartDataProviderPro/index.js";
|
|
20
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
const seriesConfig = {
|
|
22
|
+
funnel: funnelSeriesConfig
|
|
23
|
+
};
|
|
24
|
+
const FunnelChart = /*#__PURE__*/React.forwardRef(function FunnelChart(props, ref) {
|
|
25
|
+
const themedProps = useThemeProps({
|
|
26
|
+
props,
|
|
27
|
+
name: 'MuiFunnelChart'
|
|
28
|
+
});
|
|
29
|
+
const {
|
|
30
|
+
chartContainerProps,
|
|
31
|
+
funnelPlotProps,
|
|
32
|
+
overlayProps,
|
|
33
|
+
legendProps,
|
|
34
|
+
clipPathGroupProps,
|
|
35
|
+
chartsAxisProps,
|
|
36
|
+
clipPathProps,
|
|
37
|
+
chartsWrapperProps,
|
|
38
|
+
axisHighlightProps,
|
|
39
|
+
children
|
|
40
|
+
} = useFunnelChartProps(themedProps);
|
|
41
|
+
const {
|
|
42
|
+
chartDataProviderProProps,
|
|
43
|
+
chartsSurfaceProps
|
|
44
|
+
} = useChartContainerProProps(chartContainerProps, ref);
|
|
45
|
+
const Tooltip = themedProps.slots?.tooltip ?? ChartsTooltip;
|
|
46
|
+
return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
|
|
47
|
+
seriesConfig: seriesConfig,
|
|
48
|
+
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
49
|
+
children: [!themedProps.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
50
|
+
children: [/*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
|
|
51
|
+
children: [/*#__PURE__*/_jsx(FunnelPlot, _extends({}, funnelPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
|
|
52
|
+
})), !themedProps.loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, themedProps.slotProps?.tooltip, {
|
|
53
|
+
trigger: "item"
|
|
54
|
+
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
55
|
+
}))]
|
|
56
|
+
}))
|
|
57
|
+
}));
|
|
58
|
+
});
|
|
59
|
+
process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
60
|
+
// ----------------------------- Warning --------------------------------
|
|
61
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
62
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
63
|
+
// ----------------------------------------------------------------------
|
|
64
|
+
apiRef: PropTypes.shape({
|
|
65
|
+
current: PropTypes.shape({
|
|
66
|
+
setZoomData: PropTypes.func.isRequired
|
|
67
|
+
})
|
|
68
|
+
}),
|
|
69
|
+
/**
|
|
70
|
+
* The configuration of axes highlight.
|
|
71
|
+
* Default is set to 'band' in the bar direction.
|
|
72
|
+
* Depends on `layout` prop.
|
|
73
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
74
|
+
*/
|
|
75
|
+
axisHighlight: PropTypes.shape({
|
|
76
|
+
x: PropTypes.oneOf(['band', 'line', 'none']),
|
|
77
|
+
y: PropTypes.oneOf(['band', 'line', 'none'])
|
|
78
|
+
}),
|
|
79
|
+
/**
|
|
80
|
+
* The configuration of the category axis.
|
|
81
|
+
*
|
|
82
|
+
* @default { position: 'none' }
|
|
83
|
+
*/
|
|
84
|
+
categoryAxis: PropTypes.shape({
|
|
85
|
+
categories: PropTypes.arrayOf(PropTypes.string),
|
|
86
|
+
disableLine: PropTypes.bool,
|
|
87
|
+
disableTicks: PropTypes.bool,
|
|
88
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
89
|
+
position: PropTypes.oneOf(['bottom', 'left', 'none', 'right', 'top']),
|
|
90
|
+
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
91
|
+
size: PropTypes.number,
|
|
92
|
+
tickLabelStyle: PropTypes.object,
|
|
93
|
+
tickSize: PropTypes.number
|
|
94
|
+
}),
|
|
95
|
+
children: PropTypes.node,
|
|
96
|
+
className: PropTypes.string,
|
|
97
|
+
/**
|
|
98
|
+
* Color palette used to colorize multiple series.
|
|
99
|
+
* @default rainbowSurgePalette
|
|
100
|
+
*/
|
|
101
|
+
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
102
|
+
desc: PropTypes.string,
|
|
103
|
+
/**
|
|
104
|
+
* If `true`, the charts will not listen to the mouse move event.
|
|
105
|
+
* It might break interactive features, but will improve performance.
|
|
106
|
+
* @default false
|
|
107
|
+
*/
|
|
108
|
+
disableAxisListener: PropTypes.bool,
|
|
109
|
+
/**
|
|
110
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
111
|
+
*/
|
|
112
|
+
height: PropTypes.number,
|
|
113
|
+
/**
|
|
114
|
+
* If `true`, the legend is not rendered.
|
|
115
|
+
* @default false
|
|
116
|
+
*/
|
|
117
|
+
hideLegend: PropTypes.bool,
|
|
118
|
+
/**
|
|
119
|
+
* The highlighted item.
|
|
120
|
+
* Used when the highlight is controlled.
|
|
121
|
+
*/
|
|
122
|
+
highlightedItem: PropTypes.shape({
|
|
123
|
+
dataIndex: PropTypes.number,
|
|
124
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
|
|
125
|
+
}),
|
|
126
|
+
/**
|
|
127
|
+
* This prop is used to help implement the accessibility logic.
|
|
128
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
129
|
+
*/
|
|
130
|
+
id: PropTypes.string,
|
|
131
|
+
/**
|
|
132
|
+
* The list of zoom data related to each axis.
|
|
133
|
+
* Used to initialize the zoom in a specific configuration without controlling it.
|
|
134
|
+
*/
|
|
135
|
+
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
136
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
137
|
+
end: PropTypes.number.isRequired,
|
|
138
|
+
start: PropTypes.number.isRequired
|
|
139
|
+
})),
|
|
140
|
+
/**
|
|
141
|
+
* If `true`, a loading overlay is displayed.
|
|
142
|
+
* @default false
|
|
143
|
+
*/
|
|
144
|
+
loading: PropTypes.bool,
|
|
145
|
+
/**
|
|
146
|
+
* The margin between the SVG and the drawing area.
|
|
147
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
148
|
+
*
|
|
149
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
150
|
+
*/
|
|
151
|
+
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
152
|
+
bottom: PropTypes.number,
|
|
153
|
+
left: PropTypes.number,
|
|
154
|
+
right: PropTypes.number,
|
|
155
|
+
top: PropTypes.number
|
|
156
|
+
})]),
|
|
157
|
+
/**
|
|
158
|
+
* The function called for onClick events.
|
|
159
|
+
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
160
|
+
* @param {MouseEvent} event The mouse event recorded on the `<svg/>` element.
|
|
161
|
+
* @param {null | AxisData} data The data about the clicked axis and items associated with it.
|
|
162
|
+
*/
|
|
163
|
+
onAxisClick: PropTypes.func,
|
|
164
|
+
/**
|
|
165
|
+
* The callback fired when the highlighted item changes.
|
|
166
|
+
*
|
|
167
|
+
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
168
|
+
*/
|
|
169
|
+
onHighlightChange: PropTypes.func,
|
|
170
|
+
/**
|
|
171
|
+
* Callback fired when a funnel item is clicked.
|
|
172
|
+
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
173
|
+
* @param {FunnelItemIdentifier} funnelItemIdentifier The funnel item identifier.
|
|
174
|
+
*/
|
|
175
|
+
onItemClick: PropTypes.func,
|
|
176
|
+
/**
|
|
177
|
+
* The series to display in the funnel chart.
|
|
178
|
+
* An array of [[FunnelSeriesType]] objects.
|
|
179
|
+
*/
|
|
180
|
+
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
181
|
+
/**
|
|
182
|
+
* If `true`, animations are skipped.
|
|
183
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
184
|
+
*/
|
|
185
|
+
skipAnimation: PropTypes.bool,
|
|
186
|
+
/**
|
|
187
|
+
* The props used for each component slot.
|
|
188
|
+
* @default {}
|
|
189
|
+
*/
|
|
190
|
+
slotProps: PropTypes.object,
|
|
191
|
+
/**
|
|
192
|
+
* Overridable component slots.
|
|
193
|
+
* @default {}
|
|
194
|
+
*/
|
|
195
|
+
slots: PropTypes.object,
|
|
196
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
197
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
198
|
+
title: PropTypes.string,
|
|
199
|
+
/**
|
|
200
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
201
|
+
*/
|
|
202
|
+
width: PropTypes.number,
|
|
203
|
+
/**
|
|
204
|
+
* The list of zoom data related to each axis.
|
|
205
|
+
*/
|
|
206
|
+
zoomData: PropTypes.arrayOf(PropTypes.shape({
|
|
207
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
208
|
+
end: PropTypes.number.isRequired,
|
|
209
|
+
start: PropTypes.number.isRequired
|
|
210
|
+
}))
|
|
211
|
+
} : void 0;
|
|
212
|
+
export { FunnelChart };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FunnelItemIdentifier } from "./funnel.types.js";
|
|
3
|
+
import { FunnelPlotSlotExtension } from "./funnelPlotSlots.types.js";
|
|
4
|
+
export interface FunnelPlotProps extends FunnelPlotSlotExtension {
|
|
5
|
+
/**
|
|
6
|
+
* Callback fired when a funnel item is clicked.
|
|
7
|
+
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
8
|
+
* @param {FunnelItemIdentifier} funnelItemIdentifier The funnel item identifier.
|
|
9
|
+
*/
|
|
10
|
+
onItemClick?: (event: React.MouseEvent<SVGElement, MouseEvent>, funnelItemIdentifier: FunnelItemIdentifier) => void;
|
|
11
|
+
}
|
|
12
|
+
declare function FunnelPlot(props: FunnelPlotProps): React.JSX.Element;
|
|
13
|
+
declare namespace FunnelPlot {
|
|
14
|
+
var propTypes: any;
|
|
15
|
+
}
|
|
16
|
+
export { FunnelPlot };
|