gifted-charts-core 0.1.56 → 0.1.58
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.d.ts +6 -1
- package/dist/BarChart/RenderStackBars.js +6 -4
- package/dist/BarChart/index.d.ts +7 -0
- package/dist/BarChart/index.js +121 -103
- package/dist/BarChart/types.d.ts +24 -0
- package/dist/LineChart/LineChartBiColor.js +3 -1
- package/dist/LineChart/index.d.ts +8 -1
- package/dist/LineChart/index.js +238 -218
- package/dist/LineChart/types.d.ts +23 -0
- package/dist/RadarChart/index.d.ts +1 -0
- package/dist/RadarChart/index.js +25 -24
- package/dist/RadarChart/types.d.ts +0 -1
- package/dist/components/BarAndLineChartsWrapper/index.js +4 -2
- package/dist/index.d.ts +2 -2
- package/dist/utils/constants.d.ts +7 -0
- package/dist/utils/constants.js +9 -2
- package/dist/utils/types.d.ts +13 -0
- package/package.json +1 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type StackedBarChartPropsType, type stackDataItem } from './types';
|
|
2
2
|
import { TooltipProps } from '../utils/types';
|
|
3
|
-
|
|
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,
|
|
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
|
|
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
|
};
|
package/dist/BarChart/index.d.ts
CHANGED
|
@@ -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;
|
|
@@ -193,7 +194,13 @@ export declare const useBarChart: (props: extendedBarChartPropsType) => {
|
|
|
193
194
|
secondaryNegativeStepValue: number;
|
|
194
195
|
secondaryNoOfSectionsBelowXAxis: number;
|
|
195
196
|
barMarginBottom: any;
|
|
197
|
+
highlightEnabled: boolean;
|
|
198
|
+
highlightedBarIndex: number;
|
|
199
|
+
lowlightOpacity: number;
|
|
200
|
+
stackHighlightEnabled: boolean;
|
|
196
201
|
};
|
|
197
202
|
barAndLineChartsWrapperProps: BarAndLineChartsWrapperTypes;
|
|
198
203
|
yAxisExtraHeightAtTop: number;
|
|
204
|
+
selectedStackIndex: number;
|
|
205
|
+
setSelectedStackIndex: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
199
206
|
};
|
package/dist/BarChart/index.js
CHANGED
|
@@ -29,16 +29,25 @@ import { useEffect, useMemo, useState } from 'react';
|
|
|
29
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, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58;
|
|
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, _55, _56, _57, _58, _59, _60, _61, _62, _63;
|
|
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
|
|
38
|
-
var
|
|
34
|
+
var _64 = __read(useState(''), 2), points = _64[0], setPoints = _64[1];
|
|
35
|
+
var _65 = __read(useState(''), 2), points2 = _65[0], setPoints2 = _65[1];
|
|
36
|
+
var _66 = __read(useState(''), 2), arrowPoints = _66[0], setArrowPoints = _66[1];
|
|
37
|
+
var _67 = __read(useState(focusedBarIndex !== null && focusedBarIndex !== void 0 ? focusedBarIndex : -1), 2), selectedIndex = _67[0], setSelectedIndex = _67[1];
|
|
38
|
+
var _68 = __read(useState((_a = props.highlightedStackIndex) !== null && _a !== void 0 ? _a : -1), 2), selectedStackIndex = _68[0], setSelectedStackIndex = _68[1];
|
|
39
|
+
var showLine = (_b = props.showLine) !== null && _b !== void 0 ? _b : BarDefaults.showLine;
|
|
39
40
|
useEffect(function () {
|
|
40
41
|
setSelectedIndex(focusedBarIndex !== null && focusedBarIndex !== void 0 ? focusedBarIndex : -1);
|
|
41
42
|
}, [focusedBarIndex]);
|
|
43
|
+
useEffect(function () {
|
|
44
|
+
var _a;
|
|
45
|
+
setSelectedStackIndex((_a = props.highlightedStackIndex) !== null && _a !== void 0 ? _a : -1);
|
|
46
|
+
}, [props.highlightedStackIndex]);
|
|
47
|
+
var highlightEnabled = (_c = props.highlightEnabled) !== null && _c !== void 0 ? _c : BarDefaults.highlightEnabled;
|
|
48
|
+
var highlightedBarIndex = (_d = props.highlightedBarIndex) !== null && _d !== void 0 ? _d : selectedIndex;
|
|
49
|
+
var lowlightOpacity = (_e = props.lowlightOpacity) !== null && _e !== void 0 ? _e : BarDefaults.lowlightOpacity;
|
|
50
|
+
var stackHighlightEnabled = (_f = props.stackHighlightEnabled) !== null && _f !== void 0 ? _f : BarDefaults.stackHighlightEnabled;
|
|
42
51
|
var data = useMemo(function () {
|
|
43
52
|
if (!props.data) {
|
|
44
53
|
return [];
|
|
@@ -76,7 +85,7 @@ export var useBarChart = function (props) {
|
|
|
76
85
|
}
|
|
77
86
|
return props.stackData;
|
|
78
87
|
}, [yAxisOffset, props.stackData]);
|
|
79
|
-
var yAxisLabelWidth = (
|
|
88
|
+
var yAxisLabelWidth = (_g = props.yAxisLabelWidth) !== null && _g !== void 0 ? _g : (props.hideYAxisText
|
|
80
89
|
? AxesAndRulesDefaults.yAxisEmptyLabelWidth
|
|
81
90
|
: AxesAndRulesDefaults.yAxisLabelWidth);
|
|
82
91
|
var autoComputedSectionWidth = props.initialSpacing !== undefined
|
|
@@ -86,19 +95,19 @@ export var useBarChart = function (props) {
|
|
|
86
95
|
var defaultBarWidth = adjustToWidth
|
|
87
96
|
? autoComputedBarWidth
|
|
88
97
|
: BarDefaults.barWidth;
|
|
89
|
-
var barWidth = (
|
|
98
|
+
var barWidth = (_h = props.barWidth) !== null && _h !== void 0 ? _h : defaultBarWidth;
|
|
90
99
|
var autoComputedSpacing = autoComputedSectionWidth * 0.4;
|
|
91
|
-
var spacing = (
|
|
92
|
-
var initialSpacing = (
|
|
93
|
-
var endSpacing = (
|
|
94
|
-
var horizontal = (
|
|
95
|
-
var rtl = (
|
|
96
|
-
var yAxisAtTop = (
|
|
97
|
-
var intactTopLabel = (
|
|
100
|
+
var spacing = (_j = props.spacing) !== null && _j !== void 0 ? _j : (adjustToWidth ? autoComputedSpacing : BarDefaults.spacing);
|
|
101
|
+
var initialSpacing = (_k = props.initialSpacing) !== null && _k !== void 0 ? _k : spacing;
|
|
102
|
+
var endSpacing = (_l = props.endSpacing) !== null && _l !== void 0 ? _l : spacing;
|
|
103
|
+
var horizontal = (_m = props.horizontal) !== null && _m !== void 0 ? _m : BarDefaults.horizontal;
|
|
104
|
+
var rtl = (_o = props.rtl) !== null && _o !== void 0 ? _o : BarDefaults.rtl;
|
|
105
|
+
var yAxisAtTop = (_p = props.yAxisAtTop) !== null && _p !== void 0 ? _p : BarDefaults.yAxisAtTop;
|
|
106
|
+
var intactTopLabel = (_q = props.intactTopLabel) !== null && _q !== void 0 ? _q : BarDefaults.intactTopLabel;
|
|
98
107
|
var heightFromProps = horizontal ? props.width : props.height;
|
|
99
108
|
var widthFromProps = horizontal ? props.height : props.width;
|
|
100
|
-
var isAnimated = (
|
|
101
|
-
var animationDuration = (
|
|
109
|
+
var isAnimated = (_r = props.isAnimated) !== null && _r !== void 0 ? _r : BarDefaults.isAnimated;
|
|
110
|
+
var animationDuration = (_s = props.animationDuration) !== null && _s !== void 0 ? _s : BarDefaults.animationDuration;
|
|
102
111
|
// const secondaryData = getSecondaryDataWithOffsetIncluded(
|
|
103
112
|
// props.secondaryData,
|
|
104
113
|
// props.secondaryYAxis
|
|
@@ -116,7 +125,7 @@ export var useBarChart = function (props) {
|
|
|
116
125
|
return props.lineData;
|
|
117
126
|
}, [yAxisOffset, props.lineData, data, stackData]);
|
|
118
127
|
var lineData2 = props.lineData2;
|
|
119
|
-
var lineBehindBars = (
|
|
128
|
+
var lineBehindBars = (_t = props.lineBehindBars) !== null && _t !== void 0 ? _t : BarDefaults.lineBehindBars;
|
|
120
129
|
defaultLineConfig.initialSpacing = initialSpacing;
|
|
121
130
|
defaultLineConfig.endIndex = lineData.length - 1;
|
|
122
131
|
defaultLineConfig.animationDuration = animationDuration;
|
|
@@ -131,12 +140,12 @@ export var useBarChart = function (props) {
|
|
|
131
140
|
? props.stepHeight * noOfSections
|
|
132
141
|
: AxesAndRulesDefaults.containerHeight);
|
|
133
142
|
var horizSections = [{ value: '0' }];
|
|
134
|
-
var stepHeight = (
|
|
135
|
-
var labelWidth = (
|
|
136
|
-
var scrollToEnd = (
|
|
137
|
-
var scrollAnimation = (
|
|
138
|
-
var scrollEventThrottle = (
|
|
139
|
-
var labelsExtraHeight = (
|
|
143
|
+
var stepHeight = (_u = props.stepHeight) !== null && _u !== void 0 ? _u : containerHeight / noOfSections;
|
|
144
|
+
var labelWidth = (_v = props.labelWidth) !== null && _v !== void 0 ? _v : AxesAndRulesDefaults.labelWidth;
|
|
145
|
+
var scrollToEnd = (_w = props.scrollToEnd) !== null && _w !== void 0 ? _w : BarDefaults.scrollToEnd;
|
|
146
|
+
var scrollAnimation = (_x = props.scrollAnimation) !== null && _x !== void 0 ? _x : BarDefaults.scrollAnimation;
|
|
147
|
+
var scrollEventThrottle = (_y = props.scrollEventThrottle) !== null && _y !== void 0 ? _y : BarDefaults.scrollEventThrottle;
|
|
148
|
+
var labelsExtraHeight = (_z = props.labelsExtraHeight) !== null && _z !== void 0 ? _z : AxesAndRulesDefaults.labelsExtraHeight;
|
|
140
149
|
var secondaryMaxItem = 0;
|
|
141
150
|
var secondaryMinItem = 0;
|
|
142
151
|
if (lineConfig.isSecondary) {
|
|
@@ -212,13 +221,13 @@ export var useBarChart = function (props) {
|
|
|
212
221
|
});
|
|
213
222
|
}
|
|
214
223
|
var valuesRange = maxItem - minPositiveItem; // Diff bw largest & smallest +ve values
|
|
215
|
-
var showFractionalValues = (
|
|
216
|
-
var roundToDigits = (
|
|
224
|
+
var showFractionalValues = (_0 = props.showFractionalValues) !== null && _0 !== void 0 ? _0 : valuesRange <= 1;
|
|
225
|
+
var roundToDigits = (_1 = props.roundToDigits) !== null && _1 !== void 0 ? _1 : (showFractionalValues ? indexOfFirstNonZeroDigit(valuesRange) + 1 : 0);
|
|
217
226
|
var maxAndMin = maxAndMinUtil(maxItem, minItem, roundToDigits, showFractionalValues);
|
|
218
227
|
var maxValue = getMaxValue(props.maxValue, props.stepValue, noOfSections, maxAndMin.maxItem) || 10;
|
|
219
228
|
var secondaryRange = secondaryMaxItem - secondaryMinPositiveItem; // Diff bw largest & smallest +ve values
|
|
220
|
-
var showSecondaryFractionalValues = (
|
|
221
|
-
var secondaryRoundToDigits = (
|
|
229
|
+
var showSecondaryFractionalValues = (_3 = (_2 = props.secondaryYAxis) === null || _2 === void 0 ? void 0 : _2.showFractionalValues) !== null && _3 !== void 0 ? _3 : secondaryRange <= 1;
|
|
230
|
+
var secondaryRoundToDigits = (_5 = (_4 = props.secondaryYAxis) === null || _4 === void 0 ? void 0 : _4.roundToDigits) !== null && _5 !== void 0 ? _5 : (showSecondaryFractionalValues
|
|
222
231
|
? indexOfFirstNonZeroDigit(secondaryRange) + 1
|
|
223
232
|
: 0);
|
|
224
233
|
var secondaryMaxAndMin = maxAndMinUtil(secondaryMaxItem, secondaryMinItem, secondaryRoundToDigits, showSecondaryFractionalValues);
|
|
@@ -228,87 +237,87 @@ export var useBarChart = function (props) {
|
|
|
228
237
|
// secondaryMaxAndMin.maxItem
|
|
229
238
|
// : secondaryMaxAndMin.maxItem
|
|
230
239
|
// : maxValue
|
|
231
|
-
var secondaryMaxValue = (
|
|
240
|
+
var secondaryMaxValue = (_7 = (_6 = props.secondaryYAxis) === null || _6 === void 0 ? void 0 : _6.maxValue) !== null && _7 !== void 0 ? _7 : secondaryMaxAndMin.maxItem;
|
|
232
241
|
var mostNegativeValue = getMostNegativeValue(props.mostNegativeValue, props.negativeStepValue, props.noOfSectionsBelowXAxis, maxAndMin.minItem);
|
|
233
|
-
var stepValue = (
|
|
242
|
+
var stepValue = (_8 = props.stepValue) !== null && _8 !== void 0 ? _8 : maxValue / noOfSections;
|
|
234
243
|
var effectiveNegativeStepValue = negativeStepValue !== null && negativeStepValue !== void 0 ? negativeStepValue : stepValue;
|
|
235
|
-
var noOfSectionsBelowXAxis = (
|
|
244
|
+
var noOfSectionsBelowXAxis = (_9 = props.noOfSectionsBelowXAxis) !== null && _9 !== void 0 ? _9 : (effectiveNegativeStepValue
|
|
236
245
|
? Math.round(Math.ceil(-mostNegativeValue / effectiveNegativeStepValue))
|
|
237
246
|
: 0);
|
|
238
|
-
var showScrollIndicator = (
|
|
239
|
-
var side = (
|
|
240
|
-
var rotateLabel = (
|
|
241
|
-
var opacity = (
|
|
242
|
-
var isThreeD = (
|
|
243
|
-
var showXAxisIndices = (
|
|
244
|
-
var xAxisIndicesHeight = (
|
|
245
|
-
var xAxisIndicesWidth = (
|
|
246
|
-
var xAxisIndicesColor = (
|
|
247
|
-
var xAxisThickness = (
|
|
248
|
-
var xAxisTextNumberOfLines = (
|
|
249
|
-
var xAxisLabelsVerticalShift = (
|
|
247
|
+
var showScrollIndicator = (_10 = props.showScrollIndicator) !== null && _10 !== void 0 ? _10 : BarDefaults.showScrollIndicator;
|
|
248
|
+
var side = (_11 = props.side) !== null && _11 !== void 0 ? _11 : BarDefaults.side;
|
|
249
|
+
var rotateLabel = (_12 = props.rotateLabel) !== null && _12 !== void 0 ? _12 : AxesAndRulesDefaults.rotateLabel;
|
|
250
|
+
var opacity = (_13 = props.opacity) !== null && _13 !== void 0 ? _13 : BarDefaults.opacity;
|
|
251
|
+
var isThreeD = (_14 = props.isThreeD) !== null && _14 !== void 0 ? _14 : BarDefaults.isThreeD;
|
|
252
|
+
var showXAxisIndices = (_15 = props.showXAxisIndices) !== null && _15 !== void 0 ? _15 : AxesAndRulesDefaults.showXAxisIndices;
|
|
253
|
+
var xAxisIndicesHeight = (_16 = props.xAxisIndicesHeight) !== null && _16 !== void 0 ? _16 : AxesAndRulesDefaults.xAxisIndicesHeight;
|
|
254
|
+
var xAxisIndicesWidth = (_17 = props.xAxisIndicesWidth) !== null && _17 !== void 0 ? _17 : AxesAndRulesDefaults.xAxisIndicesWidth;
|
|
255
|
+
var xAxisIndicesColor = (_18 = props.xAxisIndicesColor) !== null && _18 !== void 0 ? _18 : AxesAndRulesDefaults.xAxisIndicesColor;
|
|
256
|
+
var xAxisThickness = (_19 = props.xAxisThickness) !== null && _19 !== void 0 ? _19 : AxesAndRulesDefaults.xAxisThickness;
|
|
257
|
+
var xAxisTextNumberOfLines = (_20 = props.xAxisTextNumberOfLines) !== null && _20 !== void 0 ? _20 : AxesAndRulesDefaults.xAxisTextNumberOfLines;
|
|
258
|
+
var xAxisLabelsVerticalShift = (_21 = props.xAxisLabelsVerticalShift) !== null && _21 !== void 0 ? _21 : AxesAndRulesDefaults.xAxisLabelsVerticalShift;
|
|
250
259
|
var horizontalRulesStyle = props.horizontalRulesStyle;
|
|
251
|
-
var autoShiftLabels = (
|
|
252
|
-
var barBorderColor = (
|
|
260
|
+
var autoShiftLabels = (_22 = props.autoShiftLabels) !== null && _22 !== void 0 ? _22 : false;
|
|
261
|
+
var barBorderColor = (_23 = props.barBorderColor) !== null && _23 !== void 0 ? _23 : BarDefaults.barBorderColor;
|
|
253
262
|
var extendedContainerHeight = getExtendedContainerHeightWithPadding(containerHeight, 0);
|
|
254
263
|
var axesAndRulesProps = getAxesAndRulesProps(props, containerHeight, stepHeight, stepValue, noOfSections, roundToDigits, negativeStepValue !== null && negativeStepValue !== void 0 ? negativeStepValue : stepValue, secondaryMaxValue, secondaryMinItem, showSecondaryFractionalValues, secondaryRoundToDigits);
|
|
255
|
-
var
|
|
256
|
-
var primary4thQuadrantHeight = noOfSectionsBelowXAxis * ((
|
|
264
|
+
var _69 = axesAndRulesProps.secondaryYAxisConfig, secondaryStepHeight = _69.stepHeight, secondaryStepValue = _69.stepValue, secondaryNegativeStepHeight = _69.negativeStepHeight, secondaryNegativeStepValue = _69.negativeStepValue, secondaryNoOfSectionsBelowXAxis = _69.noOfSectionsBelowXAxis;
|
|
265
|
+
var primary4thQuadrantHeight = noOfSectionsBelowXAxis * ((_24 = props.negativeStepHeight) !== null && _24 !== void 0 ? _24 : stepHeight);
|
|
257
266
|
var secondary4thQuadrantHeight = secondaryNoOfSectionsBelowXAxis * secondaryNegativeStepHeight;
|
|
258
267
|
var containerHeightIncludingBelowXAxis = extendedContainerHeight +
|
|
259
268
|
Math.max(primary4thQuadrantHeight, secondary4thQuadrantHeight);
|
|
260
|
-
var
|
|
261
|
-
var
|
|
262
|
-
var
|
|
263
|
-
var
|
|
264
|
-
var
|
|
265
|
-
var
|
|
269
|
+
var _70 = __read(useState(-1), 2), pointerIndex = _70[0], setPointerIndex = _70[1];
|
|
270
|
+
var _71 = __read(useState(0), 2), pointerX = _71[0], setPointerX = _71[1];
|
|
271
|
+
var _72 = __read(useState(0), 2), pointerY = _72[0], setPointerY = _72[1];
|
|
272
|
+
var _73 = __read(useState(), 2), pointerItem = _73[0], setPointerItem = _73[1];
|
|
273
|
+
var _74 = __read(useState(0), 2), responderStartTime = _74[0], setResponderStartTime = _74[1];
|
|
274
|
+
var _75 = __read(useState(false), 2), responderActive = _75[0], setResponderActive = _75[1];
|
|
266
275
|
var pointerConfig = props.pointerConfig;
|
|
267
|
-
var getPointerProps = (
|
|
268
|
-
var pointerHeight = (
|
|
269
|
-
var pointerWidth = (
|
|
270
|
-
var pointerRadius = (
|
|
271
|
-
var pointerColor = (
|
|
272
|
-
var pointerComponent = (
|
|
276
|
+
var getPointerProps = (_25 = props.getPointerProps) !== null && _25 !== void 0 ? _25 : null;
|
|
277
|
+
var pointerHeight = (_26 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.height) !== null && _26 !== void 0 ? _26 : defaultPointerConfig.height;
|
|
278
|
+
var pointerWidth = (_27 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.width) !== null && _27 !== void 0 ? _27 : defaultPointerConfig.width;
|
|
279
|
+
var pointerRadius = (_28 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.radius) !== null && _28 !== void 0 ? _28 : defaultPointerConfig.radius;
|
|
280
|
+
var pointerColor = (_29 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerColor) !== null && _29 !== void 0 ? _29 : defaultPointerConfig.pointerColor;
|
|
281
|
+
var pointerComponent = (_30 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerComponent) !== null && _30 !== void 0 ? _30 : defaultPointerConfig.pointerComponent;
|
|
273
282
|
var showPointerStrip = (pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.showPointerStrip) === false
|
|
274
283
|
? false
|
|
275
284
|
: defaultPointerConfig.showPointerStrip;
|
|
276
|
-
var pointerStripHeight = (
|
|
277
|
-
var pointerStripWidth = (
|
|
278
|
-
var pointerStripColor = (
|
|
279
|
-
var pointerStripUptoDataPoint = (
|
|
280
|
-
var pointerLabelComponent = (
|
|
281
|
-
var stripOverPointer = (
|
|
282
|
-
var shiftPointerLabelX = (
|
|
283
|
-
var shiftPointerLabelY = (
|
|
284
|
-
var pointerLabelWidth = (
|
|
285
|
-
var pointerLabelHeight = (
|
|
286
|
-
var autoAdjustPointerLabelPosition = (
|
|
287
|
-
var pointerVanishDelay = (
|
|
288
|
-
var activatePointersOnLongPress = (
|
|
289
|
-
var activatePointersDelay = (
|
|
290
|
-
var initialPointerIndex = (
|
|
291
|
-
var initialPointerAppearDelay = (
|
|
285
|
+
var pointerStripHeight = (_31 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripHeight) !== null && _31 !== void 0 ? _31 : defaultPointerConfig.pointerStripHeight;
|
|
286
|
+
var pointerStripWidth = (_32 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripWidth) !== null && _32 !== void 0 ? _32 : defaultPointerConfig.pointerStripWidth;
|
|
287
|
+
var pointerStripColor = (_33 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripColor) !== null && _33 !== void 0 ? _33 : defaultPointerConfig.pointerStripColor;
|
|
288
|
+
var pointerStripUptoDataPoint = (_34 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripUptoDataPoint) !== null && _34 !== void 0 ? _34 : defaultPointerConfig.pointerStripUptoDataPoint;
|
|
289
|
+
var pointerLabelComponent = (_35 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelComponent) !== null && _35 !== void 0 ? _35 : defaultPointerConfig.pointerLabelComponent;
|
|
290
|
+
var stripOverPointer = (_36 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.stripOverPointer) !== null && _36 !== void 0 ? _36 : defaultPointerConfig.stripOverPointer;
|
|
291
|
+
var shiftPointerLabelX = (_37 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.shiftPointerLabelX) !== null && _37 !== void 0 ? _37 : defaultPointerConfig.shiftPointerLabelX;
|
|
292
|
+
var shiftPointerLabelY = (_38 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.shiftPointerLabelY) !== null && _38 !== void 0 ? _38 : defaultPointerConfig.shiftPointerLabelY;
|
|
293
|
+
var pointerLabelWidth = (_39 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelWidth) !== null && _39 !== void 0 ? _39 : defaultPointerConfig.pointerLabelWidth;
|
|
294
|
+
var pointerLabelHeight = (_40 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelHeight) !== null && _40 !== void 0 ? _40 : defaultPointerConfig.pointerLabelHeight;
|
|
295
|
+
var autoAdjustPointerLabelPosition = (_41 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.autoAdjustPointerLabelPosition) !== null && _41 !== void 0 ? _41 : defaultPointerConfig.autoAdjustPointerLabelPosition;
|
|
296
|
+
var pointerVanishDelay = (_42 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerVanishDelay) !== null && _42 !== void 0 ? _42 : defaultPointerConfig.pointerVanishDelay;
|
|
297
|
+
var activatePointersOnLongPress = (_43 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersOnLongPress) !== null && _43 !== void 0 ? _43 : defaultPointerConfig.activatePointersOnLongPress;
|
|
298
|
+
var activatePointersDelay = (_44 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersDelay) !== null && _44 !== void 0 ? _44 : defaultPointerConfig.activatePointersDelay;
|
|
299
|
+
var initialPointerIndex = (_45 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.initialPointerIndex) !== null && _45 !== void 0 ? _45 : defaultPointerConfig.initialPointerIndex;
|
|
300
|
+
var initialPointerAppearDelay = (_46 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.initialPointerAppearDelay) !== null && _46 !== void 0 ? _46 : (isAnimated
|
|
292
301
|
? animationDuration
|
|
293
302
|
: defaultPointerConfig.initialPointerAppearDelay);
|
|
294
|
-
var persistPointer = (
|
|
295
|
-
var hidePointer1 = (
|
|
303
|
+
var persistPointer = (_47 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.persistPointer) !== null && _47 !== void 0 ? _47 : defaultPointerConfig.persistPointer;
|
|
304
|
+
var hidePointer1 = (_48 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer1) !== null && _48 !== void 0 ? _48 : defaultPointerConfig.hidePointer1;
|
|
296
305
|
var pointerEvents = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerEvents;
|
|
297
|
-
var stripBehindBars = (
|
|
298
|
-
var disableScroll = (
|
|
306
|
+
var stripBehindBars = (_49 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.stripBehindBars) !== null && _49 !== void 0 ? _49 : defaultPointerConfig.stripBehindBars;
|
|
307
|
+
var disableScroll = (_50 = props.disableScroll) !== null && _50 !== void 0 ? _50 : (pointerConfig
|
|
299
308
|
? activatePointersOnLongPress
|
|
300
309
|
? !!responderActive
|
|
301
310
|
: true
|
|
302
311
|
: false);
|
|
303
312
|
var yAxisExtraHeightAtTop = props.trimYAxisAtTop
|
|
304
313
|
? 0
|
|
305
|
-
: (
|
|
314
|
+
: (_51 = props.yAxisExtraHeight) !== null && _51 !== void 0 ? _51 : containerHeight / 20;
|
|
306
315
|
var barInnerComponent = props.barInnerComponent;
|
|
307
316
|
var localYAxisOffset1 = lineConfig.isSecondary
|
|
308
|
-
? (
|
|
317
|
+
? (_53 = (_52 = props.secondaryYAxis) === null || _52 === void 0 ? void 0 : _52.yAxisOffset) !== null && _53 !== void 0 ? _53 : 0
|
|
309
318
|
: yAxisOffset !== null && yAxisOffset !== void 0 ? yAxisOffset : 0;
|
|
310
319
|
var localYAxisOffset2 = lineConfig2.isSecondary
|
|
311
|
-
? (
|
|
320
|
+
? (_55 = (_54 = props.secondaryYAxis) === null || _54 === void 0 ? void 0 : _54.yAxisOffset) !== null && _55 !== void 0 ? _55 : 0
|
|
312
321
|
: yAxisOffset !== null && yAxisOffset !== void 0 ? yAxisOffset : 0;
|
|
313
322
|
useEffect(function () {
|
|
314
323
|
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;
|
|
@@ -424,9 +433,9 @@ export var useBarChart = function (props) {
|
|
|
424
433
|
spacing,
|
|
425
434
|
yAxisLabelWidth,
|
|
426
435
|
lineConfig.showArrow,
|
|
427
|
-
(
|
|
428
|
-
(
|
|
429
|
-
(
|
|
436
|
+
(_56 = lineConfig.arrowConfig) === null || _56 === void 0 ? void 0 : _56.length,
|
|
437
|
+
(_57 = lineConfig.arrowConfig) === null || _57 === void 0 ? void 0 : _57.width,
|
|
438
|
+
(_58 = lineConfig.arrowConfig) === null || _58 === void 0 ? void 0 : _58.showArrowBase
|
|
430
439
|
]);
|
|
431
440
|
useEffect(function () {
|
|
432
441
|
var _a, _b;
|
|
@@ -472,7 +481,7 @@ export var useBarChart = function (props) {
|
|
|
472
481
|
outputRange: [0, initialSpacing + totalWidth]
|
|
473
482
|
});
|
|
474
483
|
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;
|
|
484
|
+
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
485
|
return {
|
|
477
486
|
item: item,
|
|
478
487
|
index: index,
|
|
@@ -522,26 +531,27 @@ export var useBarChart = function (props) {
|
|
|
522
531
|
xAxisLabelsHeight: props.xAxisLabelsHeight,
|
|
523
532
|
xAxisLabelsVerticalShift: xAxisLabelsVerticalShift,
|
|
524
533
|
renderTooltip: props.renderTooltip,
|
|
525
|
-
|
|
534
|
+
renderTooltipConditions: (_e = props.renderTooltipConditions) !== null && _e !== void 0 ? _e : BarDefaults.renderTooltipConditions,
|
|
535
|
+
leftShiftForTooltip: (_f = props.leftShiftForTooltip) !== null && _f !== void 0 ? _f : 0,
|
|
526
536
|
autoCenterTooltip: autoCenterTooltip,
|
|
527
537
|
initialSpacing: initialSpacing,
|
|
528
538
|
selectedIndex: selectedIndex,
|
|
529
539
|
setSelectedIndex: setSelectedIndex,
|
|
530
|
-
activeOpacity: (
|
|
540
|
+
activeOpacity: (_g = props.activeOpacity) !== null && _g !== void 0 ? _g : 0.2,
|
|
531
541
|
noOfSectionsBelowXAxis: noOfSectionsBelowXAxis,
|
|
532
|
-
leftShiftForLastIndexTooltip: (
|
|
533
|
-
label: (
|
|
534
|
-
secondaryLabel: (
|
|
535
|
-
labelTextStyle: (
|
|
536
|
-
secondaryLabelTextStyle: (
|
|
542
|
+
leftShiftForLastIndexTooltip: (_h = props.leftShiftForLastIndexTooltip) !== null && _h !== void 0 ? _h : 0,
|
|
543
|
+
label: (_j = item.label) !== null && _j !== void 0 ? _j : (((_k = props.xAxisLabelTexts) === null || _k === void 0 ? void 0 : _k[index]) ? props.xAxisLabelTexts[index] : ''),
|
|
544
|
+
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 : '',
|
|
545
|
+
labelTextStyle: (_q = item.labelTextStyle) !== null && _q !== void 0 ? _q : props.xAxisLabelTextStyle,
|
|
546
|
+
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
547
|
pointerConfig: pointerConfig,
|
|
538
548
|
yAxisExtraHeightAtTop: yAxisExtraHeightAtTop,
|
|
539
549
|
yAxisOffset: yAxisOffset !== null && yAxisOffset !== void 0 ? yAxisOffset : 0,
|
|
540
550
|
focusedBarIndex: focusedBarIndex,
|
|
541
551
|
stepHeight: stepHeight,
|
|
542
552
|
stepValue: stepValue,
|
|
543
|
-
negativeStepHeight: (
|
|
544
|
-
negativeStepValue: (
|
|
553
|
+
negativeStepHeight: (_v = props.negativeStepHeight) !== null && _v !== void 0 ? _v : stepHeight,
|
|
554
|
+
negativeStepValue: (_w = props.negativeStepValue) !== null && _w !== void 0 ? _w : stepValue,
|
|
545
555
|
secondaryXAxis: props.secondaryXAxis,
|
|
546
556
|
secondaryYAxis: props.secondaryYAxis,
|
|
547
557
|
secondaryStepHeight: secondaryStepHeight,
|
|
@@ -549,7 +559,11 @@ export var useBarChart = function (props) {
|
|
|
549
559
|
secondaryNegativeStepHeight: secondaryNegativeStepHeight,
|
|
550
560
|
secondaryNegativeStepValue: secondaryNegativeStepValue,
|
|
551
561
|
secondaryNoOfSectionsBelowXAxis: secondaryNoOfSectionsBelowXAxis,
|
|
552
|
-
barMarginBottom: (
|
|
562
|
+
barMarginBottom: (_y = (_x = item.barMarginBottom) !== null && _x !== void 0 ? _x : props.barMarginBottom) !== null && _y !== void 0 ? _y : 0,
|
|
563
|
+
highlightEnabled: highlightEnabled,
|
|
564
|
+
highlightedBarIndex: highlightedBarIndex,
|
|
565
|
+
lowlightOpacity: lowlightOpacity,
|
|
566
|
+
stackHighlightEnabled: stackHighlightEnabled
|
|
553
567
|
};
|
|
554
568
|
};
|
|
555
569
|
var barAndLineChartsWrapperProps = {
|
|
@@ -557,19 +571,19 @@ export var useBarChart = function (props) {
|
|
|
557
571
|
containerHeight: containerHeight,
|
|
558
572
|
noOfSectionsBelowXAxis: noOfSectionsBelowXAxis,
|
|
559
573
|
stepHeight: stepHeight,
|
|
560
|
-
negativeStepHeight: (
|
|
574
|
+
negativeStepHeight: (_59 = props.negativeStepHeight) !== null && _59 !== void 0 ? _59 : stepHeight,
|
|
561
575
|
labelsExtraHeight: labelsExtraHeight,
|
|
562
576
|
yAxisLabelWidth: yAxisLabelWidth,
|
|
563
577
|
horizontal: horizontal,
|
|
564
578
|
rtl: rtl,
|
|
565
|
-
shiftX: (
|
|
566
|
-
shiftY: (
|
|
579
|
+
shiftX: (_60 = props.shiftX) !== null && _60 !== void 0 ? _60 : 0,
|
|
580
|
+
shiftY: (_61 = props.shiftY) !== null && _61 !== void 0 ? _61 : 0,
|
|
567
581
|
yAxisAtTop: yAxisAtTop,
|
|
568
582
|
initialSpacing: initialSpacing,
|
|
569
583
|
data: data,
|
|
570
584
|
stackData: stackData,
|
|
571
585
|
// secondaryData,
|
|
572
|
-
barWidth: (
|
|
586
|
+
barWidth: (_62 = props.barWidth) !== null && _62 !== void 0 ? _62 : defaultBarWidth,
|
|
573
587
|
xAxisThickness: xAxisThickness,
|
|
574
588
|
totalWidth: totalWidth,
|
|
575
589
|
disableScroll: disableScroll,
|
|
@@ -618,9 +632,11 @@ export var useBarChart = function (props) {
|
|
|
618
632
|
pointerY: pointerY,
|
|
619
633
|
onEndReached: props.onEndReached,
|
|
620
634
|
onStartReached: props.onStartReached,
|
|
621
|
-
endReachedOffset: (
|
|
635
|
+
endReachedOffset: (_63 = props.endReachedOffset) !== null && _63 !== void 0 ? _63 : BarDefaults.endReachedOffset,
|
|
622
636
|
onMomentumScrollEnd: props.onMomentumScrollEnd,
|
|
623
|
-
customBackground: props.customBackground
|
|
637
|
+
customBackground: props.customBackground,
|
|
638
|
+
highlightEnabled: highlightEnabled,
|
|
639
|
+
lowlightOpacity: lowlightOpacity
|
|
624
640
|
};
|
|
625
641
|
return {
|
|
626
642
|
lineConfig: lineConfig,
|
|
@@ -730,6 +746,8 @@ export var useBarChart = function (props) {
|
|
|
730
746
|
pointerIndex: pointerIndex,
|
|
731
747
|
getPropsCommonForBarAndStack: getPropsCommonForBarAndStack,
|
|
732
748
|
barAndLineChartsWrapperProps: barAndLineChartsWrapperProps,
|
|
733
|
-
yAxisExtraHeightAtTop: yAxisExtraHeightAtTop
|
|
749
|
+
yAxisExtraHeightAtTop: yAxisExtraHeightAtTop,
|
|
750
|
+
selectedStackIndex: selectedStackIndex,
|
|
751
|
+
setSelectedStackIndex: setSelectedStackIndex
|
|
734
752
|
};
|
|
735
753
|
};
|
package/dist/BarChart/types.d.ts
CHANGED
|
@@ -137,6 +137,18 @@ export interface StackedBarChartPropsType {
|
|
|
137
137
|
secondaryNegativeStepValue: number;
|
|
138
138
|
secondaryNoOfSectionsBelowXAxis: number;
|
|
139
139
|
containerHeightIncludingBelowXAxis: number;
|
|
140
|
+
highlightEnabled: boolean;
|
|
141
|
+
highlightedBarIndex: number;
|
|
142
|
+
lowlightOpacity: number;
|
|
143
|
+
stackHighlightEnabled?: boolean;
|
|
144
|
+
selectedStackIndex: number;
|
|
145
|
+
setSelectedStackIndex: Function;
|
|
146
|
+
}
|
|
147
|
+
export interface StackedBarChartPropsTypeForWeb extends StackedBarChartPropsType {
|
|
148
|
+
onContextMenu?: Function;
|
|
149
|
+
onMouseEnter?: Function;
|
|
150
|
+
onMouseLeave?: Function;
|
|
151
|
+
renderTooltipConditions?: string[];
|
|
140
152
|
}
|
|
141
153
|
export interface BarChartPropsType {
|
|
142
154
|
width?: number;
|
|
@@ -312,6 +324,11 @@ export interface BarChartPropsType {
|
|
|
312
324
|
focusBarOnPress?: boolean;
|
|
313
325
|
focusedBarConfig?: FocusedBarConfig;
|
|
314
326
|
focusedBarIndex?: number;
|
|
327
|
+
highlightEnabled?: boolean;
|
|
328
|
+
highlightedBarIndex?: number;
|
|
329
|
+
lowlightOpacity?: number;
|
|
330
|
+
stackHighlightEnabled?: boolean;
|
|
331
|
+
highlightedStackIndex?: number;
|
|
315
332
|
adjustToWidth?: boolean;
|
|
316
333
|
parentWidth?: number;
|
|
317
334
|
secondaryXAxis?: XAxisConfig;
|
|
@@ -597,6 +614,12 @@ export interface RenderBarsPropsType {
|
|
|
597
614
|
secondaryNegativeStepHeight: number;
|
|
598
615
|
secondaryNegativeStepValue: number;
|
|
599
616
|
secondaryNoOfSectionsBelowXAxis: number;
|
|
617
|
+
highlightEnabled: boolean;
|
|
618
|
+
highlightedBarIndex: number;
|
|
619
|
+
lowlightOpacity: number;
|
|
620
|
+
}
|
|
621
|
+
export interface RenderBarsPropsTypeForWeb extends RenderBarsPropsType {
|
|
622
|
+
renderTooltipConditions: string[];
|
|
600
623
|
}
|
|
601
624
|
export interface trianglePropTypes {
|
|
602
625
|
style: any;
|
|
@@ -654,5 +677,6 @@ export interface BarChartPropsTypeForWeb extends BarChartPropsType {
|
|
|
654
677
|
onContextMenu?: Function;
|
|
655
678
|
onMouseEnter?: Function;
|
|
656
679
|
onMouseLeave?: Function;
|
|
680
|
+
renderTooltipConditions?: string[];
|
|
657
681
|
}
|
|
658
682
|
export {};
|
|
@@ -435,7 +435,9 @@ export var useLineChartBiColor = function (props) {
|
|
|
435
435
|
pointerX: 0,
|
|
436
436
|
pointerY: 0,
|
|
437
437
|
endReachedOffset: (_51 = props.endReachedOffset) !== null && _51 !== void 0 ? _51 : LineDefaults.endReachedOffset,
|
|
438
|
-
extraWidthDueToDataPoint: extraWidthDueToDataPoint
|
|
438
|
+
extraWidthDueToDataPoint: extraWidthDueToDataPoint,
|
|
439
|
+
highlightEnabled: LineDefaults.highlightEnabled,
|
|
440
|
+
lowlightOpacity: LineDefaults.lowlightOpacity
|
|
439
441
|
};
|
|
440
442
|
return {
|
|
441
443
|
toggle: toggle,
|
|
@@ -400,7 +400,7 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
|
|
|
400
400
|
cumulativeSpacing4: number[];
|
|
401
401
|
cumulativeSpacing5: number[];
|
|
402
402
|
cumulativeSpacingSecondary: number[];
|
|
403
|
-
cumulativeSpacingForSet:
|
|
403
|
+
cumulativeSpacingForSet: number[][];
|
|
404
404
|
stripOverDataPoints: boolean | undefined;
|
|
405
405
|
strips: any;
|
|
406
406
|
selectedLineNumber: number;
|
|
@@ -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
|
};
|