@harveylx/react-native-gifted-charts 1.4.70

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.
Files changed (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +162 -0
  3. package/dist/BarChart/Animated2DWithGradient.d.ts +3 -0
  4. package/dist/BarChart/Animated2DWithGradient.js +78 -0
  5. package/dist/BarChart/RenderBars.d.ts +3 -0
  6. package/dist/BarChart/RenderBars.js +222 -0
  7. package/dist/BarChart/RenderStackBars.d.ts +3 -0
  8. package/dist/BarChart/RenderStackBars.js +214 -0
  9. package/dist/BarChart/index.d.ts +2 -0
  10. package/dist/BarChart/index.js +256 -0
  11. package/dist/BarChart/styles.d.ts +45 -0
  12. package/dist/BarChart/styles.js +46 -0
  13. package/dist/Components/AnimatedThreeDBar/index.d.ts +3 -0
  14. package/dist/Components/AnimatedThreeDBar/index.js +103 -0
  15. package/dist/Components/AnimatedThreeDBar/styles.d.ts +11 -0
  16. package/dist/Components/AnimatedThreeDBar/styles.js +12 -0
  17. package/dist/Components/BarAndLineChartsWrapper/index.d.ts +3 -0
  18. package/dist/Components/BarAndLineChartsWrapper/index.js +161 -0
  19. package/dist/Components/BarAndLineChartsWrapper/renderBackgroundSlices.d.ts +7 -0
  20. package/dist/Components/BarAndLineChartsWrapper/renderBackgroundSlices.js +30 -0
  21. package/dist/Components/BarAndLineChartsWrapper/renderHorizSections.d.ts +2 -0
  22. package/dist/Components/BarAndLineChartsWrapper/renderHorizSections.js +468 -0
  23. package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/index.d.ts +3 -0
  24. package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/index.js +87 -0
  25. package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderDataPoints.d.ts +2 -0
  26. package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderDataPoints.js +102 -0
  27. package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificDataPoints.d.ts +1 -0
  28. package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificDataPoints.js +25 -0
  29. package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificVerticalLines.d.ts +1 -0
  30. package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificVerticalLines.js +20 -0
  31. package/dist/Components/BarAndLineChartsWrapper/renderVerticalLines.d.ts +2 -0
  32. package/dist/Components/BarAndLineChartsWrapper/renderVerticalLines.js +133 -0
  33. package/dist/Components/BarSpecificComponents/barBackgroundPattern.d.ts +2 -0
  34. package/dist/Components/BarSpecificComponents/barBackgroundPattern.js +9 -0
  35. package/dist/Components/BarSpecificComponents/cap.d.ts +2 -0
  36. package/dist/Components/BarSpecificComponents/cap.js +16 -0
  37. package/dist/Components/BarSpecificComponents/tooltip.d.ts +3 -0
  38. package/dist/Components/BarSpecificComponents/tooltip.js +38 -0
  39. package/dist/Components/common/LinearGradient.d.ts +16 -0
  40. package/dist/Components/common/LinearGradient.js +15 -0
  41. package/dist/Components/common/Pointer.d.ts +1 -0
  42. package/dist/Components/common/Pointer.js +18 -0
  43. package/dist/Components/common/StripAndLabel.d.ts +2 -0
  44. package/dist/Components/common/StripAndLabel.js +60 -0
  45. package/dist/Components/lineSvg.d.ts +14 -0
  46. package/dist/Components/lineSvg.js +22 -0
  47. package/dist/LineChart/LineChartBicolor.d.ts +2 -0
  48. package/dist/LineChart/LineChartBicolor.js +298 -0
  49. package/dist/LineChart/index.d.ts +2 -0
  50. package/dist/LineChart/index.js +1137 -0
  51. package/dist/LineChart/styles.d.ts +43 -0
  52. package/dist/LineChart/styles.js +46 -0
  53. package/dist/PieChart/index.d.ts +2 -0
  54. package/dist/PieChart/index.js +146 -0
  55. package/dist/PieChart/main.d.ts +2 -0
  56. package/dist/PieChart/main.js +178 -0
  57. package/dist/PieChartPro/index.d.ts +2 -0
  58. package/dist/PieChartPro/index.js +124 -0
  59. package/dist/PopulationPyramid/index.d.ts +2 -0
  60. package/dist/PopulationPyramid/index.js +132 -0
  61. package/dist/RadarChart/index.d.ts +2 -0
  62. package/dist/RadarChart/index.js +113 -0
  63. package/dist/index.d.ts +8 -0
  64. package/dist/index.js +8 -0
  65. package/dist/utils/index.d.ts +5 -0
  66. package/dist/utils/index.js +22 -0
  67. package/package.json +89 -0
@@ -0,0 +1,103 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useRef } from 'react';
3
+ import { View, StyleSheet, Text, Animated } from 'react-native';
4
+ import Svg, { Defs, Rect } from 'react-native-svg';
5
+ import { styles } from './styles';
6
+ import LinearGradient from '../common/LinearGradient';
7
+ import { useAnimatedThreeDBar, } from '@harveylx/gifted-charts-core';
8
+ var TriangleCorner = function (props) {
9
+ return (_jsx(View, { style: [
10
+ triangleStyles.triangleCorner,
11
+ props.style,
12
+ {
13
+ borderRightWidth: props.width / 2,
14
+ borderTopWidth: props.width / 2,
15
+ borderTopColor: props.color,
16
+ },
17
+ ] }));
18
+ };
19
+ var triangleStyles = StyleSheet.create({
20
+ triangleCorner: {
21
+ width: 0,
22
+ height: 0,
23
+ backgroundColor: 'transparent',
24
+ borderStyle: 'solid',
25
+ borderRightColor: 'transparent',
26
+ transform: [{ rotate: '90deg' }],
27
+ },
28
+ });
29
+ var AnimatedThreeDBar = function (props) {
30
+ var _a;
31
+ var height = props.height, side = props.side;
32
+ var isAnimated = props.isAnimated, animationDuration = props.animationDuration, item = props.item, index = props.index, barWidth = props.barWidth, sideWidth = props.sideWidth, barStyle = props.barStyle, barBackgroundPattern = props.barBackgroundPattern, barInnerComponent = props.barInnerComponent, patternId = props.patternId, intactTopLabel = props.intactTopLabel, showValuesAsTopLabel = props.showValuesAsTopLabel, topLabelContainerStyle = props.topLabelContainerStyle, topLabelTextStyle = props.topLabelTextStyle, containerHeight = props.containerHeight;
33
+ var _b = useAnimatedThreeDBar(props), showGradient = _b.showGradient, gradientColor = _b.gradientColor, frontColor = _b.frontColor, sideColor = _b.sideColor, topColor = _b.topColor, opacity = _b.opacity;
34
+ var animatedHeight = useRef(new Animated.Value(0)).current;
35
+ var elevate = function () {
36
+ Animated.timing(animatedHeight, {
37
+ toValue: height,
38
+ duration: animationDuration,
39
+ useNativeDriver: false,
40
+ }).start();
41
+ };
42
+ useEffect(function () {
43
+ if (isAnimated) {
44
+ elevate();
45
+ }
46
+ }, []);
47
+ return (_jsx(View, { style: [styles.container, { height: containerHeight }], children: _jsxs(Animated.View, { style: [
48
+ styles.row,
49
+ {
50
+ height: isAnimated ? animatedHeight : height,
51
+ opacity: opacity,
52
+ position: 'absolute',
53
+ bottom: 0,
54
+ },
55
+ props.side === 'right' && { transform: [{ rotateY: '180deg' }] },
56
+ ], children: [props.height ? (_jsxs(_Fragment, { children: [_jsx(View, { style: { position: 'absolute', top: sideWidth / -2 }, children: _jsx(TriangleCorner, { color: topColor, width: sideWidth, style: { transform: [{ rotate: '90deg' }], opacity: opacity } }) }), _jsx(View, { style: { position: 'absolute', top: sideWidth / -2 }, children: _jsx(View, { style: {
57
+ width: barWidth,
58
+ height: barWidth,
59
+ // left: width / 2,
60
+ backgroundColor: topColor,
61
+ opacity: opacity,
62
+ } }) }), _jsx(View, { style: {
63
+ position: 'absolute',
64
+ top: sideWidth / -2,
65
+ left: barWidth - 1,
66
+ }, children: _jsx(TriangleCorner, { color: topColor, width: sideWidth, style: { transform: [{ rotate: '-90deg' }], opacity: opacity } }) })] })) : null, _jsxs(View, { style: { marginTop: sideWidth / -2 - 1 }, children: [_jsx(TriangleCorner, { color: height ? sideColor : 'transparent', width: sideWidth, style: { transform: [{ rotate: '-90deg' }], opacity: opacity } }), _jsx(View, { style: {
67
+ width: sideWidth / 2 + 1,
68
+ height: height - sideWidth / 2, //animatedSideHeight
69
+ backgroundColor: sideColor,
70
+ opacity: opacity,
71
+ } }), _jsx(TriangleCorner, { color: height ? sideColor : 'transparent', width: sideWidth + 1, style: {
72
+ transform: [{ rotate: '90deg' }],
73
+ opacity: opacity,
74
+ right: -0.5,
75
+ } })] }), _jsxs(View, { style: [
76
+ {
77
+ width: barWidth,
78
+ height: height, //animatedHeight
79
+ backgroundColor: frontColor,
80
+ borderLeftWidth: StyleSheet.hairlineWidth,
81
+ borderTopWidth: StyleSheet.hairlineWidth,
82
+ borderColor: 'white',
83
+ opacity: opacity,
84
+ },
85
+ item.barStyle || barStyle,
86
+ ], children: [showGradient && (_jsx(LinearGradient, { style: { position: 'absolute', width: '100%', height: '100%' }, start: { x: 0, y: 0 }, end: { x: 1, y: 1 }, colors: [gradientColor, frontColor] })), barBackgroundPattern && (_jsxs(Svg, { children: [_jsx(Defs, { children: barBackgroundPattern() }), _jsx(Rect, { stroke: "none", x: "1", y: "1", width: barWidth || 30, height: height, fill: "url(#".concat(patternId, ")") })] })), barInnerComponent ? (_jsx(View, { style: { height: '100%', width: '100%' }, children: barInnerComponent(item, index) })) : null] }), (item.topLabelComponent || showValuesAsTopLabel) && (_jsx(View, { style: [
87
+ {
88
+ position: 'absolute',
89
+ top: barWidth * -2,
90
+ marginLeft: side === 'right' ? 0 : -Math.min(barWidth / 2 - 4, 8),
91
+ height: (barWidth * 3) / 2,
92
+ width: (barWidth * 3) / 2,
93
+ justifyContent: 'flex-end',
94
+ alignItems: 'center',
95
+ opacity: opacity,
96
+ },
97
+ props.horizontal &&
98
+ !intactTopLabel && { transform: [{ rotate: '270deg' }] },
99
+ props.side === 'right' && { transform: [{ rotateY: '180deg' }] },
100
+ topLabelContainerStyle !== null && topLabelContainerStyle !== void 0 ? topLabelContainerStyle : item.topLabelContainerStyle,
101
+ ], children: showValuesAsTopLabel ? (_jsx(Text, { style: topLabelTextStyle, children: item.value })) : ((_a = item.topLabelComponent) === null || _a === void 0 ? void 0 : _a.call(item)) }))] }) }));
102
+ };
103
+ export default AnimatedThreeDBar;
@@ -0,0 +1,11 @@
1
+ export declare const styles: {
2
+ container: {
3
+ width: "150%";
4
+ position: "absolute";
5
+ bottom: number;
6
+ overflow: "hidden";
7
+ };
8
+ row: {
9
+ flexDirection: "row";
10
+ };
11
+ };
@@ -0,0 +1,12 @@
1
+ import { StyleSheet } from 'react-native';
2
+ export var styles = StyleSheet.create({
3
+ container: {
4
+ width: '150%',
5
+ position: 'absolute',
6
+ bottom: 0,
7
+ overflow: 'hidden',
8
+ },
9
+ row: {
10
+ flexDirection: 'row',
11
+ },
12
+ });
@@ -0,0 +1,3 @@
1
+ import { BarAndLineChartsWrapperTypes } from '@harveylx/gifted-charts-core';
2
+ declare const BarAndLineChartsWrapper: (props: BarAndLineChartsWrapperTypes) => import("react/jsx-runtime").JSX.Element;
3
+ export default BarAndLineChartsWrapper;
@@ -0,0 +1,161 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { Fragment, useEffect } from 'react';
14
+ import { View, ScrollView, StyleSheet, I18nManager, } from 'react-native';
15
+ import { renderHorizSections } from './renderHorizSections';
16
+ import RenderVerticalLines from './renderVerticalLines';
17
+ import { chartTypes, yAxisSides, useBarAndLineChartsWrapper, } from '@harveylx/gifted-charts-core';
18
+ import { renderBackgroundSlices } from './renderBackgroundSlices';
19
+ var isCloseToRight = function (_a, endReachedOffset) {
20
+ var layoutMeasurement = _a.layoutMeasurement, contentOffset = _a.contentOffset, contentSize = _a.contentSize;
21
+ return (layoutMeasurement.width + contentOffset.x >=
22
+ contentSize.width - endReachedOffset);
23
+ };
24
+ var isCloseToLeft = function (_a, endReachedOffset) {
25
+ var layoutMeasurement = _a.layoutMeasurement, contentOffset = _a.contentOffset, contentSize = _a.contentSize;
26
+ return (layoutMeasurement.width + contentOffset.x <=
27
+ contentSize.width - endReachedOffset);
28
+ };
29
+ var BarAndLineChartsWrapper = function (props) {
30
+ var _a, _b, _c, _d, _e;
31
+ var chartType = props.chartType, containerHeight = props.containerHeight, noOfSectionsBelowXAxis = props.noOfSectionsBelowXAxis, stepHeight = props.stepHeight, labelsExtraHeight = props.labelsExtraHeight, yAxisLabelWidth = props.yAxisLabelWidth, horizontal = props.horizontal, scrollRef = props.scrollRef, initialSpacing = props.initialSpacing, data = props.data, barWidth = props.barWidth, xAxisThickness = props.xAxisThickness, totalWidth = props.totalWidth, disableScroll = props.disableScroll, showScrollIndicator = props.showScrollIndicator, scrollToEnd = props.scrollToEnd, scrollToIndex = props.scrollToIndex, scrollAnimation = props.scrollAnimation, indicatorColor = props.indicatorColor, spacing = props.spacing, renderChartContent = props.renderChartContent, remainingScrollViewProps = props.remainingScrollViewProps, endSpacing = props.endSpacing, hideAxesAndRules = props.hideAxesAndRules, showXAxisIndices = props.showXAxisIndices, xAxisIndicesHeight = props.xAxisIndicesHeight, xAxisIndicesWidth = props.xAxisIndicesWidth, xAxisIndicesColor = props.xAxisIndicesColor, pointerConfig = props.pointerConfig, getPointerProps = props.getPointerProps, pointerIndex = props.pointerIndex, pointerX = props.pointerX, pointerY = props.pointerY, onEndReached = props.onEndReached, onStartReached = props.onStartReached, endReachedOffset = props.endReachedOffset, onMomentumScrollEnd = props.onMomentumScrollEnd, onScrollEndDrag = props.onScrollEndDrag, nestedScrollEnabled = props.nestedScrollEnabled, _f = props.extraWidthDueToDataPoint, extraWidthDueToDataPoint = _f === void 0 ? 0 : _f, // extraWidthDueToDataPoint will be receved from props onlhy in case of LineCharts, for other charts it will be undefined and will default to 0
32
+ showBackgroundSlices = props.showBackgroundSlices;
33
+ var _g = useBarAndLineChartsWrapper(__assign(__assign({}, props), { isRTL: I18nManager.isRTL })), containerHeightIncludingBelowXAxis = _g.containerHeightIncludingBelowXAxis, xAxisLabelsVerticalShift = _g.xAxisLabelsVerticalShift, trimYAxisAtTop = _g.trimYAxisAtTop, yAxisExtraHeight = _g.yAxisExtraHeight, overflowTop = _g.overflowTop, xAxisLabelsHeight = _g.xAxisLabelsHeight, xAxisTextNumberOfLines = _g.xAxisTextNumberOfLines, actualContainerWidth = _g.actualContainerWidth, transformForHorizontal = _g.transformForHorizontal, horizSectionProps = _g.horizSectionProps, referenceLinesOverChartContent = _g.referenceLinesOverChartContent, setCanMomentum = _g.setCanMomentum, isCloseToStart = _g.isCloseToStart, isCloseToEnd = _g.isCloseToEnd, canMomentum = _g.canMomentum, yAxisAtTop = _g.yAxisAtTop, yAxisThickness = _g.yAxisThickness, yAxisSide = _g.yAxisSide, showVerticalLines = _g.showVerticalLines, verticalLinesProps = _g.verticalLinesProps;
34
+ useEffect(function () {
35
+ if (pointerConfig && getPointerProps) {
36
+ getPointerProps({ pointerIndex: pointerIndex, pointerX: pointerX, pointerY: pointerY });
37
+ }
38
+ }, [pointerIndex, pointerX, pointerY]);
39
+ /*******************************************************************************************************************************************/
40
+ /*******************************************************************************************************************************************/
41
+ var styles = StyleSheet.create({
42
+ container: {
43
+ width: '100%',
44
+ height: containerHeightIncludingBelowXAxis +
45
+ labelsExtraHeight +
46
+ xAxisLabelsVerticalShift +
47
+ (trimYAxisAtTop ? 0 : yAxisExtraHeight) +
48
+ 50 -
49
+ overflowTop,
50
+ marginTop: trimYAxisAtTop ? containerHeight / 20 : 0,
51
+ marginBottom: (xAxisLabelsHeight !== null && xAxisLabelsHeight !== void 0 ? xAxisLabelsHeight : xAxisTextNumberOfLines * 18) -
52
+ 55 -
53
+ xAxisLabelsVerticalShift, //This is to not let the Things that should be rendered below the chart overlap with it
54
+ },
55
+ });
56
+ return (_jsxs(View, { style: [
57
+ styles.container,
58
+ horizontal && {
59
+ width: actualContainerWidth,
60
+ transform: transformForHorizontal,
61
+ },
62
+ ], children: [hideAxesAndRules !== true
63
+ ? renderHorizSections(__assign(__assign({}, horizSectionProps), { onlyReferenceLines: false, renderReferenceLines: !referenceLinesOverChartContent }))
64
+ : null, _jsx(ScrollView, __assign({ onScrollBeginDrag: function () {
65
+ setCanMomentum(true);
66
+ }, onScrollEndDrag: function (evt) {
67
+ var direction = 0;
68
+ if (isCloseToLeft(evt.nativeEvent, endReachedOffset)) {
69
+ direction = -1;
70
+ }
71
+ else if (isCloseToRight(evt.nativeEvent, endReachedOffset)) {
72
+ direction = 1;
73
+ }
74
+ if (onScrollEndDrag) {
75
+ onScrollEndDrag(evt, direction);
76
+ }
77
+ }, nestedScrollEnabled: nestedScrollEnabled, onMomentumScrollEnd: function (_a) {
78
+ var nativeEvent = _a.nativeEvent;
79
+ if (onMomentumScrollEnd) {
80
+ onMomentumScrollEnd();
81
+ }
82
+ if (isCloseToEnd(nativeEvent) && canMomentum) {
83
+ onEndReached ? onEndReached() : null;
84
+ setCanMomentum(false);
85
+ }
86
+ if (isCloseToStart(nativeEvent) && canMomentum) {
87
+ onStartReached ? onStartReached() : null;
88
+ setCanMomentum(false);
89
+ }
90
+ }, scrollEventThrottle: props.scrollEventThrottle ? props.scrollEventThrottle : 16, horizontal: true, ref: scrollRef, style: [
91
+ {
92
+ marginLeft: horizontal && !yAxisAtTop
93
+ ? -yAxisThickness -
94
+ (props.width ? 20 : 0) -
95
+ ((_c = (_b = (_a = data[data.length - 1]) === null || _a === void 0 ? void 0 : _a.barWidth) !== null && _b !== void 0 ? _b : barWidth) !== null && _c !== void 0 ? _c : 0) / 2
96
+ : yAxisSide === yAxisSides.RIGHT
97
+ ? 0
98
+ : yAxisLabelWidth + yAxisThickness,
99
+ position: 'absolute',
100
+ bottom: chartType === chartTypes.LINE_BI_COLOR ? 0 : xAxisThickness,
101
+ },
102
+ !!props.width && { width: props.width + extraWidthDueToDataPoint },
103
+ horizontal && {
104
+ width: ((_d = props.width) !== null && _d !== void 0 ? _d : totalWidth) + (props.width ? endSpacing : -20),
105
+ },
106
+ ], contentContainerStyle: [
107
+ {
108
+ height: containerHeightIncludingBelowXAxis +
109
+ yAxisExtraHeight +
110
+ labelsExtraHeight +
111
+ (50 + xAxisLabelsVerticalShift),
112
+ width: Math.max((_e = props.width) !== null && _e !== void 0 ? _e : 0, totalWidth - spacing + endSpacing) +
113
+ extraWidthDueToDataPoint,
114
+ paddingLeft: initialSpacing,
115
+ paddingBottom: noOfSectionsBelowXAxis * stepHeight + labelsExtraHeight,
116
+ alignItems: 'flex-end',
117
+ },
118
+ !props.width && { width: totalWidth },
119
+ ], scrollEnabled: !disableScroll, showsHorizontalScrollIndicator: showScrollIndicator, indicatorStyle: indicatorColor, onContentSizeChange: function () {
120
+ if (scrollRef.current && scrollToEnd) {
121
+ scrollRef.current.scrollToEnd({ animated: scrollAnimation });
122
+ }
123
+ else if (scrollRef.current && scrollToIndex) {
124
+ scrollRef.current.scrollTo({
125
+ x: initialSpacing +
126
+ ((barWidth !== null && barWidth !== void 0 ? barWidth : 0) + spacing) * scrollToIndex -
127
+ spacing,
128
+ animated: scrollAnimation,
129
+ });
130
+ }
131
+ } }, remainingScrollViewProps, { children: _jsxs(Fragment, { children: [showBackgroundSlices && chartType === chartTypes.LINE ? (_jsx(View, { style: {
132
+ position: 'absolute',
133
+ bottom: 61 + xAxisLabelsVerticalShift,
134
+ left: initialSpacing,
135
+ height: containerHeightIncludingBelowXAxis,
136
+ width: totalWidth,
137
+ zIndex: -1,
138
+ }, children: renderBackgroundSlices({
139
+ data: data || [],
140
+ endSpacing: endSpacing,
141
+ totalWidth: totalWidth,
142
+ }) })) : null, showVerticalLines ? (_jsx(RenderVerticalLines, __assign({}, verticalLinesProps))) : null,
143
+ // Only For Line Charts-
144
+ chartType === chartTypes.LINE &&
145
+ data.map(function (item, index) {
146
+ return showXAxisIndices || item.showXAxisIndex ? (_jsx(View, { style: {
147
+ position: 'absolute',
148
+ height: xAxisIndicesHeight,
149
+ width: xAxisIndicesWidth,
150
+ backgroundColor: xAxisIndicesColor,
151
+ bottom: 60 - xAxisIndicesHeight / 2,
152
+ left: index * spacing +
153
+ (initialSpacing - xAxisIndicesWidth / 2) -
154
+ 3,
155
+ } }, index + '' + item.value)) : null;
156
+ }), renderChartContent(containerHeightIncludingBelowXAxis)] }) })), referenceLinesOverChartContent
157
+ ? renderHorizSections(__assign(__assign({}, horizSectionProps), { onlyReferenceLines: true }))
158
+ : null, horizSectionProps.floatingYAxisLabels &&
159
+ renderHorizSections(__assign(__assign({}, horizSectionProps), { onlyLabels: true }))] }));
160
+ };
161
+ export default BarAndLineChartsWrapper;
@@ -0,0 +1,7 @@
1
+ interface RenderBackgroundSlicesProps {
2
+ data: any[];
3
+ endSpacing?: number;
4
+ totalWidth: number;
5
+ }
6
+ export declare const renderBackgroundSlices: (props: RenderBackgroundSlicesProps) => (import("react/jsx-runtime").JSX.Element | null)[] | null;
7
+ export {};
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { View } from 'react-native';
3
+ export var renderBackgroundSlices = function (props) {
4
+ var data = props.data, totalWidth = props.totalWidth, _a = props.endSpacing, endSpacing = _a === void 0 ? 0 : _a;
5
+ if (!data || data.length === 0) {
6
+ return null;
7
+ }
8
+ // Calculate total chart width
9
+ var totalChartWidth = totalWidth - endSpacing;
10
+ // Each slice gets equal width based on TOTAL data length (not filtered)
11
+ var sliceWidth = totalChartWidth / data.length;
12
+ // Map over ALL data items, preserving original index positions
13
+ return data.map(function (item, index) {
14
+ // Skip rendering if no background slice color specified
15
+ if (!item.backgroundSliceColor) {
16
+ return null;
17
+ }
18
+ // Use original data index for position
19
+ return (_jsx(View, { style: {
20
+ position: 'absolute',
21
+ left: sliceWidth * index,
22
+ top: 0,
23
+ bottom: 0,
24
+ width: sliceWidth,
25
+ backgroundColor: item.backgroundSliceColor,
26
+ zIndex: -100,
27
+ opacity: 0.5,
28
+ } }, "bg-slice-".concat(item.id, "-").concat(index)));
29
+ });
30
+ };
@@ -0,0 +1,2 @@
1
+ import { horizSectionPropTypes } from '@harveylx/gifted-charts-core';
2
+ export declare const renderHorizSections: (props: horizSectionPropTypes) => import("react/jsx-runtime").JSX.Element;