import {View, Animated} from 'react-native';
import Svg, {Path} from 'react-native-svg';
import {renderDataPoints} from './renderDataPoints';
import {renderSpecificDataPoints} from './renderSpecificDataPoints';
import {LineInBarChartPropsType} from 'gifted-charts-core';
import {DataPointProps} from 'gifted-charts-core';
import {isIos, isWebApp} from '../../../utils';
const RenderLineInBarChart = (props: LineInBarChartPropsType) => {
const {
yAxisLabelWidth,
spacing,
containerHeight,
lineConfig,
maxValue,
animatedWidth,
lineBehindBars,
points,
arrowPoints,
data,
totalWidth,
barWidth,
labelsExtraHeight,
xAxisLabelsVerticalShift,
selectedIndex,
containerHeightIncludingBelowXAxis,
yAxisOffset,
highlightEnabled,
lowlightOpacity,
disableForeignObject,
} = props;
const firstBarWidth = data[0].barWidth ?? barWidth;
const opacity = highlightEnabled
? selectedIndex.includes?.(-1)
? 1
: lowlightOpacity
: 1;
const svgHeight = containerHeightIncludingBelowXAxis + labelsExtraHeight;
const svgHeightProp = isWebApp ? svgHeight : undefined;
const dataPointsProps: DataPointProps = {
data,
lineConfig,
barWidth,
containerHeight,
maxValue,
firstBarWidth,
yAxisLabelWidth,
spacing,
selectedIndex: selectedIndex[0],
yAxisOffset,
opacity,
svgHeight,
totalWidth,
disableForeignObject,
};
const specificDataPointsProps = {
data,
barWidth,
firstBarWidth,
yAxisLabelWidth,
lineConfig,
spacing,
containerHeight,
maxValue,
yAxisOffset,
disableForeignObject,
};
const renderAnimatedLine = () => {
return (
);
};
const totalWidthWithEndSpacing = totalWidth + spacing;
const renderLine = () => {
return (
);
};
if (lineConfig.isAnimated) {
return renderAnimatedLine();
}
return renderLine();
};
export default RenderLineInBarChart;