gifted-charts-core 0.1.17 → 0.1.18
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/package.json
CHANGED
|
@@ -25,7 +25,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
25
25
|
};
|
|
26
26
|
import { getBarFrontColor, getBarWidth } from '../utils';
|
|
27
27
|
export var getPropsForAnimated2DWithGradient = function (props) {
|
|
28
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
|
29
29
|
var barBorderWidth = props.barBorderWidth, barBorderColor = props.barBorderColor, barBorderRadius = props.barBorderRadius, item = props.item, barBorderTopLeftRadius = props.barBorderTopLeftRadius, barBorderTopRightRadius = props.barBorderTopRightRadius, barBorderBottomLeftRadius = props.barBorderBottomLeftRadius, barBorderBottomRightRadius = props.barBorderBottomRightRadius, barWidth = props.barWidth, barInnerComponent = props.barInnerComponent, barStyle = props.barStyle, index = props.index, opacity = props.opacity, barHeight = props.barHeight, intactTopLabel = props.intactTopLabel, showValuesAsTopLabel = props.showValuesAsTopLabel, topLabelContainerStyle = props.topLabelContainerStyle, topLabelTextStyle = props.topLabelTextStyle, roundedBottom = props.roundedBottom, cappedBars = props.cappedBars, capRadius = props.capRadius, roundedTop = props.roundedTop, barBackgroundPattern = props.barBackgroundPattern, patternId = props.patternId, frontColor = props.frontColor, showGradient = props.showGradient, gradientColor = props.gradientColor, selectedIndex = props.selectedIndex, focusBarOnPress = props.focusBarOnPress, focusedBarConfig = props.focusedBarConfig, isThreeD = props.isThreeD, yAxisOffset = props.yAxisOffset;
|
|
30
30
|
var isFocused = (focusBarOnPress !== null && focusBarOnPress !== void 0 ? focusBarOnPress : false) && selectedIndex === index;
|
|
31
31
|
var itemOrPropsBarBorderRadius = (_b = (_a = item.barBorderRadius) !== null && _a !== void 0 ? _a : barBorderRadius) !== null && _b !== void 0 ? _b : 0;
|
|
@@ -41,16 +41,16 @@ export var getPropsForAnimated2DWithGradient = function (props) {
|
|
|
41
41
|
position: 'absolute',
|
|
42
42
|
width: '100%',
|
|
43
43
|
height: '100%',
|
|
44
|
-
borderWidth: barBorderWidth !== null &&
|
|
45
|
-
borderColor: barBorderColor,
|
|
44
|
+
borderWidth: (_f = (_e = item.barBorderWidth) !== null && _e !== void 0 ? _e : barBorderWidth) !== null && _f !== void 0 ? _f : 0,
|
|
45
|
+
borderColor: (_g = item.barBorderColor) !== null && _g !== void 0 ? _g : barBorderColor,
|
|
46
46
|
borderRadius: localBarBorderRadius,
|
|
47
|
-
borderTopLeftRadius: (
|
|
48
|
-
borderTopRightRadius: (
|
|
49
|
-
borderBottomLeftRadius: (
|
|
50
|
-
borderBottomRightRadius: (
|
|
47
|
+
borderTopLeftRadius: (_j = (_h = item.barBorderTopLeftRadius) !== null && _h !== void 0 ? _h : barBorderTopLeftRadius) !== null && _j !== void 0 ? _j : localBarBorderRadius,
|
|
48
|
+
borderTopRightRadius: (_l = (_k = item.barBorderTopRightRadius) !== null && _k !== void 0 ? _k : barBorderTopRightRadius) !== null && _l !== void 0 ? _l : localBarBorderRadius,
|
|
49
|
+
borderBottomLeftRadius: (_o = (_m = item.barBorderBottomLeftRadius) !== null && _m !== void 0 ? _m : barBorderBottomLeftRadius) !== null && _o !== void 0 ? _o : localBarBorderRadius,
|
|
50
|
+
borderBottomRightRadius: (_q = (_p = item.barBorderBottomRightRadius) !== null && _p !== void 0 ? _p : barBorderBottomRightRadius) !== null && _q !== void 0 ? _q : localBarBorderRadius
|
|
51
51
|
}
|
|
52
52
|
];
|
|
53
|
-
if ((
|
|
53
|
+
if ((_r = roundedBottom !== null && roundedBottom !== void 0 ? roundedBottom : (isFocused && (focusedBarConfig === null || focusedBarConfig === void 0 ? void 0 : focusedBarConfig.roundedBottom))) !== null && _r !== void 0 ? _r : false) {
|
|
54
54
|
commonStyleForBar.push({
|
|
55
55
|
borderBottomLeftRadius: localBarWidth / 2,
|
|
56
56
|
borderBottomRightRadius: localBarWidth / 2
|
|
@@ -58,11 +58,11 @@ export var getPropsForAnimated2DWithGradient = function (props) {
|
|
|
58
58
|
}
|
|
59
59
|
if (cappedBars !== null && cappedBars !== void 0 ? cappedBars : false) {
|
|
60
60
|
commonStyleForBar.push({
|
|
61
|
-
borderTopLeftRadius: item.capRadius === 0 ? 0 : (
|
|
62
|
-
borderTopRightRadius: item.capRadius === 0 ? 0 : (
|
|
61
|
+
borderTopLeftRadius: item.capRadius === 0 ? 0 : (_t = (_s = item.capRadius) !== null && _s !== void 0 ? _s : capRadius) !== null && _t !== void 0 ? _t : 0,
|
|
62
|
+
borderTopRightRadius: item.capRadius === 0 ? 0 : (_v = (_u = item.capRadius) !== null && _u !== void 0 ? _u : capRadius) !== null && _v !== void 0 ? _v : 0
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
if ((
|
|
65
|
+
if ((_w = roundedTop !== null && roundedTop !== void 0 ? roundedTop : (isFocused && (focusedBarConfig === null || focusedBarConfig === void 0 ? void 0 : focusedBarConfig.roundedTop))) !== null && _w !== void 0 ? _w : false) {
|
|
66
66
|
commonStyleForBar.push({
|
|
67
67
|
borderTopLeftRadius: localBarWidth / 2,
|
|
68
68
|
borderTopRightRadius: localBarWidth / 2
|
|
@@ -74,22 +74,22 @@ export var getPropsForAnimated2DWithGradient = function (props) {
|
|
|
74
74
|
}
|
|
75
75
|
], false);
|
|
76
76
|
var commonPropsFor2Dand3Dbars = {
|
|
77
|
-
barBackgroundPattern: (
|
|
77
|
+
barBackgroundPattern: (_x = item.barBackgroundPattern) !== null && _x !== void 0 ? _x : barBackgroundPattern,
|
|
78
78
|
barInnerComponent: isFocused
|
|
79
|
-
? (
|
|
79
|
+
? (_y = focusedBarConfig === null || focusedBarConfig === void 0 ? void 0 : focusedBarConfig.barInnerComponent) !== null && _y !== void 0 ? _y : barInnerComponent
|
|
80
80
|
: barInnerComponent,
|
|
81
|
-
patternId: (
|
|
81
|
+
patternId: (_z = item.patternId) !== null && _z !== void 0 ? _z : patternId,
|
|
82
82
|
barWidth: localBarWidth,
|
|
83
83
|
barStyle: barStyle,
|
|
84
84
|
item: item,
|
|
85
85
|
index: index,
|
|
86
86
|
frontColor: localFrontColor,
|
|
87
|
-
showGradient: (
|
|
87
|
+
showGradient: (_1 = (_0 = item.showGradient) !== null && _0 !== void 0 ? _0 : showGradient) !== null && _1 !== void 0 ? _1 : false,
|
|
88
88
|
gradientColor: isFocused
|
|
89
|
-
? (
|
|
89
|
+
? (_2 = focusedBarConfig === null || focusedBarConfig === void 0 ? void 0 : focusedBarConfig.gradientColor) !== null && _2 !== void 0 ? _2 : localGradientColor
|
|
90
90
|
: localGradientColor,
|
|
91
91
|
opacity: isFocused
|
|
92
|
-
? (
|
|
92
|
+
? (_3 = focusedBarConfig === null || focusedBarConfig === void 0 ? void 0 : focusedBarConfig.opacity) !== null && _3 !== void 0 ? _3 : localOpacity
|
|
93
93
|
: localOpacity,
|
|
94
94
|
height: barHeight,
|
|
95
95
|
intactTopLabel: intactTopLabel,
|
|
@@ -99,8 +99,8 @@ export const getPropsForAnimated2DWithGradient = (
|
|
|
99
99
|
position: 'absolute',
|
|
100
100
|
width: '100%',
|
|
101
101
|
height: '100%',
|
|
102
|
-
borderWidth: barBorderWidth ?? 0,
|
|
103
|
-
borderColor: barBorderColor,
|
|
102
|
+
borderWidth: item.barBorderWidth ?? barBorderWidth ?? 0,
|
|
103
|
+
borderColor: item.barBorderColor ?? barBorderColor,
|
|
104
104
|
borderRadius: localBarBorderRadius,
|
|
105
105
|
borderTopLeftRadius:
|
|
106
106
|
item.barBorderTopLeftRadius ??
|
package/src/BarChart/types.d.ts
CHANGED
|
@@ -390,6 +390,8 @@ export interface barDataItem {
|
|
|
390
390
|
labelsDistanceFromXaxis?: number;
|
|
391
391
|
barWidth?: number;
|
|
392
392
|
sideWidth?: number;
|
|
393
|
+
barBorderWidth?: number;
|
|
394
|
+
barBorderColor?: ColorValue;
|
|
393
395
|
labelTextStyle?: any;
|
|
394
396
|
topLabelComponent?: Function;
|
|
395
397
|
topLabelContainerStyle?: any;
|
package/src/BarChart/types.ts
CHANGED
|
@@ -431,6 +431,8 @@ export interface barDataItem {
|
|
|
431
431
|
labelsDistanceFromXaxis?: number
|
|
432
432
|
barWidth?: number
|
|
433
433
|
sideWidth?: number
|
|
434
|
+
barBorderWidth?: number
|
|
435
|
+
barBorderColor?: ColorValue
|
|
434
436
|
labelTextStyle?: any
|
|
435
437
|
topLabelComponent?: Function
|
|
436
438
|
topLabelContainerStyle?: any
|