react-native-gifted-charts 1.4.50 → 1.4.52
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 +23 -22
- package/dist/Components/common/StripAndLabel.js +2 -2
- package/dist/LineChart/index.js +3 -3
- package/dist/RadarChart/index.d.ts +2 -0
- package/dist/RadarChart/index.js +51 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# react-native-gifted-charts
|
|
2
|
+
|
|
2
3
|
<p align="center">
|
|
3
4
|
<a href="https://gifted-charts.web.app">
|
|
4
5
|
<img src="/demos/favicon.png" height="auto" width="26" height="26" />
|
|
@@ -10,32 +11,30 @@
|
|
|
10
11
|
<img src="/demos/discord.png" height="auto" width="30" height="30" />
|
|
11
12
|
</a>
|
|
12
13
|
</p>
|
|
13
|
-
The most complete library for Bar, Line, Area, Pie, Donut, Stacked Bar
|
|
14
|
+
The most complete library for Bar, Line, Area, Pie, Donut, Stacked Bar, Population Pyramid and Radar charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.
|
|
14
15
|
|
|
15
16
|
### Yet another chart library? Why?
|
|
16
17
|
|
|
17
18
|
**_To bring Life to your data_**
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
- Plenty of features with minimal code
|
|
21
|
+
- Apply animations to your charts on load and on value change, just by adding a prop
|
|
22
|
+
- Smooth animations implemented using LayoutAnimation
|
|
23
|
+
- Clickable and scrollable
|
|
24
|
+
- Three-D and gradient effects
|
|
25
|
+
- Fully customizable (see the [props](docs/docs.md))
|
|
26
|
+
- Detailed [documentation](https://gifted-chart*web.app/) with examples
|
|
27
|
+
- Support for **_combined_** Bar and Line charts
|
|
28
|
+
- Tested to be pixel perfect using [react-native-screenshot-test](https://www.npmjs.com/package/react-native-screenshot-test). See [the screenshot tests here](https://abhinandan-kushwaha.github.io/TestingCharts/ss-test/test.html)
|
|
29
|
+
- Detailed and illustrated [dev docs](docs/dev/index.md) that explain the architecture and working of the library
|
|
29
30
|
|
|
30
31
|
The web counterpart of this library is public now. Try out our new reactJS library- [react-gifted-charts](https://www.npmjs.com/package/react-gifted-charts) <br />
|
|
31
32
|
The exact same piece of code that you write to render charts in react-native, can be used to render charts in reactJS using this library!
|
|
32
33
|
|
|
33
|
-
|
|
34
34
|
## [Release notes 🎉](release-notes/release-notes.md)
|
|
35
35
|
|
|
36
36
|
See the **[release changes by version here.](release-notes/release-notes.md)**
|
|
37
37
|
|
|
38
|
-
|
|
39
38
|
<img src='/demos/bars.png' alt=''/>
|
|
40
39
|
<img src='/demos/lineArea.png' alt=''/>
|
|
41
40
|
<img src='/demos/blues.png' alt=''/>
|
|
@@ -49,7 +48,7 @@ See the **[release changes by version here.](release-notes/release-notes.md)**
|
|
|
49
48
|
<td><img src='/demos/crossHair.gif' alt='' height=280 /></td>
|
|
50
49
|
<td><img src='/demos/movingBars.gif' alt='' width=270 height=300/></td>
|
|
51
50
|
<tr>
|
|
52
|
-
<td><img src='/demos/
|
|
51
|
+
<td><img src='/demos/radar.png' alt='' height=280 width=320/></td>
|
|
53
52
|
<td><img src='/demos/ppnLabelled.png' alt='' height=280 width=300/></td>
|
|
54
53
|
</tr>
|
|
55
54
|
</table>
|
|
@@ -76,15 +75,15 @@ Please note that `react-native-svg` and `react-native-linear-gradient`/`expo-lin
|
|
|
76
75
|
|
|
77
76
|
# Docs
|
|
78
77
|
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
- [Documentation and gallery](https://gifted-charts.web.app/) <br />
|
|
79
|
+
- [Architecture and working (dev docs)](docs/dev/index.md)
|
|
81
80
|
|
|
82
81
|
## Usage
|
|
83
82
|
|
|
84
83
|
The simplest usage of various types of charts can be done as below-
|
|
85
84
|
|
|
86
85
|
```js
|
|
87
|
-
import { BarChart, LineChart, PieChart, PopulationPyramid } from "react-native-gifted-charts";
|
|
86
|
+
import { BarChart, LineChart, PieChart, PopulationPyramid, RadarChart } from "react-native-gifted-charts";
|
|
88
87
|
|
|
89
88
|
// ...
|
|
90
89
|
const data=[ {value:50}, {value:80}, {value:90}, {value:70} ]
|
|
@@ -93,6 +92,7 @@ const data=[ {value:50}, {value:80}, {value:90}, {value:70} ]
|
|
|
93
92
|
<LineChart data = {data} />
|
|
94
93
|
<PieChart data = {data} />
|
|
95
94
|
<PopulationPyramid data = {[{left:10,right:12}, {left:9,right:8}]} />
|
|
95
|
+
<RadarChart data = {[50, 80, 90, 70]} />
|
|
96
96
|
|
|
97
97
|
// For Horizontal Bar chart, just add the prop horizontal to the <BarChart/> component
|
|
98
98
|
|
|
@@ -112,7 +112,8 @@ const data=[ {value:50}, {value:80}, {value:90}, {value:70} ]
|
|
|
112
112
|
**1. [BarChart, Horizontal BarChart and Stacked Bar Chart props](docs/BarChart/BarChartProps.md)** \
|
|
113
113
|
**2. [LineChart and AreaChart props](docs/LineChart/LineChartProps.md)** \
|
|
114
114
|
**3. [PieChart and DonutChart props](docs/PieChart/PieChartProps.md)** \
|
|
115
|
-
**4. [Population Pyramid props](docs/PopulationPyramid/PopulationPyramid.md)**
|
|
115
|
+
**4. [Population Pyramid props](docs/PopulationPyramid/PopulationPyramid.md)** \
|
|
116
|
+
**5. [RadarChart props](docs/RadarChart/RadarChartProps.md)**
|
|
116
117
|
|
|
117
118
|
## Contributing
|
|
118
119
|
|
|
@@ -135,10 +136,10 @@ See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the
|
|
|
135
136
|
|
|
136
137
|
## Test cases
|
|
137
138
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
- Test strategy and cases are discussed here- [TESTS.md](./TESTS.md) <br />
|
|
140
|
+
- Pixel perfection is assured using [react-native-screenshot-test](https://www.npmjs.com/package/react-native-screenshot-test). <br/>
|
|
141
|
+
- 220+ screenshot tests have been written. See the [Reports here](https://abhinandan-kushwaha.github.io/TestingCharts/ss-test/test.html).
|
|
142
|
+
- Screenshot tests are written in a separate repo named [TestingCharts](https://github.com/Abhinandan-Kushwaha/TestingCharts)
|
|
142
143
|
|
|
143
144
|
## License
|
|
144
145
|
|
|
@@ -4,7 +4,7 @@ import Svg, { Line } from 'react-native-svg';
|
|
|
4
4
|
import { getTopAndLeftForStripAndLabel, } from 'gifted-charts-core';
|
|
5
5
|
export var StripAndLabel = function (props) {
|
|
6
6
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
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, pointerItemsForSet = props.pointerItemsForSet, secondaryPointerItemsForSet = props.secondaryPointerItemsForSet, pointerEvents = props.pointerEvents, isBarChart = props.isBarChart, pointerIndex = props.pointerIndex, hasDataSet = props.hasDataSet, containsNegative = props.containsNegative, horizontalStripConfig = props.horizontalStripConfig, screenWidth = props.screenWidth;
|
|
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, pointerItemsForSet = props.pointerItemsForSet, secondaryPointerItemsForSet = props.secondaryPointerItemsForSet, pointerEvents = props.pointerEvents, isBarChart = props.isBarChart, pointerIndex = props.pointerIndex, hasDataSet = props.hasDataSet, containsNegative = props.containsNegative, horizontalStripConfig = props.horizontalStripConfig, screenWidth = props.screenWidth, width = props.width;
|
|
8
8
|
var _j = getTopAndLeftForStripAndLabel(props), top = _j.top, left = _j.left;
|
|
9
9
|
if (isNaN(top) || typeof top !== 'number')
|
|
10
10
|
return null;
|
|
@@ -17,7 +17,7 @@ export var StripAndLabel = function (props) {
|
|
|
17
17
|
position: 'absolute',
|
|
18
18
|
left: -pointerStripWidth / 4,
|
|
19
19
|
top: containsNegative ? 0 : -pointerYLocal + 8 + xAxisThickness,
|
|
20
|
-
width:
|
|
20
|
+
width: width,
|
|
21
21
|
height: containerHeight,
|
|
22
22
|
}, children: [_jsxs(Svg, { children: [_jsx(Line, { stroke: pointerStripColor, strokeWidth: pointerStripWidth, strokeDasharray: (pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.strokeDashArray)
|
|
23
23
|
? pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.strokeDashArray
|
package/dist/LineChart/index.js
CHANGED
|
@@ -360,7 +360,7 @@ export var LineChart = function (props) {
|
|
|
360
360
|
if (!item.onPress && !props.onPress && focusEnabled) {
|
|
361
361
|
handleUnFocus();
|
|
362
362
|
}
|
|
363
|
-
} })) }, index)), dataPointLabelComponent ? (!showTextOnFocus || index === selectedIndex ? (_jsx(ForeignObject, { height: svgHeight, width:
|
|
363
|
+
} })) }, index)), dataPointLabelComponent ? (!showTextOnFocus || index === selectedIndex ? (_jsx(ForeignObject, { height: svgHeight, width: dataPointLabelWidth, x: initialSpacing +
|
|
364
364
|
(item.dataPointLabelShiftX ||
|
|
365
365
|
props.dataPointLabelShiftX ||
|
|
366
366
|
0) -
|
|
@@ -372,9 +372,9 @@ export var LineChart = function (props) {
|
|
|
372
372
|
(item.value * containerHeight) / maxValue, children: showDataPointLabelOnFocus
|
|
373
373
|
? index === selectedIndex &&
|
|
374
374
|
(focusTogether || key == selectedLineNumber)
|
|
375
|
-
? dataPointLabelComponent()
|
|
375
|
+
? dataPointLabelComponent(item, index) // not pushed in latest release
|
|
376
376
|
: null
|
|
377
|
-
: dataPointLabelComponent() })) : null) : text || item.dataPointText ? (!showTextOnFocus || index === selectedIndex ? (_jsx(CanvasText, { fill: item.textColor || textColor, fontSize: item.textFontSize || textFontSize, x: getX(spacingArray, index) -
|
|
377
|
+
: dataPointLabelComponent(item, index) })) : null) : text || item.dataPointText ? (!showTextOnFocus || index === selectedIndex ? (_jsx(CanvasText, { fill: item.textColor || textColor, fontSize: item.textFontSize || textFontSize, x: getX(spacingArray, index) -
|
|
378
378
|
dataPointsWidth +
|
|
379
379
|
(item.textShiftX || props.textShiftX || 0), y: getYOrSecondaryY(item.value) -
|
|
380
380
|
dataPointsHeight / 2 +
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import Svg, { Line, Polygon, Circle, Text as SvgText, Defs, RadialGradient, Stop, } from 'react-native-svg';
|
|
5
|
+
import { useRadarChart } from 'gifted-charts-core';
|
|
6
|
+
export var RadarChart = function (props) {
|
|
7
|
+
var _a = useRadarChart(props), data = _a.data, dataSet = _a.dataSet, center = _a.center, radius = _a.radius, chartSize = _a.chartSize, polarToCartesian = _a.polarToCartesian, labels = _a.labels, labelConfigArray = _a.labelConfigArray, labelsPositionOffset = _a.labelsPositionOffset, dataLabelsConfigArray = _a.dataLabelsConfigArray, maxValue = _a.maxValue, dataLabels = _a.dataLabels, dataLabelsArray = _a.dataLabelsArray, gridSections = _a.gridSections, gridFill = _a.gridFill, fontSize = _a.fontSize, stroke = _a.stroke, textAnchor = _a.textAnchor, alignmentBaseline = _a.alignmentBaseline, fontWeight = _a.fontWeight, fontFamily = _a.fontFamily, dataLabelsPositionOffset = _a.dataLabelsPositionOffset, polygonStroke = _a.polygonStroke, polygonStrokeWidth = _a.polygonStrokeWidth, polygonStrokeDashArray = _a.polygonStrokeDashArray, polygonFill = _a.polygonFill, polygonGradientColor = _a.polygonGradientColor, polygonShowGradient = _a.polygonShowGradient, polygonOpacity = _a.polygonOpacity, polygonGradientOpacity = _a.polygonGradientOpacity, asterLinesStroke = _a.asterLinesStroke, asterLinesStrokeWidth = _a.asterLinesStrokeWidth, asterLinesStrokeDashArray = _a.asterLinesStrokeDashArray, polygonPoints = _a.polygonPoints, polygonPointsArray = _a.polygonPointsArray, polygonConfigArray = _a.polygonConfigArray, angleStep = _a.angleStep, circular = _a.circular, hideGrid = _a.hideGrid, hideAsterLines = _a.hideAsterLines, getGridLevelProps = _a.getGridLevelProps;
|
|
8
|
+
return (_jsx(View, { style: { justifyContent: 'center', alignItems: 'center' }, children: _jsxs(Svg, { height: chartSize, width: chartSize, children: [(polygonConfigArray === null || polygonConfigArray === void 0 ? void 0 : polygonConfigArray.length) ? (polygonConfigArray.map(function (polygonConfigItem, index) {
|
|
9
|
+
var fill = polygonConfigItem.fill, gradientColor = polygonConfigItem.gradientColor, opacity = polygonConfigItem.opacity, gradientOpacity = polygonConfigItem.gradientOpacity;
|
|
10
|
+
return (_jsx(Defs, { children: _jsxs(RadialGradient, { id: "polygon-".concat(index), cx: center, cy: center, rx: radius, ry: radius, fx: "50%", fy: "50%", gradientUnits: "userSpaceOnUse", children: [_jsx(Stop, { offset: "0%", stopColor: gradientColor, stopOpacity: gradientOpacity }), _jsx(Stop, { offset: "100%", stopColor: fill, stopOpacity: opacity })] }, "polygon-".concat(index)) }));
|
|
11
|
+
})) : polygonShowGradient ? (_jsx(Defs, { children: _jsxs(RadialGradient, { id: 'polygon', cx: center, cy: center, rx: radius, ry: radius, fx: "50%", fy: "50%", gradientUnits: "userSpaceOnUse", children: [_jsx(Stop, { offset: "0%", stopColor: polygonGradientColor, stopOpacity: polygonGradientOpacity }), _jsx(Stop, { offset: "100%", stopColor: polygonFill, stopOpacity: polygonOpacity })] }, 'polygon') })) : null, hideGrid
|
|
12
|
+
? null
|
|
13
|
+
: gridSections.map(function (l, ind) {
|
|
14
|
+
var _a = getGridLevelProps(l, ind), level = _a.level, gridGradientColorLocal = _a.gridGradientColorLocal, gridFillColorLocal = _a.gridFillColorLocal, gridOpacityLocal = _a.gridOpacityLocal, gridGradientOpacityLocal = _a.gridGradientOpacityLocal, gridStrokeLocal = _a.gridStrokeLocal, gridStrokeWidthLocal = _a.gridStrokeWidthLocal, gridShowGradientLocal = _a.gridShowGradientLocal, gridStrokeDashArrayLocal = _a.gridStrokeDashArrayLocal, levelPolygonPoints = _a.levelPolygonPoints, r = _a.r;
|
|
15
|
+
return (_jsxs(Fragment, { children: [_jsx(Defs, { children: _jsxs(RadialGradient, { id: 'grad' + level, cx: center, cy: center, rx: r, ry: r, fx: "50%", fy: "50%", gradientUnits: "userSpaceOnUse", children: [_jsx(Stop, { offset: "".concat(100 - 100 / level, "%"), stopColor: gridGradientColorLocal, stopOpacity: gridGradientOpacityLocal }), _jsx(Stop, { offset: "100%", stopColor: gridFillColorLocal, stopOpacity: gridOpacityLocal })] }, level + '') }), circular ? (_jsx(Circle, { cx: center, cy: center, r: r, stroke: gridStrokeLocal, strokeWidth: gridStrokeWidthLocal, strokeDasharray: gridStrokeDashArrayLocal, fill: gridShowGradientLocal ? "url(#grad".concat(level, ")") : gridFill }, "grid-".concat(level))) : (_jsx(Polygon, { points: levelPolygonPoints, stroke: gridStrokeLocal, strokeWidth: gridStrokeWidthLocal, strokeDasharray: gridStrokeDashArrayLocal, fill: gridShowGradientLocal ? "url(#grad".concat(level, ")") : gridFill }, "grid-".concat(level)))] }, "fragment-".concat(level)));
|
|
16
|
+
}), dataSet ? (polygonConfigArray === null || polygonConfigArray === void 0 ? void 0 : polygonConfigArray.map(function (item, index) {
|
|
17
|
+
var polygonPoints = polygonPointsArray[index];
|
|
18
|
+
var stroke = item.stroke, strokeWidth = item.strokeWidth, strokeDashArray = item.strokeDashArray, fill = item.fill, showGradient = item.showGradient, opacity = item.opacity;
|
|
19
|
+
return (_jsx(Polygon, { points: polygonPoints, fill: showGradient ? 'url(#polygon)' : fill, stroke: stroke, strokeWidth: strokeWidth, strokeDasharray: strokeDashArray, opacity: opacity }, "polygon-".concat(index)));
|
|
20
|
+
})) : (_jsx(Polygon, { points: polygonPoints, fill: polygonShowGradient ? 'url(#polygon)' : polygonFill, stroke: polygonStroke, strokeWidth: polygonStrokeWidth, strokeDasharray: polygonStrokeDashArray, opacity: polygonOpacity })), (dataSet === null || dataSet === void 0 ? void 0 : dataSet.length) && (dataLabelsArray === null || dataLabelsArray === void 0 ? void 0 : dataLabelsArray.length) ? (dataLabelsArray === null || dataLabelsArray === void 0 ? void 0 : dataLabelsArray.map(function (labels, index) {
|
|
21
|
+
var dataItem = dataSet[index];
|
|
22
|
+
return labels === null || labels === void 0 ? void 0 : labels.map(function (label, labelIndex) {
|
|
23
|
+
var _a, _b, _c;
|
|
24
|
+
var _d = polarToCartesian(labelIndex * angleStep, dataItem[labelIndex] + dataLabelsPositionOffset), x = _d.x, y = _d.y;
|
|
25
|
+
var _e = (_a = dataLabelsConfigArray === null || dataLabelsConfigArray === void 0 ? void 0 : dataLabelsConfigArray[labelIndex]) !== null && _a !== void 0 ? _a : {}, dataLabelsFontSize = _e.fontSize, dataLabelsColor = _e.stroke, dataLabelsTextAnchor = _e.textAnchor, dataLabelsAlignmentBaseline = _e.alignmentBaseline, dataLabelsFontWeight = _e.fontWeight, dataLabelsFontFamily = _e.fontFamily;
|
|
26
|
+
return (_jsx(SvgText, { x: x, y: y, fontSize: dataLabelsFontSize, fill: dataLabelsColor, fontWeight: dataLabelsFontWeight, fontFamily: dataLabelsFontFamily, textAnchor: (_b = dataLabelsTextAnchor) !== null && _b !== void 0 ? _b : 'middle', alignmentBaseline: (_c = dataLabelsAlignmentBaseline) !== null && _c !== void 0 ? _c : 'middle', children: label }, "data-label-".concat(index, "-").concat(labelIndex)));
|
|
27
|
+
});
|
|
28
|
+
})) : (dataLabels === null || dataLabels === void 0 ? void 0 : dataLabels.length) ? (_jsx(SvgText, { children: dataLabels.map(function (label, index) {
|
|
29
|
+
var _a, _b, _c;
|
|
30
|
+
var _d = polarToCartesian(index * angleStep, data[index] + dataLabelsPositionOffset), x = _d.x, y = _d.y;
|
|
31
|
+
var _e = (_a = dataLabelsConfigArray === null || dataLabelsConfigArray === void 0 ? void 0 : dataLabelsConfigArray[index]) !== null && _a !== void 0 ? _a : {}, dataLabelsFontSize = _e.fontSize, dataLabelsColor = _e.stroke, dataLabelsTextAnchor = _e.textAnchor, dataLabelsAlignmentBaseline = _e.alignmentBaseline, dataLabelsFontWeight = _e.fontWeight, dataLabelsFontFamily = _e.fontFamily;
|
|
32
|
+
return (_jsx(SvgText, { x: x, y: y, fontSize: dataLabelsFontSize, fill: dataLabelsColor, fontWeight: dataLabelsFontWeight, fontFamily: dataLabelsFontFamily, textAnchor: (_b = dataLabelsTextAnchor) !== null && _b !== void 0 ? _b : 'middle', alignmentBaseline: (_c = dataLabelsAlignmentBaseline) !== null && _c !== void 0 ? _c : 'middle', children: label }, "data-label-".concat(index)));
|
|
33
|
+
}) })) : null, hideAsterLines
|
|
34
|
+
? null
|
|
35
|
+
: labels.map(function (_, index) {
|
|
36
|
+
var angle = index * angleStep;
|
|
37
|
+
var _a = polarToCartesian(angle, maxValue), x = _a.x, y = _a.y;
|
|
38
|
+
return (_jsx(Line, { x1: center, y1: center, x2: x, y2: y, stroke: asterLinesStroke, strokeWidth: asterLinesStrokeWidth, strokeDasharray: asterLinesStrokeDashArray }, "axis-".concat(index)));
|
|
39
|
+
}), labels.map(function (category, index) {
|
|
40
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
41
|
+
var angle = index * angleStep;
|
|
42
|
+
var _q = polarToCartesian(angle, maxValue + labelsPositionOffset), x = _q.x, y = _q.y; // Offset for label position
|
|
43
|
+
var fontSizeLocal = (_b = (_a = labelConfigArray === null || labelConfigArray === void 0 ? void 0 : labelConfigArray[index]) === null || _a === void 0 ? void 0 : _a.fontSize) !== null && _b !== void 0 ? _b : fontSize;
|
|
44
|
+
var fontWeightLocal = (_d = (_c = labelConfigArray === null || labelConfigArray === void 0 ? void 0 : labelConfigArray[index]) === null || _c === void 0 ? void 0 : _c.fontWeight) !== null && _d !== void 0 ? _d : fontWeight;
|
|
45
|
+
var fontFamilyLocal = (_f = (_e = labelConfigArray === null || labelConfigArray === void 0 ? void 0 : labelConfigArray[index]) === null || _e === void 0 ? void 0 : _e.fontFamily) !== null && _f !== void 0 ? _f : fontFamily;
|
|
46
|
+
var colorLocal = (_h = (_g = labelConfigArray === null || labelConfigArray === void 0 ? void 0 : labelConfigArray[index]) === null || _g === void 0 ? void 0 : _g.stroke) !== null && _h !== void 0 ? _h : stroke;
|
|
47
|
+
var textAnchorLocal = (_k = (_j = labelConfigArray === null || labelConfigArray === void 0 ? void 0 : labelConfigArray[index]) === null || _j === void 0 ? void 0 : _j.textAnchor) !== null && _k !== void 0 ? _k : textAnchor;
|
|
48
|
+
var alignmentBaselineLocal = (_m = (_l = labelConfigArray === null || labelConfigArray === void 0 ? void 0 : labelConfigArray[index]) === null || _l === void 0 ? void 0 : _l.alignmentBaseline) !== null && _m !== void 0 ? _m : alignmentBaseline;
|
|
49
|
+
return (_jsx(SvgText, { x: x, y: y, fontSize: fontSizeLocal, fontWeight: fontWeightLocal, fontFamily: fontFamilyLocal, fill: colorLocal, textAnchor: (_o = textAnchorLocal) !== null && _o !== void 0 ? _o : 'middle', alignmentBaseline: (_p = alignmentBaselineLocal) !== null && _p !== void 0 ? _p : 'middle', children: category }, "label-".concat(index)));
|
|
50
|
+
})] }) }));
|
|
51
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ export { PieChartPro } from './PieChartPro';
|
|
|
4
4
|
export { LineChart } from './LineChart';
|
|
5
5
|
export { LineChartBicolor } from './LineChart/LineChartBicolor';
|
|
6
6
|
export { PopulationPyramid } from './PopulationPyramid';
|
|
7
|
-
export {
|
|
7
|
+
export { RadarChart } from './RadarChart';
|
|
8
|
+
export { type barDataItem, type barDataItemNullSafe, type stackDataItem, type BarChartPropsType, type StackedBarChartPropsType, type pieDataItem, type PieChartPropsType, type lineDataItem, type lineDataItemNullSafe, type bicolorLineDataItem, type LineChartPropsType, type LineChartBicolorPropsType, type popnPyramidDataItem, type PopulationPyramidPropsType, chartTypes, ruleTypes, CurveType, yAxisSides, EdgePosition, type DataSet, type DataSetNullSafe, type Linecap, type RulesConfig, type LabelsPosition, type PointerEvents, type secondaryYAxisType, type secondaryLineConfigType, type referenceConfigType, type arrowConfigType, type Pointer, type HighlightedRange, type LineSegment, type LineProperties, Framework, type XAxisConfig, type DataPointProps, type IntersectionAreaConfig, type LabelLineConfig, type TooltipProps, type RadarChartProps, type PolygonConfig, type GridConfig, type GridSectionConfig, type AsterLinesConfig, } from 'gifted-charts-core';
|
package/dist/index.js
CHANGED
|
@@ -4,4 +4,5 @@ export { PieChartPro } from './PieChartPro';
|
|
|
4
4
|
export { LineChart } from './LineChart';
|
|
5
5
|
export { LineChartBicolor } from './LineChart/LineChartBicolor';
|
|
6
6
|
export { PopulationPyramid } from './PopulationPyramid';
|
|
7
|
+
export { RadarChart } from './RadarChart';
|
|
7
8
|
export { chartTypes, ruleTypes, CurveType, yAxisSides, EdgePosition, Framework, } from 'gifted-charts-core';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-gifted-charts",
|
|
3
|
-
"version": "1.4.
|
|
4
|
-
"description": "The most complete library for Bar, Line, Area, Pie, Donut, Stacked Bar
|
|
3
|
+
"version": "1.4.52",
|
|
4
|
+
"description": "The most complete library for Bar, Line, Area, Pie, Donut, Stacked Bar, Population Pyramid and Radar charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"registry": "https://registry.npmjs.org/"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"gifted-charts-core": "0.1.
|
|
29
|
+
"gifted-charts-core": "0.1.54"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@babel/cli": "^7.24.8",
|
|
@@ -75,6 +75,8 @@
|
|
|
75
75
|
"donut",
|
|
76
76
|
"area",
|
|
77
77
|
"line",
|
|
78
|
+
"radar",
|
|
79
|
+
"star",
|
|
78
80
|
"population",
|
|
79
81
|
"pyramid",
|
|
80
82
|
"react",
|