gifted-charts-core 0.1.56 → 0.1.57

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.
@@ -1,6 +1,9 @@
1
1
  import { type StackedBarChartPropsType, type stackDataItem } from './types';
2
2
  import { TooltipProps } from '../utils/types';
3
- export declare const useRenderStackBars: (props: StackedBarChartPropsType) => {
3
+ interface IStackedBarChartPropsType extends StackedBarChartPropsType {
4
+ renderTooltipConditions?: string[];
5
+ }
6
+ export declare const useRenderStackBars: (props: IStackedBarChartPropsType) => {
4
7
  containsNegativeValue: boolean;
5
8
  noAnimation: boolean;
6
9
  localBarInnerComponent: ((item?: stackDataItem, index?: number) => import("react").ReactNode) | undefined;
@@ -25,4 +28,6 @@ export declare const useRenderStackBars: (props: StackedBarChartPropsType) => {
25
28
  borderBottomRightRadius: number;
26
29
  };
27
30
  tooltipProps: TooltipProps;
31
+ renderTooltipConditions: string[];
28
32
  };
33
+ export {};
@@ -15,9 +15,10 @@ var __read = (this && this.__read) || function (o, n) {
15
15
  return ar;
16
16
  };
17
17
  import { useState } from 'react';
18
+ import { BarDefaults } from '../utils/constants';
18
19
  export var useRenderStackBars = function (props) {
19
- var _a, _b, _c, _d, _e, _f, _g, _h;
20
- var item = props.item, index = props.index, _j = props.containerHeight, containerHeight = _j === void 0 ? 200 : _j, containerHeightIncludingBelowXAxis = props.containerHeightIncludingBelowXAxis, maxValue = props.maxValue, propSpacing = props.propSpacing, initialSpacing = props.initialSpacing, stackData = props.stackData, isAnimated = props.isAnimated, xAxisThickness = props.xAxisThickness, renderTooltip = props.renderTooltip, leftShiftForTooltip = props.leftShiftForTooltip, leftShiftForLastIndexTooltip = props.leftShiftForLastIndexTooltip, autoCenterTooltip = props.autoCenterTooltip, horizontal = props.horizontal, stepHeight = props.stepHeight, stepValue = props.stepValue, negativeStepHeight = props.negativeStepHeight, negativeStepValue = props.negativeStepValue, secondaryStepHeight = props.secondaryStepHeight, secondaryStepValue = props.secondaryStepValue, secondaryNegativeStepHeight = props.secondaryNegativeStepHeight, secondaryNegativeStepValue = props.secondaryNegativeStepValue;
20
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
21
+ var item = props.item, index = props.index, _k = props.containerHeight, containerHeight = _k === void 0 ? 200 : _k, containerHeightIncludingBelowXAxis = props.containerHeightIncludingBelowXAxis, maxValue = props.maxValue, propSpacing = props.propSpacing, initialSpacing = props.initialSpacing, stackData = props.stackData, isAnimated = props.isAnimated, xAxisThickness = props.xAxisThickness, renderTooltip = props.renderTooltip, leftShiftForTooltip = props.leftShiftForTooltip, leftShiftForLastIndexTooltip = props.leftShiftForLastIndexTooltip, autoCenterTooltip = props.autoCenterTooltip, horizontal = props.horizontal, stepHeight = props.stepHeight, stepValue = props.stepValue, negativeStepHeight = props.negativeStepHeight, negativeStepValue = props.negativeStepValue, secondaryStepHeight = props.secondaryStepHeight, secondaryStepValue = props.secondaryStepValue, secondaryNegativeStepHeight = props.secondaryNegativeStepHeight, secondaryNegativeStepValue = props.secondaryNegativeStepValue;
21
22
  var containsNegativeValue = item.stacks.some(function (item) { return item.value < 0; });
22
23
  var anyStackContainsNegativeValue = stackData.some(function (item) {
23
24
  return item.stacks.some(function (stack) { return stack.value < 0; });
@@ -43,7 +44,7 @@ export var useRenderStackBars = function (props) {
43
44
  Math.abs(stack.value) *
44
45
  (stack.value < 0 ? negativeHeightFactor : heightFactor);
45
46
  }, 0);
46
- var _k = __read(useState(noAnimation ? totalHeight : 1), 2), height = _k[0], setHeight = _k[1];
47
+ var _l = __read(useState(noAnimation ? totalHeight : 1), 2), height = _l[0], setHeight = _l[1];
47
48
  var getBarHeight = function (value, marginBottom) {
48
49
  return (Math.abs(value) * (value < 0 ? negativeHeightFactor : heightFactor) -
49
50
  (marginBottom !== null && marginBottom !== void 0 ? marginBottom : 0));
@@ -145,6 +146,7 @@ export var useRenderStackBars = function (props) {
145
146
  getLowestPosition: getLowestPosition,
146
147
  lowestBarPosition: lowestBarPosition,
147
148
  getStackBorderRadii: getStackBorderRadii,
148
- tooltipProps: tooltipProps
149
+ tooltipProps: tooltipProps,
150
+ renderTooltipConditions: (_j = props.renderTooltipConditions) !== null && _j !== void 0 ? _j : BarDefaults.renderTooltipConditions
149
151
  };
150
152
  };
@@ -165,6 +165,7 @@ export declare const useBarChart: (props: extendedBarChartPropsType) => {
165
165
  xAxisLabelsHeight: number | undefined;
166
166
  xAxisLabelsVerticalShift: number;
167
167
  renderTooltip: Function | undefined;
168
+ renderTooltipConditions: string[];
168
169
  leftShiftForTooltip: number;
169
170
  autoCenterTooltip: boolean | undefined;
170
171
  initialSpacing: number;
@@ -472,7 +472,7 @@ export var useBarChart = function (props) {
472
472
  outputRange: [0, initialSpacing + totalWidth]
473
473
  });
474
474
  var getPropsCommonForBarAndStack = function (item, index) {
475
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
475
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
476
476
  return {
477
477
  item: item,
478
478
  index: index,
@@ -522,26 +522,27 @@ export var useBarChart = function (props) {
522
522
  xAxisLabelsHeight: props.xAxisLabelsHeight,
523
523
  xAxisLabelsVerticalShift: xAxisLabelsVerticalShift,
524
524
  renderTooltip: props.renderTooltip,
525
- leftShiftForTooltip: (_e = props.leftShiftForTooltip) !== null && _e !== void 0 ? _e : 0,
525
+ renderTooltipConditions: (_e = props.renderTooltipConditions) !== null && _e !== void 0 ? _e : BarDefaults.renderTooltipConditions,
526
+ leftShiftForTooltip: (_f = props.leftShiftForTooltip) !== null && _f !== void 0 ? _f : 0,
526
527
  autoCenterTooltip: autoCenterTooltip,
527
528
  initialSpacing: initialSpacing,
528
529
  selectedIndex: selectedIndex,
529
530
  setSelectedIndex: setSelectedIndex,
530
- activeOpacity: (_f = props.activeOpacity) !== null && _f !== void 0 ? _f : 0.2,
531
+ activeOpacity: (_g = props.activeOpacity) !== null && _g !== void 0 ? _g : 0.2,
531
532
  noOfSectionsBelowXAxis: noOfSectionsBelowXAxis,
532
- leftShiftForLastIndexTooltip: (_g = props.leftShiftForLastIndexTooltip) !== null && _g !== void 0 ? _g : 0,
533
- label: (_h = item.label) !== null && _h !== void 0 ? _h : (((_j = props.xAxisLabelTexts) === null || _j === void 0 ? void 0 : _j[index]) ? props.xAxisLabelTexts[index] : ''),
534
- secondaryLabel: (_o = (_k = item.secondaryLabel) !== null && _k !== void 0 ? _k : (_m = (_l = props.secondaryXAxis) === null || _l === void 0 ? void 0 : _l.labelTexts) === null || _m === void 0 ? void 0 : _m[index]) !== null && _o !== void 0 ? _o : '',
535
- labelTextStyle: (_p = item.labelTextStyle) !== null && _p !== void 0 ? _p : props.xAxisLabelTextStyle,
536
- secondaryLabelTextStyle: (_t = (_s = (_q = item.secondaryLabelTextStyle) !== null && _q !== void 0 ? _q : (_r = props.secondaryXAxis) === null || _r === void 0 ? void 0 : _r.labelsTextStyle) !== null && _s !== void 0 ? _s : item.labelTextStyle) !== null && _t !== void 0 ? _t : props.xAxisLabelTextStyle,
533
+ leftShiftForLastIndexTooltip: (_h = props.leftShiftForLastIndexTooltip) !== null && _h !== void 0 ? _h : 0,
534
+ label: (_j = item.label) !== null && _j !== void 0 ? _j : (((_k = props.xAxisLabelTexts) === null || _k === void 0 ? void 0 : _k[index]) ? props.xAxisLabelTexts[index] : ''),
535
+ secondaryLabel: (_p = (_l = item.secondaryLabel) !== null && _l !== void 0 ? _l : (_o = (_m = props.secondaryXAxis) === null || _m === void 0 ? void 0 : _m.labelTexts) === null || _o === void 0 ? void 0 : _o[index]) !== null && _p !== void 0 ? _p : '',
536
+ labelTextStyle: (_q = item.labelTextStyle) !== null && _q !== void 0 ? _q : props.xAxisLabelTextStyle,
537
+ secondaryLabelTextStyle: (_u = (_t = (_r = item.secondaryLabelTextStyle) !== null && _r !== void 0 ? _r : (_s = props.secondaryXAxis) === null || _s === void 0 ? void 0 : _s.labelsTextStyle) !== null && _t !== void 0 ? _t : item.labelTextStyle) !== null && _u !== void 0 ? _u : props.xAxisLabelTextStyle,
537
538
  pointerConfig: pointerConfig,
538
539
  yAxisExtraHeightAtTop: yAxisExtraHeightAtTop,
539
540
  yAxisOffset: yAxisOffset !== null && yAxisOffset !== void 0 ? yAxisOffset : 0,
540
541
  focusedBarIndex: focusedBarIndex,
541
542
  stepHeight: stepHeight,
542
543
  stepValue: stepValue,
543
- negativeStepHeight: (_u = props.negativeStepHeight) !== null && _u !== void 0 ? _u : stepHeight,
544
- negativeStepValue: (_v = props.negativeStepValue) !== null && _v !== void 0 ? _v : stepValue,
544
+ negativeStepHeight: (_v = props.negativeStepHeight) !== null && _v !== void 0 ? _v : stepHeight,
545
+ negativeStepValue: (_w = props.negativeStepValue) !== null && _w !== void 0 ? _w : stepValue,
545
546
  secondaryXAxis: props.secondaryXAxis,
546
547
  secondaryYAxis: props.secondaryYAxis,
547
548
  secondaryStepHeight: secondaryStepHeight,
@@ -549,7 +550,7 @@ export var useBarChart = function (props) {
549
550
  secondaryNegativeStepHeight: secondaryNegativeStepHeight,
550
551
  secondaryNegativeStepValue: secondaryNegativeStepValue,
551
552
  secondaryNoOfSectionsBelowXAxis: secondaryNoOfSectionsBelowXAxis,
552
- barMarginBottom: (_x = (_w = item.barMarginBottom) !== null && _w !== void 0 ? _w : props.barMarginBottom) !== null && _x !== void 0 ? _x : 0
553
+ barMarginBottom: (_y = (_x = item.barMarginBottom) !== null && _x !== void 0 ? _x : props.barMarginBottom) !== null && _y !== void 0 ? _y : 0
553
554
  };
554
555
  };
555
556
  var barAndLineChartsWrapperProps = {
@@ -138,6 +138,12 @@ export interface StackedBarChartPropsType {
138
138
  secondaryNoOfSectionsBelowXAxis: number;
139
139
  containerHeightIncludingBelowXAxis: number;
140
140
  }
141
+ export interface StackedBarChartPropsTypeForWeb extends StackedBarChartPropsType {
142
+ onContextMenu?: Function;
143
+ onMouseEnter?: Function;
144
+ onMouseLeave?: Function;
145
+ renderTooltipConditions?: string[];
146
+ }
141
147
  export interface BarChartPropsType {
142
148
  width?: number;
143
149
  height?: number;
@@ -598,6 +604,9 @@ export interface RenderBarsPropsType {
598
604
  secondaryNegativeStepValue: number;
599
605
  secondaryNoOfSectionsBelowXAxis: number;
600
606
  }
607
+ export interface RenderBarsPropsTypeForWeb extends RenderBarsPropsType {
608
+ renderTooltipConditions: string[];
609
+ }
601
610
  export interface trianglePropTypes {
602
611
  style: any;
603
612
  width: number;
@@ -654,5 +663,6 @@ export interface BarChartPropsTypeForWeb extends BarChartPropsType {
654
663
  onContextMenu?: Function;
655
664
  onMouseEnter?: Function;
656
665
  onMouseLeave?: Function;
666
+ renderTooltipConditions?: string[];
657
667
  }
658
668
  export {};
@@ -410,4 +410,11 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
410
410
  focusProximity: number;
411
411
  handleFocus: (index: number, item: lineDataItemNullSafe, locationY: number, onStripPress: Function) => void;
412
412
  handleUnFocus: () => void;
413
+ renderTooltip: Function | undefined;
414
+ renderTooltip1: Function | undefined;
415
+ renderTooltip2: Function | undefined;
416
+ renderTooltip3: Function | undefined;
417
+ renderTooltip4: Function | undefined;
418
+ renderTooltip5: Function | undefined;
419
+ renderTooltipSecondary: Function | undefined;
413
420
  };
@@ -40,7 +40,7 @@ import { computeMaxAndMinItems, getAllArrowProperties, getArrowPoints, getAxesAn
40
40
  import { EdgePosition } from '../utils/types';
41
41
  export var useLineChart = function (props) {
42
42
  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, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, _126, _127, _128, _129, _130, _131, _132, _133, _134, _135, _136, _137, _138, _139, _140, _141, _142, _143, _144, _145, _146, _147, _148, _149, _150, _151, _152, _153, _154, _155, _156, _157, _158, _159, _160, _161, _162, _163, _164, _165, _166, _167, _168, _169, _170, _171, _172, _173, _174, _175, _176, _177, _178, _179, _180, _181, _182, _183, _184, _185, _186, _187, _188, _189, _190, _191, _192, _193, _194, _195, _196, _197, _198, _199, _200, _201, _202, _203, _204, _205, _206, _207, _208, _209, _210, _211, _212, _213, _214, _215, _216, _217, _218, _219, _220, _221, _222, _223, _224, _225, _226, _227, _228, _229, _230, _231, _232, _233, _234, _235, _236, _237, _238, _239, _240, _241, _242, _243, _244, _245, _246, _247, _248, _249, _250, _251, _252, _253, _254, _255, _256, _257, _258, _259, _260, _261, _262, _263, _264, _265, _266, _267, _268, _269, _270, _271, _272, _273, _274, _275, _276, _277, _278, _279, _280, _281, _282, _283, _284, _285, _286, _287, _288, _289, _290, _291, _292, _293, _294, _295, _296, _297, _298, _299, _300, _301, _302, _303, _304, _305, _306, _307, _308, _309, _310, _311, _312, _313, _314, _315, _316, _317, _318, _319, _320, _321, _322, _323, _324, _325, _326, _327;
43
- var showDataPointsForMissingValues = props.showDataPointsForMissingValues, _328 = props.interpolateMissingValues, interpolateMissingValues = _328 === void 0 ? true : _328, _329 = props.extrapolateMissingValues, extrapolateMissingValues = _329 === void 0 ? true : _329, yAxisOffset = props.yAxisOffset, parentWidth = props.parentWidth, negativeStepValue = props.negativeStepValue;
43
+ var showDataPointsForMissingValues = props.showDataPointsForMissingValues, _328 = props.interpolateMissingValues, interpolateMissingValues = _328 === void 0 ? true : _328, _329 = props.extrapolateMissingValues, extrapolateMissingValues = _329 === void 0 ? true : _329, yAxisOffset = props.yAxisOffset, parentWidth = props.parentWidth, negativeStepValue = props.negativeStepValue, renderTooltip = props.renderTooltip, _330 = props.renderTooltip1, renderTooltip1 = _330 === void 0 ? props.renderTooltip : _330, _331 = props.renderTooltip2, renderTooltip2 = _331 === void 0 ? props.renderTooltip : _331, _332 = props.renderTooltip3, renderTooltip3 = _332 === void 0 ? props.renderTooltip : _332, _333 = props.renderTooltip4, renderTooltip4 = _333 === void 0 ? props.renderTooltip : _333, _334 = props.renderTooltip5, renderTooltip5 = _334 === void 0 ? props.renderTooltip : _334, _335 = props.renderTooltipSecondary, renderTooltipSecondary = _335 === void 0 ? props.renderTooltip : _335;
44
44
  var lastLineNumber = 1;
45
45
  if (props.secondaryData) {
46
46
  lastLineNumber = 6667; // lastLineNumber is 6667 for a secondary line, so the index or key of the secondary line is 6666
@@ -63,48 +63,48 @@ export var useLineChart = function (props) {
63
63
  // because in absence of extrapolation we don't want the chart to unnecessarily show the 4th quadrant
64
64
  var curvature = (_l = props.curvature) !== null && _l !== void 0 ? _l : LineDefaults.curvature;
65
65
  var curveType = (_m = props.curveType) !== null && _m !== void 0 ? _m : LineDefaults.curveType;
66
- var _330 = __read(useState(0), 2), scrollX = _330[0], setScrollX = _330[1];
67
- var _331 = __read(useState(''), 2), arrow1Points = _331[0], setArrow1Points = _331[1];
68
- var _332 = __read(useState(''), 2), arrow2Points = _332[0], setArrow2Points = _332[1];
69
- var _333 = __read(useState(''), 2), arrow3Points = _333[0], setArrow3Points = _333[1];
70
- var _334 = __read(useState(''), 2), arrow4Points = _334[0], setArrow4Points = _334[1];
71
- var _335 = __read(useState(''), 2), arrow5Points = _335[0], setArrow5Points = _335[1];
72
- var _336 = __read(useState(''), 2), secondaryArrowPoints = _336[0], setSecondaryArrowPoints = _336[1];
73
- var _337 = __read(useState(-1), 2), pointerIndex = _337[0], setPointerIndex = _337[1];
74
- var _338 = __read(useState(0), 2), pointerX = _338[0], setPointerX = _338[1];
75
- var _339 = __read(useState(0), 2), pointerY = _339[0], setPointerY = _339[1];
76
- var _340 = __read(useState(), 2), pointerItem = _340[0], setPointerItem = _340[1];
77
- var _341 = __read(useState(0), 2), pointerY2 = _341[0], setPointerY2 = _341[1];
78
- var _342 = __read(useState(), 2), pointerItem2 = _342[0], setPointerItem2 = _342[1];
79
- var _343 = __read(useState(0), 2), pointerY3 = _343[0], setPointerY3 = _343[1];
80
- var _344 = __read(useState(), 2), pointerItem3 = _344[0], setPointerItem3 = _344[1];
81
- var _345 = __read(useState(0), 2), pointerY4 = _345[0], setPointerY4 = _345[1];
82
- var _346 = __read(useState(), 2), pointerItem4 = _346[0], setPointerItem4 = _346[1];
83
- var _347 = __read(useState(0), 2), pointerY5 = _347[0], setPointerY5 = _347[1];
84
- var _348 = __read(useState([]), 2), pointerYsForDataSet = _348[0], setPointerYsForDataSet = _348[1];
85
- var _349 = __read(useState(), 2), pointerItem5 = _349[0], setPointerItem5 = _349[1];
86
- var _350 = __read(useState(0), 2), secondaryPointerY = _350[0], setSecondaryPointerY = _350[1];
87
- var _351 = __read(useState(), 2), secondaryPointerItem = _351[0], setSecondaryPointerItem = _351[1];
88
- var _352 = __read(useState([]), 2), pointerItemsForSet = _352[0], setPointerItemsForSet = _352[1];
89
- var _353 = __read(useState([]), 2), secondaryPointerItemsForSet = _353[0], setSecondaryPointerItemsForSet = _353[1];
90
- var _354 = __read(useState(0), 2), responderStartTime = _354[0], setResponderStartTime = _354[1];
91
- var _355 = __read(useState(false), 2), responderActive = _355[0], setResponderActive = _355[1];
92
- var _356 = __read(useState(''), 2), points = _356[0], setPoints = _356[1];
93
- var _357 = __read(useState(''), 2), points2 = _357[0], setPoints2 = _357[1];
94
- var _358 = __read(useState(''), 2), points3 = _358[0], setPoints3 = _358[1];
95
- var _359 = __read(useState(''), 2), points4 = _359[0], setPoints4 = _359[1];
96
- var _360 = __read(useState(''), 2), points5 = _360[0], setPoints5 = _360[1];
97
- var _361 = __read(useState(''), 2), secondaryPoints = _361[0], setSecondaryPoints = _361[1];
98
- var _362 = __read(useState(''), 2), fillPoints = _362[0], setFillPoints = _362[1];
99
- var _363 = __read(useState(''), 2), fillPoints2 = _363[0], setFillPoints2 = _363[1];
100
- var _364 = __read(useState(''), 2), fillPoints3 = _364[0], setFillPoints3 = _364[1];
101
- var _365 = __read(useState(''), 2), fillPoints4 = _365[0], setFillPoints4 = _365[1];
102
- var _366 = __read(useState(''), 2), fillPoints5 = _366[0], setFillPoints5 = _366[1];
103
- var _367 = __read(useState(''), 2), secondaryFillPoints = _367[0], setSecondaryFillPoints = _367[1];
104
- var _368 = __read(useState([]), 2), pointsFromSet = _368[0], setPointsFromSet = _368[1];
105
- var _369 = __read(useState([]), 2), fillPointsFromSet = _369[0], setFillPointsFromSet = _369[1];
106
- var _370 = __read(useState([]), 2), arrowPointsFromSet = _370[0], setArrowPointsFromSet = _370[1];
107
- var _371 = __read(useState((_o = props.focusedDataPointIndex) !== null && _o !== void 0 ? _o : -1), 2), selectedIndex = _371[0], setSelectedIndex = _371[1];
66
+ var _336 = __read(useState(0), 2), scrollX = _336[0], setScrollX = _336[1];
67
+ var _337 = __read(useState(''), 2), arrow1Points = _337[0], setArrow1Points = _337[1];
68
+ var _338 = __read(useState(''), 2), arrow2Points = _338[0], setArrow2Points = _338[1];
69
+ var _339 = __read(useState(''), 2), arrow3Points = _339[0], setArrow3Points = _339[1];
70
+ var _340 = __read(useState(''), 2), arrow4Points = _340[0], setArrow4Points = _340[1];
71
+ var _341 = __read(useState(''), 2), arrow5Points = _341[0], setArrow5Points = _341[1];
72
+ var _342 = __read(useState(''), 2), secondaryArrowPoints = _342[0], setSecondaryArrowPoints = _342[1];
73
+ var _343 = __read(useState(-1), 2), pointerIndex = _343[0], setPointerIndex = _343[1];
74
+ var _344 = __read(useState(0), 2), pointerX = _344[0], setPointerX = _344[1];
75
+ var _345 = __read(useState(0), 2), pointerY = _345[0], setPointerY = _345[1];
76
+ var _346 = __read(useState(), 2), pointerItem = _346[0], setPointerItem = _346[1];
77
+ var _347 = __read(useState(0), 2), pointerY2 = _347[0], setPointerY2 = _347[1];
78
+ var _348 = __read(useState(), 2), pointerItem2 = _348[0], setPointerItem2 = _348[1];
79
+ var _349 = __read(useState(0), 2), pointerY3 = _349[0], setPointerY3 = _349[1];
80
+ var _350 = __read(useState(), 2), pointerItem3 = _350[0], setPointerItem3 = _350[1];
81
+ var _351 = __read(useState(0), 2), pointerY4 = _351[0], setPointerY4 = _351[1];
82
+ var _352 = __read(useState(), 2), pointerItem4 = _352[0], setPointerItem4 = _352[1];
83
+ var _353 = __read(useState(0), 2), pointerY5 = _353[0], setPointerY5 = _353[1];
84
+ var _354 = __read(useState([]), 2), pointerYsForDataSet = _354[0], setPointerYsForDataSet = _354[1];
85
+ var _355 = __read(useState(), 2), pointerItem5 = _355[0], setPointerItem5 = _355[1];
86
+ var _356 = __read(useState(0), 2), secondaryPointerY = _356[0], setSecondaryPointerY = _356[1];
87
+ var _357 = __read(useState(), 2), secondaryPointerItem = _357[0], setSecondaryPointerItem = _357[1];
88
+ var _358 = __read(useState([]), 2), pointerItemsForSet = _358[0], setPointerItemsForSet = _358[1];
89
+ var _359 = __read(useState([]), 2), secondaryPointerItemsForSet = _359[0], setSecondaryPointerItemsForSet = _359[1];
90
+ var _360 = __read(useState(0), 2), responderStartTime = _360[0], setResponderStartTime = _360[1];
91
+ var _361 = __read(useState(false), 2), responderActive = _361[0], setResponderActive = _361[1];
92
+ var _362 = __read(useState(''), 2), points = _362[0], setPoints = _362[1];
93
+ var _363 = __read(useState(''), 2), points2 = _363[0], setPoints2 = _363[1];
94
+ var _364 = __read(useState(''), 2), points3 = _364[0], setPoints3 = _364[1];
95
+ var _365 = __read(useState(''), 2), points4 = _365[0], setPoints4 = _365[1];
96
+ var _366 = __read(useState(''), 2), points5 = _366[0], setPoints5 = _366[1];
97
+ var _367 = __read(useState(''), 2), secondaryPoints = _367[0], setSecondaryPoints = _367[1];
98
+ var _368 = __read(useState(''), 2), fillPoints = _368[0], setFillPoints = _368[1];
99
+ var _369 = __read(useState(''), 2), fillPoints2 = _369[0], setFillPoints2 = _369[1];
100
+ var _370 = __read(useState(''), 2), fillPoints3 = _370[0], setFillPoints3 = _370[1];
101
+ var _371 = __read(useState(''), 2), fillPoints4 = _371[0], setFillPoints4 = _371[1];
102
+ var _372 = __read(useState(''), 2), fillPoints5 = _372[0], setFillPoints5 = _372[1];
103
+ var _373 = __read(useState(''), 2), secondaryFillPoints = _373[0], setSecondaryFillPoints = _373[1];
104
+ var _374 = __read(useState([]), 2), pointsFromSet = _374[0], setPointsFromSet = _374[1];
105
+ var _375 = __read(useState([]), 2), fillPointsFromSet = _375[0], setFillPointsFromSet = _375[1];
106
+ var _376 = __read(useState([]), 2), arrowPointsFromSet = _376[0], setArrowPointsFromSet = _376[1];
107
+ var _377 = __read(useState((_o = props.focusedDataPointIndex) !== null && _o !== void 0 ? _o : -1), 2), selectedIndex = _377[0], setSelectedIndex = _377[1];
108
108
  useEffect(function () {
109
109
  var _a;
110
110
  setSelectedIndex((_a = props.focusedDataPointIndex) !== null && _a !== void 0 ? _a : -1);
@@ -415,7 +415,7 @@ export var useLineChart = function (props) {
415
415
  Math, __spreadArray([], __read(mergedPrimaryDataArrays.map(function (i) { return Math.max(i.value, 0); })), false)); // find the smallest +ve number
416
416
  var showFractionalValues = (_107 = props.showFractionalValues) !== null && _107 !== void 0 ? _107 : (isFinite(valuesRange) && valuesRange <= 1);
417
417
  var roundToDigits = (_108 = props.roundToDigits) !== null && _108 !== void 0 ? _108 : (showFractionalValues ? indexOfFirstNonZeroDigit(valuesRange) + 1 : 0);
418
- var _372 = computeMaxAndMinItems(mergedPrimaryDataArrays, extrapolateMissingValues, roundToDigits, showFractionalValues, mergedPrimaryDataArraysOriginals), maxItem = _372.maxItem, minItem = _372.minItem;
418
+ var _378 = computeMaxAndMinItems(mergedPrimaryDataArrays, extrapolateMissingValues, roundToDigits, showFractionalValues, mergedPrimaryDataArraysOriginals), maxItem = _378.maxItem, minItem = _378.minItem;
419
419
  var maxValue = getMaxValue(props.maxValue, props.stepValue, noOfSections, maxItem) || 10;
420
420
  var mostNegativeValue = (_109 = props.mostNegativeValue) !== null && _109 !== void 0 ? _109 : minItem;
421
421
  var overflowTop = ((_110 = props.overflowTop) !== null && _110 !== void 0 ? _110 : props.secondaryXAxis)
@@ -435,7 +435,7 @@ export var useLineChart = function (props) {
435
435
  var secondaryRoundToDigits = (_114 = (_113 = props.secondaryYAxis) === null || _113 === void 0 ? void 0 : _113.roundToDigits) !== null && _114 !== void 0 ? _114 : (showSecondaryFractionalValues
436
436
  ? indexOfFirstNonZeroDigit(secondaryValuesRange) + 1
437
437
  : 0);
438
- var _373 = computeMaxAndMinItems(mergedSecondaryDataArrays, extrapolateMissingValues, secondaryRoundToDigits, showSecondaryFractionalValues), secondaryMaxItem = _373.maxItem, secondaryMinItem = _373.minItem;
438
+ var _379 = computeMaxAndMinItems(mergedSecondaryDataArrays, extrapolateMissingValues, secondaryRoundToDigits, showSecondaryFractionalValues), secondaryMaxItem = _379.maxItem, secondaryMinItem = _379.minItem;
439
439
  var secondaryMaxValue = (_116 = (_115 = props.secondaryYAxis) === null || _115 === void 0 ? void 0 : _115.maxValue) !== null && _116 !== void 0 ? _116 : (secondaryMaxItem || maxValue);
440
440
  var getSecondaryY = function (value) {
441
441
  return extendedContainerHeight - (value * containerHeight) / secondaryMaxValue;
@@ -498,7 +498,7 @@ export var useLineChart = function (props) {
498
498
  var endOpacity5 = (_201 = props.endOpacity5) !== null && _201 !== void 0 ? _201 : endOpacity;
499
499
  defaultArrowConfig.strokeWidth = (_203 = (_202 = dataSet === null || dataSet === void 0 ? void 0 : dataSet[0]) === null || _202 === void 0 ? void 0 : _202.thickness) !== null && _203 !== void 0 ? _203 : thickness1;
500
500
  defaultArrowConfig.strokeColor = (_205 = (_204 = dataSet === null || dataSet === void 0 ? void 0 : dataSet[0]) === null || _204 === void 0 ? void 0 : _204.color) !== null && _205 !== void 0 ? _205 : color1;
501
- var _374 = getAllArrowProperties(props, defaultArrowConfig), arrowLength1 = _374.arrowLength1, arrowWidth1 = _374.arrowWidth1, arrowStrokeWidth1 = _374.arrowStrokeWidth1, arrowStrokeColor1 = _374.arrowStrokeColor1, arrowFillColor1 = _374.arrowFillColor1, showArrowBase1 = _374.showArrowBase1, arrowLength2 = _374.arrowLength2, arrowWidth2 = _374.arrowWidth2, arrowStrokeWidth2 = _374.arrowStrokeWidth2, arrowStrokeColor2 = _374.arrowStrokeColor2, arrowFillColor2 = _374.arrowFillColor2, showArrowBase2 = _374.showArrowBase2, arrowLength3 = _374.arrowLength3, arrowWidth3 = _374.arrowWidth3, arrowStrokeWidth3 = _374.arrowStrokeWidth3, arrowStrokeColor3 = _374.arrowStrokeColor3, arrowFillColor3 = _374.arrowFillColor3, showArrowBase3 = _374.showArrowBase3, arrowLength4 = _374.arrowLength4, arrowWidth4 = _374.arrowWidth4, arrowStrokeWidth4 = _374.arrowStrokeWidth4, arrowStrokeColor4 = _374.arrowStrokeColor4, arrowFillColor4 = _374.arrowFillColor4, showArrowBase4 = _374.showArrowBase4, arrowLength5 = _374.arrowLength5, arrowWidth5 = _374.arrowWidth5, arrowStrokeWidth5 = _374.arrowStrokeWidth5, arrowStrokeColor5 = _374.arrowStrokeColor5, arrowFillColor5 = _374.arrowFillColor5, showArrowBase5 = _374.showArrowBase5, arrowLengthsFromSet = _374.arrowLengthsFromSet, arrowWidthsFromSet = _374.arrowWidthsFromSet, arrowStrokeWidthsFromSet = _374.arrowStrokeWidthsFromSet, arrowStrokeColorsFromSet = _374.arrowStrokeColorsFromSet, arrowFillColorsFromSet = _374.arrowFillColorsFromSet, showArrowBasesFromSet = _374.showArrowBasesFromSet;
501
+ var _380 = getAllArrowProperties(props, defaultArrowConfig), arrowLength1 = _380.arrowLength1, arrowWidth1 = _380.arrowWidth1, arrowStrokeWidth1 = _380.arrowStrokeWidth1, arrowStrokeColor1 = _380.arrowStrokeColor1, arrowFillColor1 = _380.arrowFillColor1, showArrowBase1 = _380.showArrowBase1, arrowLength2 = _380.arrowLength2, arrowWidth2 = _380.arrowWidth2, arrowStrokeWidth2 = _380.arrowStrokeWidth2, arrowStrokeColor2 = _380.arrowStrokeColor2, arrowFillColor2 = _380.arrowFillColor2, showArrowBase2 = _380.showArrowBase2, arrowLength3 = _380.arrowLength3, arrowWidth3 = _380.arrowWidth3, arrowStrokeWidth3 = _380.arrowStrokeWidth3, arrowStrokeColor3 = _380.arrowStrokeColor3, arrowFillColor3 = _380.arrowFillColor3, showArrowBase3 = _380.showArrowBase3, arrowLength4 = _380.arrowLength4, arrowWidth4 = _380.arrowWidth4, arrowStrokeWidth4 = _380.arrowStrokeWidth4, arrowStrokeColor4 = _380.arrowStrokeColor4, arrowFillColor4 = _380.arrowFillColor4, showArrowBase4 = _380.showArrowBase4, arrowLength5 = _380.arrowLength5, arrowWidth5 = _380.arrowWidth5, arrowStrokeWidth5 = _380.arrowStrokeWidth5, arrowStrokeColor5 = _380.arrowStrokeColor5, arrowFillColor5 = _380.arrowFillColor5, showArrowBase5 = _380.showArrowBase5, arrowLengthsFromSet = _380.arrowLengthsFromSet, arrowWidthsFromSet = _380.arrowWidthsFromSet, arrowStrokeWidthsFromSet = _380.arrowStrokeWidthsFromSet, arrowStrokeColorsFromSet = _380.arrowStrokeColorsFromSet, arrowFillColorsFromSet = _380.arrowFillColorsFromSet, showArrowBasesFromSet = _380.showArrowBasesFromSet;
502
502
  var secondaryLineConfig = {
503
503
  zIndex: (_207 = (_206 = props.secondaryLineConfig) === null || _206 === void 0 ? void 0 : _206.zIndex) !== null && _207 !== void 0 ? _207 : zIndex1,
504
504
  curved: (_209 = (_208 = props.secondaryLineConfig) === null || _208 === void 0 ? void 0 : _208.curved) !== null && _209 !== void 0 ? _209 : props.curved,
@@ -1159,7 +1159,7 @@ export var useLineChart = function (props) {
1159
1159
  var lineGradientDirection = (_320 = props.lineGradientDirection) !== null && _320 !== void 0 ? _320 : 'vertical';
1160
1160
  var lineGradientStartColor = (_321 = props.lineGradientStartColor) !== null && _321 !== void 0 ? _321 : LineDefaults.lineGradientStartColor;
1161
1161
  var lineGradientEndColor = (_322 = props.lineGradientEndColor) !== null && _322 !== void 0 ? _322 : LineDefaults.lineGradientEndColor;
1162
- var _375 = __read(useState(-1), 2), selectedLineNumber = _375[0], setSelectedLineNumber = _375[1];
1162
+ var _381 = __read(useState(-1), 2), selectedLineNumber = _381[0], setSelectedLineNumber = _381[1];
1163
1163
  var getPointerY = function (value) {
1164
1164
  return value
1165
1165
  ? containerHeight -
@@ -1750,7 +1750,14 @@ export var useLineChart = function (props) {
1750
1750
  focusTogether: focusTogether,
1751
1751
  focusProximity: focusProximity,
1752
1752
  handleFocus: handleFocus,
1753
- handleUnFocus: handleUnFocus
1753
+ handleUnFocus: handleUnFocus,
1754
+ renderTooltip: renderTooltip,
1755
+ renderTooltip1: renderTooltip1,
1756
+ renderTooltip2: renderTooltip2,
1757
+ renderTooltip3: renderTooltip3,
1758
+ renderTooltip4: renderTooltip4,
1759
+ renderTooltip5: renderTooltip5,
1760
+ renderTooltipSecondary: renderTooltipSecondary
1754
1761
  // oldPoints
1755
1762
  };
1756
1763
  };
@@ -322,6 +322,13 @@ export interface LineChartPropsType {
322
322
  onBackgroundPress?: (event: GestureResponderEvent) => void;
323
323
  secondaryXAxis?: XAxisConfig;
324
324
  intersectionAreaConfig?: IntersectionAreaConfig;
325
+ renderTooltip?: Function;
326
+ renderTooltip1?: Function;
327
+ renderTooltip2?: Function;
328
+ renderTooltip3?: Function;
329
+ renderTooltip4?: Function;
330
+ renderTooltip5?: Function;
331
+ renderTooltipSecondary?: Function;
325
332
  }
326
333
  export interface lineDataItem {
327
334
  value?: number;
@@ -370,6 +377,9 @@ export interface lineDataItem {
370
377
  pointerShiftX?: number;
371
378
  pointerShiftY?: number;
372
379
  onPress?: Function;
380
+ onContextMenu?: Function;
381
+ onMouseEnter?: Function;
382
+ onMouseLeave?: Function;
373
383
  showXAxisIndex?: boolean;
374
384
  hidePointer?: boolean;
375
385
  }
@@ -419,6 +429,9 @@ export interface bicolorLineDataItem {
419
429
  pointerShiftX?: number;
420
430
  pointerShiftY?: number;
421
431
  onPress?: Function;
432
+ onContextMenu?: Function;
433
+ onMouseEnter?: Function;
434
+ onMouseLeave?: Function;
422
435
  }
423
436
  export interface LineChartBicolorPropsType {
424
437
  height?: number;
@@ -566,6 +579,16 @@ export interface LineChartBicolorPropsType {
566
579
  endReachedOffset?: number;
567
580
  parentWidth?: number;
568
581
  }
582
+ export interface LineChartPropsTypeForWeb extends LineChartPropsType {
583
+ onContextMenu?: Function;
584
+ onMouseEnter?: Function;
585
+ onMouseLeave?: Function;
586
+ }
587
+ export interface LineChartBicolorPropsTypeForWeb extends LineChartBicolorPropsType {
588
+ onContextMenu?: Function;
589
+ onMouseEnter?: Function;
590
+ onMouseLeave?: Function;
591
+ }
569
592
  export interface IDataSanitisationProps {
570
593
  showDataPointsForMissingValues: boolean | undefined;
571
594
  interpolateMissingValues: boolean;
@@ -69,6 +69,7 @@ export declare const useRadarChart: (props: RadarChartProps) => {
69
69
  angleStep: number;
70
70
  circular: boolean;
71
71
  hideGrid: boolean;
72
+ hideLabels: boolean;
72
73
  hideAsterLines: boolean;
73
74
  getGridLevelProps: (gridItem: GridConfig, ind: number) => {
74
75
  level: number;
@@ -37,7 +37,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
37
37
  import { radarChartDefaults } from '../utils/constants';
38
38
  export var useRadarChart = function (props) {
39
39
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
40
- var _u = props.circular, circular = _u === void 0 ? false : _u, _v = props.gridConfig, gridConfig = _v === void 0 ? {} : _v, _w = props.polygonConfig, polygonConfig = _w === void 0 ? {} : _w, _x = props.data, data = _x === void 0 ? [] : _x, dataSet = props.dataSet, _y = props.noOfSections, noOfSections = _y === void 0 ? radarChartDefaults.noOfSections : _y, _z = props.chartSize, chartSize = _z === void 0 ? radarChartDefaults.chartSize : _z, _0 = props.labelConfig, labelConfig = _0 === void 0 ? {} : _0, labelConfigArray = props.labelConfigArray, _1 = props.asterLinesConfig, asterLinesConfig = _1 === void 0 ? {} : _1, _2 = props.hideGrid, hideGrid = _2 === void 0 ? radarChartDefaults.hideGrid : _2, _3 = props.hideAsterLines, hideAsterLines = _3 === void 0 ? (_a = props.hideGrid) !== null && _a !== void 0 ? _a : radarChartDefaults.hideAsterLines : _3, _4 = props.dataLabelsConfig, dataLabelsConfig = _4 === void 0 ? {} : _4, _5 = props.labelsPositionOffset, labelsPositionOffset = _5 === void 0 ? radarChartDefaults.labelsPositionOffset : _5, _6 = props.dataLabelsPositionOffset, dataLabelsPositionOffset = _6 === void 0 ? radarChartDefaults.dataLabelsPositionOffset : _6, _7 = props.isAnimated, isAnimated = _7 === void 0 ? radarChartDefaults.isAnimated : _7, _8 = props.animationDuration, animationDuration = _8 === void 0 ? radarChartDefaults.animationDuration : _8, _9 = props.animateTogether, animateTogether = _9 === void 0 ? radarChartDefaults.animateTogether : _9;
40
+ var _u = props.circular, circular = _u === void 0 ? false : _u, _v = props.gridConfig, gridConfig = _v === void 0 ? {} : _v, _w = props.polygonConfig, polygonConfig = _w === void 0 ? {} : _w, _x = props.data, data = _x === void 0 ? [] : _x, dataSet = props.dataSet, _y = props.noOfSections, noOfSections = _y === void 0 ? radarChartDefaults.noOfSections : _y, _z = props.chartSize, chartSize = _z === void 0 ? radarChartDefaults.chartSize : _z, _0 = props.labelConfig, labelConfig = _0 === void 0 ? {} : _0, labelConfigArray = props.labelConfigArray, _1 = props.asterLinesConfig, asterLinesConfig = _1 === void 0 ? {} : _1, _2 = props.hideGrid, hideGrid = _2 === void 0 ? radarChartDefaults.hideGrid : _2, _3 = props.hideLabels, hideLabels = _3 === void 0 ? radarChartDefaults.hideLabels : _3, _4 = props.hideAsterLines, hideAsterLines = _4 === void 0 ? (_a = props.hideGrid) !== null && _a !== void 0 ? _a : radarChartDefaults.hideAsterLines : _4, _5 = props.dataLabelsConfig, dataLabelsConfig = _5 === void 0 ? {} : _5, _6 = props.labelsPositionOffset, labelsPositionOffset = _6 === void 0 ? radarChartDefaults.labelsPositionOffset : _6, _7 = props.dataLabelsPositionOffset, dataLabelsPositionOffset = _7 === void 0 ? radarChartDefaults.dataLabelsPositionOffset : _7, _8 = props.isAnimated, isAnimated = _8 === void 0 ? radarChartDefaults.isAnimated : _8, _9 = props.animationDuration, animationDuration = _9 === void 0 ? radarChartDefaults.animationDuration : _9, _10 = props.animateTogether, animateTogether = _10 === void 0 ? radarChartDefaults.animateTogether : _10;
41
41
  var labels = (_e = (_b = props.labels) !== null && _b !== void 0 ? _b : (_d = ((_c = dataSet === null || dataSet === void 0 ? void 0 : dataSet[0]) !== null && _c !== void 0 ? _c : data)) === null || _d === void 0 ? void 0 : _d.map(function (_, index) { return "Label".concat(index + 1); })) !== null && _e !== void 0 ? _e : [];
42
42
  var getMax = function (dataSet) {
43
43
  return dataSet.reduce(function (acc, set) {
@@ -58,31 +58,31 @@ export var useRadarChart = function (props) {
58
58
  };
59
59
  var center = chartSize / 2;
60
60
  var radius = center * 0.8;
61
- var _10 = gridConfig.stroke, gridStroke = _10 === void 0 ? radarChartDefaults.gridSection.stroke : _10, _11 = gridConfig.strokeWidth, gridStrokeWidth = _11 === void 0 ? radarChartDefaults.gridSection.strokeWidth : _11, _12 = gridConfig.strokeDashArray, gridStrokeDashArray = _12 === void 0 ? radarChartDefaults.gridSection
62
- .strokeDashArray : _12, _13 = gridConfig.fill, gridFill = _13 === void 0 ? radarChartDefaults.gridSection.fill : _13, _14 = gridConfig.gradientColor, gridGradientColor = _14 === void 0 ? radarChartDefaults.gridSection
63
- .gradientColor : _14, _15 = gridConfig.showGradient, gridShowGradient = _15 === void 0 ? radarChartDefaults.gridSection
64
- .showGradient : _15, _16 = gridConfig.opacity, gridOpacity = _16 === void 0 ? radarChartDefaults.gridSection.opacity : _16, _17 = gridConfig.gradientOpacity, gridGradientOpacity = _17 === void 0 ? radarChartDefaults.gridSection
65
- .gradientOpacity : _17;
61
+ var _11 = gridConfig.stroke, gridStroke = _11 === void 0 ? radarChartDefaults.gridSection.stroke : _11, _12 = gridConfig.strokeWidth, gridStrokeWidth = _12 === void 0 ? radarChartDefaults.gridSection.strokeWidth : _12, _13 = gridConfig.strokeDashArray, gridStrokeDashArray = _13 === void 0 ? radarChartDefaults.gridSection
62
+ .strokeDashArray : _13, _14 = gridConfig.fill, gridFill = _14 === void 0 ? radarChartDefaults.gridSection.fill : _14, _15 = gridConfig.gradientColor, gridGradientColor = _15 === void 0 ? radarChartDefaults.gridSection
63
+ .gradientColor : _15, _16 = gridConfig.showGradient, gridShowGradient = _16 === void 0 ? radarChartDefaults.gridSection
64
+ .showGradient : _16, _17 = gridConfig.opacity, gridOpacity = _17 === void 0 ? radarChartDefaults.gridSection.opacity : _17, _18 = gridConfig.gradientOpacity, gridGradientOpacity = _18 === void 0 ? radarChartDefaults.gridSection
65
+ .gradientOpacity : _18;
66
66
  var gridSections = (_j = (_h = gridConfig.gridSections) === null || _h === void 0 ? void 0 : _h.map(function (i) { return (__assign(__assign({}, radarChartDefaults.gridSection), i)); })) !== null && _j !== void 0 ? _j : Array(noOfSections).fill({});
67
- var _18 = labelConfig.fontSize, fontSize = _18 === void 0 ? radarChartDefaults.labelConfig.fontSize : _18, _19 = labelConfig.stroke, stroke = _19 === void 0 ? radarChartDefaults.labelConfig.stroke : _19, _20 = labelConfig.textAnchor, textAnchor = _20 === void 0 ? radarChartDefaults.labelConfig.textAnchor : _20, _21 = labelConfig.alignmentBaseline, alignmentBaseline = _21 === void 0 ? radarChartDefaults.labelConfig.alignmentBaseline : _21, _22 = labelConfig.fontWeight, fontWeight = _22 === void 0 ? radarChartDefaults.labelConfig.fontWeight : _22, _23 = labelConfig.fontFamily, fontFamily = _23 === void 0 ? radarChartDefaults.labelConfig.fontFamily : _23;
68
- var _24 = dataLabelsConfig.fontSize, dataLabelsFontSize = _24 === void 0 ? fontSize : _24, // defaults to labelConfig (from above)
69
- _25 = dataLabelsConfig.stroke, // defaults to labelConfig (from above)
70
- dataLabelsColor = _25 === void 0 ? stroke : _25, // defaults to labelConfig (from above)
71
- _26 = dataLabelsConfig.textAnchor, // defaults to labelConfig (from above)
72
- dataLabelsTextAnchor = _26 === void 0 ? textAnchor : _26, // defaults to labelConfig (from above)
73
- _27 = dataLabelsConfig.alignmentBaseline, // defaults to labelConfig (from above)
74
- dataLabelsAlignmentBaseline = _27 === void 0 ? alignmentBaseline : _27, // defaults to labelConfig (from above)
75
- _28 = dataLabelsConfig.fontWeight, // defaults to labelConfig (from above)
76
- dataLabelsFontWeight = _28 === void 0 ? fontWeight : _28, // defaults to labelConfig (from above)
77
- _29 = dataLabelsConfig.fontFamily // defaults to labelConfig (from above)
67
+ var _19 = labelConfig.fontSize, fontSize = _19 === void 0 ? radarChartDefaults.labelConfig.fontSize : _19, _20 = labelConfig.stroke, stroke = _20 === void 0 ? radarChartDefaults.labelConfig.stroke : _20, _21 = labelConfig.textAnchor, textAnchor = _21 === void 0 ? radarChartDefaults.labelConfig.textAnchor : _21, _22 = labelConfig.alignmentBaseline, alignmentBaseline = _22 === void 0 ? radarChartDefaults.labelConfig.alignmentBaseline : _22, _23 = labelConfig.fontWeight, fontWeight = _23 === void 0 ? radarChartDefaults.labelConfig.fontWeight : _23, _24 = labelConfig.fontFamily, fontFamily = _24 === void 0 ? radarChartDefaults.labelConfig.fontFamily : _24;
68
+ var _25 = dataLabelsConfig.fontSize, dataLabelsFontSize = _25 === void 0 ? fontSize : _25, // defaults to labelConfig (from above)
69
+ _26 = dataLabelsConfig.stroke, // defaults to labelConfig (from above)
70
+ dataLabelsColor = _26 === void 0 ? stroke : _26, // defaults to labelConfig (from above)
71
+ _27 = dataLabelsConfig.textAnchor, // defaults to labelConfig (from above)
72
+ dataLabelsTextAnchor = _27 === void 0 ? textAnchor : _27, // defaults to labelConfig (from above)
73
+ _28 = dataLabelsConfig.alignmentBaseline, // defaults to labelConfig (from above)
74
+ dataLabelsAlignmentBaseline = _28 === void 0 ? alignmentBaseline : _28, // defaults to labelConfig (from above)
75
+ _29 = dataLabelsConfig.fontWeight, // defaults to labelConfig (from above)
76
+ dataLabelsFontWeight = _29 === void 0 ? fontWeight : _29, // defaults to labelConfig (from above)
77
+ _30 = dataLabelsConfig.fontFamily // defaults to labelConfig (from above)
78
78
  , // defaults to labelConfig (from above)
79
- dataLabelsFontFamily = _29 === void 0 ? fontFamily : _29 // defaults to labelConfig (from above)
79
+ dataLabelsFontFamily = _30 === void 0 ? fontFamily : _30 // defaults to labelConfig (from above)
80
80
  ;
81
- var _30 = polygonConfig.stroke, polygonStroke = _30 === void 0 ? radarChartDefaults.polygonConfig.stroke : _30, _31 = polygonConfig.strokeWidth, polygonStrokeWidth = _31 === void 0 ? radarChartDefaults.polygonConfig
82
- .strokeWidth : _31, _32 = polygonConfig.strokeDashArray, polygonStrokeDashArray = _32 === void 0 ? radarChartDefaults.polygonConfig
83
- .strokeDashArray : _32, _33 = polygonConfig.fill, polygonFill = _33 === void 0 ? radarChartDefaults.polygonConfig.fill : _33, _34 = polygonConfig.gradientColor, polygonGradientColor = _34 === void 0 ? radarChartDefaults.polygonConfig
84
- .gradientColor : _34, _35 = polygonConfig.showGradient, polygonShowGradient = _35 === void 0 ? radarChartDefaults.polygonConfig
85
- .showGradient : _35, _36 = polygonConfig.opacity, polygonOpacity = _36 === void 0 ? radarChartDefaults.polygonConfig.opacity : _36, _37 = polygonConfig.gradientOpacity, polygonGradientOpacity = _37 === void 0 ? polygonOpacity : _37, showDataValuesAsLabels = polygonConfig.showDataValuesAsLabels, _38 = polygonConfig.isAnimated, polygonIsAnimated = _38 === void 0 ? isAnimated : _38, _39 = polygonConfig.animationDuration, polygonAnimationDuration = _39 === void 0 ? animationDuration : _39;
81
+ var _31 = polygonConfig.stroke, polygonStroke = _31 === void 0 ? radarChartDefaults.polygonConfig.stroke : _31, _32 = polygonConfig.strokeWidth, polygonStrokeWidth = _32 === void 0 ? radarChartDefaults.polygonConfig
82
+ .strokeWidth : _32, _33 = polygonConfig.strokeDashArray, polygonStrokeDashArray = _33 === void 0 ? radarChartDefaults.polygonConfig
83
+ .strokeDashArray : _33, _34 = polygonConfig.fill, polygonFill = _34 === void 0 ? radarChartDefaults.polygonConfig.fill : _34, _35 = polygonConfig.gradientColor, polygonGradientColor = _35 === void 0 ? radarChartDefaults.polygonConfig
84
+ .gradientColor : _35, _36 = polygonConfig.showGradient, polygonShowGradient = _36 === void 0 ? radarChartDefaults.polygonConfig
85
+ .showGradient : _36, _37 = polygonConfig.opacity, polygonOpacity = _37 === void 0 ? radarChartDefaults.polygonConfig.opacity : _37, _38 = polygonConfig.gradientOpacity, polygonGradientOpacity = _38 === void 0 ? polygonOpacity : _38, showDataValuesAsLabels = polygonConfig.showDataValuesAsLabels, _39 = polygonConfig.isAnimated, polygonIsAnimated = _39 === void 0 ? isAnimated : _39, _40 = polygonConfig.animationDuration, polygonAnimationDuration = _40 === void 0 ? animationDuration : _40;
86
86
  var polygonConfigArray = (_l = (_k = props.polygonConfigArray) === null || _k === void 0 ? void 0 : _k.map(function (set) {
87
87
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
88
88
  return ({
@@ -147,7 +147,7 @@ export var useRadarChart = function (props) {
147
147
  });
148
148
  });
149
149
  })) !== null && _r !== void 0 ? _r : (dataSet ? Array(dataSet.length).fill(dataLabelsConfigArray) : null);
150
- var _40 = asterLinesConfig.stroke, asterLinesStroke = _40 === void 0 ? gridStroke : _40, _41 = asterLinesConfig.strokeWidth, asterLinesStrokeWidth = _41 === void 0 ? gridStrokeWidth : _41, _42 = asterLinesConfig.strokeDashArray, asterLinesStrokeDashArray = _42 === void 0 ? radarChartDefaults.asterLineStrokeDashArray : _42;
150
+ var _41 = asterLinesConfig.stroke, asterLinesStroke = _41 === void 0 ? gridStroke : _41, _42 = asterLinesConfig.strokeWidth, asterLinesStrokeWidth = _42 === void 0 ? gridStrokeWidth : _42, _43 = asterLinesConfig.strokeDashArray, asterLinesStrokeDashArray = _43 === void 0 ? radarChartDefaults.asterLineStrokeDashArray : _43;
151
151
  // Calculate angles for each category
152
152
  var angleStep = 360 / labels.length;
153
153
  // Generate coordinates for the data points
@@ -276,6 +276,7 @@ export var useRadarChart = function (props) {
276
276
  angleStep: angleStep,
277
277
  circular: circular,
278
278
  hideGrid: hideGrid,
279
+ hideLabels: hideLabels,
279
280
  hideAsterLines: hideAsterLines,
280
281
  getGridLevelProps: getGridLevelProps,
281
282
  animateTogether: animateTogether
@@ -22,7 +22,6 @@ export interface RadarChartProps {
22
22
  labels?: string[];
23
23
  dataLabels?: string[];
24
24
  dataLabelsArray?: string[][];
25
- dataLabelConfig?: LabelConfig;
26
25
  dataLabelsConfigArray?: LabelConfig[];
27
26
  polygonConfig?: PolygonConfig;
28
27
  polygonConfigArray?: PolygonConfig[];
package/dist/index.d.ts CHANGED
@@ -5,13 +5,13 @@ export { useBarChart } from './BarChart';
5
5
  export { getPropsForAnimated2DWithGradient } from './BarChart/Animated2DWithGradient';
6
6
  export { useRenderStackBars } from './BarChart/RenderStackBars';
7
7
  export { useRenderBars } from './BarChart/RenderBars';
8
- export { type stackDataItem, type StackedBarChartPropsType, type BarChartPropsType, type defaultLineConfigType, type barDataItem, type barDataItemNullSafe, type Animated2DWithGradientPropsType, type RenderBarsPropsType, type trianglePropTypes, type animatedBarPropTypes, type FocusedBarConfig, type CommonPropsFor2dand3dBarsType } from './BarChart/types';
8
+ export { type stackDataItem, type StackedBarChartPropsType, type StackedBarChartPropsTypeForWeb, type BarChartPropsType, type defaultLineConfigType, type barDataItem, type barDataItemNullSafe, type Animated2DWithGradientPropsType, type RenderBarsPropsType, type trianglePropTypes, type animatedBarPropTypes, type FocusedBarConfig, type CommonPropsFor2dand3dBarsType } from './BarChart/types';
9
9
  /************************************************************************************************************************
10
10
  /***************************************** Line Chart *****************************************
11
11
  /************************************************************************************************************************/
12
12
  export { useLineChart } from './LineChart';
13
13
  export { useLineChartBiColor } from './LineChart/LineChartBiColor';
14
- export { type LineChartPropsType, type lineDataItem, type lineDataItemNullSafe, type bicolorLineDataItem, type LineChartBicolorPropsType } from './LineChart/types';
14
+ export { type LineChartPropsType, type LineChartPropsTypeForWeb, type lineDataItem, type lineDataItemNullSafe, type bicolorLineDataItem, type LineChartBicolorPropsType, type LineChartBicolorPropsTypeForWeb } from './LineChart/types';
15
15
  /***********************************************************************************************************************
16
16
  /***************************************** Pie Chart *****************************************
17
17
  /***********************************************************************************************************************/
@@ -119,6 +119,7 @@ export declare const BarDefaults: {
119
119
  focusedThreeDBarFrontColor: string;
120
120
  focusedBarSideColor: string;
121
121
  focusedBarTopColor: string;
122
+ renderTooltipConditions: string[];
122
123
  };
123
124
  export declare const LineDefaults: {
124
125
  color: string;
@@ -272,6 +273,7 @@ export declare const radarChartDefaults: {
272
273
  chartSize: number;
273
274
  hideAsterLines: boolean;
274
275
  hideGrid: boolean;
276
+ hideLabels: boolean;
275
277
  labelsPositionOffset: number;
276
278
  dataLabelsPositionOffset: number;
277
279
  gridSection: {
@@ -129,7 +129,8 @@ export var BarDefaults = {
129
129
  focusedBarFrontColor: 'lightgreen',
130
130
  focusedThreeDBarFrontColor: '#B0B929',
131
131
  focusedBarSideColor: '#776913',
132
- focusedBarTopColor: '#C8D565'
132
+ focusedBarTopColor: '#C8D565',
133
+ renderTooltipConditions: ['onClick', 'onHover']
133
134
  };
134
135
  // Line chart specific
135
136
  export var LineDefaults = {
@@ -325,6 +326,7 @@ export var radarChartDefaults = {
325
326
  chartSize: 300,
326
327
  hideAsterLines: false,
327
328
  hideGrid: false,
329
+ hideLabels: false,
328
330
  labelsPositionOffset: 5,
329
331
  dataLabelsPositionOffset: 5,
330
332
  gridSection: {
@@ -396,6 +396,13 @@ export interface Pointer {
396
396
  pointerEvents?: PointerEvents;
397
397
  stripBehindBars?: boolean;
398
398
  resetPointerOnDataChange?: boolean;
399
+ onTouchStart?: Function;
400
+ onTouchEnd?: Function;
401
+ onResponderGrant?: Function;
402
+ onResponderMove?: Function;
403
+ onResponderEnd?: Function;
404
+ onPointerEnter?: Function;
405
+ onPointerLeave?: Function;
399
406
  }
400
407
  export interface HighlightedRange {
401
408
  from: number;
@@ -458,6 +465,7 @@ export interface DataSet {
458
465
  isSecondary?: boolean;
459
466
  hidePointers?: boolean;
460
467
  spacing?: number;
468
+ renderTooltip?: Function;
461
469
  }
462
470
  export interface DataSetNullSafe extends DataSet {
463
471
  data: lineDataItemNullSafe[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gifted-charts-core",
3
- "version": "0.1.56",
3
+ "version": "0.1.57",
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": [