react-native-gifted-charts 1.4.32 → 1.4.33
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.
|
@@ -4,9 +4,9 @@ import Rule from '../lineSvg';
|
|
|
4
4
|
import { styles } from '../../LineChart/styles';
|
|
5
5
|
import { getHorizSectionVals, yAxisSides, chartTypes, } from 'gifted-charts-core';
|
|
6
6
|
export var renderHorizSections = function (props) {
|
|
7
|
-
var _a, _b;
|
|
7
|
+
var _a, _b, _c, _d;
|
|
8
8
|
var chartType = props.chartType, width = props.width, noOfSectionsBelowXAxis = props.noOfSectionsBelowXAxis, totalWidth = props.totalWidth, endSpacing = props.endSpacing, yAxisSide = props.yAxisSide, horizontalRulesStyle = props.horizontalRulesStyle, noOfSections = props.noOfSections, sectionColors = props.sectionColors, stepHeight = props.stepHeight, negativeStepHeight = props.negativeStepHeight, yAxisLabelWidth = props.yAxisLabelWidth, yAxisLabelContainerStyle = props.yAxisLabelContainerStyle, yAxisThickness = props.yAxisThickness, yAxisColor = props.yAxisColor, xAxisThickness = props.xAxisThickness, xAxisColor = props.xAxisColor, xAxisLength = props.xAxisLength, xAxisType = props.xAxisType, dashWidth = props.dashWidth, dashGap = props.dashGap, backgroundColor = props.backgroundColor, hideRules = props.hideRules, rulesLength = props.rulesLength, rulesType = props.rulesType, rulesThickness = props.rulesThickness, rulesColor = props.rulesColor, rulesConfigArray = props.rulesConfigArray, spacing = props.spacing, showYAxisIndices = props.showYAxisIndices, yAxisIndicesHeight = props.yAxisIndicesHeight, yAxisIndicesWidth = props.yAxisIndicesWidth, yAxisIndicesColor = props.yAxisIndicesColor, hideOrigin = props.hideOrigin, hideYAxisText = props.hideYAxisText, yAxisTextNumberOfLines = props.yAxisTextNumberOfLines, yAxisTextStyle = props.yAxisTextStyle, rotateYAxisTexts = props.rotateYAxisTexts, rtl = props.rtl, containerHeight = props.containerHeight, maxValue = props.maxValue, yAxisOffset = props.yAxisOffset, horizontal = props.horizontal, yAxisAtTop = props.yAxisAtTop, secondaryYAxis = props.secondaryYAxis, onlyReferenceLines = props.onlyReferenceLines, renderReferenceLines = props.renderReferenceLines, secondaryXAxis = props.secondaryXAxis;
|
|
9
|
-
var
|
|
9
|
+
var _e = getHorizSectionVals(props), secondaryYAxisConfig = _e.secondaryYAxisConfig, horizSections = _e.horizSections, yAxisExtraHeightAtTop = _e.yAxisExtraHeightAtTop, secondaryHorizSections = _e.secondaryHorizSections, showReferenceLine1 = _e.showReferenceLine1, referenceLine1Config = _e.referenceLine1Config, referenceLine1Position = _e.referenceLine1Position, showReferenceLine2 = _e.showReferenceLine2, referenceLine2Config = _e.referenceLine2Config, referenceLine2Position = _e.referenceLine2Position, showReferenceLine3 = _e.showReferenceLine3, referenceLine3Config = _e.referenceLine3Config, referenceLine3Position = _e.referenceLine3Position, horizSectionsBelow = _e.horizSectionsBelow, secondaryHorizSectionsBelow = _e.secondaryHorizSectionsBelow, getLabelTexts = _e.getLabelTexts, getLabelTextsForSecondaryYAxis = _e.getLabelTextsForSecondaryYAxis;
|
|
10
10
|
var secondaryYAxisExtraHeightAtBottom = 10;
|
|
11
11
|
var renderAxesAndRules = function (index) {
|
|
12
12
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
@@ -93,7 +93,7 @@ export var renderHorizSections = function (props) {
|
|
|
93
93
|
};
|
|
94
94
|
var renderSecondaryYaxisLabels = function (horizSections, isBelow) {
|
|
95
95
|
return horizSections.map(function (sectionItems, index) {
|
|
96
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
96
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
97
97
|
var label = getLabelTextsForSecondaryYAxis(sectionItems.value, index);
|
|
98
98
|
if (secondaryYAxisConfig.hideOrigin && index === 0) {
|
|
99
99
|
label = '';
|
|
@@ -114,14 +114,21 @@ export var renderHorizSections = function (props) {
|
|
|
114
114
|
? ((_e = (_d = secondaryYAxisConfig.negativeStepHeight) !== null && _d !== void 0 ? _d : secondaryYAxisConfig.stepHeight) !== null && _e !== void 0 ? _e : 0)
|
|
115
115
|
: ((_f = secondaryYAxisConfig.stepHeight) !== null && _f !== void 0 ? _f : 0),
|
|
116
116
|
},
|
|
117
|
-
yAxisLabelContainerStyle,
|
|
117
|
+
(_g = secondaryYAxisConfig.yAxisLabelContainerStyle) !== null && _g !== void 0 ? _g : yAxisLabelContainerStyle,
|
|
118
118
|
], children: [secondaryYAxisConfig.showYAxisIndices && (index !== 0 || isBelow) ? (_jsx(View, { style: {
|
|
119
119
|
height: secondaryYAxisConfig.yAxisIndicesHeight,
|
|
120
120
|
width: secondaryYAxisConfig.yAxisIndicesWidth,
|
|
121
121
|
position: 'absolute',
|
|
122
|
-
left: ((
|
|
122
|
+
left: ((_h = secondaryYAxisConfig.yAxisIndicesWidth) !== null && _h !== void 0 ? _h : 0) / -2,
|
|
123
123
|
backgroundColor: secondaryYAxisConfig.yAxisIndicesColor,
|
|
124
|
-
} })) : null, _jsx(Text, { numberOfLines: secondaryYAxisConfig.yAxisTextNumberOfLines, ellipsizeMode: 'clip', style: [
|
|
124
|
+
} })) : null, _jsx(Text, { numberOfLines: secondaryYAxisConfig.yAxisTextNumberOfLines, ellipsizeMode: 'clip', style: [
|
|
125
|
+
{
|
|
126
|
+
textAlign: 'left',
|
|
127
|
+
width: (_k = (_j = secondaryYAxisConfig.yAxisLabelContainerStyle) === null || _j === void 0 ? void 0 : _j.width) !== null && _k !== void 0 ? _k : secondaryYAxisConfig.yAxisLabelWidth,
|
|
128
|
+
marginLeft: 10,
|
|
129
|
+
},
|
|
130
|
+
secondaryYAxisConfig.yAxisTextStyle,
|
|
131
|
+
], children: label })] }, index));
|
|
125
132
|
});
|
|
126
133
|
};
|
|
127
134
|
var referenceLines = function () {
|
|
@@ -319,7 +326,6 @@ export var renderHorizSections = function (props) {
|
|
|
319
326
|
borderLeftWidth: secondaryYAxisConfig.yAxisThickness,
|
|
320
327
|
height: containerHeight + yAxisExtraHeightAtTop,
|
|
321
328
|
bottom: stepHeight / -2,
|
|
322
|
-
// backgroundColor:'red'
|
|
323
329
|
}, children: !secondaryYAxisConfig.hideYAxisText
|
|
324
330
|
? renderSecondaryYaxisLabels(secondaryHorizSections, false)
|
|
325
331
|
: null })) : null,
|
|
@@ -327,15 +333,15 @@ export var renderHorizSections = function (props) {
|
|
|
327
333
|
/************************* Render the secondary Y Axis below origin *********************/
|
|
328
334
|
/***********************************************************************************************/
|
|
329
335
|
secondaryYAxisConfig.noOfSectionsBelowXAxis ? (_jsx(View, { style: {
|
|
330
|
-
width: secondaryYAxisConfig.yAxisLabelWidth,
|
|
336
|
+
width: (_a = secondaryYAxisConfig.yAxisLabelWidth) !== null && _a !== void 0 ? _a : yAxisLabelWidth,
|
|
331
337
|
left: (width ? yAxisLabelWidth : yAxisLabelWidth - spacing) -
|
|
332
|
-
yAxisLabelWidth,
|
|
338
|
+
((_b = secondaryYAxisConfig.yAxisLabelWidth) !== null && _b !== void 0 ? _b : yAxisLabelWidth),
|
|
333
339
|
borderColor: secondaryYAxisConfig.yAxisColor,
|
|
334
340
|
borderLeftWidth: secondaryYAxisConfig.yAxisThickness,
|
|
335
|
-
height: ((
|
|
341
|
+
height: ((_d = (_c = secondaryYAxisConfig.negativeStepHeight) !== null && _c !== void 0 ? _c : secondaryYAxisConfig.stepHeight) !== null && _d !== void 0 ? _d : stepHeight) *
|
|
336
342
|
secondaryHorizSectionsBelow.length +
|
|
337
343
|
secondaryYAxisExtraHeightAtBottom,
|
|
338
|
-
bottom: -containerHeight - stepHeight
|
|
344
|
+
bottom: -containerHeight - stepHeight / 2 - yAxisExtraHeightAtTop,
|
|
339
345
|
}, children: !secondaryYAxisConfig.hideYAxisText
|
|
340
346
|
? renderSecondaryYaxisLabels(secondaryHorizSectionsBelow, true)
|
|
341
347
|
: null })) : null] })) }));
|
package/dist/LineChart/index.js
CHANGED
|
@@ -620,7 +620,8 @@ export var LineChart = function (props) {
|
|
|
620
620
|
}
|
|
621
621
|
return _jsx(Path, __assign({}, lineSvgProps), index);
|
|
622
622
|
})) : animateOnDataChange && animatedPath ? (_jsx(AnimatedPath, __assign({}, lineSvgPropsOuter))) : (_jsx(Path, __assign({}, lineSvgPropsOuter))), isNthAreaChart &&
|
|
623
|
-
getAreaGradientComponent(startFillColor, endFillColor, startOpacity, endOpacity), isNthAreaChart ? (
|
|
623
|
+
getAreaGradientComponent(startFillColor, endFillColor, startOpacity, endOpacity), isNthAreaChart ? (props.interpolateMissingValues === false &&
|
|
624
|
+
propsData.some(function (item) { return isNaN(item.value); }) ? null : animateOnDataChange && animatedFillPath ? (_jsx(AnimatedPath, { onPress: props.onChartAreaPress, d: animatedFillPath, fill: props.areaGradientId
|
|
624
625
|
? "url(#".concat(props.areaGradientId, ")")
|
|
625
626
|
: "url(#Gradient)", stroke: 'none', strokeWidth: currentLineThickness || thickness })) : (_jsx(Path, { onPress: props.onChartAreaPress, d: fillPoints, fill: props.areaGradientId
|
|
626
627
|
? "url(#".concat(props.areaGradientId, ")")
|
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.33",
|
|
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": "^0.1.
|
|
28
|
+
"gifted-charts-core": "^0.1.34"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@babel/cli": "^7.24.8",
|