gifted-charts-core 0.1.16 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gifted-charts-core",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "Mathematical and logical utilities used by react-gifted-charts and react-native-gifted-charts",
5
5
  "main": "./src/index.js",
6
6
  "files": [
@@ -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 && barBorderWidth !== void 0 ? barBorderWidth : 0,
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: (_f = (_e = item.barBorderTopLeftRadius) !== null && _e !== void 0 ? _e : barBorderTopLeftRadius) !== null && _f !== void 0 ? _f : localBarBorderRadius,
48
- borderTopRightRadius: (_h = (_g = item.barBorderTopRightRadius) !== null && _g !== void 0 ? _g : barBorderTopRightRadius) !== null && _h !== void 0 ? _h : localBarBorderRadius,
49
- borderBottomLeftRadius: (_k = (_j = item.barBorderBottomLeftRadius) !== null && _j !== void 0 ? _j : barBorderBottomLeftRadius) !== null && _k !== void 0 ? _k : localBarBorderRadius,
50
- borderBottomRightRadius: (_m = (_l = item.barBorderBottomRightRadius) !== null && _l !== void 0 ? _l : barBorderBottomRightRadius) !== null && _m !== void 0 ? _m : localBarBorderRadius
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 ((_o = roundedBottom !== null && roundedBottom !== void 0 ? roundedBottom : (isFocused && (focusedBarConfig === null || focusedBarConfig === void 0 ? void 0 : focusedBarConfig.roundedBottom))) !== null && _o !== void 0 ? _o : false) {
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 : (_q = (_p = item.capRadius) !== null && _p !== void 0 ? _p : capRadius) !== null && _q !== void 0 ? _q : 0,
62
- borderTopRightRadius: item.capRadius === 0 ? 0 : (_s = (_r = item.capRadius) !== null && _r !== void 0 ? _r : capRadius) !== null && _s !== void 0 ? _s : 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 ((_t = roundedTop !== null && roundedTop !== void 0 ? roundedTop : (isFocused && (focusedBarConfig === null || focusedBarConfig === void 0 ? void 0 : focusedBarConfig.roundedTop))) !== null && _t !== void 0 ? _t : false) {
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: (_u = item.barBackgroundPattern) !== null && _u !== void 0 ? _u : barBackgroundPattern,
77
+ barBackgroundPattern: (_x = item.barBackgroundPattern) !== null && _x !== void 0 ? _x : barBackgroundPattern,
78
78
  barInnerComponent: isFocused
79
- ? (_v = focusedBarConfig === null || focusedBarConfig === void 0 ? void 0 : focusedBarConfig.barInnerComponent) !== null && _v !== void 0 ? _v : barInnerComponent
79
+ ? (_y = focusedBarConfig === null || focusedBarConfig === void 0 ? void 0 : focusedBarConfig.barInnerComponent) !== null && _y !== void 0 ? _y : barInnerComponent
80
80
  : barInnerComponent,
81
- patternId: (_w = item.patternId) !== null && _w !== void 0 ? _w : 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: (_y = (_x = item.showGradient) !== null && _x !== void 0 ? _x : showGradient) !== null && _y !== void 0 ? _y : false,
87
+ showGradient: (_1 = (_0 = item.showGradient) !== null && _0 !== void 0 ? _0 : showGradient) !== null && _1 !== void 0 ? _1 : false,
88
88
  gradientColor: isFocused
89
- ? (_z = focusedBarConfig === null || focusedBarConfig === void 0 ? void 0 : focusedBarConfig.gradientColor) !== null && _z !== void 0 ? _z : localGradientColor
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
- ? (_0 = focusedBarConfig === null || focusedBarConfig === void 0 ? void 0 : focusedBarConfig.opacity) !== null && _0 !== void 0 ? _0 : localOpacity
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 ??
@@ -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;
@@ -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
@@ -370,6 +370,7 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
370
370
  stripWidth: number;
371
371
  stripColor: any;
372
372
  stripOpacity: number;
373
+ stripStrokeDashArray: number[] | undefined;
373
374
  unFocusOnPressOut: boolean;
374
375
  delayBeforeUnFocus: number;
375
376
  containerHeightIncludingBelowXAxis: number;
@@ -971,6 +971,7 @@ export var useLineChart = function (props) {
971
971
  var stripWidth = (_284 = props.stripWidth) !== null && _284 !== void 0 ? _284 : LineDefaults.stripWidth;
972
972
  var stripColor = (_285 = props.stripColor) !== null && _285 !== void 0 ? _285 : color1;
973
973
  var stripOpacity = (_286 = props.stripOpacity) !== null && _286 !== void 0 ? _286 : (startOpacity1 + endOpacity1) / 2;
974
+ var stripStrokeDashArray = props.stripStrokeDashArray;
974
975
  var unFocusOnPressOut = (_287 = props.unFocusOnPressOut) !== null && _287 !== void 0 ? _287 : LineDefaults.unFocusOnPressOut;
975
976
  var delayBeforeUnFocus = (_288 = props.delayBeforeUnFocus) !== null && _288 !== void 0 ? _288 : LineDefaults.delayBeforeUnFocus;
976
977
  var containerHeightIncludingBelowXAxis = extendedContainerHeight + noOfSectionsBelowXAxis * stepHeight;
@@ -1455,6 +1456,7 @@ export var useLineChart = function (props) {
1455
1456
  stripWidth: stripWidth,
1456
1457
  stripColor: stripColor,
1457
1458
  stripOpacity: stripOpacity,
1459
+ stripStrokeDashArray: stripStrokeDashArray,
1458
1460
  unFocusOnPressOut: unFocusOnPressOut,
1459
1461
  delayBeforeUnFocus: delayBeforeUnFocus,
1460
1462
  containerHeightIncludingBelowXAxis: containerHeightIncludingBelowXAxis,
@@ -1663,6 +1663,7 @@ export const useLineChart = (props: extendedLineChartPropsType) => {
1663
1663
  const stripWidth = props.stripWidth ?? LineDefaults.stripWidth
1664
1664
  const stripColor = props.stripColor ?? color1
1665
1665
  const stripOpacity = props.stripOpacity ?? (startOpacity1 + endOpacity1) / 2
1666
+ const stripStrokeDashArray = props.stripStrokeDashArray
1666
1667
  const unFocusOnPressOut =
1667
1668
  props.unFocusOnPressOut ?? LineDefaults.unFocusOnPressOut
1668
1669
  const delayBeforeUnFocus =
@@ -2187,6 +2188,7 @@ export const useLineChart = (props: extendedLineChartPropsType) => {
2187
2188
  stripWidth,
2188
2189
  stripColor,
2189
2190
  stripOpacity,
2191
+ stripStrokeDashArray,
2190
2192
  unFocusOnPressOut,
2191
2193
  delayBeforeUnFocus,
2192
2194
  containerHeightIncludingBelowXAxis,
@@ -62,6 +62,7 @@ export interface LineChartPropsType {
62
62
  stripWidth?: number;
63
63
  stripColor?: ColorValue | string | any;
64
64
  stripOpacity?: number;
65
+ stripStrokeDashArray?: number[];
65
66
  onPress?: Function;
66
67
  unFocusOnPressOut?: boolean;
67
68
  delayBeforeUnFocus?: number;
@@ -325,6 +326,7 @@ export interface lineDataItem {
325
326
  stripWidth?: number;
326
327
  stripColor?: ColorValue | string | any;
327
328
  stripOpacity?: number;
329
+ stripStrokeDashArray?: number[];
328
330
  focusedDataPointShape?: string;
329
331
  focusedDataPointWidth?: number;
330
332
  focusedDataPointHeight?: number;
@@ -77,6 +77,7 @@ export interface LineChartPropsType {
77
77
  stripWidth?: number
78
78
  stripColor?: ColorValue | string | any
79
79
  stripOpacity?: number
80
+ stripStrokeDashArray?: number[]
80
81
  onPress?: Function
81
82
  unFocusOnPressOut?: boolean
82
83
  delayBeforeUnFocus?: number
@@ -365,6 +366,7 @@ export interface lineDataItem {
365
366
  stripWidth?: number
366
367
  stripColor?: ColorValue | string | any
367
368
  stripOpacity?: number
369
+ stripStrokeDashArray?: number[]
368
370
 
369
371
  focusedDataPointShape?: string
370
372
  focusedDataPointWidth?: number