gifted-charts-core 0.1.48 → 0.1.49

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.
@@ -26,7 +26,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
26
26
  import { getBarFrontColor, getBarWidth } from '../utils';
27
27
  export var getPropsForAnimated2DWithGradient = function (props) {
28
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
- 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;
29
+ var barBorderWidth = props.barBorderWidth, barBorderColor = props.barBorderColor, barBorderRadius = props.barBorderRadius, barMarginBottom = props.barMarginBottom, 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;
32
32
  var localBarBorderRadius = (isFocused !== null && isFocused !== void 0 ? isFocused : false)
@@ -41,6 +41,7 @@ export var getPropsForAnimated2DWithGradient = function (props) {
41
41
  position: 'absolute',
42
42
  width: '100%',
43
43
  height: '100%',
44
+ bottom: barMarginBottom,
44
45
  borderWidth: (_f = (_e = item.barBorderWidth) !== null && _e !== void 0 ? _e : barBorderWidth) !== null && _f !== void 0 ? _f : 0,
45
46
  borderColor: (_g = item.barBorderColor) !== null && _g !== void 0 ? _g : barBorderColor,
46
47
  borderRadius: localBarBorderRadius,
@@ -14,7 +14,7 @@ export declare const useRenderStackBars: (props: StackedBarChartPropsType) => {
14
14
  height: number;
15
15
  setHeight: import("react").Dispatch<import("react").SetStateAction<number>>;
16
16
  getBarHeight: (value: number, marginBottom?: number) => number;
17
- getPosition: (index: number) => number;
17
+ getPosition: (index: number, height: number) => number;
18
18
  getLowestPosition: () => number;
19
19
  lowestBarPosition: number;
20
20
  getStackBorderRadii: (item: stackDataItem, index: number) => {
@@ -45,10 +45,13 @@ export var useRenderStackBars = function (props) {
45
45
  return (Math.abs(value) * (value < 0 ? negativeHeightFactor : heightFactor) -
46
46
  (marginBottom !== null && marginBottom !== void 0 ? marginBottom : 0));
47
47
  };
48
- var getPosition = function (index) {
48
+ var getPosition = function (index, height) {
49
49
  /* Returns bottom position for stack item
50
50
  negative values are below origin (-> negative position) */
51
- var height = getBarHeight(item.stacks[index].value, item.stacks[index].marginBottom);
51
+ // const height = getBarHeight(
52
+ // item.stacks[index].value,
53
+ // item.stacks[index].marginBottom
54
+ // )
52
55
  var itemValue = item.stacks[index].value;
53
56
  var isNegative = itemValue <= 0;
54
57
  var position = isNegative ? -(height || 0) - xAxisThickness : 0;
@@ -68,7 +71,9 @@ export var useRenderStackBars = function (props) {
68
71
  var getLowestPosition = function () {
69
72
  var _a;
70
73
  return (((_a = item.stacks
71
- .map(function (_, index) { return getPosition(index); })
74
+ .map(function (_, index) {
75
+ return getPosition(index, getBarHeight(index, _.marginBottom));
76
+ })
72
77
  .sort(function (a, b) { return a - b; })) === null || _a === void 0 ? void 0 : _a[0]) || 0);
73
78
  };
74
79
  var lowestBarPosition = getLowestPosition();
@@ -191,6 +191,7 @@ export declare const useBarChart: (props: extendedBarChartPropsType) => {
191
191
  secondaryNegativeStepHeight: number;
192
192
  secondaryNegativeStepValue: number;
193
193
  secondaryNoOfSectionsBelowXAxis: number;
194
+ barMarginBottom: any;
194
195
  };
195
196
  barAndLineChartsWrapperProps: BarAndLineChartsWrapperTypes;
196
197
  yAxisExtraHeightAtTop: number;
@@ -469,7 +469,7 @@ export var useBarChart = function (props) {
469
469
  outputRange: [0, initialSpacing + totalWidth]
470
470
  });
471
471
  var getPropsCommonForBarAndStack = function (item, index) {
472
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
472
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
473
473
  return {
474
474
  item: item,
475
475
  index: index,
@@ -544,7 +544,8 @@ export var useBarChart = function (props) {
544
544
  secondaryStepValue: secondaryStepValue,
545
545
  secondaryNegativeStepHeight: secondaryNegativeStepHeight,
546
546
  secondaryNegativeStepValue: secondaryNegativeStepValue,
547
- secondaryNoOfSectionsBelowXAxis: secondaryNoOfSectionsBelowXAxis
547
+ secondaryNoOfSectionsBelowXAxis: secondaryNoOfSectionsBelowXAxis,
548
+ barMarginBottom: (_x = (_w = item.barMarginBottom) !== null && _w !== void 0 ? _w : props.barMarginBottom) !== null && _x !== void 0 ? _x : 0
548
549
  };
549
550
  };
550
551
  var barAndLineChartsWrapperProps = {
@@ -614,7 +615,8 @@ export var useBarChart = function (props) {
614
615
  onEndReached: props.onEndReached,
615
616
  onStartReached: props.onStartReached,
616
617
  endReachedOffset: (_58 = props.endReachedOffset) !== null && _58 !== void 0 ? _58 : BarDefaults.endReachedOffset,
617
- onMomentumScrollEnd: props.onMomentumScrollEnd
618
+ onMomentumScrollEnd: props.onMomentumScrollEnd,
619
+ customBackground: props.customBackground
618
620
  };
619
621
  return {
620
622
  lineConfig: lineConfig,
@@ -1,6 +1,6 @@
1
1
  import { type ColorValue, type GestureResponderEvent, type ViewStyle } from 'react-native';
2
2
  import { type yAxisSides } from '../utils/constants';
3
- import { XAxisConfig, type CurveType, type Pointer, type RuleType, type RulesConfig, type referenceConfigType, type secondaryYAxisType, type Linecap } from '../utils/types';
3
+ import { XAxisConfig, type CurveType, type Pointer, type RuleType, type RulesConfig, type referenceConfigType, type secondaryYAxisType, type Linecap, CustomBackground } from '../utils/types';
4
4
  import { type Component, type ReactNode } from 'react';
5
5
  import { type lineDataItem } from '../LineChart/types';
6
6
  export interface stackDataItem {
@@ -99,6 +99,7 @@ export interface StackedBarChartPropsType {
99
99
  barBorderBottomLeftRadius?: number;
100
100
  barBorderBottomRightRadius?: number;
101
101
  barInnerComponent?: (item?: barDataItem | stackDataItem, index?: number) => ReactNode;
102
+ barMarginBottom: number;
102
103
  stackBorderRadius?: number;
103
104
  stackBorderTopLeftRadius?: number;
104
105
  stackBorderTopRightRadius?: number;
@@ -234,6 +235,7 @@ export interface BarChartPropsType {
234
235
  showFractionalValues?: boolean;
235
236
  roundToDigits?: number;
236
237
  backgroundColor?: ColorValue;
238
+ customBackground?: CustomBackground;
237
239
  disableScroll?: boolean;
238
240
  showScrollIndicator?: boolean;
239
241
  indicatorColor?: 'black' | 'default' | 'white';
@@ -337,6 +339,7 @@ export interface lineConfigType {
337
339
  delay?: number;
338
340
  thickness?: number;
339
341
  color?: ColorValue | string | any;
342
+ strokeDashArray?: number[];
340
343
  hideDataPoints?: boolean;
341
344
  dataPointsShape?: string;
342
345
  dataPointsWidth?: number;
@@ -156,13 +156,13 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
156
156
  dataPointsRadius5: number;
157
157
  dataPointsColor5: string;
158
158
  dataPointsShape5: string;
159
- areaChart: boolean;
160
- areaChart1: boolean;
161
- areaChart2: boolean;
162
- areaChart3: boolean;
163
- areaChart4: boolean;
164
- areaChart5: boolean;
165
- atLeastOneAreaChart: boolean;
159
+ areaChart: boolean | undefined;
160
+ areaChart1: boolean | undefined;
161
+ areaChart2: boolean | undefined;
162
+ areaChart3: boolean | undefined;
163
+ areaChart4: boolean | undefined;
164
+ areaChart5: boolean | undefined;
165
+ atLeastOneAreaChart: boolean | undefined;
166
166
  getIsNthAreaChart: (n: number) => boolean;
167
167
  stepChart: boolean;
168
168
  stepChart1: boolean;
@@ -283,7 +283,7 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
283
283
  curved: boolean | undefined;
284
284
  curvature: number;
285
285
  curveType: import("../utils/types").CurveType;
286
- areaChart: boolean;
286
+ areaChart: boolean | undefined;
287
287
  color: import("react-native").ColorValue;
288
288
  thickness: number;
289
289
  zIndex1: number;
@@ -349,10 +349,12 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
349
349
  autoAdjustPointerLabelPosition: boolean;
350
350
  pointerVanishDelay: number;
351
351
  activatePointersOnLongPress: boolean;
352
+ activatePointersInstantlyOnTouch: boolean;
352
353
  activatePointersDelay: number;
353
354
  initialPointerIndex: number;
354
355
  initialPointerAppearDelay: number;
355
356
  persistPointer: boolean;
357
+ resetPointerIndexOnRelease: boolean;
356
358
  hidePointer1: boolean;
357
359
  hidePointer2: boolean;
358
360
  hidePointer3: boolean;
@@ -394,4 +396,7 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
394
396
  cumulativeSpacingForSet: any[];
395
397
  stripOverDataPoints: boolean | undefined;
396
398
  strips: any;
399
+ lastLineNumber: number;
400
+ focusTogether: boolean;
401
+ focusProximity: number;
397
402
  };