react-native-gifted-charts 1.4.35 → 1.4.37
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/Components/BarAndLineChartsWrapper/renderLineInBarChart/index.js +3 -1
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderDataPoints.js +4 -4
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificDataPoints.js +2 -2
- package/dist/LineChart/index.js +3 -1
- package/package.json +2 -2
|
@@ -6,7 +6,7 @@ import { renderDataPoints } from './renderDataPoints';
|
|
|
6
6
|
import { renderSpecificDataPoints } from './renderSpecificDataPoints';
|
|
7
7
|
var RenderLineInBarChart = function (props) {
|
|
8
8
|
var _a;
|
|
9
|
-
var yAxisLabelWidth = props.yAxisLabelWidth, initialSpacing = props.initialSpacing, spacing = props.spacing, containerHeight = props.containerHeight, lineConfig = props.lineConfig, maxValue = props.maxValue, animatedWidth = props.animatedWidth, lineBehindBars = props.lineBehindBars, points = props.points, arrowPoints = props.arrowPoints, data = props.data, totalWidth = props.totalWidth, barWidth = props.barWidth, labelsExtraHeight = props.labelsExtraHeight, xAxisLabelsVerticalShift = props.xAxisLabelsVerticalShift, selectedIndex = props.selectedIndex, containerHeightIncludingBelowXAxis = props.containerHeightIncludingBelowXAxis;
|
|
9
|
+
var yAxisLabelWidth = props.yAxisLabelWidth, initialSpacing = props.initialSpacing, spacing = props.spacing, containerHeight = props.containerHeight, lineConfig = props.lineConfig, maxValue = props.maxValue, animatedWidth = props.animatedWidth, lineBehindBars = props.lineBehindBars, points = props.points, arrowPoints = props.arrowPoints, data = props.data, totalWidth = props.totalWidth, barWidth = props.barWidth, labelsExtraHeight = props.labelsExtraHeight, xAxisLabelsVerticalShift = props.xAxisLabelsVerticalShift, selectedIndex = props.selectedIndex, containerHeightIncludingBelowXAxis = props.containerHeightIncludingBelowXAxis, yAxisOffset = props.yAxisOffset;
|
|
10
10
|
var firstBarWidth = (_a = data[0].barWidth) !== null && _a !== void 0 ? _a : barWidth;
|
|
11
11
|
var dataPointsProps = {
|
|
12
12
|
data: data,
|
|
@@ -18,6 +18,7 @@ var RenderLineInBarChart = function (props) {
|
|
|
18
18
|
yAxisLabelWidth: yAxisLabelWidth,
|
|
19
19
|
spacing: spacing,
|
|
20
20
|
selectedIndex: selectedIndex,
|
|
21
|
+
yAxisOffset: yAxisOffset,
|
|
21
22
|
};
|
|
22
23
|
var specificVerticalLinesProps = {
|
|
23
24
|
data: data,
|
|
@@ -38,6 +39,7 @@ var RenderLineInBarChart = function (props) {
|
|
|
38
39
|
spacing: spacing,
|
|
39
40
|
containerHeight: containerHeight,
|
|
40
41
|
maxValue: maxValue,
|
|
42
|
+
yAxisOffset: yAxisOffset
|
|
41
43
|
};
|
|
42
44
|
var renderAnimatedLine = function () {
|
|
43
45
|
var _a, _b, _c;
|
|
@@ -5,7 +5,7 @@ import { View } from 'react-native';
|
|
|
5
5
|
import { getXForLineInBar, getYForLineInBar } from 'gifted-charts-core';
|
|
6
6
|
import { Rect, Text as CanvasText, Circle } from 'react-native-svg';
|
|
7
7
|
export var renderDataPoints = function (props) {
|
|
8
|
-
var data = props.data, lineConfig = props.lineConfig, barWidth = props.barWidth, containerHeight = props.containerHeight, maxValue = props.maxValue, firstBarWidth = props.firstBarWidth, yAxisLabelWidth = props.yAxisLabelWidth, spacing = props.spacing, selectedIndex = props.selectedIndex;
|
|
8
|
+
var data = props.data, lineConfig = props.lineConfig, barWidth = props.barWidth, containerHeight = props.containerHeight, maxValue = props.maxValue, firstBarWidth = props.firstBarWidth, yAxisLabelWidth = props.yAxisLabelWidth, spacing = props.spacing, selectedIndex = props.selectedIndex, yAxisOffset = props.yAxisOffset;
|
|
9
9
|
return data.map(function (item, index) {
|
|
10
10
|
var _a, _b, _c, _d, _e;
|
|
11
11
|
if (index < lineConfig.startIndex ||
|
|
@@ -38,12 +38,12 @@ export var renderDataPoints = function (props) {
|
|
|
38
38
|
], children: customDataPoint(item, index) }));
|
|
39
39
|
}
|
|
40
40
|
if (lineConfig.dataPointsShape === 'rectangular') {
|
|
41
|
-
return (_jsxs(Fragment, { children: [_jsx(Rect, { x: getXForLineInBar(index, firstBarWidth, currentBarWidth, yAxisLabelWidth, lineConfig, spacing), y: getYForLineInBar(value, lineConfig.shiftY, containerHeight, maxValue) -
|
|
42
|
-
lineConfig.dataPointsHeight / 2, width: lineConfig.dataPointsWidth, height: lineConfig.dataPointsHeight, fill: dataPointColor }), item.dataPointText && (_jsx(CanvasText, { fill: item.textColor || lineConfig.textColor, fontSize: item.textFontSize || lineConfig.textFontSize, x: getXForLineInBar(index, firstBarWidth, currentBarWidth, yAxisLabelWidth, lineConfig, spacing) + (item.textShiftX || lineConfig.textShiftX || 0), y: getYForLineInBar(value, lineConfig.shiftY, containerHeight, maxValue) -
|
|
41
|
+
return (_jsxs(Fragment, { children: [_jsx(Rect, { x: getXForLineInBar(index, firstBarWidth, currentBarWidth, yAxisLabelWidth, lineConfig, spacing), y: getYForLineInBar(value, lineConfig.shiftY, containerHeight, maxValue, yAxisOffset) -
|
|
42
|
+
lineConfig.dataPointsHeight / 2, width: lineConfig.dataPointsWidth, height: lineConfig.dataPointsHeight, fill: dataPointColor }), item.dataPointText && (_jsx(CanvasText, { fill: item.textColor || lineConfig.textColor, fontSize: item.textFontSize || lineConfig.textFontSize, x: getXForLineInBar(index, firstBarWidth, currentBarWidth, yAxisLabelWidth, lineConfig, spacing) + (item.textShiftX || lineConfig.textShiftX || 0), y: getYForLineInBar(value, lineConfig.shiftY, containerHeight, maxValue, yAxisOffset) -
|
|
43
43
|
lineConfig.dataPointsHeight / 2 +
|
|
44
44
|
(item.textShiftY || lineConfig.textShiftY || 0), children: item.dataPointText }))] }, index));
|
|
45
45
|
}
|
|
46
|
-
return (_jsxs(Fragment, { children: [_jsx(Circle, { cx: getXForLineInBar(index, firstBarWidth, currentBarWidth, yAxisLabelWidth, lineConfig, spacing), cy: getYForLineInBar(value, lineConfig.shiftY, containerHeight, maxValue), r: dataPointRadius, fill: dataPointColor }), item.dataPointText && (_jsx(CanvasText, { fill: item.textColor || lineConfig.textColor, fontSize: item.textFontSize || lineConfig.textFontSize, x: getXForLineInBar(index, firstBarWidth, currentBarWidth, yAxisLabelWidth, lineConfig, spacing) + (item.textShiftX || lineConfig.textShiftX || 0), y: getYForLineInBar(value, lineConfig.shiftY, containerHeight, maxValue) -
|
|
46
|
+
return (_jsxs(Fragment, { children: [_jsx(Circle, { cx: getXForLineInBar(index, firstBarWidth, currentBarWidth, yAxisLabelWidth, lineConfig, spacing), cy: getYForLineInBar(value, lineConfig.shiftY, containerHeight, maxValue, yAxisOffset), r: dataPointRadius, fill: dataPointColor }), item.dataPointText && (_jsx(CanvasText, { fill: item.textColor || lineConfig.textColor, fontSize: item.textFontSize || lineConfig.textFontSize, x: getXForLineInBar(index, firstBarWidth, currentBarWidth, yAxisLabelWidth, lineConfig, spacing) + (item.textShiftX || lineConfig.textShiftX || 0), y: getYForLineInBar(value, lineConfig.shiftY, containerHeight, maxValue, yAxisOffset) -
|
|
47
47
|
lineConfig.dataPointsHeight / 2 +
|
|
48
48
|
(item.textShiftY || lineConfig.textShiftY || 0), children: item.dataPointText }))] }, index));
|
|
49
49
|
});
|
package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificDataPoints.js
CHANGED
|
@@ -3,11 +3,11 @@ import { Fragment } from 'react';
|
|
|
3
3
|
import { getXForLineInBar, getYForLineInBar } from 'gifted-charts-core';
|
|
4
4
|
import { Circle, Rect, Text as CanvasText } from 'react-native-svg';
|
|
5
5
|
export var renderSpecificDataPoints = function (props) {
|
|
6
|
-
var data = props.data, barWidth = props.barWidth, firstBarWidth = props.firstBarWidth, yAxisLabelWidth = props.yAxisLabelWidth, lineConfig = props.lineConfig, spacing = props.spacing, containerHeight = props.containerHeight, maxValue = props.maxValue;
|
|
6
|
+
var data = props.data, barWidth = props.barWidth, firstBarWidth = props.firstBarWidth, yAxisLabelWidth = props.yAxisLabelWidth, lineConfig = props.lineConfig, spacing = props.spacing, containerHeight = props.containerHeight, maxValue = props.maxValue, yAxisOffset = props.yAxisOffset;
|
|
7
7
|
return data.map(function (item, index) {
|
|
8
8
|
var currentBarWidth = item.barWidth || barWidth || 30;
|
|
9
9
|
var x = getXForLineInBar(index, firstBarWidth, currentBarWidth, yAxisLabelWidth, lineConfig, spacing);
|
|
10
|
-
var y = getYForLineInBar(item.value, lineConfig.shiftY, containerHeight, maxValue);
|
|
10
|
+
var y = getYForLineInBar(item.value, lineConfig.shiftY, containerHeight, maxValue, yAxisOffset);
|
|
11
11
|
if (item.showDataPoint) {
|
|
12
12
|
if (item.dataPointShape === 'rectangular') {
|
|
13
13
|
return (_jsxs(Fragment, { children: [_jsx(Rect, { x: x, y: y - item.dataPointsHeight / 2, width: item.dataPointWidth || lineConfig.dataPointsWidth, height: item.dataPointHeight || 2, fill: item.dataPointColor || 'black' }), item.dataPointText && (_jsx(CanvasText, { fill: item.textColor || 'black', fontSize: item.textFontSize || 10, x: x + (item.textShiftX || lineConfig.textShiftX || 0), y: y -
|
package/dist/LineChart/index.js
CHANGED
|
@@ -598,7 +598,9 @@ export var LineChart = function (props) {
|
|
|
598
598
|
lineSvgPropsOuter.strokeDasharray = strokeDashArray;
|
|
599
599
|
}
|
|
600
600
|
return (_jsxs(Svg, { height: containerHeightIncludingBelowXAxis +
|
|
601
|
-
((_b = props.overflowBottom) !== null && _b !== void 0 ? _b : dataPointsRadius1),
|
|
601
|
+
((_b = props.overflowBottom) !== null && _b !== void 0 ? _b : dataPointsRadius1),
|
|
602
|
+
// width={widthValue}
|
|
603
|
+
onPress: props.onBackgroundPress, children: [lineGradient && getLineGradientComponent(), points.includes(SEGMENT_START) || points.includes(RANGE_ENTER) ? (ar.map(function (item, index) {
|
|
602
604
|
var lineSvgProps = {
|
|
603
605
|
d: item.d,
|
|
604
606
|
fill: 'none',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-gifted-charts",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.37",
|
|
4
4
|
"description": "The most complete library for Bar, Line, Area, Pie, Donut, Stacked Bar and Population Pyramid charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"registry": "https://registry.npmjs.org/"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"gifted-charts-core": "
|
|
28
|
+
"gifted-charts-core": "0.1.38"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@babel/cli": "^7.24.8",
|