react-native-gifted-charts 1.4.21 → 1.4.23
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/dist/BarChart/Animated2DWithGradient.d.ts +3 -0
- package/dist/BarChart/Animated2DWithGradient.js +113 -1
- package/dist/BarChart/RenderBars.d.ts +3 -0
- package/dist/BarChart/RenderBars.js +264 -1
- package/dist/BarChart/RenderStackBars.d.ts +3 -0
- package/dist/BarChart/RenderStackBars.js +174 -1
- package/dist/BarChart/index.d.ts +2 -0
- package/dist/BarChart/index.js +236 -1
- package/dist/BarChart/styles.d.ts +45 -0
- package/dist/BarChart/styles.js +46 -1
- package/dist/Components/AnimatedThreeDBar/index.d.ts +3 -0
- package/dist/Components/AnimatedThreeDBar/index.js +129 -1
- package/dist/Components/AnimatedThreeDBar/styles.d.ts +10 -0
- package/dist/Components/AnimatedThreeDBar/styles.js +13 -1
- package/dist/Components/BarAndLineChartsWrapper/index.d.ts +3 -0
- package/dist/Components/BarAndLineChartsWrapper/index.js +128 -1
- package/dist/Components/BarAndLineChartsWrapper/renderHorizSections.d.ts +2 -0
- package/dist/Components/BarAndLineChartsWrapper/renderHorizSections.js +322 -1
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/index.d.ts +3 -0
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/index.js +76 -1
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderDataPoints.d.ts +2 -0
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderDataPoints.js +50 -1
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificDataPoints.d.ts +1 -0
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificDataPoints.js +25 -1
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificVerticalLines.d.ts +1 -0
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificVerticalLines.js +20 -1
- package/dist/Components/BarAndLineChartsWrapper/renderVerticalLines.d.ts +2 -0
- package/dist/Components/BarAndLineChartsWrapper/renderVerticalLines.js +94 -1
- package/dist/Components/BarSpecificComponents/barBackgroundPattern.d.ts +2 -0
- package/dist/Components/BarSpecificComponents/barBackgroundPattern.js +9 -1
- package/dist/Components/BarSpecificComponents/cap.d.ts +2 -0
- package/dist/Components/BarSpecificComponents/cap.js +16 -1
- package/dist/Components/BarSpecificComponents/tooltip.d.ts +15 -0
- package/dist/Components/BarSpecificComponents/tooltip.js +40 -1
- package/dist/Components/common/LinearGradient.d.ts +16 -0
- package/dist/Components/common/LinearGradient.js +15 -1
- package/dist/Components/common/Pointer.d.ts +1 -0
- package/dist/Components/common/Pointer.js +16 -1
- package/dist/Components/common/StripAndLabel.d.ts +2 -0
- package/dist/Components/common/StripAndLabel.js +43 -1
- package/dist/Components/lineSvg.d.ts +14 -0
- package/dist/Components/lineSvg.js +22 -1
- package/dist/LineChart/LineChartBicolor.d.ts +2 -0
- package/dist/LineChart/LineChartBicolor.js +294 -1
- package/dist/LineChart/index.d.ts +2 -0
- package/dist/LineChart/index.js +1110 -1
- package/dist/LineChart/previous.d.ts +2 -0
- package/dist/LineChart/previous.js +9 -0
- package/dist/LineChart/styles.d.ts +43 -0
- package/dist/LineChart/styles.js +46 -1
- package/dist/PieChart/index.d.ts +2 -0
- package/dist/PieChart/index.js +99 -1
- package/dist/PieChart/main.d.ts +2 -0
- package/dist/PieChart/main.js +182 -1
- package/dist/PieChartPro/index.d.ts +2 -0
- package/dist/PieChartPro/index.js +124 -1
- package/dist/PopulationPyramid/index.d.ts +2 -0
- package/dist/PopulationPyramid/index.js +130 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -1
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +20 -1
- package/package.json +3 -3
|
@@ -1 +1,94 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { chartTypes } from 'gifted-charts-core';
|
|
4
|
+
import { Line, Svg } from 'react-native-svg';
|
|
5
|
+
var RenderVerticalLines = function (props) {
|
|
6
|
+
var verticalLinesAr = props.verticalLinesAr, verticalLinesSpacing = props.verticalLinesSpacing, spacing = props.spacing, initialSpacing = props.initialSpacing, verticalLinesZIndex = props.verticalLinesZIndex, verticalLinesHeight = props.verticalLinesHeight, verticalLinesThickness = props.verticalLinesThickness, verticalLinesColor = props.verticalLinesColor, verticalLinesStrokeDashArray = props.verticalLinesStrokeDashArray, verticalLinesShift = props.verticalLinesShift, verticalLinesUptoDataPoint = props.verticalLinesUptoDataPoint, verticalLinesStrokeLinecap = props.verticalLinesStrokeLinecap, xAxisThickness = props.xAxisThickness, labelsExtraHeight = props.labelsExtraHeight, containerHeight = props.containerHeight, data = props.data, stackData = props.stackData, barWidth = props.barWidth, maxValue = props.maxValue, chartType = props.chartType, containerHeightIncludingBelowXAxis = props.containerHeightIncludingBelowXAxis, totalWidth = props.totalWidth, xAxisLabelsVerticalShift = props.xAxisLabelsVerticalShift;
|
|
7
|
+
var getHeightOfVerticalLine = function (index) {
|
|
8
|
+
if (verticalLinesUptoDataPoint) {
|
|
9
|
+
if (index < data.length) {
|
|
10
|
+
return ((data[index].value * containerHeight) / maxValue - xAxisThickness);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
return verticalLinesHeight !== null && verticalLinesHeight !== void 0 ? verticalLinesHeight : 0;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return (verticalLinesHeight ||
|
|
18
|
+
containerHeightIncludingBelowXAxis - xAxisThickness);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var extendedContainerHeight = containerHeight + 10 + labelsExtraHeight;
|
|
22
|
+
var thickness = verticalLinesThickness || 2;
|
|
23
|
+
var heightAdjustmentDueToStrokeLinecap = verticalLinesStrokeLinecap === 'round' ||
|
|
24
|
+
verticalLinesStrokeLinecap === 'square'
|
|
25
|
+
? thickness / 2
|
|
26
|
+
: 0;
|
|
27
|
+
return (_jsx(View, { style: {
|
|
28
|
+
position: 'absolute',
|
|
29
|
+
height: extendedContainerHeight,
|
|
30
|
+
bottom: 60 + xAxisLabelsVerticalShift, //stepHeight * -0.5 + xAxisThickness,
|
|
31
|
+
width: totalWidth,
|
|
32
|
+
zIndex: verticalLinesZIndex || -1,
|
|
33
|
+
}, children: _jsx(Svg, { children: verticalLinesAr.map(function (item, index) {
|
|
34
|
+
var totalSpacing = initialSpacing;
|
|
35
|
+
if (verticalLinesSpacing) {
|
|
36
|
+
totalSpacing = verticalLinesSpacing * (index + 1);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
if (stackData) {
|
|
40
|
+
totalSpacing += (stackData[0].barWidth || barWidth || 30) / 2;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
totalSpacing += (data[0].barWidth || barWidth || 30) / 2;
|
|
44
|
+
}
|
|
45
|
+
for (var i = 0; i < index; i++) {
|
|
46
|
+
var actualSpacing = spacing;
|
|
47
|
+
if (stackData) {
|
|
48
|
+
if (i >= stackData.length - 1) {
|
|
49
|
+
actualSpacing += (barWidth || 30) / 2;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
if (stackData[i].spacing || stackData[i].spacing === 0) {
|
|
53
|
+
actualSpacing = stackData[i].spacing;
|
|
54
|
+
}
|
|
55
|
+
if (stackData[i + 1].barWidth) {
|
|
56
|
+
actualSpacing += stackData[i + 1].barWidth;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
actualSpacing += barWidth || 30;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
if (i >= data.length - 1) {
|
|
65
|
+
actualSpacing += (barWidth || 30) / 2;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
if (data[i].spacing || data[i].spacing === 0) {
|
|
69
|
+
actualSpacing = data[i].spacing;
|
|
70
|
+
}
|
|
71
|
+
if (data[i + 1].barWidth) {
|
|
72
|
+
actualSpacing += data[i + 1].barWidth;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
actualSpacing += barWidth || 30;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
totalSpacing += actualSpacing;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
var x = verticalLinesShift +
|
|
83
|
+
1 +
|
|
84
|
+
(chartType === chartTypes.BAR
|
|
85
|
+
? totalSpacing - 1
|
|
86
|
+
: verticalLinesSpacing
|
|
87
|
+
? verticalLinesSpacing * (index + 1)
|
|
88
|
+
: index * spacing + (initialSpacing - 2));
|
|
89
|
+
return (_jsx(Line, { x1: x, y1: extendedContainerHeight -
|
|
90
|
+
getHeightOfVerticalLine(index) +
|
|
91
|
+
heightAdjustmentDueToStrokeLinecap, x2: x, y2: extendedContainerHeight - heightAdjustmentDueToStrokeLinecap, stroke: verticalLinesColor || 'lightgray', strokeWidth: verticalLinesThickness || 2, strokeDasharray: verticalLinesStrokeDashArray !== null && verticalLinesStrokeDashArray !== void 0 ? verticalLinesStrokeDashArray : '', strokeLinecap: verticalLinesStrokeLinecap }, index));
|
|
92
|
+
}) }) }));
|
|
93
|
+
};
|
|
94
|
+
export default RenderVerticalLines;
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Svg, { Defs, Rect } from 'react-native-svg';
|
|
3
|
+
var BarBackgroundPattern = function (props) {
|
|
4
|
+
var barBackgroundPatternFromItem = props.barBackgroundPatternFromItem, barBackgroundPatternFromProps = props.barBackgroundPatternFromProps, patternIdFromItem = props.patternIdFromItem, patternIdFromProps = props.patternIdFromProps;
|
|
5
|
+
return (_jsxs(Svg, { children: [_jsx(Defs, { children: barBackgroundPatternFromItem
|
|
6
|
+
? barBackgroundPatternFromItem()
|
|
7
|
+
: barBackgroundPatternFromProps() }), _jsx(Rect, { stroke: "transparent", x: "1", y: "1", width: "100%", height: "100%", fill: "url(#".concat(patternIdFromItem !== null && patternIdFromItem !== void 0 ? patternIdFromItem : patternIdFromProps, ")") })] }));
|
|
8
|
+
};
|
|
9
|
+
export default BarBackgroundPattern;
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { BarDefaults } from 'gifted-charts-core';
|
|
4
|
+
var Cap = function (props) {
|
|
5
|
+
var _a, _b, _c, _d;
|
|
6
|
+
var capThicknessFromItem = props.capThicknessFromItem, capThicknessFromProps = props.capThicknessFromProps, capColorFromItem = props.capColorFromItem, capColorFromProps = props.capColorFromProps, capRadiusFromItem = props.capRadiusFromItem, capRadiusFromProps = props.capRadiusFromProps;
|
|
7
|
+
return (_jsx(View, { style: {
|
|
8
|
+
position: 'absolute',
|
|
9
|
+
width: '100%',
|
|
10
|
+
height: (_a = capThicknessFromItem !== null && capThicknessFromItem !== void 0 ? capThicknessFromItem : capThicknessFromProps) !== null && _a !== void 0 ? _a : BarDefaults.capThickness,
|
|
11
|
+
backgroundColor: (_b = capColorFromItem !== null && capColorFromItem !== void 0 ? capColorFromItem : capColorFromProps) !== null && _b !== void 0 ? _b : BarDefaults.capColor,
|
|
12
|
+
borderTopLeftRadius: (_c = capRadiusFromItem !== null && capRadiusFromItem !== void 0 ? capRadiusFromItem : capRadiusFromProps) !== null && _c !== void 0 ? _c : BarDefaults.capRadius,
|
|
13
|
+
borderTopRightRadius: (_d = capRadiusFromItem !== null && capRadiusFromItem !== void 0 ? capRadiusFromItem : capRadiusFromProps) !== null && _d !== void 0 ? _d : BarDefaults.capRadius,
|
|
14
|
+
} }));
|
|
15
|
+
};
|
|
16
|
+
export default Cap;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface TooltipProps {
|
|
2
|
+
barHeight: number;
|
|
3
|
+
barWidth: number;
|
|
4
|
+
item: any;
|
|
5
|
+
index: number;
|
|
6
|
+
isLast: boolean;
|
|
7
|
+
leftSpacing: number;
|
|
8
|
+
leftShiftForLastIndexTooltip: number;
|
|
9
|
+
leftShiftForTooltip: number;
|
|
10
|
+
renderTooltip?: Function;
|
|
11
|
+
autoCenterTooltip?: boolean;
|
|
12
|
+
horizontal?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const Tooltip: (props: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default Tooltip;
|
|
@@ -1 +1,40 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
2
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3
|
+
if (!m) return o;
|
|
4
|
+
var i = m.call(o), r, ar = [], e;
|
|
5
|
+
try {
|
|
6
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
7
|
+
}
|
|
8
|
+
catch (error) { e = { error: error }; }
|
|
9
|
+
finally {
|
|
10
|
+
try {
|
|
11
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
12
|
+
}
|
|
13
|
+
finally { if (e) throw e.error; }
|
|
14
|
+
}
|
|
15
|
+
return ar;
|
|
16
|
+
};
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
import { useState } from 'react';
|
|
19
|
+
import { View } from 'react-native';
|
|
20
|
+
var Tooltip = function (props) {
|
|
21
|
+
var barHeight = props.barHeight, barWidth = props.barWidth, item = props.item, index = props.index, isLast = props.isLast, leftSpacing = props.leftSpacing, leftShiftForLastIndexTooltip = props.leftShiftForLastIndexTooltip, leftShiftForTooltip = props.leftShiftForTooltip, renderTooltip = props.renderTooltip, autoCenterTooltip = props.autoCenterTooltip, horizontal = props.horizontal;
|
|
22
|
+
var _a = __read(useState(0), 2), leftShiftTooltipForCentering = _a[0], setLeftShiftTooltipForCentering = _a[1];
|
|
23
|
+
return (_jsx(View, { style: {
|
|
24
|
+
position: 'absolute',
|
|
25
|
+
bottom: barHeight + 60,
|
|
26
|
+
left: leftSpacing -
|
|
27
|
+
(isLast ? leftShiftForLastIndexTooltip : leftShiftForTooltip) -
|
|
28
|
+
leftShiftTooltipForCentering,
|
|
29
|
+
zIndex: 1000,
|
|
30
|
+
transform: [{ rotate: horizontal ? '-90deg' : '0deg' }],
|
|
31
|
+
}, onLayout: function (event) {
|
|
32
|
+
if (!autoCenterTooltip)
|
|
33
|
+
return;
|
|
34
|
+
var width = event.nativeEvent.layout.width;
|
|
35
|
+
var shift = (width - barWidth) / 2;
|
|
36
|
+
if (shift > 0)
|
|
37
|
+
setLeftShiftTooltipForCentering(shift);
|
|
38
|
+
}, children: renderTooltip === null || renderTooltip === void 0 ? void 0 : renderTooltip(item, index) }));
|
|
39
|
+
};
|
|
40
|
+
export default Tooltip;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type LinearGradientProps = {
|
|
3
|
+
style?: any;
|
|
4
|
+
start?: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
};
|
|
8
|
+
end?: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
};
|
|
12
|
+
colors: string[];
|
|
13
|
+
children?: any;
|
|
14
|
+
};
|
|
15
|
+
declare let LinearGradient: React.FC<LinearGradientProps>;
|
|
16
|
+
export default LinearGradient;
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
var LinearGradient;
|
|
2
|
+
try {
|
|
3
|
+
// for bare react-native projects
|
|
4
|
+
LinearGradient = require('react-native-linear-gradient').LinearGradient;
|
|
5
|
+
}
|
|
6
|
+
catch (e) {
|
|
7
|
+
try {
|
|
8
|
+
// for expo-based projects
|
|
9
|
+
LinearGradient = require('expo-linear-gradient').LinearGradient;
|
|
10
|
+
}
|
|
11
|
+
catch (e) {
|
|
12
|
+
throw new Error('Gradient package was not found. Make sure "react-native-linear-gradient" or "expo-linear-gradient" is installed');
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export default LinearGradient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Pointer: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
export var Pointer = function (props) {
|
|
4
|
+
var pointerX = props.pointerX, pointerYLocal = props.pointerYLocal, pointerComponent = props.pointerComponent, pointerHeight = props.pointerHeight, pointerRadius = props.pointerRadius, pointerWidth = props.pointerWidth, pointerItemLocal = props.pointerItemLocal, pointerColorLocal = props.pointerColorLocal;
|
|
5
|
+
return (_jsx(View, { style: {
|
|
6
|
+
position: 'absolute',
|
|
7
|
+
left: pointerX + (pointerX.pointerShiftX || 0),
|
|
8
|
+
top: pointerYLocal - 2,
|
|
9
|
+
}, children: pointerComponent ? (pointerComponent()) : (_jsx(View, { style: {
|
|
10
|
+
height: pointerHeight || pointerRadius * 2,
|
|
11
|
+
width: pointerWidth || pointerRadius * 2,
|
|
12
|
+
marginTop: (pointerItemLocal === null || pointerItemLocal === void 0 ? void 0 : pointerItemLocal.pointerShiftY) || 0,
|
|
13
|
+
backgroundColor: pointerColorLocal,
|
|
14
|
+
borderRadius: pointerRadius || 0,
|
|
15
|
+
} })) }));
|
|
16
|
+
};
|
|
@@ -1 +1,43 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import Svg, { Line } from 'react-native-svg';
|
|
4
|
+
import { getTopAndLeftForStripAndLabel, } from 'gifted-charts-core';
|
|
5
|
+
export var StripAndLabel = function (props) {
|
|
6
|
+
var _a;
|
|
7
|
+
var pointerX = props.pointerX, pointerLabelWidth = props.pointerLabelWidth, pointerRadius = props.pointerRadius, pointerWidth = props.pointerWidth, pointerYLocal = props.pointerYLocal, pointerStripUptoDataPoint = props.pointerStripUptoDataPoint, pointerStripHeight = props.pointerStripHeight, pointerItemLocal = props.pointerItemLocal, showPointerStrip = props.showPointerStrip, pointerStripWidth = props.pointerStripWidth, containerHeight = props.containerHeight, xAxisThickness = props.xAxisThickness, pointerStripColor = props.pointerStripColor, pointerConfig = props.pointerConfig, pointerLabelComponent = props.pointerLabelComponent, secondaryPointerItem = props.secondaryPointerItem, pointerEvents = props.pointerEvents, isBarChart = props.isBarChart, pointerIndex = props.pointerIndex;
|
|
8
|
+
var _b = getTopAndLeftForStripAndLabel(props), top = _b.top, left = _b.left;
|
|
9
|
+
return (_jsxs(View, { style: {
|
|
10
|
+
position: 'absolute',
|
|
11
|
+
left: pointerX + (((_a = pointerItemLocal[0]) === null || _a === void 0 ? void 0 : _a.pointerShiftX) || 0),
|
|
12
|
+
top: pointerYLocal,
|
|
13
|
+
}, children: [(isBarChart
|
|
14
|
+
? showPointerStrip && !pointerLabelComponent
|
|
15
|
+
: showPointerStrip) ? (_jsx(View, { style: {
|
|
16
|
+
position: 'absolute',
|
|
17
|
+
left: (pointerRadius || pointerWidth) - pointerStripWidth / 4,
|
|
18
|
+
top: pointerStripUptoDataPoint
|
|
19
|
+
? pointerRadius || pointerStripHeight / 2
|
|
20
|
+
: -pointerYLocal + 8,
|
|
21
|
+
width: pointerStripWidth,
|
|
22
|
+
height: pointerStripUptoDataPoint
|
|
23
|
+
? containerHeight - pointerYLocal + 5 - xAxisThickness
|
|
24
|
+
: pointerStripHeight,
|
|
25
|
+
marginTop: pointerStripUptoDataPoint
|
|
26
|
+
? 0
|
|
27
|
+
: containerHeight - pointerStripHeight,
|
|
28
|
+
}, children: _jsx(Svg, { children: _jsx(Line, { stroke: pointerStripColor, strokeWidth: pointerStripWidth, strokeDasharray: (pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.strokeDashArray)
|
|
29
|
+
? pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.strokeDashArray
|
|
30
|
+
: '', x1: 0, y1: 0, x2: 0, y2: pointerStripUptoDataPoint
|
|
31
|
+
? containerHeight - pointerYLocal + 5 - xAxisThickness
|
|
32
|
+
: pointerStripHeight }) }) })) : null, pointerLabelComponent ? (_jsx(View, { pointerEvents: pointerEvents !== null && pointerEvents !== void 0 ? pointerEvents : 'none', style: [
|
|
33
|
+
{
|
|
34
|
+
position: 'absolute',
|
|
35
|
+
left: left,
|
|
36
|
+
top: top,
|
|
37
|
+
marginTop: pointerStripUptoDataPoint
|
|
38
|
+
? 0
|
|
39
|
+
: containerHeight - pointerStripHeight,
|
|
40
|
+
width: pointerLabelWidth,
|
|
41
|
+
},
|
|
42
|
+
], children: pointerLabelComponent === null || pointerLabelComponent === void 0 ? void 0 : pointerLabelComponent(pointerItemLocal, secondaryPointerItem, pointerIndex) })) : null] }));
|
|
43
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ColorValue } from 'react-native';
|
|
2
|
+
type ruleProps = {
|
|
3
|
+
thickness: number;
|
|
4
|
+
width: number;
|
|
5
|
+
color: ColorValue | string | any;
|
|
6
|
+
type: string;
|
|
7
|
+
dashWidth: number;
|
|
8
|
+
dashGap: number;
|
|
9
|
+
};
|
|
10
|
+
type configType = {
|
|
11
|
+
config: ruleProps;
|
|
12
|
+
};
|
|
13
|
+
declare function Rule(props: configType): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default Rule;
|
|
@@ -1 +1,22 @@
|
|
|
1
|
-
|
|
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 } from "react/jsx-runtime";
|
|
13
|
+
import Svg, { G, Path } from 'react-native-svg';
|
|
14
|
+
import { ruleTypes } from 'gifted-charts-core';
|
|
15
|
+
function Rule(props) {
|
|
16
|
+
var _a = props.config, thickness = _a.thickness, width = _a.width, color = _a.color, type = _a.type, dashWidth = _a.dashWidth, dashGap = _a.dashGap;
|
|
17
|
+
if (type === ruleTypes.SOLID) {
|
|
18
|
+
return (_jsx(Svg, __assign({ height: thickness, width: width }, props, { children: _jsx(G, { fill: "lightgray", stroke: color, strokeWidth: thickness, children: _jsx(Path, { d: "M0 ".concat(thickness / 2, "h").concat(width) }) }) })));
|
|
19
|
+
}
|
|
20
|
+
return (_jsx(Svg, __assign({ height: thickness, width: width }, props, { children: _jsx(G, { fill: "lightgray", stroke: color, strokeWidth: thickness, children: _jsx(Path, { strokeDasharray: "".concat(dashWidth, ",").concat(dashGap), d: "M0 ".concat(thickness / 2, "h").concat(width) }) }) })));
|
|
21
|
+
}
|
|
22
|
+
export default Rule;
|