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,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,SAkFH,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
onStartShouldSetResponderCapture: (event) => viewportPan.shouldSetResponder(event) || isInteractionEnabled,
|
|
48
|
+
onMoveShouldSetResponderCapture: (event) => viewportPan.shouldSetResponder(event) ||
|
|
49
|
+
(interactionConfig.mode === "scrub" && isResponderEventInPlot(event)),
|
|
50
|
+
onStartShouldSetResponder: (event) => viewportPan.shouldSetResponder(event) || isInteractionEnabled,
|
|
51
|
+
onMoveShouldSetResponder: (event) => viewportPan.shouldSetResponder(event) ||
|
|
52
|
+
(interactionConfig.mode === "scrub" && isResponderEventInPlot(event)),
|
|
53
|
+
onResponderTerminationRequest: () => viewportPan.isActive()
|
|
54
|
+
? !viewportPan.shouldBlockTermination
|
|
55
|
+
: interactionConfig.mode !== "scrub",
|
|
56
|
+
onResponderGrant: handleResponderGrant,
|
|
57
|
+
onResponderMove: handleResponderMove,
|
|
58
|
+
onResponderRelease: handleResponderEnd,
|
|
59
|
+
onResponderTerminate: handleResponderEnd
|
|
60
|
+
}
|
|
61
|
+
: {};
|
|
62
|
+
};
|
|
@@ -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.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.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.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,uCAoCA,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,gCAwGA,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,gCA0FA,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
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ResolvedLineChartTooltipConfig } from "./options";
|
|
2
|
+
export declare const lineChartTooltipLineHeight = 18;
|
|
3
|
+
export declare const lineChartTooltipLabelLineHeight = 16;
|
|
4
|
+
export type LineChartTooltipSeriesItem<TPoint = unknown> = {
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
color: string;
|
|
8
|
+
value: number | null | undefined;
|
|
9
|
+
formattedValue: string;
|
|
10
|
+
point: TPoint;
|
|
11
|
+
};
|
|
12
|
+
export type LineChartTooltipRenderProps<TPoint = unknown, TTheme = unknown> = {
|
|
13
|
+
index: number;
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
xLabel: string;
|
|
19
|
+
series: Array<LineChartTooltipSeriesItem<TPoint>>;
|
|
20
|
+
config: ResolvedLineChartTooltipConfig;
|
|
21
|
+
theme: TTheme;
|
|
22
|
+
};
|
|
23
|
+
type TextMeasurer = (text: string, options?: {
|
|
24
|
+
fontSize?: number;
|
|
25
|
+
}) => {
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
};
|
|
29
|
+
export declare const easeLineChartTooltipPosition: (progress: number) => number;
|
|
30
|
+
export declare const interpolateLineChartTooltipPosition: ({ from, progress, to }: {
|
|
31
|
+
from: {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
};
|
|
35
|
+
progress: number;
|
|
36
|
+
to: {
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
};
|
|
40
|
+
}) => {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
};
|
|
44
|
+
export declare const clampLineChartTooltipToViewport: <TPoint, TTheme>(tooltip: LineChartTooltipRenderProps<TPoint, TTheme>, { leftInset, scrollOffset, viewportWidth }: {
|
|
45
|
+
leftInset?: number | undefined;
|
|
46
|
+
scrollOffset: number;
|
|
47
|
+
viewportWidth: number;
|
|
48
|
+
}) => LineChartTooltipRenderProps<TPoint, TTheme>;
|
|
49
|
+
export declare const getLineChartTooltipModel: <TPoint, TTheme>({ chartHeight, chartWidth, config, measureText, plotX, plotY, selection, theme }: {
|
|
50
|
+
chartHeight: number;
|
|
51
|
+
chartWidth: number;
|
|
52
|
+
config: ResolvedLineChartTooltipConfig;
|
|
53
|
+
measureText: TextMeasurer;
|
|
54
|
+
plotX?: number | undefined;
|
|
55
|
+
plotY: number;
|
|
56
|
+
selection: {
|
|
57
|
+
index: number;
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
pointer?: {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
} | undefined;
|
|
64
|
+
xLabel: string;
|
|
65
|
+
series: Array<LineChartTooltipSeriesItem<TPoint>>;
|
|
66
|
+
};
|
|
67
|
+
theme: TTheme;
|
|
68
|
+
}) => LineChartTooltipRenderProps<TPoint, TTheme> | undefined;
|
|
69
|
+
export {};
|
|
70
|
+
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/charts/line/tooltip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAEhE,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAC7C,eAAO,MAAM,+BAA+B,KAAK,CAAC;AAElD,MAAM,MAAM,0BAA0B,CAAC,MAAM,GAAG,OAAO,IAAI;IACzD,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,2BAA2B,CAAC,MAAM,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI;IAC5E,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,KAAK,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAC;IAClD,MAAM,EAAE,8BAA8B,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,YAAY,GAAG,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,KAC5B;IACH,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAUF,eAAO,MAAM,4BAA4B,GAAI,UAAU,MAAM,WAI5D,CAAC;AAEF,eAAO,MAAM,mCAAmC,GAAI,wBAIjD;IACD,IAAI,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9B;;;CAOA,CAAC;AA6CF,eAAO,MAAM,+BAA+B,GAAI,MAAM,EAAE,MAAM,EAC5D,SAAS,2BAA2B,CAAC,MAAM,EAAE,MAAM,CAAC,EACpD,4CAIG;IACD,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB,KACA,2BAA2B,CAAC,MAAM,EAAE,MAAM,CAO3C,CAAC;AAEH,eAAO,MAAM,wBAAwB,GAAI,MAAM,EAAE,MAAM,EAAE,kFAStD;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,8BAA8B,CAAC;IACvC,WAAW,EAAE,YAAY,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,OAAO,CAAC,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,GAAG,SAAS,CAAC;QAC/C,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,KAAK,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAC;KACnD,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;CACf,KAAG,2BAA2B,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAyDjD,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export const lineChartTooltipLineHeight = 18;
|
|
2
|
+
export const lineChartTooltipLabelLineHeight = 16;
|
|
3
|
+
const clamp = (value, min, max) => {
|
|
4
|
+
if (max < min) {
|
|
5
|
+
return min;
|
|
6
|
+
}
|
|
7
|
+
return Math.min(Math.max(value, min), max);
|
|
8
|
+
};
|
|
9
|
+
export const easeLineChartTooltipPosition = (progress) => {
|
|
10
|
+
const clampedProgress = clamp(progress, 0, 1);
|
|
11
|
+
return 1 - Math.pow(1 - clampedProgress, 3);
|
|
12
|
+
};
|
|
13
|
+
export const interpolateLineChartTooltipPosition = ({ from, progress, to }) => {
|
|
14
|
+
const easedProgress = easeLineChartTooltipPosition(progress);
|
|
15
|
+
return {
|
|
16
|
+
x: from.x + (to.x - from.x) * easedProgress,
|
|
17
|
+
y: from.y + (to.y - from.y) * easedProgress
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
const getTooltipX = ({ chartWidth, edgePadding, anchorX, leftInset = edgePadding, width }) => clamp(anchorX - width / 2, leftInset, chartWidth - width - edgePadding);
|
|
21
|
+
const getTooltipY = ({ anchorY, chartHeight, config, height, plotY }) => {
|
|
22
|
+
const minY = config.edgePadding;
|
|
23
|
+
const maxY = chartHeight - height - config.edgePadding;
|
|
24
|
+
const aboveY = anchorY - height - config.offset;
|
|
25
|
+
const belowY = anchorY + config.offset;
|
|
26
|
+
if (config.placement === "above") {
|
|
27
|
+
return clamp(aboveY, minY, maxY);
|
|
28
|
+
}
|
|
29
|
+
if (config.placement === "below") {
|
|
30
|
+
return clamp(belowY, minY, maxY);
|
|
31
|
+
}
|
|
32
|
+
return aboveY >= plotY ? aboveY : clamp(belowY, minY, maxY);
|
|
33
|
+
};
|
|
34
|
+
export const clampLineChartTooltipToViewport = (tooltip, { leftInset = 4, scrollOffset, viewportWidth }) => ({
|
|
35
|
+
...tooltip,
|
|
36
|
+
x: clamp(tooltip.x, scrollOffset + leftInset, scrollOffset + viewportWidth - tooltip.width - tooltip.config.edgePadding)
|
|
37
|
+
});
|
|
38
|
+
export const getLineChartTooltipModel = ({ chartHeight, chartWidth, config, measureText, plotX, plotY, selection, theme }) => {
|
|
39
|
+
if (!config.visible || selection.series.length === 0) {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
const series = config.shared
|
|
43
|
+
? selection.series
|
|
44
|
+
: selection.series.slice(0, 1);
|
|
45
|
+
const labelWidth = measureText(selection.xLabel, {
|
|
46
|
+
fontSize: config.labelFontSize
|
|
47
|
+
}).width;
|
|
48
|
+
const seriesTextWidths = series.map((item) => measureText(`${item.label}: ${item.formattedValue}`, {
|
|
49
|
+
fontSize: config.fontSize
|
|
50
|
+
}).width);
|
|
51
|
+
const markerWidth = 12;
|
|
52
|
+
const contentWidth = Math.max(labelWidth, ...seriesTextWidths) + markerWidth;
|
|
53
|
+
const width = config.width ?? contentWidth + config.padding * 2;
|
|
54
|
+
const height = config.padding * 2 +
|
|
55
|
+
lineChartTooltipLabelLineHeight +
|
|
56
|
+
series.length * lineChartTooltipLineHeight;
|
|
57
|
+
const anchor = config.anchor === "pointer" && selection.pointer
|
|
58
|
+
? selection.pointer
|
|
59
|
+
: selection;
|
|
60
|
+
const x = getTooltipX({
|
|
61
|
+
chartWidth,
|
|
62
|
+
edgePadding: config.edgePadding,
|
|
63
|
+
leftInset: plotX === undefined
|
|
64
|
+
? config.edgePadding
|
|
65
|
+
: Math.max(config.edgePadding, plotX + config.edgePadding),
|
|
66
|
+
anchorX: anchor.x,
|
|
67
|
+
width
|
|
68
|
+
});
|
|
69
|
+
const y = getTooltipY({
|
|
70
|
+
anchorY: anchor.y,
|
|
71
|
+
chartHeight,
|
|
72
|
+
config,
|
|
73
|
+
height,
|
|
74
|
+
plotY
|
|
75
|
+
});
|
|
76
|
+
return {
|
|
77
|
+
index: selection.index,
|
|
78
|
+
x,
|
|
79
|
+
y,
|
|
80
|
+
width,
|
|
81
|
+
height,
|
|
82
|
+
xLabel: selection.xLabel,
|
|
83
|
+
series,
|
|
84
|
+
config,
|
|
85
|
+
theme
|
|
86
|
+
};
|
|
87
|
+
};
|