react-native-chart-kit 7.0.0-next.0 → 7.0.0-next.2
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 +17 -0
- 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 +198 -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 +126 -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 +15 -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 +40 -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 +65 -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/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 +50 -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 +176 -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 +59 -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/viewportInteractionConfig.d.ts +3 -0
- package/dist/v2/react-native/charts/line/viewportInteractionConfig.d.ts.map +1 -0
- package/dist/v2/react-native/charts/line/viewportInteractionConfig.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 +244 -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/panResponder.d.ts +14 -0
- package/dist/v2/react-native/viewport/panResponder.d.ts.map +1 -0
- package/dist/v2/react-native/viewport/panResponder.js +115 -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 +46 -47
- 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,156 @@
|
|
|
1
|
+
import { resolveReferenceLineLabelY } from "./referenceLabelPlacement";
|
|
2
|
+
const defaultReferenceLineOpacity = 0.86;
|
|
3
|
+
const defaultReferenceBandOpacity = 0.1;
|
|
4
|
+
const defaultReferenceLabelContainerBorderRadius = 4;
|
|
5
|
+
const defaultReferenceLabelContainerOpacity = 0.9;
|
|
6
|
+
const defaultReferenceLabelContainerPaddingX = 3;
|
|
7
|
+
const defaultReferenceLabelContainerPaddingY = 2;
|
|
8
|
+
const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
|
|
9
|
+
const resolveOpacity = (value, fallback) => typeof value === "number" && Number.isFinite(value)
|
|
10
|
+
? clamp(value, 0, 1)
|
|
11
|
+
: fallback;
|
|
12
|
+
const isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);
|
|
13
|
+
const resolveFiniteNumber = (value, fallback) => typeof value === "number" && Number.isFinite(value) ? value : fallback;
|
|
14
|
+
const resolveReferenceLabelContainer = ({ container, theme }) => {
|
|
15
|
+
if (!container) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
const config = typeof container === "object" ? container : {};
|
|
19
|
+
return {
|
|
20
|
+
backgroundColor: config.backgroundColor ?? theme.plotBackground,
|
|
21
|
+
borderRadius: Math.max(0, resolveFiniteNumber(config.borderRadius, defaultReferenceLabelContainerBorderRadius)),
|
|
22
|
+
opacity: resolveOpacity(config.opacity, defaultReferenceLabelContainerOpacity),
|
|
23
|
+
paddingX: Math.max(0, resolveFiniteNumber(config.paddingX, defaultReferenceLabelContainerPaddingX)),
|
|
24
|
+
paddingY: Math.max(0, resolveFiniteNumber(config.paddingY, defaultReferenceLabelContainerPaddingY))
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
const getTextAnchor = (position) => {
|
|
28
|
+
if (position === "start") {
|
|
29
|
+
return "start";
|
|
30
|
+
}
|
|
31
|
+
if (position === "center") {
|
|
32
|
+
return "middle";
|
|
33
|
+
}
|
|
34
|
+
return "end";
|
|
35
|
+
};
|
|
36
|
+
const getReferenceLabelX = ({ plot, position }) => {
|
|
37
|
+
if (position === "start") {
|
|
38
|
+
return plot.x + 8;
|
|
39
|
+
}
|
|
40
|
+
if (position === "center") {
|
|
41
|
+
return plot.x + plot.width / 2;
|
|
42
|
+
}
|
|
43
|
+
return plot.x + plot.width - 8;
|
|
44
|
+
};
|
|
45
|
+
export const buildLineChartReferenceLineModels = ({ geometries, lines, plot, theme, yScale }) => {
|
|
46
|
+
if (!lines || lines.length === 0) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
const plotBottom = plot.y + plot.height;
|
|
50
|
+
return lines.flatMap((line, index) => {
|
|
51
|
+
if (!isFiniteNumber(line.y)) {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
const y = yScale.scale(line.y);
|
|
55
|
+
if (y < plot.y || y > plotBottom) {
|
|
56
|
+
return [];
|
|
57
|
+
}
|
|
58
|
+
const labelPosition = line.labelPosition ?? "end";
|
|
59
|
+
const labelFontSize = typeof line.labelFontSize === "number" && line.labelFontSize > 0
|
|
60
|
+
? line.labelFontSize
|
|
61
|
+
: theme.typography.axisLabelSize;
|
|
62
|
+
const labelOffset = typeof line.labelOffset === "number" && Number.isFinite(line.labelOffset)
|
|
63
|
+
? line.labelOffset
|
|
64
|
+
: 6;
|
|
65
|
+
const model = {
|
|
66
|
+
key: `reference-line-${index}-${line.y}`,
|
|
67
|
+
x1: plot.x,
|
|
68
|
+
x2: plot.x + plot.width,
|
|
69
|
+
y,
|
|
70
|
+
color: line.color ?? theme.mutedText,
|
|
71
|
+
opacity: resolveOpacity(line.opacity, defaultReferenceLineOpacity),
|
|
72
|
+
strokeWidth: line.strokeWidth ?? 1
|
|
73
|
+
};
|
|
74
|
+
if (line.strokeDasharray !== undefined) {
|
|
75
|
+
model.strokeDasharray = line.strokeDasharray;
|
|
76
|
+
}
|
|
77
|
+
if (line.label) {
|
|
78
|
+
const textAnchor = getTextAnchor(labelPosition);
|
|
79
|
+
const labelX = getReferenceLabelX({ plot, position: labelPosition });
|
|
80
|
+
const labelContainer = resolveReferenceLabelContainer({
|
|
81
|
+
container: line.labelContainer,
|
|
82
|
+
theme
|
|
83
|
+
});
|
|
84
|
+
model.label = {
|
|
85
|
+
text: line.label,
|
|
86
|
+
x: labelX,
|
|
87
|
+
y: resolveReferenceLineLabelY({
|
|
88
|
+
geometries,
|
|
89
|
+
labelOffset,
|
|
90
|
+
labelPlacement: line.labelPlacement,
|
|
91
|
+
lineY: y,
|
|
92
|
+
plot,
|
|
93
|
+
text: line.label,
|
|
94
|
+
textAnchor,
|
|
95
|
+
fontSize: labelFontSize,
|
|
96
|
+
x: labelX
|
|
97
|
+
}),
|
|
98
|
+
color: line.labelColor ?? line.color ?? theme.mutedText,
|
|
99
|
+
...(labelContainer !== undefined ? { container: labelContainer } : {}),
|
|
100
|
+
fontSize: labelFontSize,
|
|
101
|
+
textAnchor
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return [model];
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
export const buildLineChartReferenceBandModels = ({ bands, plot, theme, yScale }) => {
|
|
108
|
+
if (!bands || bands.length === 0) {
|
|
109
|
+
return [];
|
|
110
|
+
}
|
|
111
|
+
const plotBottom = plot.y + plot.height;
|
|
112
|
+
return bands.flatMap((band, index) => {
|
|
113
|
+
if (!isFiniteNumber(band.y1) || !isFiniteNumber(band.y2)) {
|
|
114
|
+
return [];
|
|
115
|
+
}
|
|
116
|
+
const yA = yScale.scale(band.y1);
|
|
117
|
+
const yB = yScale.scale(band.y2);
|
|
118
|
+
const top = Math.min(yA, yB);
|
|
119
|
+
const bottom = Math.max(yA, yB);
|
|
120
|
+
const clampedTop = clamp(top, plot.y, plotBottom);
|
|
121
|
+
const clampedBottom = clamp(bottom, plot.y, plotBottom);
|
|
122
|
+
const height = clampedBottom - clampedTop;
|
|
123
|
+
if (height <= 0.5) {
|
|
124
|
+
return [];
|
|
125
|
+
}
|
|
126
|
+
const labelPosition = band.labelPosition ?? "start";
|
|
127
|
+
const labelFontSize = typeof band.labelFontSize === "number" && band.labelFontSize > 0
|
|
128
|
+
? band.labelFontSize
|
|
129
|
+
: theme.typography.axisLabelSize;
|
|
130
|
+
const model = {
|
|
131
|
+
key: `reference-band-${index}-${band.y1}-${band.y2}`,
|
|
132
|
+
x: plot.x,
|
|
133
|
+
y: clampedTop,
|
|
134
|
+
width: plot.width,
|
|
135
|
+
height,
|
|
136
|
+
color: band.color ?? theme.series[0] ?? theme.grid,
|
|
137
|
+
opacity: resolveOpacity(band.opacity, defaultReferenceBandOpacity)
|
|
138
|
+
};
|
|
139
|
+
if (band.label) {
|
|
140
|
+
const labelContainer = resolveReferenceLabelContainer({
|
|
141
|
+
container: band.labelContainer,
|
|
142
|
+
theme
|
|
143
|
+
});
|
|
144
|
+
model.label = {
|
|
145
|
+
text: band.label,
|
|
146
|
+
x: getReferenceLabelX({ plot, position: labelPosition }),
|
|
147
|
+
y: clamp(clampedTop + labelFontSize + 6, plot.y + labelFontSize, plotBottom - 4),
|
|
148
|
+
color: band.labelColor ?? band.color ?? theme.mutedText,
|
|
149
|
+
...(labelContainer !== undefined ? { container: labelContainer } : {}),
|
|
150
|
+
fontSize: labelFontSize,
|
|
151
|
+
textAnchor: getTextAnchor(labelPosition)
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
return [model];
|
|
155
|
+
});
|
|
156
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../../src/charts/line/renderer.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,eAAO,MAAM,oBAAoB,EAAE,iBAoBlC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,UAAU,iBAAiB,GAAG,SAAS,sBAC1C,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SvgClipRect, SvgCircle, SvgDefs, SvgGroup, SvgLayer, SvgLine, SvgLinearGradientDef, SvgPath, SvgRect, SvgSurface, SvgText } from "../../../svg-renderer/index";
|
|
2
|
+
export const lineChartSvgRenderer = {
|
|
3
|
+
ClipRect: SvgClipRect,
|
|
4
|
+
Circle: SvgCircle,
|
|
5
|
+
Defs: SvgDefs,
|
|
6
|
+
Group: SvgGroup,
|
|
7
|
+
Layer: SvgLayer,
|
|
8
|
+
Line: SvgLine,
|
|
9
|
+
LinearGradient: SvgLinearGradientDef,
|
|
10
|
+
Path: SvgPath,
|
|
11
|
+
Rect: SvgRect,
|
|
12
|
+
Surface: SvgSurface,
|
|
13
|
+
Text: SvgText,
|
|
14
|
+
capabilities: {
|
|
15
|
+
clipPaths: true,
|
|
16
|
+
gradients: true,
|
|
17
|
+
pathGradients: false,
|
|
18
|
+
rectClips: false,
|
|
19
|
+
text: true
|
|
20
|
+
},
|
|
21
|
+
name: "svg"
|
|
22
|
+
};
|
|
23
|
+
export const getLineChartRenderer = (renderer) => renderer ?? lineChartSvgRenderer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { GestureResponderEvent, ViewProps } from "react-native";
|
|
2
|
+
import type { LineChartDeselectEvent, ResolvedLineChartInteractionConfig } from "./interaction";
|
|
3
|
+
import type { LineChartViewportPanHandlers } from "./viewportInteraction";
|
|
4
|
+
export declare const useLineChartResponderProps: <TData>({ clearGestureSelection, handleInteractionEvent, interactionConfig, isInteractionEnabled, isResponderEventInPlot, preventBrowserSelection, viewportPan }: {
|
|
5
|
+
clearGestureSelection: (event: LineChartDeselectEvent) => void;
|
|
6
|
+
handleInteractionEvent: (event: GestureResponderEvent) => void;
|
|
7
|
+
interactionConfig: ResolvedLineChartInteractionConfig<TData>;
|
|
8
|
+
isInteractionEnabled: boolean;
|
|
9
|
+
isResponderEventInPlot: (event: GestureResponderEvent) => boolean;
|
|
10
|
+
preventBrowserSelection: (event: GestureResponderEvent) => void;
|
|
11
|
+
viewportPan: LineChartViewportPanHandlers;
|
|
12
|
+
}) => ViewProps;
|
|
13
|
+
//# sourceMappingURL=responders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responders.d.ts","sourceRoot":"","sources":["../../../src/charts/line/responders.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAErE,OAAO,KAAK,EACV,sBAAsB,EACtB,kCAAkC,EACnC,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAE1E,eAAO,MAAM,0BAA0B,GAAI,KAAK,EAAE,0JAQ/C;IACD,qBAAqB,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAC/D,sBAAsB,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC/D,iBAAiB,EAAE,kCAAkC,CAAC,KAAK,CAAC,CAAC;IAC7D,oBAAoB,EAAE,OAAO,CAAC;IAC9B,sBAAsB,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,OAAO,CAAC;IAClE,uBAAuB,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChE,WAAW,EAAE,4BAA4B,CAAC;CAC3C,KAAG,SA6EH,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
export const useLineChartResponderProps = ({ clearGestureSelection, handleInteractionEvent, interactionConfig, isInteractionEnabled, isResponderEventInPlot, preventBrowserSelection, viewportPan }) => {
|
|
3
|
+
const handleResponderGrant = useCallback((event) => {
|
|
4
|
+
preventBrowserSelection(event);
|
|
5
|
+
if (!isResponderEventInPlot(event)) {
|
|
6
|
+
if (interactionConfig.deselectOnOutsidePress) {
|
|
7
|
+
clearGestureSelection({ reason: "outsidePress" });
|
|
8
|
+
}
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
if (viewportPan.isEnabled) {
|
|
12
|
+
viewportPan.handleGrant(event);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
interactionConfig.onGestureStart?.();
|
|
16
|
+
handleInteractionEvent(event);
|
|
17
|
+
}, [
|
|
18
|
+
clearGestureSelection,
|
|
19
|
+
handleInteractionEvent,
|
|
20
|
+
interactionConfig,
|
|
21
|
+
isResponderEventInPlot,
|
|
22
|
+
preventBrowserSelection,
|
|
23
|
+
viewportPan
|
|
24
|
+
]);
|
|
25
|
+
const handleResponderMove = useCallback((event) => {
|
|
26
|
+
if (viewportPan.isActive()) {
|
|
27
|
+
viewportPan.handleMove(event);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (interactionConfig.mode === "scrub") {
|
|
31
|
+
handleInteractionEvent(event);
|
|
32
|
+
}
|
|
33
|
+
}, [handleInteractionEvent, interactionConfig.mode, viewportPan]);
|
|
34
|
+
const handleResponderEnd = useCallback(() => {
|
|
35
|
+
if (viewportPan.isActive()) {
|
|
36
|
+
viewportPan.handleEnd();
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (interactionConfig.selectionPersistence === "whileActive") {
|
|
40
|
+
clearGestureSelection({ reason: "gestureEnd" });
|
|
41
|
+
}
|
|
42
|
+
interactionConfig.onGestureEnd?.();
|
|
43
|
+
}, [clearGestureSelection, interactionConfig, viewportPan]);
|
|
44
|
+
const isResponderEnabled = isInteractionEnabled || viewportPan.isEnabled;
|
|
45
|
+
return isResponderEnabled
|
|
46
|
+
? {
|
|
47
|
+
onStartShouldSetResponder: (event) => viewportPan.shouldSetResponder(event) || isInteractionEnabled,
|
|
48
|
+
onMoveShouldSetResponder: (event) => viewportPan.shouldSetResponder(event) ||
|
|
49
|
+
(interactionConfig.mode === "scrub" && isResponderEventInPlot(event)),
|
|
50
|
+
onResponderTerminationRequest: () => viewportPan.isActive()
|
|
51
|
+
? !viewportPan.shouldBlockTermination
|
|
52
|
+
: interactionConfig.mode !== "scrub",
|
|
53
|
+
onResponderGrant: handleResponderGrant,
|
|
54
|
+
onResponderMove: handleResponderMove,
|
|
55
|
+
onResponderRelease: handleResponderEnd,
|
|
56
|
+
onResponderTerminate: handleResponderEnd
|
|
57
|
+
}
|
|
58
|
+
: {};
|
|
59
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type LineChartDotConfig, type ResolvedLineChartDotConfig } from "./options";
|
|
2
|
+
import type { LineChartTooltipSeriesItem } from "./tooltip";
|
|
3
|
+
export type LineChartSelectablePoint = {
|
|
4
|
+
dataIndex: number;
|
|
5
|
+
defined: boolean;
|
|
6
|
+
index: number;
|
|
7
|
+
value?: number | null;
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
export type LineChartSelectableGeometry<TPoint extends LineChartSelectablePoint> = {
|
|
12
|
+
geometry: {
|
|
13
|
+
key: string;
|
|
14
|
+
label: string;
|
|
15
|
+
points: TPoint[];
|
|
16
|
+
};
|
|
17
|
+
style: {
|
|
18
|
+
color: string;
|
|
19
|
+
dot: ResolvedLineChartDotConfig;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type LineChartSelectedSeriesItem<TPoint extends LineChartSelectablePoint> = LineChartTooltipSeriesItem<TPoint> & {
|
|
23
|
+
activeDot: ResolvedLineChartDotConfig;
|
|
24
|
+
};
|
|
25
|
+
export declare const getSelectedLineSeries: <TPoint extends LineChartSelectablePoint>({ activeDot, formatYLabel, geometries, selectedDataIndex }: {
|
|
26
|
+
activeDot: boolean | LineChartDotConfig | undefined;
|
|
27
|
+
formatYLabel: (value: number) => string;
|
|
28
|
+
geometries: Array<LineChartSelectableGeometry<TPoint>>;
|
|
29
|
+
selectedDataIndex: number | undefined;
|
|
30
|
+
}) => Array<LineChartSelectedSeriesItem<TPoint>>;
|
|
31
|
+
//# sourceMappingURL=selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../../src/charts/line/selection.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAChC,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAE5D,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,2BAA2B,CACrC,MAAM,SAAS,wBAAwB,IACrC;IACF,QAAQ,EAAE;QACR,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;IACF,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,0BAA0B,CAAC;KACjC,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,2BAA2B,CACrC,MAAM,SAAS,wBAAwB,IACrC,0BAA0B,CAAC,MAAM,CAAC,GAAG;IACvC,SAAS,EAAE,0BAA0B,CAAC;CACvC,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,MAAM,SAAS,wBAAwB,EAAE,4DAK5E;IACD,SAAS,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS,CAAC;IACpD,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,UAAU,EAAE,KAAK,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC,CAAC;IACvD,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC,KAAG,KAAK,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAgC5C,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { getLineChartActiveDotConfig } from "./options";
|
|
2
|
+
export const getSelectedLineSeries = ({ activeDot, formatYLabel, geometries, selectedDataIndex }) => {
|
|
3
|
+
if (selectedDataIndex === undefined) {
|
|
4
|
+
return [];
|
|
5
|
+
}
|
|
6
|
+
return geometries.flatMap(({ geometry, style }) => {
|
|
7
|
+
const point = geometry.points.find((item) => item.dataIndex === selectedDataIndex);
|
|
8
|
+
if (!point || !point.defined) {
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
return [
|
|
12
|
+
{
|
|
13
|
+
key: geometry.key,
|
|
14
|
+
label: geometry.label,
|
|
15
|
+
color: style.color,
|
|
16
|
+
value: point.value,
|
|
17
|
+
formattedValue: typeof point.value === "number" ? formatYLabel(point.value) : "—",
|
|
18
|
+
point,
|
|
19
|
+
activeDot: getLineChartActiveDotConfig({
|
|
20
|
+
activeDot,
|
|
21
|
+
baseDot: style.dot
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
];
|
|
25
|
+
});
|
|
26
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { LineChartProps, LineChartSeries } from "./types";
|
|
2
|
+
export declare const resolveLineChartSeriesInput: <TData extends Record<string, unknown>>(yKey: LineChartProps<TData>["yKey"], yKeys: LineChartProps<TData>["yKeys"], series: LineChartProps<TData>["series"]) => LineChartSeries<TData>[];
|
|
3
|
+
export declare const useSeriesInput: <TData extends Record<string, unknown>>(yKey: LineChartProps<TData>["yKey"], yKeys: LineChartProps<TData>["yKeys"], series: LineChartProps<TData>["series"]) => LineChartSeries<TData>[];
|
|
4
|
+
//# sourceMappingURL=seriesInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seriesInput.d.ts","sourceRoot":"","sources":["../../../src/charts/line/seriesInput.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/D,eAAO,MAAM,2BAA2B,GACtC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAErC,MAAM,cAAc,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,EACnC,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EACrC,QAAQ,cAAc,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,6BAWxC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,MAAM,cAAc,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,EACnC,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EACrC,QAAQ,cAAc,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,6BAMxC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
export const resolveLineChartSeriesInput = (yKey, yKeys, series) => {
|
|
3
|
+
if (series && series.length > 0) {
|
|
4
|
+
return series;
|
|
5
|
+
}
|
|
6
|
+
if (yKeys && yKeys.length > 0) {
|
|
7
|
+
return yKeys.map((key) => ({ yKey: key }));
|
|
8
|
+
}
|
|
9
|
+
return yKey ? [{ yKey }] : [];
|
|
10
|
+
};
|
|
11
|
+
export const useSeriesInput = (yKey, yKeys, series) => {
|
|
12
|
+
return useMemo(() => resolveLineChartSeriesInput(yKey, yKeys, series), [series, yKey, yKeys]);
|
|
13
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ResolvedCartesianChartTheme } from "../../theme";
|
|
2
|
+
import { type LineChartAreaFillConfig, type LineChartDotConfig } from "./options";
|
|
3
|
+
import type { LineChartSeries } from "./types";
|
|
4
|
+
export declare const buildLineChartSeriesStyleMap: <TData extends Record<string, unknown>>({ areaFill, dots, resolvedTheme, seriesInput, showDots }: {
|
|
5
|
+
areaFill: LineChartAreaFillConfig | undefined;
|
|
6
|
+
dots: boolean | LineChartDotConfig | undefined;
|
|
7
|
+
resolvedTheme: ResolvedCartesianChartTheme;
|
|
8
|
+
seriesInput: Array<LineChartSeries<TData>>;
|
|
9
|
+
showDots: boolean;
|
|
10
|
+
}) => Map<string, {
|
|
11
|
+
strokeWidth: number;
|
|
12
|
+
strokeStyle: import("./options").ResolvedLineChartStrokeStyle;
|
|
13
|
+
area: boolean | undefined;
|
|
14
|
+
areaFill: import("./options").ResolvedLineChartAreaFillConfig;
|
|
15
|
+
curve: import("../../../core/index").LineCurve | undefined;
|
|
16
|
+
color: string;
|
|
17
|
+
threshold: import("./options").ResolvedLineChartThresholdStyle | undefined;
|
|
18
|
+
dot: import("./options").ResolvedLineChartDotConfig;
|
|
19
|
+
}>;
|
|
20
|
+
//# sourceMappingURL=seriesStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seriesStyles.d.ts","sourceRoot":"","sources":["../../../src/charts/line/seriesStyles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAKL,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACxB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,eAAO,MAAM,4BAA4B,GACvC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,0DAMC;IACD,QAAQ,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAC9C,IAAI,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS,CAAC;IAC/C,aAAa,EAAE,2BAA2B,CAAC;IAC3C,WAAW,EAAE,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3C,QAAQ,EAAE,OAAO,CAAC;CACnB;;;;;;;;;EAkCE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { getLineChartAreaFillConfig, getLineChartDotConfig, getLineChartStrokeStyle, getLineChartThresholdStyle } from "./options";
|
|
2
|
+
import { getSeriesColor } from "./utils";
|
|
3
|
+
export const buildLineChartSeriesStyleMap = ({ areaFill, dots, resolvedTheme, seriesInput, showDots }) => new Map(seriesInput.map((item, index) => {
|
|
4
|
+
const color = item.color ?? getSeriesColor(resolvedTheme, index);
|
|
5
|
+
return [
|
|
6
|
+
String(item.key ?? item.yKey),
|
|
7
|
+
{
|
|
8
|
+
strokeWidth: item.strokeWidth ?? 3,
|
|
9
|
+
strokeStyle: getLineChartStrokeStyle({
|
|
10
|
+
strokeDasharray: item.strokeDasharray,
|
|
11
|
+
strokeLinecap: item.strokeLinecap,
|
|
12
|
+
strokeLinejoin: item.strokeLinejoin,
|
|
13
|
+
strokeOpacity: item.strokeOpacity
|
|
14
|
+
}),
|
|
15
|
+
area: item.area,
|
|
16
|
+
areaFill: getLineChartAreaFillConfig({
|
|
17
|
+
areaFill: item.areaFill ?? areaFill,
|
|
18
|
+
seriesColor: color
|
|
19
|
+
}),
|
|
20
|
+
curve: item.curve,
|
|
21
|
+
color,
|
|
22
|
+
threshold: getLineChartThresholdStyle({
|
|
23
|
+
seriesColor: color,
|
|
24
|
+
threshold: item.threshold
|
|
25
|
+
}),
|
|
26
|
+
dot: getLineChartDotConfig({
|
|
27
|
+
dots,
|
|
28
|
+
seriesDot: item.dot,
|
|
29
|
+
showDots
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
];
|
|
33
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stickyYAxisLayout.d.ts","sourceRoot":"","sources":["../../../src/charts/line/stickyYAxisLayout.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,GAAI,uBAG5C;IACD,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB,WAAoC,CAAC;AAEtC,eAAO,MAAM,yBAAyB,GAAI,cAAc,MAAM,UAClC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const measureLineChartText: import("../../../svg-renderer/index").SvgTextMeasurer;
|
|
2
|
+
export declare const getFontFamilyProps: (fontFamily: string | undefined) => {
|
|
3
|
+
fontFamily: string;
|
|
4
|
+
} | {
|
|
5
|
+
fontFamily?: never;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/charts/line/text.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,mDAE/B,CAAC;AAEH,eAAO,MAAM,kBAAkB,GAAI,YAAY,MAAM,GAAG,SAAS;;;;CAEhE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { LineChartModel } from "./useChartModel";
|
|
2
|
+
import type { LineChartRenderer } from "./types";
|
|
3
|
+
type LineChartGeometryModel<TData extends Record<string, unknown>> = LineChartModel<TData>["geometries"][number];
|
|
4
|
+
export declare const getLineChartAreaGradientRef: (chartId: string, index: number) => string;
|
|
5
|
+
export declare const getLineChartAreaGradientId: (chartId: string, index: number) => string;
|
|
6
|
+
export declare const LineChartThresholdClipDefs: <TData extends Record<string, unknown>>({ chartId, geometries, plot, renderer, yScale }: {
|
|
7
|
+
chartId: string;
|
|
8
|
+
geometries: Array<LineChartGeometryModel<TData>>;
|
|
9
|
+
plot: LineChartModel<TData>["boxes"]["plot"];
|
|
10
|
+
renderer: LineChartRenderer;
|
|
11
|
+
yScale: LineChartModel<TData>["yScale"];
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export declare const LineChartAreaPaths: <TData extends Record<string, unknown>>({ chartId, geometries, plot, yScale, renderer }: {
|
|
14
|
+
chartId: string;
|
|
15
|
+
geometries: Array<LineChartGeometryModel<TData>>;
|
|
16
|
+
plot?: LineChartModel<TData>["boxes"]["plot"] | undefined;
|
|
17
|
+
renderer: LineChartRenderer;
|
|
18
|
+
yScale?: LineChartModel<TData>["yScale"] | undefined;
|
|
19
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const LineChartLinePaths: <TData extends Record<string, unknown>>({ chartId, geometries, plot, yScale, renderer }: {
|
|
21
|
+
chartId: string;
|
|
22
|
+
geometries: Array<LineChartGeometryModel<TData>>;
|
|
23
|
+
plot?: LineChartModel<TData>["boxes"]["plot"] | undefined;
|
|
24
|
+
renderer: LineChartRenderer;
|
|
25
|
+
yScale?: LineChartModel<TData>["yScale"] | undefined;
|
|
26
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=thresholdRendering.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thresholdRendering.d.ts","sourceRoot":"","sources":["../../../src/charts/line/thresholdRendering.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,KAAK,sBAAsB,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAC/D,cAAc,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AA6B9C,eAAO,MAAM,2BAA2B,GAAI,SAAS,MAAM,EAAE,OAAO,MAAM,WAC5B,CAAC;AAE/C,eAAO,MAAM,0BAA0B,YAZH,MAAM,SAAS,MAAM,WAYE,CAAC;AAyC5D,eAAO,MAAM,0BAA0B,GACrC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,iDAMC;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,KAAK,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;IACjD,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;IAC7C,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC;CACzC,mDAoCA,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,iDAMvE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,KAAK,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;IACjD,IAAI,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IAC1D,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,MAAM,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;CACtD,4CAwGA,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,iDAMvE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,KAAK,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;IACjD,IAAI,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IAC1D,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,MAAM,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;CACtD,4CA0FA,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { createClipPathRef } from "../../../svg-renderer/index";
|
|
3
|
+
const getAreaGradientId = (chartId, index) => `${chartId}-area-gradient-${index}`;
|
|
4
|
+
const getThresholdClipId = (chartId, index, side) => `${chartId}-threshold-${index}-${side}`;
|
|
5
|
+
export const getLineChartAreaGradientRef = (chartId, index) => `url(#${getAreaGradientId(chartId, index)})`;
|
|
6
|
+
export const getLineChartAreaGradientId = getAreaGradientId;
|
|
7
|
+
const getThresholdRectClips = ({ plot, thresholdY }) => {
|
|
8
|
+
const plotBottom = plot.y + plot.height;
|
|
9
|
+
return {
|
|
10
|
+
above: {
|
|
11
|
+
height: Math.max(0, thresholdY - plot.y),
|
|
12
|
+
width: plot.width,
|
|
13
|
+
x: plot.x,
|
|
14
|
+
y: plot.y
|
|
15
|
+
},
|
|
16
|
+
below: {
|
|
17
|
+
height: Math.max(0, plotBottom - thresholdY),
|
|
18
|
+
width: plot.width,
|
|
19
|
+
x: plot.x,
|
|
20
|
+
y: thresholdY
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
const getThresholdY = ({ plot, threshold, yScale }) => {
|
|
25
|
+
const plotBottom = plot.y + plot.height;
|
|
26
|
+
return Math.min(Math.max(yScale.scale(threshold), plot.y), plotBottom);
|
|
27
|
+
};
|
|
28
|
+
export const LineChartThresholdClipDefs = ({ chartId, geometries, plot, renderer, yScale }) => {
|
|
29
|
+
const ClipRect = renderer.ClipRect;
|
|
30
|
+
if (!ClipRect || renderer.capabilities?.clipPaths !== true) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
return (_jsx(_Fragment, { children: geometries.flatMap(({ style }, index) => {
|
|
34
|
+
if (!style.threshold) {
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
const thresholdY = getThresholdY({
|
|
38
|
+
plot,
|
|
39
|
+
threshold: style.threshold.y,
|
|
40
|
+
yScale
|
|
41
|
+
});
|
|
42
|
+
const rectClips = getThresholdRectClips({ plot, thresholdY });
|
|
43
|
+
return [
|
|
44
|
+
_jsx(ClipRect, { id: getThresholdClipId(chartId, index, "above"), ...rectClips.above }, `threshold-above-${index}`),
|
|
45
|
+
_jsx(ClipRect, { id: getThresholdClipId(chartId, index, "below"), ...rectClips.below }, `threshold-below-${index}`)
|
|
46
|
+
];
|
|
47
|
+
}) }));
|
|
48
|
+
};
|
|
49
|
+
export const LineChartAreaPaths = ({ chartId, geometries, plot, yScale, renderer }) => {
|
|
50
|
+
const Path = renderer.Path;
|
|
51
|
+
const supportsClipPaths = renderer.capabilities?.clipPaths === true;
|
|
52
|
+
const supportsGradientDefs = renderer.capabilities?.gradients !== false &&
|
|
53
|
+
renderer.capabilities?.pathGradients !== true;
|
|
54
|
+
const supportsPathGradients = renderer.capabilities?.pathGradients === true;
|
|
55
|
+
const supportsRectClips = renderer.capabilities?.rectClips === true;
|
|
56
|
+
return (_jsx(_Fragment, { children: geometries.flatMap(({ geometry, style }, index) => {
|
|
57
|
+
if (!geometry.area) {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
const paths = [
|
|
61
|
+
_jsx(Path, { d: geometry.area.path, fill: supportsGradientDefs
|
|
62
|
+
? getLineChartAreaGradientRef(chartId, index)
|
|
63
|
+
: style.areaFill.fromColor, ...(supportsPathGradients
|
|
64
|
+
? {
|
|
65
|
+
fillGradient: {
|
|
66
|
+
x1: "0%",
|
|
67
|
+
x2: "0%",
|
|
68
|
+
y1: "0%",
|
|
69
|
+
y2: "100%",
|
|
70
|
+
stops: [
|
|
71
|
+
{
|
|
72
|
+
offset: "0%",
|
|
73
|
+
color: style.areaFill.fromColor,
|
|
74
|
+
opacity: style.areaFill.fromOpacity
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
offset: "100%",
|
|
78
|
+
color: style.areaFill.toColor,
|
|
79
|
+
opacity: style.areaFill.toOpacity
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
: {}), ...(!supportsGradientDefs && !supportsPathGradients
|
|
85
|
+
? { opacity: style.areaFill.fromOpacity }
|
|
86
|
+
: {}) }, `area-${geometry.key}`)
|
|
87
|
+
];
|
|
88
|
+
if (style.threshold && supportsClipPaths) {
|
|
89
|
+
paths.push(_jsx(Path, { d: geometry.area.path, fill: style.threshold.areaAboveColor, opacity: style.threshold.areaOpacity, clipPath: createClipPathRef(getThresholdClipId(chartId, index, "above")) }, `area-${geometry.key}-above`), _jsx(Path, { d: geometry.area.path, fill: style.threshold.areaBelowColor, opacity: style.threshold.areaOpacity, clipPath: createClipPathRef(getThresholdClipId(chartId, index, "below")) }, `area-${geometry.key}-below`));
|
|
90
|
+
}
|
|
91
|
+
else if (style.threshold && supportsRectClips && plot && yScale) {
|
|
92
|
+
const thresholdY = getThresholdY({
|
|
93
|
+
plot,
|
|
94
|
+
threshold: style.threshold.y,
|
|
95
|
+
yScale
|
|
96
|
+
});
|
|
97
|
+
const rectClips = getThresholdRectClips({ plot, thresholdY });
|
|
98
|
+
paths.push(_jsx(Path, { d: geometry.area.path, fill: style.threshold.areaAboveColor, opacity: style.threshold.areaOpacity, clipRect: rectClips.above }, `area-${geometry.key}-above`), _jsx(Path, { d: geometry.area.path, fill: style.threshold.areaBelowColor, opacity: style.threshold.areaOpacity, clipRect: rectClips.below }, `area-${geometry.key}-below`));
|
|
99
|
+
}
|
|
100
|
+
return paths;
|
|
101
|
+
}) }));
|
|
102
|
+
};
|
|
103
|
+
export const LineChartLinePaths = ({ chartId, geometries, plot, yScale, renderer }) => {
|
|
104
|
+
const Path = renderer.Path;
|
|
105
|
+
const supportsClipPaths = renderer.capabilities?.clipPaths === true;
|
|
106
|
+
const supportsRectClips = renderer.capabilities?.rectClips === true;
|
|
107
|
+
return (_jsx(_Fragment, { children: geometries.flatMap(({ geometry, style }, index) => {
|
|
108
|
+
const commonLineProps = {
|
|
109
|
+
d: geometry.line.path,
|
|
110
|
+
fill: "none",
|
|
111
|
+
strokeWidth: style.strokeWidth,
|
|
112
|
+
strokeLinecap: style.strokeStyle.strokeLinecap,
|
|
113
|
+
strokeLinejoin: style.strokeStyle.strokeLinejoin,
|
|
114
|
+
...(style.strokeStyle.strokeDasharray
|
|
115
|
+
? { strokeDasharray: style.strokeStyle.strokeDasharray }
|
|
116
|
+
: {})
|
|
117
|
+
};
|
|
118
|
+
if (!style.threshold) {
|
|
119
|
+
return [
|
|
120
|
+
_jsx(Path, { ...commonLineProps, stroke: style.color, strokeOpacity: style.strokeStyle.strokeOpacity }, `line-${geometry.key}`)
|
|
121
|
+
];
|
|
122
|
+
}
|
|
123
|
+
if (supportsRectClips && plot && yScale) {
|
|
124
|
+
const thresholdY = getThresholdY({
|
|
125
|
+
plot,
|
|
126
|
+
threshold: style.threshold.y,
|
|
127
|
+
yScale
|
|
128
|
+
});
|
|
129
|
+
const rectClips = getThresholdRectClips({ plot, thresholdY });
|
|
130
|
+
return [
|
|
131
|
+
_jsx(Path, { ...commonLineProps, stroke: style.threshold.aboveColor, strokeOpacity: style.threshold.aboveOpacity, clipRect: rectClips.above }, `line-${geometry.key}-above`),
|
|
132
|
+
_jsx(Path, { ...commonLineProps, stroke: style.threshold.belowColor, strokeOpacity: style.threshold.belowOpacity, clipRect: rectClips.below }, `line-${geometry.key}-below`)
|
|
133
|
+
];
|
|
134
|
+
}
|
|
135
|
+
if (!supportsClipPaths) {
|
|
136
|
+
return [
|
|
137
|
+
_jsx(Path, { ...commonLineProps, stroke: style.color, strokeOpacity: style.strokeStyle.strokeOpacity }, `line-${geometry.key}`)
|
|
138
|
+
];
|
|
139
|
+
}
|
|
140
|
+
return [
|
|
141
|
+
_jsx(Path, { ...commonLineProps, stroke: style.threshold.aboveColor, strokeOpacity: style.threshold.aboveOpacity, clipPath: createClipPathRef(getThresholdClipId(chartId, index, "above")) }, `line-${geometry.key}-above`),
|
|
142
|
+
_jsx(Path, { ...commonLineProps, stroke: style.threshold.belowColor, strokeOpacity: style.threshold.belowOpacity, clipPath: createClipPathRef(getThresholdClipId(chartId, index, "below")) }, `line-${geometry.key}-below`)
|
|
143
|
+
];
|
|
144
|
+
}) }));
|
|
145
|
+
};
|