gifted-charts-core 0.1.34 → 0.1.36
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/dist/BarChart/RenderStackBars.js +10 -3
- package/dist/BarChart/index.d.ts +11 -3
- package/dist/BarChart/index.js +165 -111
- package/dist/BarChart/types.d.ts +33 -2
- package/dist/LineChart/LineChartBiColor.js +7 -7
- package/dist/LineChart/index.d.ts +1 -0
- package/dist/LineChart/index.js +321 -273
- package/dist/LineChart/types.d.ts +2 -0
- package/dist/components/BarAndLineChartsWrapper/getHorizSectionsVals.js +43 -43
- package/dist/components/BarAndLineChartsWrapper/index.js +12 -15
- package/dist/utils/index.d.ts +11 -2
- package/dist/utils/index.js +76 -32
- package/dist/utils/types.d.ts +5 -1
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
17
17
|
import { useState } from 'react';
|
|
18
18
|
export var useRenderStackBars = function (props) {
|
|
19
19
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
20
|
-
var item = props.item, index = props.index, containerHeight = props.containerHeight, 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;
|
|
20
|
+
var item = props.item, index = props.index, containerHeight = props.containerHeight, 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
21
|
var containsNegativeValue = item.stacks.some(function (item) { return item.value < 0; });
|
|
22
22
|
var noAnimation = containsNegativeValue || !isAnimated;
|
|
23
23
|
var localBarInnerComponent = (_a = item.barInnerComponent) !== null && _a !== void 0 ? _a : props.barInnerComponent;
|
|
@@ -29,13 +29,20 @@ export var useRenderStackBars = function (props) {
|
|
|
29
29
|
((_e = (_d = stackData[i].stacks[0].barWidth) !== null && _d !== void 0 ? _d : props.barWidth) !== null && _e !== void 0 ? _e : 30);
|
|
30
30
|
}
|
|
31
31
|
var disablePress = (_f = props.disablePress) !== null && _f !== void 0 ? _f : false;
|
|
32
|
+
var heightFactor = item.isSecondary
|
|
33
|
+
? secondaryStepHeight / secondaryStepValue
|
|
34
|
+
: stepHeight / stepValue;
|
|
35
|
+
var negativeHeightFactor = item.isSecondary
|
|
36
|
+
? secondaryNegativeStepHeight / secondaryNegativeStepValue
|
|
37
|
+
: negativeStepHeight / negativeStepValue;
|
|
32
38
|
var totalHeight = props.item.stacks.reduce(function (acc, stack) {
|
|
33
39
|
return acc +
|
|
34
|
-
|
|
40
|
+
Math.abs(stack.value) *
|
|
41
|
+
(stack.value < 0 ? negativeHeightFactor : heightFactor);
|
|
35
42
|
}, 0);
|
|
36
43
|
var _j = __read(useState(noAnimation ? totalHeight : 1), 2), height = _j[0], setHeight = _j[1];
|
|
37
44
|
var getBarHeight = function (value, marginBottom) {
|
|
38
|
-
return (
|
|
45
|
+
return (Math.abs(value) * (value < 0 ? negativeHeightFactor : heightFactor) -
|
|
39
46
|
(marginBottom !== null && marginBottom !== void 0 ? marginBottom : 0));
|
|
40
47
|
};
|
|
41
48
|
var getPosition = function (index) {
|
package/dist/BarChart/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type lineConfigType, type
|
|
1
|
+
import { type lineConfigType, type barDataItem, type stackDataItem, BarChartPropsTypeForWeb } from './types';
|
|
2
2
|
import { type BarAndLineChartsWrapperTypes, type secondaryYAxisType } from '../utils/types';
|
|
3
3
|
import { type Animated } from 'react-native';
|
|
4
|
-
export interface extendedBarChartPropsType extends
|
|
4
|
+
export interface extendedBarChartPropsType extends BarChartPropsTypeForWeb {
|
|
5
5
|
parentWidth: number;
|
|
6
6
|
heightValue?: Animated.Value;
|
|
7
7
|
widthValue?: Animated.Value;
|
|
@@ -87,7 +87,6 @@ export declare const useBarChart: (props: extendedBarChartPropsType) => {
|
|
|
87
87
|
appearingOpacity: Animated.AnimatedInterpolation<string | number> | undefined;
|
|
88
88
|
autoShiftLabels: boolean;
|
|
89
89
|
yAxisAtTop: boolean;
|
|
90
|
-
secondaryData: import("..").lineDataItem[] | barDataItem[] | undefined;
|
|
91
90
|
disableScroll: boolean;
|
|
92
91
|
showScrollIndicator: boolean;
|
|
93
92
|
scrollToEnd: boolean;
|
|
@@ -156,6 +155,9 @@ export declare const useBarChart: (props: extendedBarChartPropsType) => {
|
|
|
156
155
|
onPress: Function | undefined;
|
|
157
156
|
onLongPress: Function | undefined;
|
|
158
157
|
onPressOut: Function | undefined;
|
|
158
|
+
onContextMenu: Function | undefined;
|
|
159
|
+
onMouseEnter: Function | undefined;
|
|
160
|
+
onMouseLeave: Function | undefined;
|
|
159
161
|
focusBarOnPress: boolean | undefined;
|
|
160
162
|
focusedBarConfig: import("./types").FocusedBarConfig | undefined;
|
|
161
163
|
xAxisTextNumberOfLines: number;
|
|
@@ -183,6 +185,12 @@ export declare const useBarChart: (props: extendedBarChartPropsType) => {
|
|
|
183
185
|
negativeStepHeight: number;
|
|
184
186
|
negativeStepValue: number;
|
|
185
187
|
secondaryXAxis: import("../utils/types").XAxisConfig | undefined;
|
|
188
|
+
secondaryYAxis: boolean | secondaryYAxisType | undefined;
|
|
189
|
+
secondaryStepHeight: number;
|
|
190
|
+
secondaryStepValue: number;
|
|
191
|
+
secondaryNegativeStepHeight: number;
|
|
192
|
+
secondaryNegativeStepValue: number;
|
|
193
|
+
secondaryNoOfSectionsBelowXAxis: number;
|
|
186
194
|
};
|
|
187
195
|
barAndLineChartsWrapperProps: BarAndLineChartsWrapperTypes;
|
|
188
196
|
yAxisExtraHeightAtTop: number;
|
package/dist/BarChart/index.js
CHANGED
|
@@ -26,15 +26,15 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
26
26
|
return ar;
|
|
27
27
|
};
|
|
28
28
|
import { useEffect, useMemo, useState } from 'react';
|
|
29
|
-
import { getArrowPoints, getAxesAndRulesProps, getExtendedContainerHeightWithPadding, getLineConfigForBarChart, getMaxValue, getMostNegativeValue, getNoOfSections,
|
|
29
|
+
import { getArrowPoints, getAxesAndRulesProps, getExtendedContainerHeightWithPadding, getLineConfigForBarChart, getMaxValue, getMostNegativeValue, getNoOfSections, getXForLineInBar, getYForLineInBar, indexOfFirstNonZeroDigit, maxAndMinUtil, svgPath } from '../utils';
|
|
30
30
|
import { AxesAndRulesDefaults, BarDefaults, chartTypes, defaultLineConfig, defaultPointerConfig } from '../utils/constants';
|
|
31
31
|
export var useBarChart = function (props) {
|
|
32
|
-
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;
|
|
32
|
+
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;
|
|
33
33
|
var heightValue = props.heightValue, widthValue = props.widthValue, opacityValue = props.opacityValue, yAxisOffset = props.yAxisOffset, adjustToWidth = props.adjustToWidth, parentWidth = props.parentWidth, labelsDistanceFromXaxis = props.labelsDistanceFromXaxis, autoShiftLabelsForNegativeStacks = props.autoShiftLabelsForNegativeStacks, focusedBarIndex = props.focusedBarIndex, negativeStepValue = props.negativeStepValue, autoCenterTooltip = props.autoCenterTooltip;
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
34
|
+
var _55 = __read(useState(''), 2), points = _55[0], setPoints = _55[1];
|
|
35
|
+
var _56 = __read(useState(''), 2), points2 = _56[0], setPoints2 = _56[1];
|
|
36
|
+
var _57 = __read(useState(''), 2), arrowPoints = _57[0], setArrowPoints = _57[1];
|
|
37
|
+
var _58 = __read(useState(focusedBarIndex !== null && focusedBarIndex !== void 0 ? focusedBarIndex : -1), 2), selectedIndex = _58[0], setSelectedIndex = _58[1];
|
|
38
38
|
var showLine = (_a = props.showLine) !== null && _a !== void 0 ? _a : BarDefaults.showLine;
|
|
39
39
|
useEffect(function () {
|
|
40
40
|
setSelectedIndex(focusedBarIndex !== null && focusedBarIndex !== void 0 ? focusedBarIndex : -1);
|
|
@@ -66,16 +66,18 @@ export var useBarChart = function (props) {
|
|
|
66
66
|
var spacing = (_d = props.spacing) !== null && _d !== void 0 ? _d : (adjustToWidth ? autoComputedSpacing : BarDefaults.spacing);
|
|
67
67
|
var initialSpacing = (_e = props.initialSpacing) !== null && _e !== void 0 ? _e : spacing;
|
|
68
68
|
var endSpacing = (_f = props.endSpacing) !== null && _f !== void 0 ? _f : spacing;
|
|
69
|
-
var
|
|
70
|
-
var
|
|
71
|
-
var
|
|
72
|
-
var
|
|
73
|
-
var intactTopLabel = (_l = props.intactTopLabel) !== null && _l !== void 0 ? _l : BarDefaults.intactTopLabel;
|
|
69
|
+
var horizontal = (_g = props.horizontal) !== null && _g !== void 0 ? _g : BarDefaults.horizontal;
|
|
70
|
+
var rtl = (_h = props.rtl) !== null && _h !== void 0 ? _h : BarDefaults.rtl;
|
|
71
|
+
var yAxisAtTop = (_j = props.yAxisAtTop) !== null && _j !== void 0 ? _j : BarDefaults.yAxisAtTop;
|
|
72
|
+
var intactTopLabel = (_k = props.intactTopLabel) !== null && _k !== void 0 ? _k : BarDefaults.intactTopLabel;
|
|
74
73
|
var heightFromProps = horizontal ? props.width : props.height;
|
|
75
74
|
var widthFromProps = horizontal ? props.height : props.width;
|
|
76
|
-
var isAnimated = (
|
|
77
|
-
var animationDuration = (
|
|
78
|
-
|
|
75
|
+
var isAnimated = (_l = props.isAnimated) !== null && _l !== void 0 ? _l : BarDefaults.isAnimated;
|
|
76
|
+
var animationDuration = (_m = props.animationDuration) !== null && _m !== void 0 ? _m : BarDefaults.animationDuration;
|
|
77
|
+
// const secondaryData = getSecondaryDataWithOffsetIncluded(
|
|
78
|
+
// props.secondaryData,
|
|
79
|
+
// props.secondaryYAxis
|
|
80
|
+
// )
|
|
79
81
|
var lineData = useMemo(function () {
|
|
80
82
|
var _a;
|
|
81
83
|
if (!props.lineData) {
|
|
@@ -90,7 +92,7 @@ export var useBarChart = function (props) {
|
|
|
90
92
|
return props.lineData;
|
|
91
93
|
}, [yAxisOffset, props.lineData, data, props.stackData]);
|
|
92
94
|
var lineData2 = props.lineData2;
|
|
93
|
-
var lineBehindBars = (
|
|
95
|
+
var lineBehindBars = (_o = props.lineBehindBars) !== null && _o !== void 0 ? _o : BarDefaults.lineBehindBars;
|
|
94
96
|
defaultLineConfig.initialSpacing = initialSpacing;
|
|
95
97
|
defaultLineConfig.endIndex = lineData.length - 1;
|
|
96
98
|
defaultLineConfig.animationDuration = animationDuration;
|
|
@@ -105,25 +107,53 @@ export var useBarChart = function (props) {
|
|
|
105
107
|
? props.stepHeight * noOfSections
|
|
106
108
|
: AxesAndRulesDefaults.containerHeight);
|
|
107
109
|
var horizSections = [{ value: '0' }];
|
|
108
|
-
var stepHeight = (
|
|
109
|
-
var labelWidth = (
|
|
110
|
-
var scrollToEnd = (
|
|
111
|
-
var scrollAnimation = (
|
|
112
|
-
var scrollEventThrottle = (
|
|
113
|
-
var labelsExtraHeight = (
|
|
110
|
+
var stepHeight = (_p = props.stepHeight) !== null && _p !== void 0 ? _p : containerHeight / noOfSections;
|
|
111
|
+
var labelWidth = (_q = props.labelWidth) !== null && _q !== void 0 ? _q : AxesAndRulesDefaults.labelWidth;
|
|
112
|
+
var scrollToEnd = (_r = props.scrollToEnd) !== null && _r !== void 0 ? _r : BarDefaults.scrollToEnd;
|
|
113
|
+
var scrollAnimation = (_s = props.scrollAnimation) !== null && _s !== void 0 ? _s : BarDefaults.scrollAnimation;
|
|
114
|
+
var scrollEventThrottle = (_t = props.scrollEventThrottle) !== null && _t !== void 0 ? _t : BarDefaults.scrollEventThrottle;
|
|
115
|
+
var labelsExtraHeight = (_u = props.labelsExtraHeight) !== null && _u !== void 0 ? _u : AxesAndRulesDefaults.labelsExtraHeight;
|
|
116
|
+
var secondaryMaxItem = 0;
|
|
117
|
+
var secondaryMinItem = 0;
|
|
118
|
+
if (lineConfig.isSecondary) {
|
|
119
|
+
lineData.forEach(function (item) {
|
|
120
|
+
var _a, _b, _c, _d;
|
|
121
|
+
if (((_a = item.value) !== null && _a !== void 0 ? _a : 0) > secondaryMaxItem) {
|
|
122
|
+
secondaryMaxItem = (_b = item.value) !== null && _b !== void 0 ? _b : 0;
|
|
123
|
+
}
|
|
124
|
+
if (((_c = item.value) !== null && _c !== void 0 ? _c : 0) < secondaryMinItem) {
|
|
125
|
+
secondaryMinItem = (_d = item.value) !== null && _d !== void 0 ? _d : 0;
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
114
129
|
var totalWidth = initialSpacing + endSpacing;
|
|
115
130
|
var maxItem = 0;
|
|
116
131
|
var minItem = 0;
|
|
132
|
+
var minPositiveItem = 0;
|
|
133
|
+
var secondaryMinPositiveItem = 0;
|
|
117
134
|
if (props.stackData) {
|
|
118
135
|
props.stackData.forEach(function (stackItem, index) {
|
|
119
136
|
var _a, _b, _c;
|
|
120
137
|
var stackSumMax = stackItem.stacks.reduce(function (acc, stack) { return acc + (stack.value >= 0 ? stack.value : 0); }, 0);
|
|
121
138
|
var stackSumMin = stackItem.stacks.reduce(function (acc, stack) { return acc + (stack.value < 0 ? stack.value : 0); }, 0);
|
|
122
|
-
if (
|
|
123
|
-
|
|
139
|
+
if (stackItem.isSecondary) {
|
|
140
|
+
if (stackSumMax > secondaryMaxItem) {
|
|
141
|
+
secondaryMaxItem = stackSumMax;
|
|
142
|
+
}
|
|
143
|
+
if (stackSumMin < secondaryMinItem) {
|
|
144
|
+
secondaryMinItem = stackSumMin;
|
|
145
|
+
secondaryMinPositiveItem =
|
|
146
|
+
secondaryMinItem > 0 ? secondaryMinItem : secondaryMinPositiveItem;
|
|
147
|
+
}
|
|
124
148
|
}
|
|
125
|
-
|
|
126
|
-
|
|
149
|
+
else {
|
|
150
|
+
if (stackSumMax > maxItem) {
|
|
151
|
+
maxItem = stackSumMax;
|
|
152
|
+
}
|
|
153
|
+
if (stackSumMin < minItem) {
|
|
154
|
+
minItem = stackSumMin;
|
|
155
|
+
minPositiveItem = minItem > 0 ? minItem : minPositiveItem;
|
|
156
|
+
}
|
|
127
157
|
}
|
|
128
158
|
totalWidth +=
|
|
129
159
|
((_b = (_a = stackItem.stacks[0].barWidth) !== null && _a !== void 0 ? _a : props.barWidth) !== null && _b !== void 0 ? _b : defaultBarWidth) +
|
|
@@ -133,104 +163,119 @@ export var useBarChart = function (props) {
|
|
|
133
163
|
else {
|
|
134
164
|
data.forEach(function (item, index) {
|
|
135
165
|
var _a, _b, _c;
|
|
136
|
-
if (item.
|
|
137
|
-
|
|
166
|
+
if (item.isSecondary) {
|
|
167
|
+
if (item.value > secondaryMaxItem) {
|
|
168
|
+
secondaryMaxItem = item.value;
|
|
169
|
+
}
|
|
170
|
+
if (item.value < secondaryMinItem) {
|
|
171
|
+
secondaryMinItem = item.value;
|
|
172
|
+
secondaryMinPositiveItem =
|
|
173
|
+
secondaryMinItem > 0 ? secondaryMinItem : secondaryMinPositiveItem;
|
|
174
|
+
}
|
|
138
175
|
}
|
|
139
|
-
|
|
140
|
-
|
|
176
|
+
else {
|
|
177
|
+
if (item.value > maxItem) {
|
|
178
|
+
maxItem = item.value;
|
|
179
|
+
}
|
|
180
|
+
if (item.value < minItem) {
|
|
181
|
+
minItem = item.value;
|
|
182
|
+
minPositiveItem = minItem > 0 ? minItem : minPositiveItem;
|
|
183
|
+
}
|
|
141
184
|
}
|
|
142
185
|
totalWidth +=
|
|
143
186
|
((_b = (_a = item.barWidth) !== null && _a !== void 0 ? _a : props.barWidth) !== null && _b !== void 0 ? _b : defaultBarWidth) +
|
|
144
187
|
(index === data.length - 1 ? spacing : (_c = item.spacing) !== null && _c !== void 0 ? _c : spacing);
|
|
145
188
|
});
|
|
146
189
|
}
|
|
147
|
-
var
|
|
148
|
-
var
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
var _a, _b, _c, _d;
|
|
152
|
-
if (((_a = item.value) !== null && _a !== void 0 ? _a : 0) > secondaryMaxItem) {
|
|
153
|
-
secondaryMaxItem = (_b = item.value) !== null && _b !== void 0 ? _b : 0;
|
|
154
|
-
}
|
|
155
|
-
if (((_c = item.value) !== null && _c !== void 0 ? _c : 0) < secondaryMinItem) {
|
|
156
|
-
secondaryMinItem = (_d = item.value) !== null && _d !== void 0 ? _d : 0;
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
var maxAndMin = maxAndMinUtil(maxItem, minItem, props.roundToDigits, props.showFractionalValues);
|
|
161
|
-
var secondaryMaxAndMin = maxAndMinUtil(secondaryMaxItem, secondaryMinItem, props.roundToDigits, props.showFractionalValues);
|
|
190
|
+
var valuesRange = maxItem - minPositiveItem; // Diff bw largest & smallest +ve values
|
|
191
|
+
var showFractionalValues = (_v = props.showFractionalValues) !== null && _v !== void 0 ? _v : valuesRange <= 1;
|
|
192
|
+
var roundToDigits = (_w = props.roundToDigits) !== null && _w !== void 0 ? _w : (showFractionalValues ? indexOfFirstNonZeroDigit(valuesRange) + 1 : 0);
|
|
193
|
+
var maxAndMin = maxAndMinUtil(maxItem, minItem, roundToDigits, showFractionalValues);
|
|
162
194
|
var maxValue = getMaxValue(props.maxValue, props.stepValue, noOfSections, maxAndMin.maxItem);
|
|
163
|
-
var
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
:
|
|
195
|
+
var secondaryRange = secondaryMaxItem - secondaryMinPositiveItem; // Diff bw largest & smallest +ve values
|
|
196
|
+
var showSecondaryFractionalValues = (_y = (_x = props.secondaryYAxis) === null || _x === void 0 ? void 0 : _x.showFractionalValues) !== null && _y !== void 0 ? _y : secondaryRange <= 1;
|
|
197
|
+
var secondaryRoundToDigits = (_0 = (_z = props.secondaryYAxis) === null || _z === void 0 ? void 0 : _z.roundToDigits) !== null && _0 !== void 0 ? _0 : (showSecondaryFractionalValues
|
|
198
|
+
? indexOfFirstNonZeroDigit(secondaryRange) + 1
|
|
199
|
+
: 0);
|
|
200
|
+
var secondaryMaxAndMin = maxAndMinUtil(secondaryMaxItem, secondaryMinItem, secondaryRoundToDigits, showSecondaryFractionalValues);
|
|
201
|
+
// const secondaryMaxValue = lineConfig.isSecondary
|
|
202
|
+
// ? typeof props.secondaryYAxis !== 'boolean'
|
|
203
|
+
// ? (props.secondaryYAxis as secondaryYAxisType).maxValue ??
|
|
204
|
+
// secondaryMaxAndMin.maxItem
|
|
205
|
+
// : secondaryMaxAndMin.maxItem
|
|
206
|
+
// : maxValue
|
|
207
|
+
var secondaryMaxValue = (_2 = (_1 = props.secondaryYAxis) === null || _1 === void 0 ? void 0 : _1.maxValue) !== null && _2 !== void 0 ? _2 : secondaryMaxAndMin.maxItem;
|
|
168
208
|
var mostNegativeValue = getMostNegativeValue(props.mostNegativeValue, props.negativeStepValue, props.noOfSectionsBelowXAxis, maxAndMin.minItem);
|
|
169
|
-
var stepValue = (
|
|
170
|
-
var noOfSectionsBelowXAxis = (
|
|
171
|
-
var showScrollIndicator = (
|
|
172
|
-
var side = (
|
|
173
|
-
var rotateLabel = (
|
|
174
|
-
var opacity = (
|
|
175
|
-
var isThreeD = (
|
|
176
|
-
var showXAxisIndices = (
|
|
177
|
-
var xAxisIndicesHeight = (
|
|
178
|
-
var xAxisIndicesWidth = (
|
|
179
|
-
var xAxisIndicesColor = (
|
|
180
|
-
var xAxisThickness = (
|
|
181
|
-
var xAxisTextNumberOfLines = (
|
|
182
|
-
var xAxisLabelsVerticalShift = (
|
|
209
|
+
var stepValue = (_3 = props.stepValue) !== null && _3 !== void 0 ? _3 : maxValue / noOfSections;
|
|
210
|
+
var noOfSectionsBelowXAxis = (_4 = props.noOfSectionsBelowXAxis) !== null && _4 !== void 0 ? _4 : Math.round(Math.ceil(-mostNegativeValue / (negativeStepValue !== null && negativeStepValue !== void 0 ? negativeStepValue : stepValue)));
|
|
211
|
+
var showScrollIndicator = (_5 = props.showScrollIndicator) !== null && _5 !== void 0 ? _5 : BarDefaults.showScrollIndicator;
|
|
212
|
+
var side = (_6 = props.side) !== null && _6 !== void 0 ? _6 : BarDefaults.side;
|
|
213
|
+
var rotateLabel = (_7 = props.rotateLabel) !== null && _7 !== void 0 ? _7 : AxesAndRulesDefaults.rotateLabel;
|
|
214
|
+
var opacity = (_8 = props.opacity) !== null && _8 !== void 0 ? _8 : BarDefaults.opacity;
|
|
215
|
+
var isThreeD = (_9 = props.isThreeD) !== null && _9 !== void 0 ? _9 : BarDefaults.isThreeD;
|
|
216
|
+
var showXAxisIndices = (_10 = props.showXAxisIndices) !== null && _10 !== void 0 ? _10 : AxesAndRulesDefaults.showXAxisIndices;
|
|
217
|
+
var xAxisIndicesHeight = (_11 = props.xAxisIndicesHeight) !== null && _11 !== void 0 ? _11 : AxesAndRulesDefaults.xAxisIndicesHeight;
|
|
218
|
+
var xAxisIndicesWidth = (_12 = props.xAxisIndicesWidth) !== null && _12 !== void 0 ? _12 : AxesAndRulesDefaults.xAxisIndicesWidth;
|
|
219
|
+
var xAxisIndicesColor = (_13 = props.xAxisIndicesColor) !== null && _13 !== void 0 ? _13 : AxesAndRulesDefaults.xAxisIndicesColor;
|
|
220
|
+
var xAxisThickness = (_14 = props.xAxisThickness) !== null && _14 !== void 0 ? _14 : AxesAndRulesDefaults.xAxisThickness;
|
|
221
|
+
var xAxisTextNumberOfLines = (_15 = props.xAxisTextNumberOfLines) !== null && _15 !== void 0 ? _15 : AxesAndRulesDefaults.xAxisTextNumberOfLines;
|
|
222
|
+
var xAxisLabelsVerticalShift = (_16 = props.xAxisLabelsVerticalShift) !== null && _16 !== void 0 ? _16 : AxesAndRulesDefaults.xAxisLabelsVerticalShift;
|
|
183
223
|
var horizontalRulesStyle = props.horizontalRulesStyle;
|
|
184
|
-
var autoShiftLabels = (
|
|
185
|
-
var barBorderColor = (
|
|
224
|
+
var autoShiftLabels = (_17 = props.autoShiftLabels) !== null && _17 !== void 0 ? _17 : false;
|
|
225
|
+
var barBorderColor = (_18 = props.barBorderColor) !== null && _18 !== void 0 ? _18 : BarDefaults.barBorderColor;
|
|
186
226
|
var extendedContainerHeight = getExtendedContainerHeightWithPadding(containerHeight, 0);
|
|
187
|
-
var
|
|
188
|
-
var
|
|
189
|
-
var
|
|
190
|
-
var
|
|
191
|
-
var
|
|
192
|
-
|
|
193
|
-
var
|
|
227
|
+
var axesAndRulesProps = getAxesAndRulesProps(props, containerHeight, stepHeight, stepValue, noOfSections, roundToDigits, negativeStepValue !== null && negativeStepValue !== void 0 ? negativeStepValue : stepValue, secondaryMaxValue, secondaryMinItem, showSecondaryFractionalValues, secondaryRoundToDigits);
|
|
228
|
+
var _59 = axesAndRulesProps.secondaryYAxisConfig, secondaryStepHeight = _59.stepHeight, secondaryStepValue = _59.stepValue, secondaryNegativeStepHeight = _59.negativeStepHeight, secondaryNegativeStepValue = _59.negativeStepValue, secondaryNoOfSectionsBelowXAxis = _59.noOfSectionsBelowXAxis;
|
|
229
|
+
var primary4thQuadrantHeight = noOfSectionsBelowXAxis * ((_19 = props.negativeStepHeight) !== null && _19 !== void 0 ? _19 : stepHeight);
|
|
230
|
+
var secondary4thQuadrantHeight = secondaryNoOfSectionsBelowXAxis * secondaryNegativeStepHeight;
|
|
231
|
+
var containerHeightIncludingBelowXAxis = extendedContainerHeight +
|
|
232
|
+
Math.max(primary4thQuadrantHeight, secondary4thQuadrantHeight);
|
|
233
|
+
var _60 = __read(useState(-1), 2), pointerIndex = _60[0], setPointerIndex = _60[1];
|
|
234
|
+
var _61 = __read(useState(0), 2), pointerX = _61[0], setPointerX = _61[1];
|
|
235
|
+
var _62 = __read(useState(0), 2), pointerY = _62[0], setPointerY = _62[1];
|
|
236
|
+
var _63 = __read(useState(), 2), pointerItem = _63[0], setPointerItem = _63[1];
|
|
237
|
+
var _64 = __read(useState(0), 2), responderStartTime = _64[0], setResponderStartTime = _64[1];
|
|
238
|
+
var _65 = __read(useState(false), 2), responderActive = _65[0], setResponderActive = _65[1];
|
|
194
239
|
var pointerConfig = props.pointerConfig;
|
|
195
|
-
var getPointerProps = (
|
|
196
|
-
var pointerHeight = (
|
|
197
|
-
var pointerWidth = (
|
|
198
|
-
var pointerRadius = (
|
|
199
|
-
var pointerColor = (
|
|
200
|
-
var pointerComponent = (
|
|
240
|
+
var getPointerProps = (_20 = props.getPointerProps) !== null && _20 !== void 0 ? _20 : null;
|
|
241
|
+
var pointerHeight = (_21 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.height) !== null && _21 !== void 0 ? _21 : defaultPointerConfig.height;
|
|
242
|
+
var pointerWidth = (_22 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.width) !== null && _22 !== void 0 ? _22 : defaultPointerConfig.width;
|
|
243
|
+
var pointerRadius = (_23 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.radius) !== null && _23 !== void 0 ? _23 : defaultPointerConfig.radius;
|
|
244
|
+
var pointerColor = (_24 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerColor) !== null && _24 !== void 0 ? _24 : defaultPointerConfig.pointerColor;
|
|
245
|
+
var pointerComponent = (_25 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerComponent) !== null && _25 !== void 0 ? _25 : defaultPointerConfig.pointerComponent;
|
|
201
246
|
var showPointerStrip = (pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.showPointerStrip) === false
|
|
202
247
|
? false
|
|
203
248
|
: defaultPointerConfig.showPointerStrip;
|
|
204
|
-
var pointerStripHeight = (
|
|
205
|
-
var pointerStripWidth = (
|
|
206
|
-
var pointerStripColor = (
|
|
207
|
-
var pointerStripUptoDataPoint = (
|
|
208
|
-
var pointerLabelComponent = (
|
|
209
|
-
var stripOverPointer = (
|
|
210
|
-
var shiftPointerLabelX = (
|
|
211
|
-
var shiftPointerLabelY = (
|
|
212
|
-
var pointerLabelWidth = (
|
|
213
|
-
var pointerLabelHeight = (
|
|
214
|
-
var autoAdjustPointerLabelPosition = (
|
|
215
|
-
var pointerVanishDelay = (
|
|
216
|
-
var activatePointersOnLongPress = (
|
|
217
|
-
var activatePointersDelay = (
|
|
218
|
-
var initialPointerIndex = (
|
|
219
|
-
var initialPointerAppearDelay = (
|
|
249
|
+
var pointerStripHeight = (_26 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripHeight) !== null && _26 !== void 0 ? _26 : defaultPointerConfig.pointerStripHeight;
|
|
250
|
+
var pointerStripWidth = (_27 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripWidth) !== null && _27 !== void 0 ? _27 : defaultPointerConfig.pointerStripWidth;
|
|
251
|
+
var pointerStripColor = (_28 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripColor) !== null && _28 !== void 0 ? _28 : defaultPointerConfig.pointerStripColor;
|
|
252
|
+
var pointerStripUptoDataPoint = (_29 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripUptoDataPoint) !== null && _29 !== void 0 ? _29 : defaultPointerConfig.pointerStripUptoDataPoint;
|
|
253
|
+
var pointerLabelComponent = (_30 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelComponent) !== null && _30 !== void 0 ? _30 : defaultPointerConfig.pointerLabelComponent;
|
|
254
|
+
var stripOverPointer = (_31 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.stripOverPointer) !== null && _31 !== void 0 ? _31 : defaultPointerConfig.stripOverPointer;
|
|
255
|
+
var shiftPointerLabelX = (_32 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.shiftPointerLabelX) !== null && _32 !== void 0 ? _32 : defaultPointerConfig.shiftPointerLabelX;
|
|
256
|
+
var shiftPointerLabelY = (_33 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.shiftPointerLabelY) !== null && _33 !== void 0 ? _33 : defaultPointerConfig.shiftPointerLabelY;
|
|
257
|
+
var pointerLabelWidth = (_34 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelWidth) !== null && _34 !== void 0 ? _34 : defaultPointerConfig.pointerLabelWidth;
|
|
258
|
+
var pointerLabelHeight = (_35 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelHeight) !== null && _35 !== void 0 ? _35 : defaultPointerConfig.pointerLabelHeight;
|
|
259
|
+
var autoAdjustPointerLabelPosition = (_36 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.autoAdjustPointerLabelPosition) !== null && _36 !== void 0 ? _36 : defaultPointerConfig.autoAdjustPointerLabelPosition;
|
|
260
|
+
var pointerVanishDelay = (_37 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerVanishDelay) !== null && _37 !== void 0 ? _37 : defaultPointerConfig.pointerVanishDelay;
|
|
261
|
+
var activatePointersOnLongPress = (_38 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersOnLongPress) !== null && _38 !== void 0 ? _38 : defaultPointerConfig.activatePointersOnLongPress;
|
|
262
|
+
var activatePointersDelay = (_39 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersDelay) !== null && _39 !== void 0 ? _39 : defaultPointerConfig.activatePointersDelay;
|
|
263
|
+
var initialPointerIndex = (_40 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.initialPointerIndex) !== null && _40 !== void 0 ? _40 : defaultPointerConfig.initialPointerIndex;
|
|
264
|
+
var initialPointerAppearDelay = (_41 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.initialPointerAppearDelay) !== null && _41 !== void 0 ? _41 : (isAnimated
|
|
220
265
|
? animationDuration
|
|
221
266
|
: defaultPointerConfig.initialPointerAppearDelay);
|
|
222
|
-
var persistPointer = (
|
|
223
|
-
var hidePointer1 = (
|
|
267
|
+
var persistPointer = (_42 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.persistPointer) !== null && _42 !== void 0 ? _42 : defaultPointerConfig.persistPointer;
|
|
268
|
+
var hidePointer1 = (_43 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer1) !== null && _43 !== void 0 ? _43 : defaultPointerConfig.hidePointer1;
|
|
224
269
|
var pointerEvents = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerEvents;
|
|
225
|
-
var stripBehindBars = (
|
|
226
|
-
var disableScroll = (
|
|
270
|
+
var stripBehindBars = (_44 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.stripBehindBars) !== null && _44 !== void 0 ? _44 : defaultPointerConfig.stripBehindBars;
|
|
271
|
+
var disableScroll = (_45 = props.disableScroll) !== null && _45 !== void 0 ? _45 : (pointerConfig
|
|
227
272
|
? activatePointersOnLongPress
|
|
228
273
|
? !!responderActive
|
|
229
274
|
: true
|
|
230
275
|
: false);
|
|
231
276
|
var yAxisExtraHeightAtTop = props.trimYAxisAtTop
|
|
232
277
|
? 0
|
|
233
|
-
: (
|
|
278
|
+
: (_46 = props.yAxisExtraHeight) !== null && _46 !== void 0 ? _46 : containerHeight / 20;
|
|
234
279
|
var barInnerComponent = props.barInnerComponent;
|
|
235
280
|
useEffect(function () {
|
|
236
281
|
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;
|
|
@@ -346,9 +391,9 @@ export var useBarChart = function (props) {
|
|
|
346
391
|
spacing,
|
|
347
392
|
yAxisLabelWidth,
|
|
348
393
|
lineConfig.showArrow,
|
|
349
|
-
(
|
|
350
|
-
(
|
|
351
|
-
(
|
|
394
|
+
(_47 = lineConfig.arrowConfig) === null || _47 === void 0 ? void 0 : _47.length,
|
|
395
|
+
(_48 = lineConfig.arrowConfig) === null || _48 === void 0 ? void 0 : _48.width,
|
|
396
|
+
(_49 = lineConfig.arrowConfig) === null || _49 === void 0 ? void 0 : _49.showArrowBase
|
|
352
397
|
]);
|
|
353
398
|
useEffect(function () {
|
|
354
399
|
var _a, _b, _c, _d;
|
|
@@ -434,6 +479,9 @@ export var useBarChart = function (props) {
|
|
|
434
479
|
onPress: props.onPress,
|
|
435
480
|
onLongPress: props.onLongPress,
|
|
436
481
|
onPressOut: props.onPressOut,
|
|
482
|
+
onContextMenu: props.onContextMenu,
|
|
483
|
+
onMouseEnter: props.onMouseEnter,
|
|
484
|
+
onMouseLeave: props.onMouseLeave,
|
|
437
485
|
focusBarOnPress: props.focusBarOnPress,
|
|
438
486
|
focusedBarConfig: props.focusedBarConfig,
|
|
439
487
|
xAxisTextNumberOfLines: xAxisTextNumberOfLines,
|
|
@@ -460,7 +508,13 @@ export var useBarChart = function (props) {
|
|
|
460
508
|
stepValue: stepValue,
|
|
461
509
|
negativeStepHeight: (_u = props.negativeStepHeight) !== null && _u !== void 0 ? _u : stepHeight,
|
|
462
510
|
negativeStepValue: (_v = props.negativeStepValue) !== null && _v !== void 0 ? _v : stepValue,
|
|
463
|
-
secondaryXAxis: props.secondaryXAxis
|
|
511
|
+
secondaryXAxis: props.secondaryXAxis,
|
|
512
|
+
secondaryYAxis: props.secondaryYAxis,
|
|
513
|
+
secondaryStepHeight: secondaryStepHeight,
|
|
514
|
+
secondaryStepValue: secondaryStepValue,
|
|
515
|
+
secondaryNegativeStepHeight: secondaryNegativeStepHeight,
|
|
516
|
+
secondaryNegativeStepValue: secondaryNegativeStepValue,
|
|
517
|
+
secondaryNoOfSectionsBelowXAxis: secondaryNoOfSectionsBelowXAxis
|
|
464
518
|
};
|
|
465
519
|
};
|
|
466
520
|
var barAndLineChartsWrapperProps = {
|
|
@@ -468,19 +522,19 @@ export var useBarChart = function (props) {
|
|
|
468
522
|
containerHeight: containerHeight,
|
|
469
523
|
noOfSectionsBelowXAxis: noOfSectionsBelowXAxis,
|
|
470
524
|
stepHeight: stepHeight,
|
|
471
|
-
negativeStepHeight: (
|
|
525
|
+
negativeStepHeight: (_50 = props.negativeStepHeight) !== null && _50 !== void 0 ? _50 : stepHeight,
|
|
472
526
|
labelsExtraHeight: labelsExtraHeight,
|
|
473
527
|
yAxisLabelWidth: yAxisLabelWidth,
|
|
474
528
|
horizontal: horizontal,
|
|
475
529
|
rtl: rtl,
|
|
476
|
-
shiftX: (
|
|
477
|
-
shiftY: (
|
|
530
|
+
shiftX: (_51 = props.shiftX) !== null && _51 !== void 0 ? _51 : 0,
|
|
531
|
+
shiftY: (_52 = props.shiftY) !== null && _52 !== void 0 ? _52 : 0,
|
|
478
532
|
yAxisAtTop: yAxisAtTop,
|
|
479
533
|
initialSpacing: initialSpacing,
|
|
480
534
|
data: data,
|
|
481
535
|
stackData: props.stackData,
|
|
482
|
-
|
|
483
|
-
barWidth: (
|
|
536
|
+
// secondaryData,
|
|
537
|
+
barWidth: (_53 = props.barWidth) !== null && _53 !== void 0 ? _53 : defaultBarWidth,
|
|
484
538
|
xAxisThickness: xAxisThickness,
|
|
485
539
|
totalWidth: totalWidth,
|
|
486
540
|
disableScroll: disableScroll,
|
|
@@ -512,7 +566,7 @@ export var useBarChart = function (props) {
|
|
|
512
566
|
noOfSections: noOfSections,
|
|
513
567
|
sectionColors: props.sectionColors,
|
|
514
568
|
showFractionalValues: showFractionalValues,
|
|
515
|
-
axesAndRulesProps:
|
|
569
|
+
axesAndRulesProps: axesAndRulesProps,
|
|
516
570
|
yAxisLabelTexts: props.yAxisLabelTexts,
|
|
517
571
|
yAxisOffset: yAxisOffset,
|
|
518
572
|
rotateYAxisTexts: props.rotateYAxisTexts,
|
|
@@ -529,7 +583,7 @@ export var useBarChart = function (props) {
|
|
|
529
583
|
pointerY: pointerY,
|
|
530
584
|
onEndReached: props.onEndReached,
|
|
531
585
|
onStartReached: props.onStartReached,
|
|
532
|
-
endReachedOffset: (
|
|
586
|
+
endReachedOffset: (_54 = props.endReachedOffset) !== null && _54 !== void 0 ? _54 : BarDefaults.endReachedOffset,
|
|
533
587
|
onMomentumScrollEnd: props.onMomentumScrollEnd
|
|
534
588
|
};
|
|
535
589
|
return {
|
|
@@ -610,7 +664,7 @@ export var useBarChart = function (props) {
|
|
|
610
664
|
appearingOpacity: appearingOpacity,
|
|
611
665
|
autoShiftLabels: autoShiftLabels,
|
|
612
666
|
yAxisAtTop: yAxisAtTop,
|
|
613
|
-
|
|
667
|
+
// secondaryData,
|
|
614
668
|
disableScroll: disableScroll,
|
|
615
669
|
showScrollIndicator: showScrollIndicator,
|
|
616
670
|
scrollToEnd: scrollToEnd,
|
package/dist/BarChart/types.d.ts
CHANGED
|
@@ -39,6 +39,9 @@ export interface stackDataItem {
|
|
|
39
39
|
gradientColor?: ColorValue;
|
|
40
40
|
barWidth?: number;
|
|
41
41
|
innerBarComponent?: Function;
|
|
42
|
+
onContextMenu?: Function;
|
|
43
|
+
onMouseEnter?: Function;
|
|
44
|
+
onMouseLeave?: Function;
|
|
42
45
|
}>;
|
|
43
46
|
barBackgroundPattern?: () => ReactNode;
|
|
44
47
|
borderRadius?: number;
|
|
@@ -50,6 +53,10 @@ export interface stackDataItem {
|
|
|
50
53
|
patternId?: string;
|
|
51
54
|
leftShiftForTooltip?: number;
|
|
52
55
|
showXAxisIndex?: boolean;
|
|
56
|
+
onContextMenu?: Function;
|
|
57
|
+
onMouseEnter?: Function;
|
|
58
|
+
onMouseLeave?: Function;
|
|
59
|
+
isSecondary?: boolean;
|
|
53
60
|
}
|
|
54
61
|
export interface StackedBarChartPropsType {
|
|
55
62
|
style?: any;
|
|
@@ -119,6 +126,15 @@ export interface StackedBarChartPropsType {
|
|
|
119
126
|
pointerConfig?: Pointer;
|
|
120
127
|
showValuesAsTopLabel?: boolean;
|
|
121
128
|
yAxisOffset: number;
|
|
129
|
+
stepHeight: number;
|
|
130
|
+
stepValue: number;
|
|
131
|
+
negativeStepHeight: number;
|
|
132
|
+
negativeStepValue: number;
|
|
133
|
+
secondaryStepHeight: number;
|
|
134
|
+
secondaryStepValue: number;
|
|
135
|
+
secondaryNegativeStepHeight: number;
|
|
136
|
+
secondaryNegativeStepValue: number;
|
|
137
|
+
secondaryNoOfSectionsBelowXAxis: number;
|
|
122
138
|
}
|
|
123
139
|
export interface BarChartPropsType {
|
|
124
140
|
width?: number;
|
|
@@ -281,7 +297,6 @@ export interface BarChartPropsType {
|
|
|
281
297
|
leftShiftForLastIndexTooltip?: number;
|
|
282
298
|
barStyle?: object;
|
|
283
299
|
barInnerComponent?: (item?: stackDataItem | barDataItem, index?: number) => ReactNode;
|
|
284
|
-
secondaryData?: barDataItem[];
|
|
285
300
|
secondaryYAxis?: secondaryYAxisType | boolean;
|
|
286
301
|
pointerConfig?: Pointer;
|
|
287
302
|
getPointerProps?: Function;
|
|
@@ -431,6 +446,9 @@ export interface barDataItem {
|
|
|
431
446
|
barInnerComponent?: (item?: barDataItem, index?: number) => ReactNode;
|
|
432
447
|
showXAxisIndex?: boolean;
|
|
433
448
|
isSecondary?: boolean;
|
|
449
|
+
onContextMenu?: Function;
|
|
450
|
+
onMouseEnter?: Function;
|
|
451
|
+
onMouseLeave?: Function;
|
|
434
452
|
}
|
|
435
453
|
export interface Animated2DWithGradientPropsType {
|
|
436
454
|
item: barDataItem;
|
|
@@ -541,6 +559,9 @@ export interface RenderBarsPropsType {
|
|
|
541
559
|
onPress?: Function;
|
|
542
560
|
onLongPress?: Function;
|
|
543
561
|
onPressOut?: Function;
|
|
562
|
+
onContextMenu?: Function;
|
|
563
|
+
onMouseEnter?: Function;
|
|
564
|
+
onMouseLeave?: Function;
|
|
544
565
|
xAxisTextNumberOfLines: number;
|
|
545
566
|
xAxisLabelsHeight?: number;
|
|
546
567
|
xAxisLabelsVerticalShift: number;
|
|
@@ -553,6 +574,7 @@ export interface RenderBarsPropsType {
|
|
|
553
574
|
setSelectedIndex: Function;
|
|
554
575
|
barStyle?: object;
|
|
555
576
|
xAxisThickness?: number;
|
|
577
|
+
secondaryXAxis?: XAxisConfig;
|
|
556
578
|
pointerConfig?: Pointer;
|
|
557
579
|
focusBarOnPress?: boolean;
|
|
558
580
|
focusedBarIndex?: number;
|
|
@@ -562,7 +584,11 @@ export interface RenderBarsPropsType {
|
|
|
562
584
|
stepValue: number;
|
|
563
585
|
negativeStepHeight: number;
|
|
564
586
|
negativeStepValue: number;
|
|
565
|
-
|
|
587
|
+
secondaryStepHeight: number;
|
|
588
|
+
secondaryStepValue: number;
|
|
589
|
+
secondaryNegativeStepHeight: number;
|
|
590
|
+
secondaryNegativeStepValue: number;
|
|
591
|
+
secondaryNoOfSectionsBelowXAxis: number;
|
|
566
592
|
}
|
|
567
593
|
export interface trianglePropTypes {
|
|
568
594
|
style: any;
|
|
@@ -616,4 +642,9 @@ export interface CommonPropsFor2dand3dBarsType {
|
|
|
616
642
|
topLabelTextStyle: any;
|
|
617
643
|
yAxisOffset: number;
|
|
618
644
|
}
|
|
645
|
+
export interface BarChartPropsTypeForWeb extends BarChartPropsType {
|
|
646
|
+
onContextMenu?: Function;
|
|
647
|
+
onMouseEnter?: Function;
|
|
648
|
+
onMouseLeave?: Function;
|
|
649
|
+
}
|
|
619
650
|
export {};
|