react-native-chart-kit 7.0.0-next.1 → 7.0.0-next.3
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/README.md +89 -521
- package/dist/charts/line/LineChart.d.ts +3 -3
- package/dist/charts/line/LineChart.js +1 -1
- package/dist/v2/core/data/index.d.ts +3 -0
- package/dist/v2/core/data/index.d.ts.map +1 -0
- package/dist/v2/core/data/index.js +1 -0
- package/dist/v2/core/data/normalize.d.ts +8 -0
- package/dist/v2/core/data/normalize.d.ts.map +1 -0
- package/dist/v2/core/data/normalize.js +229 -0
- package/dist/v2/core/data/normalizeValues.d.ts +16 -0
- package/dist/v2/core/data/normalizeValues.d.ts.map +1 -0
- package/dist/v2/core/data/normalizeValues.js +96 -0
- package/dist/v2/core/data/types.d.ts +161 -0
- package/dist/v2/core/data/types.d.ts.map +1 -0
- package/dist/v2/core/data/types.js +1 -0
- package/dist/v2/core/geometry/areaPath.d.ts +3 -0
- package/dist/v2/core/geometry/areaPath.d.ts.map +1 -0
- package/dist/v2/core/geometry/areaPath.js +36 -0
- package/dist/v2/core/geometry/barRects.d.ts +44 -0
- package/dist/v2/core/geometry/barRects.d.ts.map +1 -0
- package/dist/v2/core/geometry/barRects.js +201 -0
- package/dist/v2/core/geometry/contributionHeatmap.d.ts +49 -0
- package/dist/v2/core/geometry/contributionHeatmap.d.ts.map +1 -0
- package/dist/v2/core/geometry/contributionHeatmap.js +107 -0
- package/dist/v2/core/geometry/horizontalBarRects.d.ts +27 -0
- package/dist/v2/core/geometry/horizontalBarRects.d.ts.map +1 -0
- package/dist/v2/core/geometry/horizontalBarRects.js +202 -0
- package/dist/v2/core/geometry/index.d.ts +12 -0
- package/dist/v2/core/geometry/index.d.ts.map +1 -0
- package/dist/v2/core/geometry/index.js +11 -0
- package/dist/v2/core/geometry/lineDecimation.d.ts +8 -0
- package/dist/v2/core/geometry/lineDecimation.d.ts.map +1 -0
- package/dist/v2/core/geometry/lineDecimation.js +110 -0
- package/dist/v2/core/geometry/linePath.d.ts +5 -0
- package/dist/v2/core/geometry/linePath.d.ts.map +1 -0
- package/dist/v2/core/geometry/linePath.js +98 -0
- package/dist/v2/core/geometry/lineSeries.d.ts +29 -0
- package/dist/v2/core/geometry/lineSeries.d.ts.map +1 -0
- package/dist/v2/core/geometry/lineSeries.js +51 -0
- package/dist/v2/core/geometry/path.d.ts +6 -0
- package/dist/v2/core/geometry/path.d.ts.map +1 -0
- package/dist/v2/core/geometry/path.js +24 -0
- package/dist/v2/core/geometry/pieArcs.d.ts +29 -0
- package/dist/v2/core/geometry/pieArcs.d.ts.map +1 -0
- package/dist/v2/core/geometry/pieArcs.js +142 -0
- package/dist/v2/core/geometry/progressRings.d.ts +30 -0
- package/dist/v2/core/geometry/progressRings.d.ts.map +1 -0
- package/dist/v2/core/geometry/progressRings.js +104 -0
- package/dist/v2/core/geometry/types.d.ts +32 -0
- package/dist/v2/core/geometry/types.d.ts.map +1 -0
- package/dist/v2/core/geometry/types.js +1 -0
- package/dist/v2/core/index.d.ts +6 -0
- package/dist/v2/core/index.d.ts.map +1 -0
- package/dist/v2/core/index.js +6 -0
- package/dist/v2/core/interaction/index.d.ts +5 -0
- package/dist/v2/core/interaction/index.d.ts.map +1 -0
- package/dist/v2/core/interaction/index.js +2 -0
- package/dist/v2/core/interaction/viewport.d.ts +71 -0
- package/dist/v2/core/interaction/viewport.d.ts.map +1 -0
- package/dist/v2/core/interaction/viewport.js +216 -0
- package/dist/v2/core/interaction/viewportTransform.d.ts +17 -0
- package/dist/v2/core/interaction/viewportTransform.d.ts.map +1 -0
- package/dist/v2/core/interaction/viewportTransform.js +70 -0
- package/dist/v2/core/layout/autoPadding.d.ts +3 -0
- package/dist/v2/core/layout/autoPadding.d.ts.map +1 -0
- package/dist/v2/core/layout/autoPadding.js +33 -0
- package/dist/v2/core/layout/chartBox.d.ts +5 -0
- package/dist/v2/core/layout/chartBox.d.ts.map +1 -0
- package/dist/v2/core/layout/chartBox.js +22 -0
- package/dist/v2/core/layout/debugLayout.d.ts +3 -0
- package/dist/v2/core/layout/debugLayout.d.ts.map +1 -0
- package/dist/v2/core/layout/debugLayout.js +20 -0
- package/dist/v2/core/layout/index.d.ts +8 -0
- package/dist/v2/core/layout/index.d.ts.map +1 -0
- package/dist/v2/core/layout/index.js +6 -0
- package/dist/v2/core/layout/labelCollision.d.ts +3 -0
- package/dist/v2/core/layout/labelCollision.d.ts.map +1 -0
- package/dist/v2/core/layout/labelCollision.js +90 -0
- package/dist/v2/core/layout/legendLayout.d.ts +3 -0
- package/dist/v2/core/layout/legendLayout.d.ts.map +1 -0
- package/dist/v2/core/layout/legendLayout.js +39 -0
- package/dist/v2/core/layout/tooltipPlacement.d.ts +3 -0
- package/dist/v2/core/layout/tooltipPlacement.d.ts.map +1 -0
- package/dist/v2/core/layout/tooltipPlacement.js +76 -0
- package/dist/v2/core/layout/types.d.ts +114 -0
- package/dist/v2/core/layout/types.d.ts.map +1 -0
- package/dist/v2/core/layout/types.js +1 -0
- package/dist/v2/core/scales/band.d.ts +15 -0
- package/dist/v2/core/scales/band.d.ts.map +1 -0
- package/dist/v2/core/scales/band.js +34 -0
- package/dist/v2/core/scales/domain.d.ts +6 -0
- package/dist/v2/core/scales/domain.d.ts.map +1 -0
- package/dist/v2/core/scales/domain.js +109 -0
- package/dist/v2/core/scales/index.d.ts +7 -0
- package/dist/v2/core/scales/index.d.ts.map +1 -0
- package/dist/v2/core/scales/index.js +5 -0
- package/dist/v2/core/scales/linear.d.ts +8 -0
- package/dist/v2/core/scales/linear.d.ts.map +1 -0
- package/dist/v2/core/scales/linear.js +22 -0
- package/dist/v2/core/scales/ticks.d.ts +4 -0
- package/dist/v2/core/scales/ticks.d.ts.map +1 -0
- package/dist/v2/core/scales/ticks.js +111 -0
- package/dist/v2/core/scales/time.d.ts +8 -0
- package/dist/v2/core/scales/time.d.ts.map +1 -0
- package/dist/v2/core/scales/time.js +23 -0
- package/dist/v2/core/scales/types.d.ts +46 -0
- package/dist/v2/core/scales/types.d.ts.map +1 -0
- package/dist/v2/core/scales/types.js +1 -0
- package/dist/v2/index.d.ts +1 -0
- package/dist/v2/index.js +1 -0
- package/dist/v2/react-native/charts/bar/BarChart.d.ts +6 -0
- package/dist/v2/react-native/charts/bar/BarChart.d.ts.map +1 -0
- package/dist/v2/react-native/charts/bar/BarChart.js +199 -0
- package/dist/v2/react-native/charts/bar/BarChartSurface.d.ts +36 -0
- package/dist/v2/react-native/charts/bar/BarChartSurface.d.ts.map +1 -0
- package/dist/v2/react-native/charts/bar/BarChartSurface.js +134 -0
- package/dist/v2/react-native/charts/bar/StackedBarChart.d.ts +4 -0
- package/dist/v2/react-native/charts/bar/StackedBarChart.d.ts.map +1 -0
- package/dist/v2/react-native/charts/bar/StackedBarChart.js +9 -0
- package/dist/v2/react-native/charts/bar/accessibility.d.ts +31 -0
- package/dist/v2/react-native/charts/bar/accessibility.d.ts.map +1 -0
- package/dist/v2/react-native/charts/bar/accessibility.js +87 -0
- package/dist/v2/react-native/charts/bar/interaction.d.ts +18 -0
- package/dist/v2/react-native/charts/bar/interaction.d.ts.map +1 -0
- package/dist/v2/react-native/charts/bar/interaction.js +62 -0
- package/dist/v2/react-native/charts/bar/model.d.ts +3 -0
- package/dist/v2/react-native/charts/bar/model.d.ts.map +1 -0
- package/dist/v2/react-native/charts/bar/model.js +326 -0
- package/dist/v2/react-native/charts/bar/modelUtils.d.ts +27 -0
- package/dist/v2/react-native/charts/bar/modelUtils.d.ts.map +1 -0
- package/dist/v2/react-native/charts/bar/modelUtils.js +58 -0
- package/dist/v2/react-native/charts/bar/options.d.ts +7 -0
- package/dist/v2/react-native/charts/bar/options.d.ts.map +1 -0
- package/dist/v2/react-native/charts/bar/options.js +49 -0
- package/dist/v2/react-native/charts/bar/rendererSafety.d.ts +12 -0
- package/dist/v2/react-native/charts/bar/rendererSafety.d.ts.map +1 -0
- package/dist/v2/react-native/charts/bar/rendererSafety.js +31 -0
- package/dist/v2/react-native/charts/bar/selectionAnimation.d.ts +42 -0
- package/dist/v2/react-native/charts/bar/selectionAnimation.d.ts.map +1 -0
- package/dist/v2/react-native/charts/bar/selectionAnimation.js +158 -0
- package/dist/v2/react-native/charts/bar/stackedCompat.d.ts +55 -0
- package/dist/v2/react-native/charts/bar/stackedCompat.d.ts.map +1 -0
- package/dist/v2/react-native/charts/bar/stackedCompat.js +105 -0
- package/dist/v2/react-native/charts/bar/tooltip.d.ts +11 -0
- package/dist/v2/react-native/charts/bar/tooltip.d.ts.map +1 -0
- package/dist/v2/react-native/charts/bar/tooltip.js +18 -0
- package/dist/v2/react-native/charts/bar/tooltipModel.d.ts +33 -0
- package/dist/v2/react-native/charts/bar/tooltipModel.d.ts.map +1 -0
- package/dist/v2/react-native/charts/bar/tooltipModel.js +46 -0
- package/dist/v2/react-native/charts/bar/tooltipPlacement.d.ts +9 -0
- package/dist/v2/react-native/charts/bar/tooltipPlacement.d.ts.map +1 -0
- package/dist/v2/react-native/charts/bar/tooltipPlacement.js +9 -0
- package/dist/v2/react-native/charts/bar/types.d.ts +211 -0
- package/dist/v2/react-native/charts/bar/types.d.ts.map +1 -0
- package/dist/v2/react-native/charts/bar/types.js +1 -0
- package/dist/v2/react-native/charts/bar/useAnimatedTooltipModel.d.ts +10 -0
- package/dist/v2/react-native/charts/bar/useAnimatedTooltipModel.d.ts.map +1 -0
- package/dist/v2/react-native/charts/bar/useAnimatedTooltipModel.js +87 -0
- package/dist/v2/react-native/charts/bar/viewport.d.ts +20 -0
- package/dist/v2/react-native/charts/bar/viewport.d.ts.map +1 -0
- package/dist/v2/react-native/charts/bar/viewport.js +47 -0
- package/dist/v2/react-native/charts/contribution/ContributionGraph.d.ts +13 -0
- package/dist/v2/react-native/charts/contribution/ContributionGraph.d.ts.map +1 -0
- package/dist/v2/react-native/charts/contribution/ContributionGraph.js +159 -0
- package/dist/v2/react-native/charts/contribution/accessibility.d.ts +25 -0
- package/dist/v2/react-native/charts/contribution/accessibility.d.ts.map +1 -0
- package/dist/v2/react-native/charts/contribution/accessibility.js +50 -0
- package/dist/v2/react-native/charts/contribution/interaction.d.ts +23 -0
- package/dist/v2/react-native/charts/contribution/interaction.d.ts.map +1 -0
- package/dist/v2/react-native/charts/contribution/interaction.js +75 -0
- package/dist/v2/react-native/charts/contribution/model.d.ts +17 -0
- package/dist/v2/react-native/charts/contribution/model.d.ts.map +1 -0
- package/dist/v2/react-native/charts/contribution/model.js +102 -0
- package/dist/v2/react-native/charts/contribution/types.d.ts +71 -0
- package/dist/v2/react-native/charts/contribution/types.d.ts.map +1 -0
- package/dist/v2/react-native/charts/contribution/types.js +1 -0
- package/dist/v2/react-native/charts/line/AreaChart.d.ts +3 -0
- package/dist/v2/react-native/charts/line/AreaChart.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/AreaChart.js +3 -0
- package/dist/v2/react-native/charts/line/ChartSurface.d.ts +16 -0
- package/dist/v2/react-native/charts/line/ChartSurface.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/ChartSurface.js +151 -0
- package/dist/v2/react-native/charts/line/LineChart.d.ts +6 -0
- package/dist/v2/react-native/charts/line/LineChart.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/LineChart.js +294 -0
- package/dist/v2/react-native/charts/line/StickyYAxis.d.ts +15 -0
- package/dist/v2/react-native/charts/line/StickyYAxis.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/StickyYAxis.js +26 -0
- package/dist/v2/react-native/charts/line/accessibility.d.ts +34 -0
- package/dist/v2/react-native/charts/line/accessibility.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/accessibility.js +103 -0
- package/dist/v2/react-native/charts/line/axisLabels.d.ts +37 -0
- package/dist/v2/react-native/charts/line/axisLabels.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/axisLabels.js +55 -0
- package/dist/v2/react-native/charts/line/debugLayout.d.ts +26 -0
- package/dist/v2/react-native/charts/line/debugLayout.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/debugLayout.js +77 -0
- package/dist/v2/react-native/charts/line/debugOverlay.d.ts +9 -0
- package/dist/v2/react-native/charts/line/debugOverlay.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/debugOverlay.js +30 -0
- package/dist/v2/react-native/charts/line/defaultTooltip.d.ts +3 -0
- package/dist/v2/react-native/charts/line/defaultTooltip.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/defaultTooltip.js +17 -0
- package/dist/v2/react-native/charts/line/interaction.d.ts +82 -0
- package/dist/v2/react-native/charts/line/interaction.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/interaction.js +94 -0
- package/dist/v2/react-native/charts/line/legend.d.ts +35 -0
- package/dist/v2/react-native/charts/line/legend.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/legend.js +95 -0
- package/dist/v2/react-native/charts/line/markers.d.ts +11 -0
- package/dist/v2/react-native/charts/line/markers.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/markers.js +52 -0
- package/dist/v2/react-native/charts/line/options.d.ts +172 -0
- package/dist/v2/react-native/charts/line/options.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/options.js +168 -0
- package/dist/v2/react-native/charts/line/outsidePressSurfaces.d.ts +15 -0
- package/dist/v2/react-native/charts/line/outsidePressSurfaces.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/outsidePressSurfaces.js +37 -0
- package/dist/v2/react-native/charts/line/overviewProps.d.ts +45 -0
- package/dist/v2/react-native/charts/line/overviewProps.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/overviewProps.js +4 -0
- package/dist/v2/react-native/charts/line/rangeSelector.d.ts +19 -0
- package/dist/v2/react-native/charts/line/rangeSelector.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/rangeSelector.js +185 -0
- package/dist/v2/react-native/charts/line/rangeSelectorConfig.d.ts +38 -0
- package/dist/v2/react-native/charts/line/rangeSelectorConfig.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/rangeSelectorConfig.js +41 -0
- package/dist/v2/react-native/charts/line/referenceLabelPlacement.d.ts +21 -0
- package/dist/v2/react-native/charts/line/referenceLabelPlacement.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/referenceLabelPlacement.js +113 -0
- package/dist/v2/react-native/charts/line/references.d.ts +62 -0
- package/dist/v2/react-native/charts/line/references.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/references.js +156 -0
- package/dist/v2/react-native/charts/line/renderer.d.ts +4 -0
- package/dist/v2/react-native/charts/line/renderer.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/renderer.js +23 -0
- package/dist/v2/react-native/charts/line/responders.d.ts +13 -0
- package/dist/v2/react-native/charts/line/responders.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/responders.js +62 -0
- package/dist/v2/react-native/charts/line/selection.d.ts +31 -0
- package/dist/v2/react-native/charts/line/selection.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/selection.js +26 -0
- package/dist/v2/react-native/charts/line/seriesInput.d.ts +4 -0
- package/dist/v2/react-native/charts/line/seriesInput.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/seriesInput.js +13 -0
- package/dist/v2/react-native/charts/line/seriesStyles.d.ts +20 -0
- package/dist/v2/react-native/charts/line/seriesStyles.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/seriesStyles.js +33 -0
- package/dist/v2/react-native/charts/line/stickyYAxisLayout.d.ts +6 -0
- package/dist/v2/react-native/charts/line/stickyYAxisLayout.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/stickyYAxisLayout.js +2 -0
- package/dist/v2/react-native/charts/line/text.d.ts +7 -0
- package/dist/v2/react-native/charts/line/text.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/text.js +7 -0
- package/dist/v2/react-native/charts/line/thresholdRendering.d.ts +28 -0
- package/dist/v2/react-native/charts/line/thresholdRendering.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/thresholdRendering.js +145 -0
- package/dist/v2/react-native/charts/line/tooltip.d.ts +70 -0
- package/dist/v2/react-native/charts/line/tooltip.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/tooltip.js +87 -0
- package/dist/v2/react-native/charts/line/types.d.ts +371 -0
- package/dist/v2/react-native/charts/line/types.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/types.js +1 -0
- package/dist/v2/react-native/charts/line/useAnimatedTooltipModel.d.ts +13 -0
- package/dist/v2/react-native/charts/line/useAnimatedTooltipModel.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/useAnimatedTooltipModel.js +84 -0
- package/dist/v2/react-native/charts/line/useAnimatedYAxisLabels.d.ts +5 -0
- package/dist/v2/react-native/charts/line/useAnimatedYAxisLabels.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/useAnimatedYAxisLabels.js +141 -0
- package/dist/v2/react-native/charts/line/useChartModel.d.ts +103 -0
- package/dist/v2/react-native/charts/line/useChartModel.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/useChartModel.js +367 -0
- package/dist/v2/react-native/charts/line/useDebugLayout.d.ts +16 -0
- package/dist/v2/react-native/charts/line/useDebugLayout.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/useDebugLayout.js +35 -0
- package/dist/v2/react-native/charts/line/utils.d.ts +10 -0
- package/dist/v2/react-native/charts/line/utils.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/utils.js +40 -0
- package/dist/v2/react-native/charts/line/viewportInteraction.d.ts +3 -0
- package/dist/v2/react-native/charts/line/viewportInteraction.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/viewportInteraction.js +1 -0
- package/dist/v2/react-native/charts/line/viewportPinchZoom.d.ts +2 -0
- package/dist/v2/react-native/charts/line/viewportPinchZoom.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/viewportPinchZoom.js +1 -0
- package/dist/v2/react-native/charts/line/xLabelCandidates.d.ts +13 -0
- package/dist/v2/react-native/charts/line/xLabelCandidates.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/xLabelCandidates.js +23 -0
- package/dist/v2/react-native/charts/line/xLabels.d.ts +39 -0
- package/dist/v2/react-native/charts/line/xLabels.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/xLabels.js +289 -0
- package/dist/v2/react-native/charts/line/xScale.d.ts +6 -0
- package/dist/v2/react-native/charts/line/xScale.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/xScale.js +25 -0
- package/dist/v2/react-native/charts/line/yAxisModel.d.ts +29 -0
- package/dist/v2/react-native/charts/line/yAxisModel.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/yAxisModel.js +39 -0
- package/dist/v2/react-native/charts/pie/PieChart.d.ts +7 -0
- package/dist/v2/react-native/charts/pie/PieChart.d.ts.map +1 -0
- package/dist/v2/react-native/charts/pie/PieChart.js +253 -0
- package/dist/v2/react-native/charts/pie/accessibility.d.ts +28 -0
- package/dist/v2/react-native/charts/pie/accessibility.d.ts.map +1 -0
- package/dist/v2/react-native/charts/pie/accessibility.js +49 -0
- package/dist/v2/react-native/charts/pie/activeSlice.d.ts +15 -0
- package/dist/v2/react-native/charts/pie/activeSlice.d.ts.map +1 -0
- package/dist/v2/react-native/charts/pie/activeSlice.js +26 -0
- package/dist/v2/react-native/charts/pie/arcLabels.d.ts +32 -0
- package/dist/v2/react-native/charts/pie/arcLabels.d.ts.map +1 -0
- package/dist/v2/react-native/charts/pie/arcLabels.js +191 -0
- package/dist/v2/react-native/charts/pie/interaction.d.ts +26 -0
- package/dist/v2/react-native/charts/pie/interaction.d.ts.map +1 -0
- package/dist/v2/react-native/charts/pie/interaction.js +66 -0
- package/dist/v2/react-native/charts/pie/model.d.ts +15 -0
- package/dist/v2/react-native/charts/pie/model.d.ts.map +1 -0
- package/dist/v2/react-native/charts/pie/model.js +157 -0
- package/dist/v2/react-native/charts/pie/selectionAnimation.d.ts +33 -0
- package/dist/v2/react-native/charts/pie/selectionAnimation.d.ts.map +1 -0
- package/dist/v2/react-native/charts/pie/selectionAnimation.js +121 -0
- package/dist/v2/react-native/charts/pie/sliceSeparator.d.ts +7 -0
- package/dist/v2/react-native/charts/pie/sliceSeparator.d.ts.map +1 -0
- package/dist/v2/react-native/charts/pie/sliceSeparator.js +26 -0
- package/dist/v2/react-native/charts/pie/slices.d.ts +20 -0
- package/dist/v2/react-native/charts/pie/slices.d.ts.map +1 -0
- package/dist/v2/react-native/charts/pie/slices.js +54 -0
- package/dist/v2/react-native/charts/pie/types.d.ts +165 -0
- package/dist/v2/react-native/charts/pie/types.d.ts.map +1 -0
- package/dist/v2/react-native/charts/pie/types.js +1 -0
- package/dist/v2/react-native/charts/progress/ProgressChart.d.ts +7 -0
- package/dist/v2/react-native/charts/progress/ProgressChart.d.ts.map +1 -0
- package/dist/v2/react-native/charts/progress/ProgressChart.js +111 -0
- package/dist/v2/react-native/charts/progress/accessibility.d.ts +26 -0
- package/dist/v2/react-native/charts/progress/accessibility.d.ts.map +1 -0
- package/dist/v2/react-native/charts/progress/accessibility.js +71 -0
- package/dist/v2/react-native/charts/progress/animation.d.ts +36 -0
- package/dist/v2/react-native/charts/progress/animation.d.ts.map +1 -0
- package/dist/v2/react-native/charts/progress/animation.js +103 -0
- package/dist/v2/react-native/charts/progress/model.d.ts +14 -0
- package/dist/v2/react-native/charts/progress/model.d.ts.map +1 -0
- package/dist/v2/react-native/charts/progress/model.js +133 -0
- package/dist/v2/react-native/charts/progress/types.d.ts +72 -0
- package/dist/v2/react-native/charts/progress/types.d.ts.map +1 -0
- package/dist/v2/react-native/charts/progress/types.js +1 -0
- package/dist/v2/react-native/index.d.ts +24 -0
- package/dist/v2/react-native/index.d.ts.map +1 -0
- package/dist/v2/react-native/index.js +14 -0
- package/dist/v2/react-native/selection/ChartSelectionProvider.d.ts +27 -0
- package/dist/v2/react-native/selection/ChartSelectionProvider.d.ts.map +1 -0
- package/dist/v2/react-native/selection/ChartSelectionProvider.js +92 -0
- package/dist/v2/react-native/selection/index.d.ts +2 -0
- package/dist/v2/react-native/selection/index.d.ts.map +1 -0
- package/dist/v2/react-native/selection/index.js +1 -0
- package/dist/v2/react-native/selection/scope.d.ts +16 -0
- package/dist/v2/react-native/selection/scope.d.ts.map +1 -0
- package/dist/v2/react-native/selection/scope.js +18 -0
- package/dist/v2/react-native/theme/index.d.ts +4 -0
- package/dist/v2/react-native/theme/index.d.ts.map +1 -0
- package/dist/v2/react-native/theme/index.js +2 -0
- package/dist/v2/react-native/theme/presets.d.ts +84 -0
- package/dist/v2/react-native/theme/presets.d.ts.map +1 -0
- package/dist/v2/react-native/theme/presets.js +298 -0
- package/dist/v2/react-native/theme/provider.d.ts +20 -0
- package/dist/v2/react-native/theme/provider.d.ts.map +1 -0
- package/dist/v2/react-native/theme/provider.js +27 -0
- package/dist/v2/react-native/viewport/bounds.d.ts +7 -0
- package/dist/v2/react-native/viewport/bounds.d.ts.map +1 -0
- package/dist/v2/react-native/viewport/bounds.js +7 -0
- package/dist/v2/react-native/viewport/config.d.ts +13 -0
- package/dist/v2/react-native/viewport/config.d.ts.map +1 -0
- package/dist/v2/react-native/viewport/config.js +64 -0
- package/dist/v2/react-native/viewport/pan.d.ts +23 -0
- package/dist/v2/react-native/viewport/pan.d.ts.map +1 -0
- package/dist/v2/react-native/viewport/pan.js +110 -0
- package/dist/v2/react-native/viewport/pinchZoom.d.ts +17 -0
- package/dist/v2/react-native/viewport/pinchZoom.d.ts.map +1 -0
- package/dist/v2/react-native/viewport/pinchZoom.js +131 -0
- package/dist/v2/react-native/viewport/types.d.ts +55 -0
- package/dist/v2/react-native/viewport/types.d.ts.map +1 -0
- package/dist/v2/react-native/viewport/types.js +1 -0
- package/dist/v2/svg-renderer/capabilities.d.ts +3 -0
- package/dist/v2/svg-renderer/capabilities.d.ts.map +1 -0
- package/dist/v2/svg-renderer/capabilities.js +12 -0
- package/dist/v2/svg-renderer/clipPath.d.ts +4 -0
- package/dist/v2/svg-renderer/clipPath.d.ts.map +1 -0
- package/dist/v2/svg-renderer/clipPath.js +35 -0
- package/dist/v2/svg-renderer/defs.d.ts +6 -0
- package/dist/v2/svg-renderer/defs.d.ts.map +1 -0
- package/dist/v2/svg-renderer/defs.js +18 -0
- package/dist/v2/svg-renderer/ensureConsole.d.ts +4 -0
- package/dist/v2/svg-renderer/ensureConsole.d.ts.map +1 -0
- package/dist/v2/svg-renderer/ensureConsole.js +54 -0
- package/dist/v2/svg-renderer/hitRegions.d.ts +3 -0
- package/dist/v2/svg-renderer/hitRegions.d.ts.map +1 -0
- package/dist/v2/svg-renderer/hitRegions.js +6 -0
- package/dist/v2/svg-renderer/index.d.ts +14 -0
- package/dist/v2/svg-renderer/index.d.ts.map +1 -0
- package/dist/v2/svg-renderer/index.js +13 -0
- package/dist/v2/svg-renderer/layerOrder.d.ts +19 -0
- package/dist/v2/svg-renderer/layerOrder.d.ts.map +1 -0
- package/dist/v2/svg-renderer/layerOrder.js +18 -0
- package/dist/v2/svg-renderer/layers.d.ts +3 -0
- package/dist/v2/svg-renderer/layers.d.ts.map +1 -0
- package/dist/v2/svg-renderer/layers.js +4 -0
- package/dist/v2/svg-renderer/primitives.d.ts +12 -0
- package/dist/v2/svg-renderer/primitives.d.ts.map +1 -0
- package/dist/v2/svg-renderer/primitives.js +13 -0
- package/dist/v2/svg-renderer/renderer.d.ts +4 -0
- package/dist/v2/svg-renderer/renderer.d.ts.map +1 -0
- package/dist/v2/svg-renderer/renderer.js +24 -0
- package/dist/v2/svg-renderer/symbolGeometry.d.ts +6 -0
- package/dist/v2/svg-renderer/symbolGeometry.d.ts.map +1 -0
- package/dist/v2/svg-renderer/symbolGeometry.js +10 -0
- package/dist/v2/svg-renderer/symbols.d.ts +3 -0
- package/dist/v2/svg-renderer/symbols.d.ts.map +1 -0
- package/dist/v2/svg-renderer/symbols.js +23 -0
- package/dist/v2/svg-renderer/testIds.d.ts +2 -0
- package/dist/v2/svg-renderer/testIds.d.ts.map +1 -0
- package/dist/v2/svg-renderer/testIds.js +10 -0
- package/dist/v2/svg-renderer/textMeasurement.d.ts +4 -0
- package/dist/v2/svg-renderer/textMeasurement.d.ts.map +1 -0
- package/dist/v2/svg-renderer/textMeasurement.js +37 -0
- package/dist/v2/svg-renderer/types.d.ts +134 -0
- package/dist/v2/svg-renderer/types.d.ts.map +1 -0
- package/dist/v2/svg-renderer/types.js +1 -0
- package/package.json +56 -50
- package/v2/index.d.ts +1 -0
- package/v2/index.js +1 -0
- package/v2/package.json +6 -0
- package/scripts/chartkit-codemod.mjs +0 -256
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { buildLayoutDebugModel } from "../../../core/index";
|
|
2
|
+
const getXLabelRect = (label) => {
|
|
3
|
+
const left = label.textAnchor === "start"
|
|
4
|
+
? label.x
|
|
5
|
+
: label.textAnchor === "end"
|
|
6
|
+
? label.x - label.size.width
|
|
7
|
+
: label.x - label.size.width / 2;
|
|
8
|
+
return {
|
|
9
|
+
id: `x-label-${label.index}`,
|
|
10
|
+
text: label.text,
|
|
11
|
+
x: left,
|
|
12
|
+
y: label.y - label.size.height,
|
|
13
|
+
width: label.size.width,
|
|
14
|
+
height: label.size.height
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
const getYLabelRect = ({ label, measureYLabel, plotX }) => {
|
|
18
|
+
const size = measureYLabel(label.text);
|
|
19
|
+
return {
|
|
20
|
+
id: `y-label-${label.key}`,
|
|
21
|
+
text: label.text,
|
|
22
|
+
x: plotX - 8 - size.width,
|
|
23
|
+
y: label.y - size.height,
|
|
24
|
+
width: size.width,
|
|
25
|
+
height: size.height
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
const defaultMeasureYLabel = (fontSize) => {
|
|
29
|
+
return (text) => ({
|
|
30
|
+
height: fontSize + 2,
|
|
31
|
+
width: text.length * fontSize * 0.58
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
const getBaseDebugLayout = ({ boxes, labels, tooltip }) => {
|
|
35
|
+
const options = {
|
|
36
|
+
boxes,
|
|
37
|
+
labels
|
|
38
|
+
};
|
|
39
|
+
return buildLayoutDebugModel(tooltip
|
|
40
|
+
? {
|
|
41
|
+
...options,
|
|
42
|
+
tooltip: {
|
|
43
|
+
placement: "top",
|
|
44
|
+
rect: {
|
|
45
|
+
x: tooltip.x,
|
|
46
|
+
y: tooltip.y,
|
|
47
|
+
width: tooltip.width,
|
|
48
|
+
height: tooltip.height
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
: options);
|
|
53
|
+
};
|
|
54
|
+
export const buildLineChartDebugLayoutModel = ({ boxes, legendItems, measureYLabel, tooltip, xLabels, yAxisLabelFontSize, yLabels }) => {
|
|
55
|
+
const resolvedMeasureYLabel = measureYLabel ?? defaultMeasureYLabel(yAxisLabelFontSize);
|
|
56
|
+
const labels = [
|
|
57
|
+
...xLabels.map(getXLabelRect),
|
|
58
|
+
...yLabels.map((label) => getYLabelRect({
|
|
59
|
+
label,
|
|
60
|
+
measureYLabel: resolvedMeasureYLabel,
|
|
61
|
+
plotX: boxes.plot.x
|
|
62
|
+
}))
|
|
63
|
+
];
|
|
64
|
+
const base = getBaseDebugLayout({ boxes, labels, tooltip });
|
|
65
|
+
const legendRects = legendItems?.map((item) => ({
|
|
66
|
+
id: `legend-${item.key}`,
|
|
67
|
+
kind: "legend",
|
|
68
|
+
text: item.label,
|
|
69
|
+
x: item.x,
|
|
70
|
+
y: item.y,
|
|
71
|
+
width: item.width,
|
|
72
|
+
height: item.height
|
|
73
|
+
})) ?? [];
|
|
74
|
+
return {
|
|
75
|
+
rects: [...base.rects, ...legendRects]
|
|
76
|
+
};
|
|
77
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { LayoutDebugModel } from "../../../core/index";
|
|
3
|
+
import type { LineChartRenderer } from "./types";
|
|
4
|
+
export declare const renderLineChartDebugLayout: ({ fontFamily, model, renderer }: {
|
|
5
|
+
fontFamily?: string | undefined;
|
|
6
|
+
model: LayoutDebugModel;
|
|
7
|
+
renderer: LineChartRenderer;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
//# sourceMappingURL=debugOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugOverlay.d.ts","sourceRoot":"","sources":["../../../src/charts/line/debugOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,iBAAiB,CAAC;AAGzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAoBjD,eAAO,MAAM,0BAA0B,GAAI,iCAIxC;IACD,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,KAAK,EAAE,gBAAgB,CAAC;IACxB,QAAQ,EAAE,iBAAiB,CAAC;CAC7B,KAAG,SAuCH,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getFontFamilyProps } from "./text";
|
|
3
|
+
const getDebugStroke = (kind) => {
|
|
4
|
+
switch (kind) {
|
|
5
|
+
case "outer":
|
|
6
|
+
return "#ef4444";
|
|
7
|
+
case "plot":
|
|
8
|
+
return "#22c55e";
|
|
9
|
+
case "legend":
|
|
10
|
+
return "#a855f7";
|
|
11
|
+
case "tooltip":
|
|
12
|
+
return "#f97316";
|
|
13
|
+
case "axis":
|
|
14
|
+
return "#eab308";
|
|
15
|
+
case "label":
|
|
16
|
+
default:
|
|
17
|
+
return "#2563eb";
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export const renderLineChartDebugLayout = ({ fontFamily, model, renderer }) => {
|
|
21
|
+
const { Group, Rect, Text } = renderer;
|
|
22
|
+
const canRenderText = renderer.capabilities?.text !== false;
|
|
23
|
+
return model.rects.map((rect, index) => {
|
|
24
|
+
const stroke = getDebugStroke(rect.kind);
|
|
25
|
+
const dashProps = rect.kind === "outer" || rect.kind === "plot"
|
|
26
|
+
? {}
|
|
27
|
+
: { strokeDasharray: [4, 3] };
|
|
28
|
+
return (_jsxs(Group, { children: [_jsx(Rect, { fill: "none", height: rect.height, stroke: stroke, strokeOpacity: 0.9, strokeWidth: 1, width: rect.width, x: rect.x, y: rect.y, ...dashProps }), rect.text && canRenderText ? (_jsx(Text, { fill: stroke, fontSize: 9, text: rect.text, x: rect.x + 2, y: Math.max(10, rect.y - 3), ...getFontFamilyProps(fontFamily), children: rect.text })) : null] }, `debug-${rect.kind}-${rect.id}-${index}`));
|
|
29
|
+
});
|
|
30
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { LineChartRenderer, LineChartTooltipRenderProps } from "./types";
|
|
2
|
+
export declare const renderDefaultTooltip: <TData>({ config, height, series, width, x, xLabel, y }: LineChartTooltipRenderProps<TData>, renderer: LineChartRenderer) => import("react").JSX.Element | null;
|
|
3
|
+
//# sourceMappingURL=defaultTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultTooltip.d.ts","sourceRoot":"","sources":["../../../src/charts/line/defaultTooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE9E,eAAO,MAAM,oBAAoB,GAAI,KAAK,EACxC,iDAQG,2BAA2B,CAAC,KAAK,CAAC,EACrC,UAAU,iBAAiB,uCAyE5B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getFontFamilyProps } from "./text";
|
|
3
|
+
import { lineChartTooltipLineHeight } from "./tooltip";
|
|
4
|
+
export const renderDefaultTooltip = ({ config, height, series, width, x, xLabel, y }, renderer) => {
|
|
5
|
+
if (renderer.capabilities?.text === false) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
const contentX = x + config.padding;
|
|
9
|
+
const labelY = y + config.padding + config.labelFontSize;
|
|
10
|
+
const firstItemY = labelY + lineChartTooltipLineHeight;
|
|
11
|
+
const hasShadow = config.shadowOpacity > 0;
|
|
12
|
+
const { Circle, Group, Rect, Text } = renderer;
|
|
13
|
+
return (_jsxs(Group, { children: [hasShadow ? (_jsx(Rect, { x: x + config.shadowOffsetX, y: y + config.shadowOffsetY, width: width, height: height, rx: config.borderRadius, fill: config.shadowColor, opacity: config.shadowOpacity })) : null, _jsx(Rect, { x: x, y: y, width: width, height: height, rx: config.borderRadius, fill: config.backgroundColor, stroke: config.borderColor, strokeOpacity: 0.2, strokeWidth: 1 }), _jsx(Text, { x: contentX, y: labelY, fill: config.labelColor, fontSize: config.labelFontSize, fontWeight: "600", text: xLabel, ...getFontFamilyProps(config.fontFamily), children: xLabel }), series.map((item, index) => {
|
|
14
|
+
const itemY = firstItemY + index * lineChartTooltipLineHeight;
|
|
15
|
+
return (_jsxs(Group, { children: [_jsx(Circle, { cx: contentX + 3, cy: itemY - config.fontSize * 0.32, r: 3, fill: item.color }), _jsx(Text, { x: contentX + 12, y: itemY, fill: config.textColor, fontSize: config.fontSize, text: `${item.label}: ${item.formattedValue}`, ...getFontFamilyProps(config.fontFamily), children: `${item.label}: ${item.formattedValue}` })] }, `tooltip-${item.key}`));
|
|
16
|
+
})] }));
|
|
17
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { ChartXValue } from "../../../core/index";
|
|
2
|
+
import type { LineChartSelectablePoint, LineChartSelectedSeriesItem } from "./selection";
|
|
3
|
+
export type LineChartInteractionMode = "none" | "tap" | "scrub";
|
|
4
|
+
export type LineChartSelectionPersistence = "persist" | "whileActive" | "none";
|
|
5
|
+
export type LineChartSelectSeriesItem<TPoint extends LineChartSelectablePoint = LineChartSelectablePoint> = {
|
|
6
|
+
key: string;
|
|
7
|
+
label: string;
|
|
8
|
+
color: string;
|
|
9
|
+
value: number | null | undefined;
|
|
10
|
+
formattedValue: string;
|
|
11
|
+
point: TPoint;
|
|
12
|
+
};
|
|
13
|
+
export type LineChartSelectEvent<TData = unknown, TPoint extends LineChartSelectablePoint = LineChartSelectablePoint> = {
|
|
14
|
+
index: number;
|
|
15
|
+
x: ChartXValue;
|
|
16
|
+
xLabel: string;
|
|
17
|
+
position: {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
};
|
|
21
|
+
series: Array<LineChartSelectSeriesItem<TPoint>>;
|
|
22
|
+
raw?: TData;
|
|
23
|
+
};
|
|
24
|
+
export type LineChartDeselectEvent = {
|
|
25
|
+
reason: "outsidePress" | "gestureEnd" | "programmatic";
|
|
26
|
+
};
|
|
27
|
+
export type LineChartInteractionConfig<TData = unknown> = {
|
|
28
|
+
mode?: LineChartInteractionMode;
|
|
29
|
+
selectionPersistence?: LineChartSelectionPersistence;
|
|
30
|
+
deselectOnOutsidePress?: boolean;
|
|
31
|
+
onSelect?: (event: LineChartSelectEvent<TData>) => void;
|
|
32
|
+
onDeselect?: (event: LineChartDeselectEvent) => void;
|
|
33
|
+
onGestureStart?: () => void;
|
|
34
|
+
onGestureEnd?: () => void;
|
|
35
|
+
};
|
|
36
|
+
export type LineChartInteraction<TData = unknown> = LineChartInteractionMode | LineChartInteractionConfig<TData>;
|
|
37
|
+
export type ResolvedLineChartInteractionConfig<TData = unknown> = {
|
|
38
|
+
mode: LineChartInteractionMode;
|
|
39
|
+
selectionPersistence: LineChartSelectionPersistence;
|
|
40
|
+
deselectOnOutsidePress: boolean;
|
|
41
|
+
onSelect?: (event: LineChartSelectEvent<TData>) => void;
|
|
42
|
+
onDeselect?: (event: LineChartDeselectEvent) => void;
|
|
43
|
+
onGestureStart?: () => void;
|
|
44
|
+
onGestureEnd?: () => void;
|
|
45
|
+
};
|
|
46
|
+
export type LineChartInteractionPoint<TData = unknown> = {
|
|
47
|
+
dataIndex: number;
|
|
48
|
+
x: number;
|
|
49
|
+
xValue: ChartXValue;
|
|
50
|
+
xLabel: string;
|
|
51
|
+
raw?: TData;
|
|
52
|
+
};
|
|
53
|
+
export type LineChartInteractionBounds = {
|
|
54
|
+
x: number;
|
|
55
|
+
y: number;
|
|
56
|
+
width: number;
|
|
57
|
+
height: number;
|
|
58
|
+
};
|
|
59
|
+
export declare const normalizeLineChartSelectedIndex: (selectedIndex: number | undefined) => number | undefined;
|
|
60
|
+
export declare const getLineChartInteractionConfig: <TData>(interaction: LineChartInteraction<TData> | undefined) => ResolvedLineChartInteractionConfig<TData>;
|
|
61
|
+
export declare const isLineChartInteractionEnabled: <TData>(config: ResolvedLineChartInteractionConfig<TData>) => boolean;
|
|
62
|
+
export declare const isLineChartInteractionInBounds: ({ bounds, locationX, locationY, touchSlop }: {
|
|
63
|
+
bounds: LineChartInteractionBounds;
|
|
64
|
+
locationX: number;
|
|
65
|
+
locationY: number;
|
|
66
|
+
touchSlop?: number;
|
|
67
|
+
}) => boolean;
|
|
68
|
+
export declare const getLineChartVisibleInteractionBounds: ({ bounds, scrollable, viewportWidth }: {
|
|
69
|
+
bounds: LineChartInteractionBounds;
|
|
70
|
+
scrollable: boolean;
|
|
71
|
+
viewportWidth: number;
|
|
72
|
+
}) => LineChartInteractionBounds;
|
|
73
|
+
export declare const getNearestLineChartInteractionIndex: ({ locationX, points }: {
|
|
74
|
+
locationX: number;
|
|
75
|
+
points: Array<LineChartInteractionPoint>;
|
|
76
|
+
}) => number | undefined;
|
|
77
|
+
export declare const buildLineChartSelectEvent: <TData, TPoint extends LineChartSelectablePoint>({ interactionPoints, selectedDataIndex, selectedSeries }: {
|
|
78
|
+
interactionPoints: Array<LineChartInteractionPoint<TData>>;
|
|
79
|
+
selectedDataIndex: number;
|
|
80
|
+
selectedSeries: Array<LineChartSelectedSeriesItem<TPoint>>;
|
|
81
|
+
}) => LineChartSelectEvent<TData, TPoint> | undefined;
|
|
82
|
+
//# sourceMappingURL=interaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["../../../src/charts/line/interaction.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export const normalizeLineChartSelectedIndex = (selectedIndex) => {
|
|
2
|
+
return typeof selectedIndex === "number" && Number.isFinite(selectedIndex)
|
|
3
|
+
? Math.round(selectedIndex)
|
|
4
|
+
: undefined;
|
|
5
|
+
};
|
|
6
|
+
export const getLineChartInteractionConfig = (interaction) => {
|
|
7
|
+
if (!interaction) {
|
|
8
|
+
return {
|
|
9
|
+
mode: "none",
|
|
10
|
+
selectionPersistence: "persist",
|
|
11
|
+
deselectOnOutsidePress: false
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
if (typeof interaction === "string") {
|
|
15
|
+
return {
|
|
16
|
+
mode: interaction,
|
|
17
|
+
selectionPersistence: "persist",
|
|
18
|
+
deselectOnOutsidePress: true
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const mode = interaction.mode ?? "tap";
|
|
22
|
+
return {
|
|
23
|
+
mode,
|
|
24
|
+
selectionPersistence: interaction.selectionPersistence ?? "persist",
|
|
25
|
+
deselectOnOutsidePress: interaction.deselectOnOutsidePress ?? true,
|
|
26
|
+
...(interaction.onSelect ? { onSelect: interaction.onSelect } : {}),
|
|
27
|
+
...(interaction.onDeselect ? { onDeselect: interaction.onDeselect } : {}),
|
|
28
|
+
...(interaction.onGestureStart
|
|
29
|
+
? { onGestureStart: interaction.onGestureStart }
|
|
30
|
+
: {}),
|
|
31
|
+
...(interaction.onGestureEnd
|
|
32
|
+
? { onGestureEnd: interaction.onGestureEnd }
|
|
33
|
+
: {})
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export const isLineChartInteractionEnabled = (config) => config.mode !== "none";
|
|
37
|
+
export const isLineChartInteractionInBounds = ({ bounds, locationX, locationY, touchSlop = 16 }) => {
|
|
38
|
+
return (locationX >= bounds.x - touchSlop &&
|
|
39
|
+
locationX <= bounds.x + bounds.width + touchSlop &&
|
|
40
|
+
locationY >= bounds.y - touchSlop &&
|
|
41
|
+
locationY <= bounds.y + bounds.height + touchSlop);
|
|
42
|
+
};
|
|
43
|
+
export const getLineChartVisibleInteractionBounds = ({ bounds, scrollable, viewportWidth }) => {
|
|
44
|
+
if (!scrollable) {
|
|
45
|
+
return bounds;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
...bounds,
|
|
49
|
+
width: Math.max(0, viewportWidth - bounds.x)
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export const getNearestLineChartInteractionIndex = ({ locationX, points }) => {
|
|
53
|
+
let nearest;
|
|
54
|
+
points.forEach((point) => {
|
|
55
|
+
if (!Number.isFinite(point.x)) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const distance = Math.abs(point.x - locationX);
|
|
59
|
+
if (!nearest || distance < nearest.distance) {
|
|
60
|
+
nearest = {
|
|
61
|
+
dataIndex: point.dataIndex,
|
|
62
|
+
distance
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
return nearest?.dataIndex;
|
|
67
|
+
};
|
|
68
|
+
export const buildLineChartSelectEvent = ({ interactionPoints, selectedDataIndex, selectedSeries }) => {
|
|
69
|
+
const interactionPoint = interactionPoints.find((point) => point.dataIndex === selectedDataIndex);
|
|
70
|
+
if (!interactionPoint || selectedSeries.length === 0) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
const y = Math.min(...selectedSeries.map((item) => item.point.y));
|
|
74
|
+
const event = {
|
|
75
|
+
index: selectedDataIndex,
|
|
76
|
+
x: interactionPoint.xValue,
|
|
77
|
+
xLabel: interactionPoint.xLabel,
|
|
78
|
+
position: {
|
|
79
|
+
x: interactionPoint.x,
|
|
80
|
+
y
|
|
81
|
+
},
|
|
82
|
+
series: selectedSeries.map((item) => ({
|
|
83
|
+
key: item.key,
|
|
84
|
+
label: item.label,
|
|
85
|
+
color: item.color,
|
|
86
|
+
value: item.value,
|
|
87
|
+
formattedValue: item.formattedValue,
|
|
88
|
+
point: item.point
|
|
89
|
+
}))
|
|
90
|
+
};
|
|
91
|
+
return interactionPoint.raw !== undefined
|
|
92
|
+
? { ...event, raw: interactionPoint.raw }
|
|
93
|
+
: event;
|
|
94
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { solveChartBoxes } from "../../../core/index";
|
|
2
|
+
import type { Size } from "../../../core/index";
|
|
3
|
+
import type { ResolvedCartesianChartTheme } from "../../theme";
|
|
4
|
+
import type { LineChartLegendAlign, LineChartLegendRenderProps, LineChartLegendPosition, LineChartProps, LineChartRenderer, ResolvedLineChartLegendConfig } from "./types";
|
|
5
|
+
export declare const getLegendConfig: (legend: LineChartProps<Record<string, unknown>>["legend"], seriesCount: number, theme: ResolvedCartesianChartTheme) => ResolvedLineChartLegendConfig;
|
|
6
|
+
export declare const getLegendX: ({ align, boxes, legendWidth, width }: {
|
|
7
|
+
align: LineChartLegendAlign;
|
|
8
|
+
boxes: ReturnType<typeof solveChartBoxes>;
|
|
9
|
+
legendWidth: number;
|
|
10
|
+
width: number;
|
|
11
|
+
}) => number;
|
|
12
|
+
export declare const getLegendY: ({ boxes, xLabelHeight, xLabelLineHeight, legendHeight, position }: {
|
|
13
|
+
boxes: ReturnType<typeof solveChartBoxes>;
|
|
14
|
+
xLabelHeight: number;
|
|
15
|
+
xLabelLineHeight: number;
|
|
16
|
+
legendHeight: number;
|
|
17
|
+
position: LineChartLegendPosition;
|
|
18
|
+
}) => number;
|
|
19
|
+
export declare const renderConfiguredLegend: ({ legend, config, renderer }: {
|
|
20
|
+
legend: LineChartLegendRenderProps;
|
|
21
|
+
config: ResolvedLineChartLegendConfig;
|
|
22
|
+
renderer: LineChartRenderer;
|
|
23
|
+
}) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
24
|
+
export declare const buildLegendLayout: ({ config, items, maxWidth, measureText }: {
|
|
25
|
+
config: ResolvedLineChartLegendConfig;
|
|
26
|
+
items: Array<{
|
|
27
|
+
id: string;
|
|
28
|
+
label: string;
|
|
29
|
+
}>;
|
|
30
|
+
maxWidth: number;
|
|
31
|
+
measureText: (text: string, options: {
|
|
32
|
+
fontSize: number;
|
|
33
|
+
}) => Size;
|
|
34
|
+
}) => import("../../../core/index").LegendLayout;
|
|
35
|
+
//# sourceMappingURL=legend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../../src/charts/line/legend.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EACV,oBAAoB,EAEpB,0BAA0B,EAC1B,uBAAuB,EACvB,cAAc,EACd,iBAAiB,EACjB,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,eAAe,GAC1B,QAAQ,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,EACzD,aAAa,MAAM,EACnB,OAAO,2BAA2B,KACjC,6BA4BF,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,sCAKxB;IACD,KAAK,EAAE,oBAAoB,CAAC;IAC5B,KAAK,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,WAUA,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,mEAMxB;IACD,KAAK,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,uBAAuB,CAAC;CACnC,WAYA,CAAC;AA6DF,eAAO,MAAM,sBAAsB,GAAI,8BAIpC;IACD,MAAM,EAAE,0BAA0B,CAAC;IACnC,MAAM,EAAE,6BAA6B,CAAC;IACtC,QAAQ,EAAE,iBAAiB,CAAC;CAC7B,gWAoBA,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,0CAK/B;IACD,MAAM,EAAE,6BAA6B,CAAC;IACtC,KAAK,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CACpE,2CA4BA,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { layoutLegend } from "../../../core/index";
|
|
3
|
+
import { getFontFamilyProps } from "./text";
|
|
4
|
+
export const getLegendConfig = (legend, seriesCount, theme) => {
|
|
5
|
+
const config = typeof legend === "object" ? legend : {};
|
|
6
|
+
const visible = typeof legend === "boolean"
|
|
7
|
+
? legend
|
|
8
|
+
: config.visible !== undefined
|
|
9
|
+
? config.visible
|
|
10
|
+
: seriesCount > 1;
|
|
11
|
+
return {
|
|
12
|
+
visible,
|
|
13
|
+
position: config.position ?? "top",
|
|
14
|
+
align: config.align ?? "start",
|
|
15
|
+
wrap: config.wrap ?? true,
|
|
16
|
+
itemGap: config.itemGap ?? 20,
|
|
17
|
+
rowGap: config.rowGap ?? 8,
|
|
18
|
+
padding: config.padding ?? 0,
|
|
19
|
+
labelGap: config.labelGap ?? 6,
|
|
20
|
+
itemPaddingHorizontal: config.itemPaddingHorizontal ?? 0,
|
|
21
|
+
itemPaddingVertical: config.itemPaddingVertical ?? 0,
|
|
22
|
+
markerSize: config.markerSize ?? 8,
|
|
23
|
+
marker: config.marker ?? "square",
|
|
24
|
+
labelColor: config.labelColor ?? theme.text,
|
|
25
|
+
fontSize: config.fontSize ?? theme.typography.legendLabelSize,
|
|
26
|
+
fontFamily: config.fontFamily ?? theme.typography.fontFamily,
|
|
27
|
+
renderItem: config.renderItem,
|
|
28
|
+
renderLegend: config.renderLegend
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export const getLegendX = ({ align, boxes, legendWidth, width }) => {
|
|
32
|
+
if (align === "center") {
|
|
33
|
+
return Math.max(4, (width - legendWidth) / 2);
|
|
34
|
+
}
|
|
35
|
+
if (align === "end") {
|
|
36
|
+
return Math.max(4, width - boxes.padding.right - legendWidth);
|
|
37
|
+
}
|
|
38
|
+
return boxes.plot.x;
|
|
39
|
+
};
|
|
40
|
+
export const getLegendY = ({ boxes, xLabelHeight, xLabelLineHeight, legendHeight, position }) => {
|
|
41
|
+
if (position === "bottom") {
|
|
42
|
+
return (boxes.plot.y +
|
|
43
|
+
boxes.plot.height +
|
|
44
|
+
(xLabelHeight > 0
|
|
45
|
+
? 20 + Math.max(0, xLabelHeight - xLabelLineHeight) + 10
|
|
46
|
+
: 10));
|
|
47
|
+
}
|
|
48
|
+
return Math.max(8, boxes.plot.y - legendHeight - 8);
|
|
49
|
+
};
|
|
50
|
+
const renderDefaultLegendItem = (item, renderer) => {
|
|
51
|
+
const markerCenterY = item.contentY + item.contentHeight / 2;
|
|
52
|
+
const legendLineStrokeWidth = Math.min(3, Math.max(1.5, item.strokeWidth));
|
|
53
|
+
const { Circle, Group, Line, Rect, Text } = renderer;
|
|
54
|
+
return (_jsxs(Group, { children: [item.marker === "line" ? (_jsx(Line, { x1: item.contentX, x2: item.contentX + item.markerSize, y1: markerCenterY, y2: markerCenterY, stroke: item.color, strokeLinecap: item.strokeLinecap, strokeOpacity: item.strokeOpacity, strokeWidth: legendLineStrokeWidth, ...(item.strokeDasharray
|
|
55
|
+
? { strokeDasharray: item.strokeDasharray }
|
|
56
|
+
: {}) })) : item.marker === "circle" ? (_jsx(Circle, { cx: item.contentX + item.markerSize / 2, cy: markerCenterY, r: item.markerSize / 2, fill: item.color, opacity: item.strokeOpacity, stroke: item.color })) : (_jsx(Rect, { x: item.contentX, y: markerCenterY - item.markerSize / 2, width: item.markerSize, height: item.markerSize, rx: 2, fill: item.color, opacity: item.strokeOpacity, stroke: item.color })), _jsx(Text, { x: item.contentX + item.markerSize + item.labelGap, y: item.contentY + item.contentHeight / 2 + item.fontSize * 0.36, fill: item.labelColor, fontSize: item.fontSize, text: item.label, ...getFontFamilyProps(item.fontFamily), children: item.label })] }, `legend-${item.key}`));
|
|
57
|
+
};
|
|
58
|
+
export const renderConfiguredLegend = ({ legend, config, renderer }) => {
|
|
59
|
+
if (config.renderLegend) {
|
|
60
|
+
return config.renderLegend(legend);
|
|
61
|
+
}
|
|
62
|
+
if (!config.renderItem && renderer.capabilities?.text === false) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
const { Group } = renderer;
|
|
66
|
+
return (_jsx(Group, { children: legend.items.map((item) => config.renderItem
|
|
67
|
+
? config.renderItem(item)
|
|
68
|
+
: renderDefaultLegendItem(item, renderer)) }));
|
|
69
|
+
};
|
|
70
|
+
export const buildLegendLayout = ({ config, items, maxWidth, measureText }) => {
|
|
71
|
+
const markerSize = config.marker === "line" ? config.markerSize + 8 : config.markerSize;
|
|
72
|
+
return layoutLegend({
|
|
73
|
+
items: items.map((item) => {
|
|
74
|
+
const labelSize = measureText(item.label, {
|
|
75
|
+
fontSize: config.fontSize,
|
|
76
|
+
...getFontFamilyProps(config.fontFamily)
|
|
77
|
+
});
|
|
78
|
+
return {
|
|
79
|
+
id: item.id,
|
|
80
|
+
label: item.label,
|
|
81
|
+
markerSize,
|
|
82
|
+
labelWidth: labelSize.width,
|
|
83
|
+
labelHeight: labelSize.height
|
|
84
|
+
};
|
|
85
|
+
}),
|
|
86
|
+
position: config.position,
|
|
87
|
+
maxWidth: config.wrap ? Math.max(0, maxWidth - 32) : 100000,
|
|
88
|
+
itemGap: config.itemGap,
|
|
89
|
+
rowGap: config.rowGap,
|
|
90
|
+
padding: config.padding,
|
|
91
|
+
labelGap: config.labelGap,
|
|
92
|
+
itemPaddingHorizontal: config.itemPaddingHorizontal,
|
|
93
|
+
itemPaddingVertical: config.itemPaddingVertical
|
|
94
|
+
});
|
|
95
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ResolvedCartesianChartTheme } from "../../theme";
|
|
2
|
+
import type { LineChartDotRenderProps, LineChartRenderer } from "./types";
|
|
3
|
+
import type { LineChartDotColor } from "./options";
|
|
4
|
+
export declare const resolveDotColor: ({ color, fallback, seriesColor, theme }: {
|
|
5
|
+
color: LineChartDotColor;
|
|
6
|
+
fallback: string;
|
|
7
|
+
seriesColor: string;
|
|
8
|
+
theme: ResolvedCartesianChartTheme;
|
|
9
|
+
}) => string;
|
|
10
|
+
export declare const renderDefaultDot: <TData>({ color, config, point, theme }: LineChartDotRenderProps<TData>, renderer: LineChartRenderer) => import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=markers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markers.d.ts","sourceRoot":"","sources":["../../../src/charts/line/markers.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,eAAO,MAAM,eAAe,GAAI,yCAK7B;IACD,KAAK,EAAE,iBAAiB,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,2BAA2B,CAAC;CACpC,WAUA,CAAC;AAsBF,eAAO,MAAM,gBAAgB,GAAI,KAAK,EACpC,iCAAiC,uBAAuB,CAAC,KAAK,CAAC,EAC/D,UAAU,iBAAiB,gCA0D5B,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createSvgTestId } from "../../../svg-renderer/index";
|
|
3
|
+
export const resolveDotColor = ({ color, fallback, seriesColor, theme }) => {
|
|
4
|
+
if (color === "background") {
|
|
5
|
+
return theme.background;
|
|
6
|
+
}
|
|
7
|
+
if (color === "series") {
|
|
8
|
+
return seriesColor;
|
|
9
|
+
}
|
|
10
|
+
return color || fallback;
|
|
11
|
+
};
|
|
12
|
+
const createDiamondPath = ({ size, x, y }) => {
|
|
13
|
+
const radius = size / 2;
|
|
14
|
+
return [
|
|
15
|
+
`M ${x} ${y - radius}`,
|
|
16
|
+
`L ${x + radius} ${y}`,
|
|
17
|
+
`L ${x} ${y + radius}`,
|
|
18
|
+
`L ${x - radius} ${y}`,
|
|
19
|
+
"Z"
|
|
20
|
+
].join(" ");
|
|
21
|
+
};
|
|
22
|
+
export const renderDefaultDot = ({ color, config, point, theme }, renderer) => {
|
|
23
|
+
const fill = resolveDotColor({
|
|
24
|
+
color: config.fill,
|
|
25
|
+
fallback: theme.background,
|
|
26
|
+
seriesColor: color,
|
|
27
|
+
theme
|
|
28
|
+
});
|
|
29
|
+
const stroke = resolveDotColor({
|
|
30
|
+
color: config.stroke,
|
|
31
|
+
fallback: color,
|
|
32
|
+
seriesColor: color,
|
|
33
|
+
theme
|
|
34
|
+
});
|
|
35
|
+
const dotKey = `dot-${point.seriesKey}-${point.index}`;
|
|
36
|
+
const commonProps = {
|
|
37
|
+
testID: createSvgTestId("line-dot", point.seriesKey, point.index),
|
|
38
|
+
fill,
|
|
39
|
+
opacity: config.opacity,
|
|
40
|
+
stroke,
|
|
41
|
+
strokeWidth: config.strokeWidth
|
|
42
|
+
};
|
|
43
|
+
const { Circle, Path, Rect } = renderer;
|
|
44
|
+
const size = config.radius * 2;
|
|
45
|
+
if (config.shape === "square") {
|
|
46
|
+
return (_jsx(Rect, { x: point.x - size / 2, y: point.y - size / 2, width: size, height: size, rx: Math.min(3, config.radius * 0.45), ...commonProps }, dotKey));
|
|
47
|
+
}
|
|
48
|
+
if (config.shape === "diamond") {
|
|
49
|
+
return (_jsx(Path, { d: createDiamondPath({ x: point.x, y: point.y, size }), ...commonProps }, dotKey));
|
|
50
|
+
}
|
|
51
|
+
return (_jsx(Circle, { cx: point.x, cy: point.y, r: config.radius, ...commonProps }, dotKey));
|
|
52
|
+
};
|