gifted-charts-core 0.0.28 → 0.0.29

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.0.28",
3
+ "version": "0.0.29",
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": [
@@ -3,9 +3,9 @@ import { type lineConfigType, type BarChartPropsType, type barDataItem, type sta
3
3
  import { type BarAndLineChartsWrapperTypes, type secondaryYAxisType } from '../utils/types';
4
4
  import { type Animated } from 'react-native';
5
5
  export interface extendedBarChartPropsType extends BarChartPropsType {
6
- heightValue: Animated.Value;
7
- widthValue: Animated.Value;
8
- opacValue: Animated.Value;
6
+ heightValue?: Animated.Value;
7
+ widthValue?: Animated.Value;
8
+ opacValue?: Animated.Value;
9
9
  verticalLinesUptoDataPoint?: boolean;
10
10
  secondaryYAxis?: secondaryYAxisType | boolean;
11
11
  }
@@ -81,8 +81,8 @@ export declare const useBarChart: (props: extendedBarChartPropsType) => {
81
81
  side: string;
82
82
  labelWidth: number;
83
83
  isThreeD: boolean;
84
- animatedHeight: Animated.AnimatedInterpolation<string | number>;
85
- appearingOpacity: Animated.AnimatedInterpolation<string | number>;
84
+ animatedHeight: Animated.AnimatedInterpolation<string | number> | undefined;
85
+ appearingOpacity: Animated.AnimatedInterpolation<string | number> | undefined;
86
86
  autoShiftLabels: boolean;
87
87
  yAxisAtTop: boolean;
88
88
  secondaryData: import("..").lineDataItem[] | barDataItem[] | undefined;
@@ -95,7 +95,7 @@ export declare const useBarChart: (props: extendedBarChartPropsType) => {
95
95
  lineConfig2: lineConfigType;
96
96
  lineData: (import("..").lineDataItem | barDataItem | stackDataItem)[];
97
97
  lineData2: (import("..").lineDataItem | barDataItem | stackDataItem)[] | undefined;
98
- animatedWidth: Animated.AnimatedInterpolation<string | number>;
98
+ animatedWidth: Animated.AnimatedInterpolation<string | number> | undefined;
99
99
  lineBehindBars: boolean;
100
100
  points: string;
101
101
  setPoints: import("react").Dispatch<import("react").SetStateAction<string>>;
@@ -365,15 +365,15 @@ export var useBarChart = function (props) {
365
365
  setPointerX(x);
366
366
  setPointerY(y);
367
367
  };
368
- var animatedHeight = heightValue.interpolate({
368
+ var animatedHeight = heightValue === null || heightValue === void 0 ? void 0 : heightValue.interpolate({
369
369
  inputRange: [0, 1],
370
370
  outputRange: ['0%', '100%']
371
371
  });
372
- var appearingOpacity = opacValue.interpolate({
372
+ var appearingOpacity = opacValue === null || opacValue === void 0 ? void 0 : opacValue.interpolate({
373
373
  inputRange: [0, 1],
374
374
  outputRange: [0, 1]
375
375
  });
376
- var animatedWidth = widthValue.interpolate({
376
+ var animatedWidth = widthValue === null || widthValue === void 0 ? void 0 : widthValue.interpolate({
377
377
  inputRange: [0, 1],
378
378
  outputRange: [0, initialSpacing + totalWidth + endSpacing]
379
379
  });
@@ -32,9 +32,9 @@ import {
32
32
  import { type Animated } from 'react-native'
33
33
 
34
34
  export interface extendedBarChartPropsType extends BarChartPropsType {
35
- heightValue: Animated.Value
36
- widthValue: Animated.Value
37
- opacValue: Animated.Value
35
+ heightValue?: Animated.Value
36
+ widthValue?: Animated.Value
37
+ opacValue?: Animated.Value
38
38
  verticalLinesUptoDataPoint?: boolean
39
39
  secondaryYAxis?: secondaryYAxisType | boolean
40
40
  }
@@ -578,16 +578,16 @@ export const useBarChart = (props: extendedBarChartPropsType) => {
578
578
  setPointerY(y)
579
579
  }
580
580
 
581
- const animatedHeight = heightValue.interpolate({
581
+ const animatedHeight = heightValue?.interpolate({
582
582
  inputRange: [0, 1],
583
583
  outputRange: ['0%', '100%']
584
584
  })
585
- const appearingOpacity = opacValue.interpolate({
585
+ const appearingOpacity = opacValue?.interpolate({
586
586
  inputRange: [0, 1],
587
587
  outputRange: [0, 1]
588
588
  })
589
589
 
590
- const animatedWidth = widthValue.interpolate({
590
+ const animatedWidth = widthValue?.interpolate({
591
591
  inputRange: [0, 1],
592
592
  outputRange: [0, initialSpacing + totalWidth + endSpacing]
593
593
  })
@@ -59,7 +59,7 @@ export var usePopulationPyramid = function (props) {
59
59
  ? props.stepHeight * noOfSections
60
60
  : height;
61
61
  var stepHeight = (_s = props.stepHeight) !== null && _s !== void 0 ? _s : containerHeight / noOfSections;
62
- var xAxisLabelsHeight = 80;
62
+ var xAxisLabelsHeight = 30;
63
63
  var containerHeightWithXaxisLabels = containerHeight + xAxisLabelsHeight;
64
64
  var mid = (width + yAxisLabelWidth) / 2;
65
65
  var leftMax = Math.max.apply(Math, __spreadArray([], __read(data.map(function (item) { return item.left; })), false));
@@ -159,7 +159,7 @@ export const usePopulationPyramid = (props: extendedPopulationPyramidPropsType)
159
159
  : height
160
160
  const stepHeight = props.stepHeight ?? containerHeight / noOfSections
161
161
 
162
- const xAxisLabelsHeight = 80
162
+ const xAxisLabelsHeight = 30
163
163
  const containerHeightWithXaxisLabels = containerHeight + xAxisLabelsHeight
164
164
 
165
165
  const mid = (width + yAxisLabelWidth) / 2
package/src/index.d.ts CHANGED
@@ -34,4 +34,4 @@ export { getTopAndLeftForStripAndLabel } from './components/common/StripAndLabel
34
34
  /***********************************************************************************************************************/
35
35
  export { getCumulativeWidth, getLighterColor, svgQuadraticCurvePath, svgPath, bezierCommand, getSegmentString, getCurvePathWithSegments, getPreviousSegmentsLastPoint, getPathWithHighlight, getRegionPathObjects, getSegmentedPathObjects, getArrowPoints, getAxesAndRulesProps, getExtendedContainerHeightWithPadding, getSecondaryDataWithOffsetIncluded, getArrowProperty, getAllArrowProperties, maxAndMinUtil, computeMaxAndMinItems, getLabelTextUtil, getXForLineInBar, getYForLineInBar, clone, getLineConfigForBarChart, adjustToOffset } from './utils';
36
36
  export { chartTypes, yAxisSides, loc, SEGMENT_START, SEGMENT_END, RANGE_ENTER, RANGE_EXIT, STOP, ruleTypes, AxesAndRulesDefaults, defaultArrowConfig, BarDefaults, defaultLineConfig, LineDefaults, defaultPointerConfig, pieColors, populationDefaults } from './utils/constants';
37
- export { type RuleType, type RuleTypes, type RulesConfig, type CurveType, type EdgePosition, type PointerEvents, type secondaryYAxisType, type secondaryLineConfigType, type referenceConfigType, type arrowConfigType, type horizSectionPropTypes, type HorizSectionsType, type BarAndLineChartsWrapperTypes, type Pointer, type HighlightedRange, type LineSegment, type LineSvgProps, type LineProperties, type DataSet } from './utils/types';
37
+ export { type RuleType, type RuleTypes, type RulesConfig, type CurveType, type EdgePosition, type PointerEvents, type secondaryYAxisType, type secondaryLineConfigType, type referenceConfigType, type arrowConfigType, type horizSectionPropTypes, type HorizSectionsType, type BarAndLineChartsWrapperTypes, type Pointer, type HighlightedRange, type LineSegment, type LineSvgProps, type LineProperties, type DataSet, type Framework } from './utils/types';
package/src/index.ts CHANGED
@@ -141,5 +141,6 @@ export {
141
141
  type LineSegment,
142
142
  type LineSvgProps,
143
143
  type LineProperties,
144
- type DataSet
144
+ type DataSet,
145
+ type Framework
145
146
  } from './utils/types'