gifted-charts-core 0.1.44 → 0.1.46

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.
@@ -391,4 +391,5 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
391
391
  cumulativeSpacing5: number[];
392
392
  cumulativeSpacingSecondary: number[];
393
393
  cumulativeSpacingForSet: any[];
394
+ stripOverDataPoints: boolean | undefined;
394
395
  };
@@ -150,8 +150,6 @@ export var useLineChart = function (props) {
150
150
  var startIndex5 = (_5 = props.startIndex5) !== null && _5 !== void 0 ? _5 : 0;
151
151
  var endIndex5 = (_6 = props.endIndex5) !== null && _6 !== void 0 ? _6 : data5.length - 1;
152
152
  var lengthOfLongestDataArray = Math.max(data.length, data2.length, data3.length, data4.length, data5.length);
153
- var maxLengthOfDataOrSet = dataSet
154
- ? Math.max.apply(Math, __spreadArray([], __read(dataSet.map(function (item) { return item.data.length; })), false)) : lengthOfLongestDataArray;
155
153
  var lineSegments = !interpolateMissingValues
156
154
  ? getLineSegmentsForMissingValues(props.data)
157
155
  : !extrapolateMissingValues
@@ -1582,7 +1580,8 @@ export var useLineChart = function (props) {
1582
1580
  cumulativeSpacing4: cumulativeSpacing4,
1583
1581
  cumulativeSpacing5: cumulativeSpacing5,
1584
1582
  cumulativeSpacingSecondary: cumulativeSpacingSecondary,
1585
- cumulativeSpacingForSet: cumulativeSpacingForSet
1583
+ cumulativeSpacingForSet: cumulativeSpacingForSet,
1584
+ stripOverDataPoints: props.stripOverDataPoints
1586
1585
  // oldPoints
1587
1586
  };
1588
1587
  };
@@ -62,6 +62,7 @@ export interface LineChartPropsType {
62
62
  onFocus?: Function;
63
63
  showDataPointOnFocus?: boolean;
64
64
  showStripOnFocus?: boolean;
65
+ stripOverDataPoints?: boolean;
65
66
  showTextOnFocus?: boolean;
66
67
  showDataPointLabelOnFocus?: boolean;
67
68
  stripHeight?: number;
@@ -43,17 +43,17 @@ export var getPieChartMainProps = function (props) {
43
43
  var propData = props.data;
44
44
  var data = [];
45
45
  var _20 = __read(useState(-1), 2), tooltipSelectedIndex = _20[0], setTooltipSelectedIndex = _20[1];
46
+ var minisculeDataItem = props.data.map(function (item) { return item.value; }).reduce(function (v, a) { return v + a; }) / 160000;
46
47
  var itemHasInnerComponent = false;
47
48
  if (propData) {
48
49
  for (var i = 0; i < propData.length; i++) {
49
50
  if (propData[i].pieInnerComponent)
50
51
  itemHasInnerComponent = true;
51
- if (propData[i].value !== 0) {
52
+ if (propData[i].value > minisculeDataItem) {
52
53
  data.push(propData[i]);
53
54
  }
54
55
  else {
55
- data.push(__assign(__assign({}, propData[i]), { value: props.data.map(function (item) { return item.value; }).reduce(function (v, a) { return v + a; }) /
56
- 160000 }));
56
+ data.push(__assign(__assign({}, propData[i]), { value: minisculeDataItem }));
57
57
  }
58
58
  }
59
59
  }
@@ -1,5 +1,5 @@
1
1
  import { type ColorValue } from 'react-native';
2
- import { PointerEvents, type Pointer } from '../../utils/types';
2
+ import { PointerEvents, type Pointer, HorizontalStripConfig } from '../../utils/types';
3
3
  export interface StripAndLabelProps {
4
4
  autoAdjustPointerLabelPosition: boolean;
5
5
  pointerX: number;
@@ -33,4 +33,5 @@ export interface StripAndLabelProps {
33
33
  isBarChart: boolean;
34
34
  pointerIndex: number;
35
35
  containsNegative: boolean;
36
+ horizontalStripConfig?: HorizontalStripConfig;
36
37
  }
@@ -985,7 +985,7 @@ export var getLineSegmentsDueToNoExtrapolation = function (data) {
985
985
  });
986
986
  }
987
987
  var lastNumericIndex = myFindLastIndex(data, function (item) { return typeof item.value === 'number'; });
988
- if (lastNumericIndex !== data.length) {
988
+ if (lastNumericIndex !== data.length - 1) {
989
989
  segments.push({
990
990
  startIndex: lastNumericIndex,
991
991
  endIndex: data.length,
@@ -307,6 +307,16 @@ export interface BarAndLineChartsWrapperTypes {
307
307
  nestedScrollEnabled?: boolean;
308
308
  dataSet?: DataSet[];
309
309
  }
310
+ export interface HorizontalStripConfig {
311
+ thickness?: number;
312
+ length?: number;
313
+ color?: ColorValue;
314
+ strokeDashArray?: number[];
315
+ horizontalStripUptoDataPoint?: boolean;
316
+ labelComponent?: Function;
317
+ labelComponentHeight?: number;
318
+ labelComponentWidth?: number;
319
+ }
310
320
  export interface Pointer {
311
321
  height?: number;
312
322
  width?: number;
@@ -325,6 +335,7 @@ export interface Pointer {
325
335
  pointerStripHeight?: number;
326
336
  pointerStripColor?: ColorValue;
327
337
  pointerStripUptoDataPoint?: boolean;
338
+ horizontalStripConfig?: HorizontalStripConfig;
328
339
  pointerLabelComponent?: Function;
329
340
  dynamicLegendComponent?: Function;
330
341
  dynamicLegendContainerStyle?: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gifted-charts-core",
3
- "version": "0.1.44",
3
+ "version": "0.1.46",
4
4
  "description": "Mathematical and logical utilities used by react-gifted-charts and react-native-gifted-charts",
5
5
  "main": "./dist/index.js",
6
6
  "files": [