@mui/x-charts 9.7.0 → 9.9.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.d.mts +1 -1
- package/BarChart/AnimatedBarElement.d.ts +1 -1
- package/BarChart/BarClipPath.d.mts +1 -1
- package/BarChart/BarClipPath.d.ts +1 -1
- package/BarChart/BarElement.d.mts +1 -1
- package/BarChart/BarElement.d.ts +1 -1
- package/BarChart/BarLabel/BarLabelItem.d.mts +1 -1
- package/BarChart/BarLabel/BarLabelItem.d.ts +1 -1
- package/BarChart/BarLabel/BarLabelPlot.d.mts +2 -1
- package/BarChart/BarLabel/BarLabelPlot.d.ts +2 -1
- package/BarChart/BatchBarPlot/BarGroup.d.mts +1 -1
- package/BarChart/BatchBarPlot/BarGroup.d.ts +1 -1
- package/BarChart/BatchBarPlot/BatchBarPlot.d.mts +2 -1
- package/BarChart/BatchBarPlot/BatchBarPlot.d.ts +2 -1
- package/BarChart/FocusedBar.d.mts +1 -1
- package/BarChart/FocusedBar.d.ts +1 -1
- package/BarChart/IndividualBarPlot.d.mts +2 -1
- package/BarChart/IndividualBarPlot.d.ts +2 -1
- package/BarChart/seriesConfig/bar/tooltipPosition.d.mts +2 -3
- package/BarChart/seriesConfig/bar/tooltipPosition.d.ts +2 -3
- package/BarChart/seriesConfig/bar/tooltipPosition.js +19 -15
- package/BarChart/seriesConfig/bar/tooltipPosition.mjs +18 -14
- package/BarChart/seriesConfig/index.js +2 -2
- package/BarChart/seriesConfig/index.mjs +2 -2
- package/BarChart/useBarPlotData.d.mts +5 -1
- package/BarChart/useBarPlotData.d.ts +5 -1
- package/BarChart/useBarPlotData.js +102 -25
- package/BarChart/useBarPlotData.mjs +102 -26
- package/CHANGELOG.md +249 -1
- package/ChartsAxis/ChartsAxis.d.mts +2 -1
- package/ChartsAxis/ChartsAxis.d.ts +2 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.d.mts +2 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +2 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.d.mts +2 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +2 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +22 -5
- package/ChartsAxisHighlight/ChartsXAxisHighlight.mjs +23 -6
- package/ChartsAxisHighlight/ChartsYAxisHighlight.d.mts +2 -1
- package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +2 -1
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +22 -5
- package/ChartsAxisHighlight/ChartsYAxisHighlight.mjs +23 -6
- package/ChartsAxisHighlight/getSampledBandHighlight.d.mts +27 -0
- package/ChartsAxisHighlight/getSampledBandHighlight.d.ts +27 -0
- package/ChartsAxisHighlight/getSampledBandHighlight.js +35 -0
- package/ChartsAxisHighlight/getSampledBandHighlight.mjs +29 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.mts +1 -1
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.ts +1 -1
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.d.mts +2 -1
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.d.ts +2 -1
- package/ChartsBrushOverlay/ChartsBrushOverlay.d.mts +2 -1
- package/ChartsBrushOverlay/ChartsBrushOverlay.d.ts +2 -1
- package/ChartsClipPath/ChartsClipPath.d.mts +1 -1
- package/ChartsClipPath/ChartsClipPath.d.ts +1 -1
- package/ChartsDataProvider/ChartsDataProvider.d.mts +1 -1
- package/ChartsDataProvider/ChartsDataProvider.d.ts +1 -1
- package/ChartsGrid/ChartsGrid.d.mts +1 -1
- package/ChartsGrid/ChartsGrid.d.ts +1 -1
- package/ChartsGrid/ChartsHorizontalGrid.d.mts +2 -1
- package/ChartsGrid/ChartsHorizontalGrid.d.ts +2 -1
- package/ChartsGrid/ChartsVerticalGrid.d.mts +2 -1
- package/ChartsGrid/ChartsVerticalGrid.d.ts +2 -1
- package/ChartsLocalizationProvider/ChartsLocalizationProvider.d.mts +1 -1
- package/ChartsLocalizationProvider/ChartsLocalizationProvider.d.ts +1 -1
- package/ChartsOverlay/ChartsLoadingOverlay.d.mts +1 -1
- package/ChartsOverlay/ChartsLoadingOverlay.d.ts +1 -1
- package/ChartsOverlay/ChartsNoDataOverlay.d.mts +1 -1
- package/ChartsOverlay/ChartsNoDataOverlay.d.ts +1 -1
- package/ChartsOverlay/ChartsOverlay.d.mts +1 -1
- package/ChartsOverlay/ChartsOverlay.d.ts +1 -1
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.d.mts +2 -1
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.d.ts +2 -1
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.d.mts +2 -1
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.d.ts +2 -1
- package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.d.mts +2 -1
- package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.d.ts +2 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.mts +1 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.ts +1 -1
- package/ChartsRadialGrid/ChartsRadialGrid.d.mts +1 -1
- package/ChartsRadialGrid/ChartsRadialGrid.d.ts +1 -1
- package/ChartsRadialGrid/ChartsRadiusGrid.d.mts +2 -1
- package/ChartsRadialGrid/ChartsRadiusGrid.d.ts +2 -1
- package/ChartsRadialGrid/ChartsRotationGrid.d.mts +2 -1
- package/ChartsRadialGrid/ChartsRotationGrid.d.ts +2 -1
- package/ChartsRadiusAxis/ChartsRadiusAxis.d.mts +1 -1
- package/ChartsRadiusAxis/ChartsRadiusAxis.d.ts +1 -1
- package/ChartsReferenceLine/ChartsReferenceLine.d.mts +1 -1
- package/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.d.mts +1 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.d.mts +1 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
- package/ChartsRotationAxis/ChartsRotationAxis.d.mts +1 -1
- package/ChartsRotationAxis/ChartsRotationAxis.d.ts +1 -1
- package/ChartsText/ChartsText.d.mts +1 -1
- package/ChartsText/ChartsText.d.ts +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.d.mts +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -1
- package/ChartsTooltip/ChartsItemTooltipContent.d.mts +2 -1
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +2 -1
- package/ChartsTooltip/ChartsTooltip.d.mts +1 -1
- package/ChartsTooltip/ChartsTooltip.d.ts +1 -1
- package/ChartsTooltip/ChartsTooltipContainer.d.mts +1 -1
- package/ChartsTooltip/ChartsTooltipContainer.d.ts +1 -1
- package/ChartsTooltip/ChartsTooltipContainer.js +10 -3
- package/ChartsTooltip/ChartsTooltipContainer.mjs +11 -4
- package/ChartsXAxis/ChartsGroupedXAxisTicks.d.mts +2 -1
- package/ChartsXAxis/ChartsGroupedXAxisTicks.d.ts +2 -1
- package/ChartsXAxis/ChartsGroupedXAxisTicks.js +3 -13
- package/ChartsXAxis/ChartsGroupedXAxisTicks.mjs +2 -12
- package/ChartsXAxis/ChartsSingleXAxisTicks.d.mts +2 -1
- package/ChartsXAxis/ChartsSingleXAxisTicks.d.ts +2 -1
- package/ChartsXAxis/ChartsXAxis.d.mts +1 -1
- package/ChartsXAxis/ChartsXAxis.d.ts +1 -1
- package/ChartsXAxis/ChartsXAxisImpl.d.mts +2 -1
- package/ChartsXAxis/ChartsXAxisImpl.d.ts +2 -1
- package/ChartsYAxis/ChartsGroupedYAxisTicks.d.mts +2 -1
- package/ChartsYAxis/ChartsGroupedYAxisTicks.d.ts +2 -1
- package/ChartsYAxis/ChartsGroupedYAxisTicks.js +4 -16
- package/ChartsYAxis/ChartsGroupedYAxisTicks.mjs +3 -13
- package/ChartsYAxis/ChartsSingleYAxisTicks.d.mts +2 -1
- package/ChartsYAxis/ChartsSingleYAxisTicks.d.ts +2 -1
- package/ChartsYAxis/ChartsYAxis.d.mts +1 -1
- package/ChartsYAxis/ChartsYAxis.d.ts +1 -1
- package/ChartsYAxis/ChartsYAxisImpl.d.mts +2 -1
- package/ChartsYAxis/ChartsYAxisImpl.d.ts +2 -1
- package/Gauge/GaugeProvider.d.mts +1 -1
- package/Gauge/GaugeProvider.d.ts +1 -1
- package/Gauge/GaugeReferenceArc.d.mts +1 -1
- package/Gauge/GaugeReferenceArc.d.ts +1 -1
- package/Gauge/GaugeValueArc.d.mts +1 -1
- package/Gauge/GaugeValueArc.d.ts +1 -1
- package/Gauge/GaugeValueText.d.mts +1 -1
- package/Gauge/GaugeValueText.d.ts +1 -1
- package/LineChart/AnimatedArea.d.mts +1 -1
- package/LineChart/AnimatedArea.d.ts +1 -1
- package/LineChart/AppearingMask.d.mts +1 -1
- package/LineChart/AppearingMask.d.ts +1 -1
- package/LineChart/AreaElement.d.mts +1 -1
- package/LineChart/AreaElement.d.ts +1 -1
- package/LineChart/AreaPlot.d.mts +1 -1
- package/LineChart/AreaPlot.d.ts +1 -1
- package/LineChart/CircleMarkElement.d.mts +1 -1
- package/LineChart/CircleMarkElement.d.ts +1 -1
- package/LineChart/FocusedLineMark.d.mts +1 -1
- package/LineChart/FocusedLineMark.d.ts +1 -1
- package/LineChart/LineElement.d.mts +1 -1
- package/LineChart/LineElement.d.ts +1 -1
- package/LineChart/LineHighlightElement.d.mts +1 -1
- package/LineChart/LineHighlightElement.d.ts +1 -1
- package/LineChart/LineHighlightPlot.d.mts +1 -1
- package/LineChart/LineHighlightPlot.d.ts +1 -1
- package/LineChart/LinePlot.d.mts +1 -1
- package/LineChart/LinePlot.d.ts +1 -1
- package/LineChart/LinePlot.js +3 -2
- package/LineChart/LinePlot.mjs +3 -2
- package/LineChart/MarkElement.d.mts +1 -1
- package/LineChart/MarkElement.d.ts +1 -1
- package/LineChart/MarkPlot.d.mts +1 -1
- package/LineChart/MarkPlot.d.ts +1 -1
- package/LineChart/seriesConfig/index.js +2 -2
- package/LineChart/seriesConfig/index.mjs +2 -2
- package/LineChart/seriesConfig/tooltipPosition.d.mts +2 -3
- package/LineChart/seriesConfig/tooltipPosition.d.ts +2 -3
- package/LineChart/seriesConfig/tooltipPosition.js +14 -14
- package/LineChart/seriesConfig/tooltipPosition.mjs +13 -13
- package/LineChart/useLinePlotData.d.mts +13 -1
- package/LineChart/useLinePlotData.d.ts +13 -1
- package/LineChart/useLinePlotData.js +90 -33
- package/LineChart/useLinePlotData.mjs +92 -34
- package/PieChart/FocusedPieArc.d.mts +1 -1
- package/PieChart/FocusedPieArc.d.ts +1 -1
- package/PieChart/PieArcLabelPlot.d.mts +1 -1
- package/PieChart/PieArcLabelPlot.d.ts +1 -1
- package/PieChart/PieArcPlot.d.mts +1 -1
- package/PieChart/PieArcPlot.d.ts +1 -1
- package/PieChart/PiePlot.d.mts +1 -1
- package/PieChart/PiePlot.d.ts +1 -1
- package/PieChart/seriesConfig/index.js +2 -2
- package/PieChart/seriesConfig/index.mjs +2 -2
- package/PieChart/seriesConfig/tooltipPosition.d.mts +2 -3
- package/PieChart/seriesConfig/tooltipPosition.d.ts +2 -3
- package/PieChart/seriesConfig/tooltipPosition.js +7 -11
- package/PieChart/seriesConfig/tooltipPosition.mjs +6 -10
- package/RadarChart/FocusedRadarMark.d.mts +1 -1
- package/RadarChart/FocusedRadarMark.d.ts +1 -1
- package/RadarChart/RadarAxis/RadarAxis.d.mts +1 -1
- package/RadarChart/RadarAxis/RadarAxis.d.ts +1 -1
- package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.d.mts +1 -1
- package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.d.ts +1 -1
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.mts +2 -1
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +2 -1
- package/RadarChart/RadarGrid/CircularRadarGrid.d.mts +2 -1
- package/RadarChart/RadarGrid/CircularRadarGrid.d.ts +2 -1
- package/RadarChart/RadarGrid/CircularRadarStripes.d.mts +2 -1
- package/RadarChart/RadarGrid/CircularRadarStripes.d.ts +2 -1
- package/RadarChart/RadarGrid/RadarGrid.d.mts +2 -1
- package/RadarChart/RadarGrid/RadarGrid.d.ts +2 -1
- package/RadarChart/RadarGrid/SharpRadarGrid.d.mts +2 -1
- package/RadarChart/RadarGrid/SharpRadarGrid.d.ts +2 -1
- package/RadarChart/RadarGrid/SharpRadarStripes.d.mts +2 -1
- package/RadarChart/RadarGrid/SharpRadarStripes.d.ts +2 -1
- package/RadarChart/RadarMetricLabels/RadarMetricLabels.d.mts +2 -1
- package/RadarChart/RadarMetricLabels/RadarMetricLabels.d.ts +2 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.mts +2 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.ts +2 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.mts +2 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.ts +2 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.mts +1 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.ts +1 -1
- package/RadarChart/seriesConfig/index.js +2 -2
- package/RadarChart/seriesConfig/index.mjs +2 -2
- package/RadarChart/seriesConfig/tooltipPosition.d.mts +2 -3
- package/RadarChart/seriesConfig/tooltipPosition.d.ts +2 -3
- package/RadarChart/seriesConfig/tooltipPosition.js +9 -16
- package/RadarChart/seriesConfig/tooltipPosition.mjs +8 -15
- package/ScatterChart/BatchScatter.d.mts +2 -1
- package/ScatterChart/BatchScatter.d.ts +2 -1
- package/ScatterChart/FocusedScatterMark.d.mts +1 -1
- package/ScatterChart/FocusedScatterMark.d.ts +1 -1
- package/ScatterChart/HighlightedScatterMark.d.mts +1 -1
- package/ScatterChart/HighlightedScatterMark.d.ts +1 -1
- package/ScatterChart/Scatter.d.mts +1 -1
- package/ScatterChart/Scatter.d.ts +1 -1
- package/ScatterChart/ScatterMarker.d.mts +1 -1
- package/ScatterChart/ScatterMarker.d.ts +1 -1
- package/ScatterChart/ScatterPlot.d.mts +1 -1
- package/ScatterChart/ScatterPlot.d.ts +1 -1
- package/ScatterChart/async/ScatterAsync.d.mts +2 -1
- package/ScatterChart/async/ScatterAsync.d.ts +2 -1
- package/ScatterChart/async/ScatterAsyncBatch.d.mts +1 -1
- package/ScatterChart/async/ScatterAsyncBatch.d.ts +1 -1
- package/ScatterChart/seriesConfig/index.js +2 -2
- package/ScatterChart/seriesConfig/index.mjs +2 -2
- package/ScatterChart/seriesConfig/tooltipPosition.d.mts +2 -3
- package/ScatterChart/seriesConfig/tooltipPosition.d.ts +2 -3
- package/ScatterChart/seriesConfig/tooltipPosition.js +13 -13
- package/ScatterChart/seriesConfig/tooltipPosition.mjs +12 -12
- package/context/ChartsProvider/ChartsProvider.d.mts +1 -1
- package/context/ChartsProvider/ChartsProvider.d.ts +1 -1
- package/context/ChartsSlotsContext.d.mts +1 -1
- package/context/ChartsSlotsContext.d.ts +1 -1
- package/hooks/index.d.mts +2 -1
- package/hooks/index.d.ts +2 -1
- package/hooks/index.js +10 -2
- package/hooks/index.mjs +2 -1
- package/hooks/usePolarGeometry.d.mts +51 -0
- package/hooks/usePolarGeometry.d.ts +51 -0
- package/hooks/usePolarGeometry.js +47 -0
- package/hooks/usePolarGeometry.mjs +41 -0
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/animation/animation.d.mts +1 -1
- package/internals/animation/animation.d.ts +1 -1
- package/internals/commonNextFocusItem.d.mts +15 -5
- package/internals/commonNextFocusItem.d.ts +15 -5
- package/internals/commonNextFocusItem.js +6 -0
- package/internals/commonNextFocusItem.mjs +7 -0
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.d.mts +2 -1
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.d.ts +2 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.mts +2 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +2 -1
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.mts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.mts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.ts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.mts +2 -1
- package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +2 -1
- package/internals/createCommonKeyboardFocusHandler.d.mts +5 -1
- package/internals/createCommonKeyboardFocusHandler.d.ts +5 -1
- package/internals/createGetBarDimensions.d.mts +14 -1
- package/internals/createGetBarDimensions.d.ts +14 -1
- package/internals/createGetBarDimensions.js +45 -0
- package/internals/createGetBarDimensions.mjs +45 -0
- package/internals/geometry.js +1 -1
- package/internals/geometry.mjs +1 -1
- package/internals/getGroupingConfig.d.mts +6 -0
- package/internals/getGroupingConfig.d.ts +6 -0
- package/internals/getGroupingConfig.js +20 -0
- package/internals/getGroupingConfig.mjs +12 -0
- package/internals/index.d.mts +1 -2
- package/internals/index.d.ts +1 -2
- package/internals/index.js +12 -8
- package/internals/index.mjs +1 -2
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.mts +2 -1
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/colorProcessor.types.d.mts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/colorProcessor.types.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.d.mts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.js +4 -4
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.mjs +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.mts +13 -2
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.ts +13 -2
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionSelector.types.d.mts +18 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionSelector.types.d.ts +18 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.mts +2 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +12 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.mjs +1 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.d.mts +26 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.d.ts +26 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.js +89 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.mjs +81 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.types.d.mts +93 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.types.d.ts +93 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.mts +5 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +5 -0
- package/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.mts +3 -8
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +3 -8
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.js +2 -57
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.mjs +2 -57
- package/internals/shallowEqual.d.mts +1 -1
- package/internals/shallowEqual.d.ts +1 -1
- package/internals/shallowEqual.js +1 -1
- package/internals/shallowEqual.mjs +1 -1
- package/models/seriesType/config.d.mts +6 -2
- package/models/seriesType/config.d.ts +6 -2
- package/package.json +6 -6
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.mts +0 -34
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.ts +0 -34
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.d.mts +0 -49
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.d.ts +0 -49
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.js +0 -124
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.mjs +0 -117
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.d.mts +0 -64
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.d.ts +0 -64
- /package/internals/plugins/corePlugins/useChartSeriesConfig/types/{tooltipItemPositionGetter.types.js → tooltipItemPositionSelector.types.js} +0 -0
- /package/internals/plugins/corePlugins/useChartSeriesConfig/types/{tooltipItemPositionGetter.types.mjs → tooltipItemPositionSelector.types.mjs} +0 -0
- /package/internals/plugins/featurePlugins/{useGeoProjection/useGeoProjection.types.js → useChartCartesianAxis/sampling.types.js} +0 -0
- /package/internals/plugins/featurePlugins/{useGeoProjection/useGeoProjection.types.mjs → useChartCartesianAxis/sampling.types.mjs} +0 -0
package/hooks/index.d.ts
CHANGED
|
@@ -24,4 +24,5 @@ export * from "./useFocusedItem.js";
|
|
|
24
24
|
export { useXAxisCoordinates, useYAxisCoordinates, type AxisCoordinates } from "./useAxisCoordinates.js";
|
|
25
25
|
export * from "./useAxisTicks.js";
|
|
26
26
|
export { type TickItem } from "./useTicks.js";
|
|
27
|
-
export * from "./getValueToPositionMapper.js";
|
|
27
|
+
export * from "./getValueToPositionMapper.js";
|
|
28
|
+
export { usePolarGeometry } from "./usePolarGeometry.js";
|
package/hooks/index.js
CHANGED
|
@@ -9,7 +9,8 @@ var _exportNames = {
|
|
|
9
9
|
useChartGradientId: true,
|
|
10
10
|
useChartGradientIdObjectBound: true,
|
|
11
11
|
useXAxisCoordinates: true,
|
|
12
|
-
useYAxisCoordinates: true
|
|
12
|
+
useYAxisCoordinates: true,
|
|
13
|
+
usePolarGeometry: true
|
|
13
14
|
};
|
|
14
15
|
Object.defineProperty(exports, "useChartGradientId", {
|
|
15
16
|
enumerable: true,
|
|
@@ -35,6 +36,12 @@ Object.defineProperty(exports, "usePieSeriesContext", {
|
|
|
35
36
|
return _usePieSeries.usePieSeriesContext;
|
|
36
37
|
}
|
|
37
38
|
});
|
|
39
|
+
Object.defineProperty(exports, "usePolarGeometry", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () {
|
|
42
|
+
return _usePolarGeometry.usePolarGeometry;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
38
45
|
Object.defineProperty(exports, "useXAxisCoordinates", {
|
|
39
46
|
enumerable: true,
|
|
40
47
|
get: function () {
|
|
@@ -325,4 +332,5 @@ Object.keys(_getValueToPositionMapper).forEach(function (key) {
|
|
|
325
332
|
return _getValueToPositionMapper[key];
|
|
326
333
|
}
|
|
327
334
|
});
|
|
328
|
-
});
|
|
335
|
+
});
|
|
336
|
+
var _usePolarGeometry = require("./usePolarGeometry");
|
package/hooks/index.mjs
CHANGED
|
@@ -23,4 +23,5 @@ export * from "./useBrush.mjs";
|
|
|
23
23
|
export * from "./useFocusedItem.mjs";
|
|
24
24
|
export { useXAxisCoordinates, useYAxisCoordinates } from "./useAxisCoordinates.mjs";
|
|
25
25
|
export * from "./useAxisTicks.mjs";
|
|
26
|
-
export * from "./getValueToPositionMapper.mjs";
|
|
26
|
+
export * from "./getValueToPositionMapper.mjs";
|
|
27
|
+
export { usePolarGeometry } from "./usePolarGeometry.mjs";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { AxisScaleConfig, ScaleName } from "../models/axis.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Provides access to the geometry of a polar chart.
|
|
4
|
+
*
|
|
5
|
+
* It can be used to position custom elements and convert between polar and Cartesian coordinates.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* const geo = usePolarGeometry();
|
|
10
|
+
*
|
|
11
|
+
* const [x, y] = geo.point(100, Math.PI / 2);
|
|
12
|
+
*
|
|
13
|
+
* return <circle cx={geo.cx + x} cy={geo.cy + y} r={4} />
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @returns The polar geometry helpers, or `null` if the chart scales are not ready.
|
|
17
|
+
*/
|
|
18
|
+
export declare function usePolarGeometry<AngleScale extends ScaleName = ScaleName, RadiusScale extends ScaleName = ScaleName>(): PolarGeometry<AngleScale, RadiusScale> | null;
|
|
19
|
+
export interface PolarGeometry<AngleScale extends ScaleName = ScaleName, RadiusScale extends ScaleName = ScaleName> {
|
|
20
|
+
/**
|
|
21
|
+
* The X coordinate of the chart center within the SVG.
|
|
22
|
+
*/
|
|
23
|
+
cx: number;
|
|
24
|
+
/**
|
|
25
|
+
* The Y coordinate of the chart center within the SVG.
|
|
26
|
+
*/
|
|
27
|
+
cy: number;
|
|
28
|
+
/**
|
|
29
|
+
* The scale that maps rotation axis values to angles in radians.
|
|
30
|
+
*/
|
|
31
|
+
angleScale: AxisScaleConfig[AngleScale]['scale'];
|
|
32
|
+
/**
|
|
33
|
+
* The scale that maps data values to radii (distance from the chart center).
|
|
34
|
+
*/
|
|
35
|
+
radiusScale: AxisScaleConfig[RadiusScale]['scale'];
|
|
36
|
+
/**
|
|
37
|
+
* Converts polar coordinates to Cartesian offsets relative to the chart center.
|
|
38
|
+
* @param {number} radius - Distance from the center.
|
|
39
|
+
* @param {number} angle - Angle in radians, measured clockwise from the top (12 o'clock).
|
|
40
|
+
* @returns {[number, number]} `[x, y]` offset from `[cx, cy]`.
|
|
41
|
+
*/
|
|
42
|
+
point: (radius: number, angle: number) => [number, number];
|
|
43
|
+
/**
|
|
44
|
+
* Converts Cartesian offsets (relative to the chart center) back to polar coordinates.
|
|
45
|
+
* The inverse of `point`.
|
|
46
|
+
* @param {number} x - Horizontal offset from `cx`.
|
|
47
|
+
* @param {number} y - Vertical offset from `cy`.
|
|
48
|
+
* @returns {[number, number]} `[radius, angle]` where angle is in radians within `[-π, π]`.
|
|
49
|
+
*/
|
|
50
|
+
pointInverse: (x: number, y: number) => [number, number];
|
|
51
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { AxisScaleConfig, ScaleName } from "../models/axis.js";
|
|
2
|
+
/**
|
|
3
|
+
* Provides access to the geometry of a polar chart.
|
|
4
|
+
*
|
|
5
|
+
* It can be used to position custom elements and convert between polar and Cartesian coordinates.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* const geo = usePolarGeometry();
|
|
10
|
+
*
|
|
11
|
+
* const [x, y] = geo.point(100, Math.PI / 2);
|
|
12
|
+
*
|
|
13
|
+
* return <circle cx={geo.cx + x} cy={geo.cy + y} r={4} />
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @returns The polar geometry helpers, or `null` if the chart scales are not ready.
|
|
17
|
+
*/
|
|
18
|
+
export declare function usePolarGeometry<AngleScale extends ScaleName = ScaleName, RadiusScale extends ScaleName = ScaleName>(): PolarGeometry<AngleScale, RadiusScale> | null;
|
|
19
|
+
export interface PolarGeometry<AngleScale extends ScaleName = ScaleName, RadiusScale extends ScaleName = ScaleName> {
|
|
20
|
+
/**
|
|
21
|
+
* The X coordinate of the chart center within the SVG.
|
|
22
|
+
*/
|
|
23
|
+
cx: number;
|
|
24
|
+
/**
|
|
25
|
+
* The Y coordinate of the chart center within the SVG.
|
|
26
|
+
*/
|
|
27
|
+
cy: number;
|
|
28
|
+
/**
|
|
29
|
+
* The scale that maps rotation axis values to angles in radians.
|
|
30
|
+
*/
|
|
31
|
+
angleScale: AxisScaleConfig[AngleScale]['scale'];
|
|
32
|
+
/**
|
|
33
|
+
* The scale that maps data values to radii (distance from the chart center).
|
|
34
|
+
*/
|
|
35
|
+
radiusScale: AxisScaleConfig[RadiusScale]['scale'];
|
|
36
|
+
/**
|
|
37
|
+
* Converts polar coordinates to Cartesian offsets relative to the chart center.
|
|
38
|
+
* @param {number} radius - Distance from the center.
|
|
39
|
+
* @param {number} angle - Angle in radians, measured clockwise from the top (12 o'clock).
|
|
40
|
+
* @returns {[number, number]} `[x, y]` offset from `[cx, cy]`.
|
|
41
|
+
*/
|
|
42
|
+
point: (radius: number, angle: number) => [number, number];
|
|
43
|
+
/**
|
|
44
|
+
* Converts Cartesian offsets (relative to the chart center) back to polar coordinates.
|
|
45
|
+
* The inverse of `point`.
|
|
46
|
+
* @param {number} x - Horizontal offset from `cx`.
|
|
47
|
+
* @param {number} y - Vertical offset from `cy`.
|
|
48
|
+
* @returns {[number, number]} `[radius, angle]` where angle is in radians within `[-π, π]`.
|
|
49
|
+
*/
|
|
50
|
+
pointInverse: (x: number, y: number) => [number, number];
|
|
51
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.usePolarGeometry = usePolarGeometry;
|
|
7
|
+
var _useDrawingArea = require("./useDrawingArea");
|
|
8
|
+
var _useAxis = require("./useAxis");
|
|
9
|
+
/**
|
|
10
|
+
* Provides access to the geometry of a polar chart.
|
|
11
|
+
*
|
|
12
|
+
* It can be used to position custom elements and convert between polar and Cartesian coordinates.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const geo = usePolarGeometry();
|
|
17
|
+
*
|
|
18
|
+
* const [x, y] = geo.point(100, Math.PI / 2);
|
|
19
|
+
*
|
|
20
|
+
* return <circle cx={geo.cx + x} cy={geo.cy + y} r={4} />
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @returns The polar geometry helpers, or `null` if the chart scales are not ready.
|
|
24
|
+
*/
|
|
25
|
+
function usePolarGeometry() {
|
|
26
|
+
const {
|
|
27
|
+
left,
|
|
28
|
+
top,
|
|
29
|
+
width,
|
|
30
|
+
height
|
|
31
|
+
} = (0, _useDrawingArea.useDrawingArea)();
|
|
32
|
+
const rotationAxis = (0, _useAxis.useRotationAxis)();
|
|
33
|
+
const radiusAxis = (0, _useAxis.useRadiusAxis)();
|
|
34
|
+
if (!rotationAxis || !radiusAxis) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
const angleScale = rotationAxis.scale;
|
|
38
|
+
const radiusScale = radiusAxis.scale;
|
|
39
|
+
return {
|
|
40
|
+
cx: left + width / 2,
|
|
41
|
+
cy: top + height / 2,
|
|
42
|
+
angleScale,
|
|
43
|
+
radiusScale,
|
|
44
|
+
point: (radius, angle) => [radius * Math.sin(angle), -radius * Math.cos(angle)],
|
|
45
|
+
pointInverse: (x, y) => [Math.sqrt(x * x + y * y), Math.atan2(x, -y)]
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useDrawingArea } from "./useDrawingArea.mjs";
|
|
2
|
+
import { useRotationAxis, useRadiusAxis } from "./useAxis.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Provides access to the geometry of a polar chart.
|
|
5
|
+
*
|
|
6
|
+
* It can be used to position custom elements and convert between polar and Cartesian coordinates.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* const geo = usePolarGeometry();
|
|
11
|
+
*
|
|
12
|
+
* const [x, y] = geo.point(100, Math.PI / 2);
|
|
13
|
+
*
|
|
14
|
+
* return <circle cx={geo.cx + x} cy={geo.cy + y} r={4} />
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @returns The polar geometry helpers, or `null` if the chart scales are not ready.
|
|
18
|
+
*/
|
|
19
|
+
export function usePolarGeometry() {
|
|
20
|
+
const {
|
|
21
|
+
left,
|
|
22
|
+
top,
|
|
23
|
+
width,
|
|
24
|
+
height
|
|
25
|
+
} = useDrawingArea();
|
|
26
|
+
const rotationAxis = useRotationAxis();
|
|
27
|
+
const radiusAxis = useRadiusAxis();
|
|
28
|
+
if (!rotationAxis || !radiusAxis) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
const angleScale = rotationAxis.scale;
|
|
32
|
+
const radiusScale = radiusAxis.scale;
|
|
33
|
+
return {
|
|
34
|
+
cx: left + width / 2,
|
|
35
|
+
cy: top + height / 2,
|
|
36
|
+
angleScale,
|
|
37
|
+
radiusScale,
|
|
38
|
+
point: (radius, angle) => [radius * Math.sin(angle), -radius * Math.cos(angle)],
|
|
39
|
+
pointInverse: (x, y) => [Math.sqrt(x * x + y * y), Math.atan2(x, -y)]
|
|
40
|
+
};
|
|
41
|
+
}
|
package/index.js
CHANGED
package/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const ANIMATION_DURATION_MS = 300;
|
|
2
2
|
export declare const ANIMATION_TIMING_FUNCTION = "cubic-bezier(0.66, 0, 0.34, 1)";
|
|
3
|
-
export declare const ANIMATION_TIMING_FUNCTION_JS:
|
|
3
|
+
export declare const ANIMATION_TIMING_FUNCTION_JS: (x: number) => number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const ANIMATION_DURATION_MS = 300;
|
|
2
2
|
export declare const ANIMATION_TIMING_FUNCTION = "cubic-bezier(0.66, 0, 0.34, 1)";
|
|
3
|
-
export declare const ANIMATION_TIMING_FUNCTION_JS:
|
|
3
|
+
export declare const ANIMATION_TIMING_FUNCTION_JS: (x: number) => number;
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import type { UseChartKeyboardNavigationSignature } from "./plugins/featurePlugins/useChartKeyboardNavigation/index.mjs";
|
|
2
2
|
import type { ChartState } from "./plugins/models/chart.mjs";
|
|
3
3
|
import type { ChartSeriesType } from "../models/seriesType/config.mjs";
|
|
4
|
-
import type { SeriesId
|
|
4
|
+
import type { SeriesId } from "../models/seriesType/index.mjs";
|
|
5
5
|
type ReturnedItem<OutSeriesType extends ChartSeriesType> = {
|
|
6
6
|
type: OutSeriesType;
|
|
7
7
|
seriesId: SeriesId;
|
|
8
8
|
dataIndex: number;
|
|
9
9
|
} | null;
|
|
10
|
+
/**
|
|
11
|
+
* The item the navigators work on. Decoupled from the public `FocusedItemIdentifier` because
|
|
12
|
+
* navigation is position-based: series keyed differently (e.g. `mapShape`, keyed by `name`)
|
|
13
|
+
* reuse these helpers by translating to a `dataIndex` at their boundary.
|
|
14
|
+
*/
|
|
15
|
+
type WorkingItem = {
|
|
16
|
+
type: Exclude<ChartSeriesType, 'sankey' | 'heatmap'>;
|
|
17
|
+
seriesId: SeriesId;
|
|
18
|
+
dataIndex?: number;
|
|
19
|
+
};
|
|
10
20
|
type StateParameters<SeriesType extends ChartSeriesType> = Pick<ChartState<[UseChartKeyboardNavigationSignature], [], SeriesType>, 'series'>;
|
|
11
21
|
export declare function createGetNextIndexFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
|
|
12
22
|
/**
|
|
@@ -20,7 +30,7 @@ allowCycles?: boolean,
|
|
|
20
30
|
/**
|
|
21
31
|
* If true, series max index is defined by the current series length and not all series.
|
|
22
32
|
*/
|
|
23
|
-
useCurrentSeriesMaxLength?: boolean): (currentItem:
|
|
33
|
+
useCurrentSeriesMaxLength?: boolean): (currentItem: WorkingItem | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
|
|
24
34
|
export declare function createGetPreviousIndexFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
|
|
25
35
|
/**
|
|
26
36
|
* The set of series types compatible with this navigation action.
|
|
@@ -33,15 +43,15 @@ allowCycles?: boolean,
|
|
|
33
43
|
/**
|
|
34
44
|
* If true, series max index is defined by the current series length and not all series.
|
|
35
45
|
*/
|
|
36
|
-
useCurrentSeriesMaxLength?: boolean): (currentItem:
|
|
46
|
+
useCurrentSeriesMaxLength?: boolean): (currentItem: WorkingItem | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
|
|
37
47
|
export declare function createGetNextSeriesFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
|
|
38
48
|
/**
|
|
39
49
|
* The set of series types compatible with this navigation action.
|
|
40
50
|
*/
|
|
41
|
-
compatibleSeriesTypes: Set<OutSeriesType>): (currentItem:
|
|
51
|
+
compatibleSeriesTypes: Set<OutSeriesType>): (currentItem: WorkingItem | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
|
|
42
52
|
export declare function createGetPreviousSeriesFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
|
|
43
53
|
/**
|
|
44
54
|
* The set of series types compatible with this navigation action.
|
|
45
55
|
*/
|
|
46
|
-
compatibleSeriesTypes: Set<OutSeriesType>): (currentItem:
|
|
56
|
+
compatibleSeriesTypes: Set<OutSeriesType>): (currentItem: WorkingItem | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
|
|
47
57
|
export {};
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import type { UseChartKeyboardNavigationSignature } from "./plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
2
2
|
import type { ChartState } from "./plugins/models/chart.js";
|
|
3
3
|
import type { ChartSeriesType } from "../models/seriesType/config.js";
|
|
4
|
-
import type { SeriesId
|
|
4
|
+
import type { SeriesId } from "../models/seriesType/index.js";
|
|
5
5
|
type ReturnedItem<OutSeriesType extends ChartSeriesType> = {
|
|
6
6
|
type: OutSeriesType;
|
|
7
7
|
seriesId: SeriesId;
|
|
8
8
|
dataIndex: number;
|
|
9
9
|
} | null;
|
|
10
|
+
/**
|
|
11
|
+
* The item the navigators work on. Decoupled from the public `FocusedItemIdentifier` because
|
|
12
|
+
* navigation is position-based: series keyed differently (e.g. `mapShape`, keyed by `name`)
|
|
13
|
+
* reuse these helpers by translating to a `dataIndex` at their boundary.
|
|
14
|
+
*/
|
|
15
|
+
type WorkingItem = {
|
|
16
|
+
type: Exclude<ChartSeriesType, 'sankey' | 'heatmap'>;
|
|
17
|
+
seriesId: SeriesId;
|
|
18
|
+
dataIndex?: number;
|
|
19
|
+
};
|
|
10
20
|
type StateParameters<SeriesType extends ChartSeriesType> = Pick<ChartState<[UseChartKeyboardNavigationSignature], [], SeriesType>, 'series'>;
|
|
11
21
|
export declare function createGetNextIndexFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
|
|
12
22
|
/**
|
|
@@ -20,7 +30,7 @@ allowCycles?: boolean,
|
|
|
20
30
|
/**
|
|
21
31
|
* If true, series max index is defined by the current series length and not all series.
|
|
22
32
|
*/
|
|
23
|
-
useCurrentSeriesMaxLength?: boolean): (currentItem:
|
|
33
|
+
useCurrentSeriesMaxLength?: boolean): (currentItem: WorkingItem | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
|
|
24
34
|
export declare function createGetPreviousIndexFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
|
|
25
35
|
/**
|
|
26
36
|
* The set of series types compatible with this navigation action.
|
|
@@ -33,15 +43,15 @@ allowCycles?: boolean,
|
|
|
33
43
|
/**
|
|
34
44
|
* If true, series max index is defined by the current series length and not all series.
|
|
35
45
|
*/
|
|
36
|
-
useCurrentSeriesMaxLength?: boolean): (currentItem:
|
|
46
|
+
useCurrentSeriesMaxLength?: boolean): (currentItem: WorkingItem | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
|
|
37
47
|
export declare function createGetNextSeriesFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
|
|
38
48
|
/**
|
|
39
49
|
* The set of series types compatible with this navigation action.
|
|
40
50
|
*/
|
|
41
|
-
compatibleSeriesTypes: Set<OutSeriesType>): (currentItem:
|
|
51
|
+
compatibleSeriesTypes: Set<OutSeriesType>): (currentItem: WorkingItem | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
|
|
42
52
|
export declare function createGetPreviousSeriesFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
|
|
43
53
|
/**
|
|
44
54
|
* The set of series types compatible with this navigation action.
|
|
45
55
|
*/
|
|
46
|
-
compatibleSeriesTypes: Set<OutSeriesType>): (currentItem:
|
|
56
|
+
compatibleSeriesTypes: Set<OutSeriesType>): (currentItem: WorkingItem | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
|
|
47
57
|
export {};
|
|
@@ -13,6 +13,12 @@ var _getNextNonEmptySeries = require("./plugins/featurePlugins/useChartKeyboardN
|
|
|
13
13
|
var _findVisibleDataIndex = require("./plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex");
|
|
14
14
|
var _seriesHasData = require("./seriesHasData");
|
|
15
15
|
var _useChartSeries = require("./plugins/corePlugins/useChartSeries/useChartSeries.selectors");
|
|
16
|
+
/**
|
|
17
|
+
* The item the navigators work on. Decoupled from the public `FocusedItemIdentifier` because
|
|
18
|
+
* navigation is position-based: series keyed differently (e.g. `mapShape`, keyed by `name`)
|
|
19
|
+
* reuse these helpers by translating to a `dataIndex` at their boundary.
|
|
20
|
+
*/
|
|
21
|
+
|
|
16
22
|
function isSeriesHidden(processedSeries, type, seriesId) {
|
|
17
23
|
const seriesItem = processedSeries[type]?.series[seriesId];
|
|
18
24
|
return Boolean(seriesItem && 'hidden' in seriesItem && seriesItem.hidden);
|
|
@@ -4,6 +4,13 @@ import { getNextNonEmptySeries } from "./plugins/featurePlugins/useChartKeyboard
|
|
|
4
4
|
import { findVisibleDataIndex } from "./plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.mjs";
|
|
5
5
|
import { seriesHasData } from "./seriesHasData.mjs";
|
|
6
6
|
import { selectorChartSeriesProcessed } from "./plugins/corePlugins/useChartSeries/useChartSeries.selectors.mjs";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The item the navigators work on. Decoupled from the public `FocusedItemIdentifier` because
|
|
10
|
+
* navigation is position-based: series keyed differently (e.g. `mapShape`, keyed by `name`)
|
|
11
|
+
* reuse these helpers by translating to a `dataIndex` at their boundary.
|
|
12
|
+
*/
|
|
13
|
+
|
|
7
14
|
function isSeriesHidden(processedSeries, type, seriesId) {
|
|
8
15
|
const seriesItem = processedSeries[type]?.series[seriesId];
|
|
9
16
|
return Boolean(seriesItem && 'hidden' in seriesItem && seriesItem.hidden);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
/**
|
|
2
3
|
* This component provides an accessibility proxy for charts.
|
|
3
4
|
* It uses two divs to let screen readers announce the focused content when it changes.
|
|
4
5
|
*/
|
|
5
|
-
export declare function ChartsAccessibilityProxy():
|
|
6
|
+
export declare function ChartsAccessibilityProxy(): React.JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
/**
|
|
2
3
|
* This component provides an accessibility proxy for charts.
|
|
3
4
|
* It uses two divs to let screen readers announce the focused content when it changes.
|
|
4
5
|
*/
|
|
5
|
-
export declare function ChartsAccessibilityProxy():
|
|
6
|
+
export declare function ChartsAccessibilityProxy(): React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare function ChartsAxesGradients(): React.JSX.Element | null;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare function ChartsAxesGradients(): React.JSX.Element | null;
|
|
@@ -14,5 +14,5 @@ type ChartsContinuousGradientProps = {
|
|
|
14
14
|
*/
|
|
15
15
|
gradientUnits?: 'objectBoundingBox' | 'userSpaceOnUse';
|
|
16
16
|
};
|
|
17
|
-
export default function ChartsContinuousGradient(props: ChartsContinuousGradientProps): import("react
|
|
17
|
+
export default function ChartsContinuousGradient(props: ChartsContinuousGradientProps): import("react").JSX.Element | null;
|
|
18
18
|
export {};
|
|
@@ -14,5 +14,5 @@ type ChartsContinuousGradientProps = {
|
|
|
14
14
|
*/
|
|
15
15
|
gradientUnits?: 'objectBoundingBox' | 'userSpaceOnUse';
|
|
16
16
|
};
|
|
17
|
-
export default function ChartsContinuousGradient(props: ChartsContinuousGradientProps): import("react
|
|
17
|
+
export default function ChartsContinuousGradient(props: ChartsContinuousGradientProps): import("react").JSX.Element | null;
|
|
18
18
|
export {};
|
|
@@ -8,5 +8,5 @@ type ChartsContinuousGradientObjectBoundProps = {
|
|
|
8
8
|
/**
|
|
9
9
|
* Generates gradients to be used in tooltips and legends.
|
|
10
10
|
*/
|
|
11
|
-
export default function ChartsContinuousGradientObjectBound(props: ChartsContinuousGradientObjectBoundProps): import("react
|
|
11
|
+
export default function ChartsContinuousGradientObjectBound(props: ChartsContinuousGradientObjectBoundProps): import("react").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -8,5 +8,5 @@ type ChartsContinuousGradientObjectBoundProps = {
|
|
|
8
8
|
/**
|
|
9
9
|
* Generates gradients to be used in tooltips and legends.
|
|
10
10
|
*/
|
|
11
|
-
export default function ChartsContinuousGradientObjectBound(props: ChartsContinuousGradientObjectBoundProps): import("react
|
|
11
|
+
export default function ChartsContinuousGradientObjectBound(props: ChartsContinuousGradientObjectBoundProps): import("react").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import type { PiecewiseColorConfig } from "../../../models/colorMapping.mjs";
|
|
2
3
|
type ChartsPiecewiseGradientProps = {
|
|
3
4
|
isReversed?: boolean;
|
|
@@ -7,5 +8,5 @@ type ChartsPiecewiseGradientProps = {
|
|
|
7
8
|
scale: (value: any) => number | undefined;
|
|
8
9
|
colorMap: PiecewiseColorConfig;
|
|
9
10
|
};
|
|
10
|
-
export default function ChartsPiecewiseGradient(props: ChartsPiecewiseGradientProps):
|
|
11
|
+
export default function ChartsPiecewiseGradient(props: ChartsPiecewiseGradientProps): React.JSX.Element | null;
|
|
11
12
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import type { PiecewiseColorConfig } from "../../../models/colorMapping.js";
|
|
2
3
|
type ChartsPiecewiseGradientProps = {
|
|
3
4
|
isReversed?: boolean;
|
|
@@ -7,5 +8,5 @@ type ChartsPiecewiseGradientProps = {
|
|
|
7
8
|
scale: (value: any) => number | undefined;
|
|
8
9
|
colorMap: PiecewiseColorConfig;
|
|
9
10
|
};
|
|
10
|
-
export default function ChartsPiecewiseGradient(props: ChartsPiecewiseGradientProps):
|
|
11
|
+
export default function ChartsPiecewiseGradient(props: ChartsPiecewiseGradientProps): React.JSX.Element | null;
|
|
11
12
|
export {};
|
|
@@ -2,7 +2,11 @@ import type { ChartSeriesType } from "../models/seriesType/config.mjs";
|
|
|
2
2
|
/**
|
|
3
3
|
* Create a keyboard focus handler for common use cases where focused item are defined by the series is and data index.
|
|
4
4
|
*/
|
|
5
|
-
export declare function createCommonKeyboardFocusHandler<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, TInputSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = SeriesType>(outSeriesTypes: Set<SeriesType>, allowCycles?: boolean, useCurrentSeriesMaxLength?: boolean): (event: KeyboardEvent) => ((currentItem:
|
|
5
|
+
export declare function createCommonKeyboardFocusHandler<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, TInputSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = SeriesType>(outSeriesTypes: Set<SeriesType>, allowCycles?: boolean, useCurrentSeriesMaxLength?: boolean): (event: KeyboardEvent) => ((currentItem: {
|
|
6
|
+
type: Exclude<ChartSeriesType, "sankey" | "heatmap">;
|
|
7
|
+
seriesId: import("../index.mjs").SeriesId;
|
|
8
|
+
dataIndex?: number;
|
|
9
|
+
} | null, state: {
|
|
6
10
|
series: {
|
|
7
11
|
defaultizedSeries: import("./plugins/corePlugins/useChartSeries/useChartSeries.types.mjs").DefaultizedSeriesGroups<TInputSeriesType>;
|
|
8
12
|
idToType: import("./index.mjs").SeriesIdToType;
|
|
@@ -2,7 +2,11 @@ import type { ChartSeriesType } from "../models/seriesType/config.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Create a keyboard focus handler for common use cases where focused item are defined by the series is and data index.
|
|
4
4
|
*/
|
|
5
|
-
export declare function createCommonKeyboardFocusHandler<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, TInputSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = SeriesType>(outSeriesTypes: Set<SeriesType>, allowCycles?: boolean, useCurrentSeriesMaxLength?: boolean): (event: KeyboardEvent) => ((currentItem:
|
|
5
|
+
export declare function createCommonKeyboardFocusHandler<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, TInputSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = SeriesType>(outSeriesTypes: Set<SeriesType>, allowCycles?: boolean, useCurrentSeriesMaxLength?: boolean): (event: KeyboardEvent) => ((currentItem: {
|
|
6
|
+
type: Exclude<ChartSeriesType, "sankey" | "heatmap">;
|
|
7
|
+
seriesId: import("../index.js").SeriesId;
|
|
8
|
+
dataIndex?: number;
|
|
9
|
+
} | null, state: {
|
|
6
10
|
series: {
|
|
7
11
|
defaultizedSeries: import("./plugins/corePlugins/useChartSeries/useChartSeries.types.js").DefaultizedSeriesGroups<TInputSeriesType>;
|
|
8
12
|
idToType: import("./index.js").SeriesIdToType;
|
|
@@ -11,4 +11,17 @@ export declare function createGetBarDimensions(params: {
|
|
|
11
11
|
y: number;
|
|
12
12
|
height: number;
|
|
13
13
|
width: number;
|
|
14
|
-
} | null;
|
|
14
|
+
} | null;
|
|
15
|
+
/** Like {@link createGetBarDimensions}, but for a sampled bucket spanning several categories. */
|
|
16
|
+
export declare function createGetBucketBarDimensions(params: {
|
|
17
|
+
verticalLayout: boolean;
|
|
18
|
+
xAxisConfig: ComputedAxis<ScaleName, any, ChartsXAxisProps>;
|
|
19
|
+
yAxisConfig: ComputedAxis<ScaleName, any, ChartsYAxisProps>;
|
|
20
|
+
series: ChartSeriesDefaultized<'bar'>;
|
|
21
|
+
numberOfGroups: number;
|
|
22
|
+
}): (startIndex: number, endIndex: number, min: number, max: number, groupIndex: number) => {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
height: number;
|
|
26
|
+
width: number;
|
|
27
|
+
};
|
|
@@ -11,4 +11,17 @@ export declare function createGetBarDimensions(params: {
|
|
|
11
11
|
y: number;
|
|
12
12
|
height: number;
|
|
13
13
|
width: number;
|
|
14
|
-
} | null;
|
|
14
|
+
} | null;
|
|
15
|
+
/** Like {@link createGetBarDimensions}, but for a sampled bucket spanning several categories. */
|
|
16
|
+
export declare function createGetBucketBarDimensions(params: {
|
|
17
|
+
verticalLayout: boolean;
|
|
18
|
+
xAxisConfig: ComputedAxis<ScaleName, any, ChartsXAxisProps>;
|
|
19
|
+
yAxisConfig: ComputedAxis<ScaleName, any, ChartsYAxisProps>;
|
|
20
|
+
series: ChartSeriesDefaultized<'bar'>;
|
|
21
|
+
numberOfGroups: number;
|
|
22
|
+
}): (startIndex: number, endIndex: number, min: number, max: number, groupIndex: number) => {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
height: number;
|
|
26
|
+
width: number;
|
|
27
|
+
};
|
|
@@ -4,8 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createGetBarDimensions = createGetBarDimensions;
|
|
7
|
+
exports.createGetBucketBarDimensions = createGetBucketBarDimensions;
|
|
7
8
|
var _findMinMax = require("./findMinMax");
|
|
8
9
|
var _getBandSize = require("./getBandSize");
|
|
10
|
+
/** Minimum on-screen gap (px) kept between merged (sampled) bars so they stay distinguishable. */
|
|
11
|
+
const MIN_SAMPLED_BAR_GAP_PX = 2;
|
|
9
12
|
function shouldInvertStartCoordinate(verticalLayout, baseValue, reverse) {
|
|
10
13
|
const isVerticalAndPositive = verticalLayout && baseValue > 0;
|
|
11
14
|
const isHorizontalAndNegative = !verticalLayout && baseValue < 0;
|
|
@@ -58,4 +61,46 @@ function createGetBarDimensions(params) {
|
|
|
58
61
|
width: verticalLayout ? barWidth : barSize
|
|
59
62
|
};
|
|
60
63
|
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Like {@link createGetBarDimensions}, but for a sampled bucket spanning several categories. */
|
|
67
|
+
function createGetBucketBarDimensions(params) {
|
|
68
|
+
const {
|
|
69
|
+
verticalLayout,
|
|
70
|
+
xAxisConfig,
|
|
71
|
+
yAxisConfig,
|
|
72
|
+
series,
|
|
73
|
+
numberOfGroups
|
|
74
|
+
} = params;
|
|
75
|
+
const baseScaleConfig = verticalLayout ? xAxisConfig : yAxisConfig;
|
|
76
|
+
const baseScale = baseScaleConfig.scale;
|
|
77
|
+
const bandwidth = baseScale.bandwidth();
|
|
78
|
+
const step = baseScale.step();
|
|
79
|
+
const valueScale = verticalLayout ? yAxisConfig.scale : xAxisConfig.scale;
|
|
80
|
+
return function getBucketBarDimensions(startIndex, endIndex, min, max, groupIndex) {
|
|
81
|
+
const spanStart = baseScale(baseScaleConfig.data[startIndex]);
|
|
82
|
+
const bucketCount = endIndex - startIndex + 1;
|
|
83
|
+
const bucketStride = bucketCount * step;
|
|
84
|
+
|
|
85
|
+
// Keep the gap between buckets proportional to the bucket (same ratio as an unsampled chart),
|
|
86
|
+
// but never thinner than MIN_SAMPLED_BAR_GAP_PX so it stays visible at every level and zoom.
|
|
87
|
+
const gap = Math.min(bucketStride / 2, Math.max(bucketCount * (step - bandwidth), MIN_SAMPLED_BAR_GAP_PX));
|
|
88
|
+
const {
|
|
89
|
+
barWidth,
|
|
90
|
+
offset
|
|
91
|
+
} = (0, _getBandSize.getBandSize)(bucketStride - gap, numberOfGroups, baseScaleConfig.barGapRatio);
|
|
92
|
+
const barOffset = groupIndex * (barWidth + offset);
|
|
93
|
+
const valueCoordinates = [valueScale(min), valueScale(max)];
|
|
94
|
+
const [minValueCoord, maxValueCoord] = (0, _findMinMax.findMinMax)(valueCoordinates).map(v => Math.round(v));
|
|
95
|
+
let barSize = maxValueCoord - minValueCoord;
|
|
96
|
+
if (!series.hidden && barSize > 0) {
|
|
97
|
+
barSize = Math.max(series.minBarSize, barSize);
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
x: verticalLayout ? spanStart + barOffset : minValueCoord,
|
|
101
|
+
y: verticalLayout ? minValueCoord : spanStart + barOffset,
|
|
102
|
+
height: verticalLayout ? barSize : barWidth,
|
|
103
|
+
width: verticalLayout ? barWidth : barSize
|
|
104
|
+
};
|
|
105
|
+
};
|
|
61
106
|
}
|