gifted-charts-core 0.1.57 → 0.1.59
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/README.md +10 -0
- package/dist/BarChart/index.d.ts +6 -0
- package/dist/BarChart/index.js +110 -93
- package/dist/BarChart/types.d.ts +14 -0
- package/dist/LineChart/LineChartBiColor.js +3 -1
- package/dist/LineChart/index.d.ts +2 -1
- package/dist/LineChart/index.js +251 -219
- package/dist/PieChart/index.d.ts +16 -0
- package/dist/PieChart/index.js +32 -5
- package/dist/PieChart/main.d.ts +2 -2
- package/dist/PieChart/main.js +9 -11
- package/dist/PieChart/types.d.ts +8 -0
- package/dist/components/BarAndLineChartsWrapper/index.js +4 -2
- package/dist/utils/constants.d.ts +5 -0
- package/dist/utils/constants.js +7 -2
- package/dist/utils/types.d.ts +5 -0
- package/package.json +1 -1
package/dist/PieChart/index.d.ts
CHANGED
|
@@ -29,6 +29,22 @@ interface IusePieChart {
|
|
|
29
29
|
isDataShifted: boolean;
|
|
30
30
|
paddingHorizontal: number;
|
|
31
31
|
paddingVertical: number;
|
|
32
|
+
showTooltip?: boolean;
|
|
33
|
+
tooltipHorizontalShift: number;
|
|
34
|
+
tooltipVerticalShift: any;
|
|
35
|
+
tooltipComponent: any;
|
|
36
|
+
getTooltipText: any;
|
|
37
|
+
tooltipBackgroundColor: any;
|
|
38
|
+
tooltipBorderRadius: any;
|
|
39
|
+
tooltipWidth: any;
|
|
40
|
+
tooltipTextNoOfLines: any;
|
|
41
|
+
textColor: any;
|
|
42
|
+
textSize: any;
|
|
43
|
+
font: any;
|
|
44
|
+
fontWeight: any;
|
|
45
|
+
fontStyle: any;
|
|
46
|
+
tooltipSelectedIndex: number;
|
|
47
|
+
setTooltipSelectedIndex: any;
|
|
32
48
|
}
|
|
33
49
|
interface IPieChartPropsType extends PieChartPropsType {
|
|
34
50
|
pro?: boolean;
|
package/dist/PieChart/index.js
CHANGED
|
@@ -16,8 +16,13 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
16
16
|
};
|
|
17
17
|
import { useEffect, useState } from 'react';
|
|
18
18
|
import { getTextSizeForPieLabels } from '../utils';
|
|
19
|
+
import { PieTooltipDefaults } from '../utils/constants';
|
|
19
20
|
export var usePieChart = function (props) {
|
|
20
21
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
22
|
+
var showTooltip = props.showTooltip, tooltipWidth = props.tooltipWidth, tooltipComponent = props.tooltipComponent, _w = props.tooltipDuration, tooltipDuration = _w === void 0 ? PieTooltipDefaults.tooltipDuration : _w, _x = props.tooltipVerticalShift, tooltipVerticalShift = _x === void 0 ? PieTooltipDefaults.tooltipVerticalShift : _x, _y = props.tooltipHorizontalShift, tooltipHorizontalShift = _y === void 0 ? PieTooltipDefaults.tooltipHorizontalShift : _y, _z = props.showValuesAsTooltipText, showValuesAsTooltipText = _z === void 0 ? PieTooltipDefaults.showValuesAsTooltipText : _z, _0 = props.tooltipTextNoOfLines, tooltipTextNoOfLines = _0 === void 0 ? PieTooltipDefaults.tooltipTextNoOfLines : _0, _1 = props.tooltipBackgroundColor, tooltipBackgroundColor = _1 === void 0 ? PieTooltipDefaults.tooltipBackgroundColor : _1, _2 = props.tooltipBorderRadius, tooltipBorderRadius = _2 === void 0 ? PieTooltipDefaults.tooltipBorderRadius : _2, textColor = props.textColor,
|
|
23
|
+
// textSize,
|
|
24
|
+
font = props.font, fontWeight = props.fontWeight, fontStyle = props.fontStyle;
|
|
25
|
+
var _3 = __read(useState(-1), 2), tooltipSelectedIndex = _3[0], setTooltipSelectedIndex = _3[1];
|
|
21
26
|
var radius = (_a = props.radius) !== null && _a !== void 0 ? _a : 120;
|
|
22
27
|
var extraRadius = (_b = props.extraRadius) !== null && _b !== void 0 ? _b : (props.showExternalLabels
|
|
23
28
|
? 40
|
|
@@ -25,10 +30,10 @@ export var usePieChart = function (props) {
|
|
|
25
30
|
? radius / 10
|
|
26
31
|
: 0);
|
|
27
32
|
var pi = props.semiCircle ? Math.PI / 2 : Math.PI;
|
|
28
|
-
var
|
|
33
|
+
var _4 = __read(useState((_d = props.focusedPieIndex) !== null && _d !== void 0 ? _d : -1), 2), selectedIndex = _4[0], setSelectedIndex = _4[1]; // at the start, nothing is selected
|
|
29
34
|
// because we're going to use a useEffect, we need startAngle and total to be state variables
|
|
30
|
-
var
|
|
31
|
-
var
|
|
35
|
+
var _5 = __read(useState((_e = props.initialAngle) !== null && _e !== void 0 ? _e : (props.semiCircle ? -pi : 0)), 2), startAngle = _5[0], setStartAngle = _5[1];
|
|
36
|
+
var _6 = __read(useState(0), 2), total = _6[0], setTotal = _6[1];
|
|
32
37
|
useEffect(function () {
|
|
33
38
|
var _a;
|
|
34
39
|
setSelectedIndex((_a = props.focusedPieIndex) !== null && _a !== void 0 ? _a : -1);
|
|
@@ -71,7 +76,7 @@ export var usePieChart = function (props) {
|
|
|
71
76
|
}
|
|
72
77
|
}
|
|
73
78
|
}, [selectedIndex]);
|
|
74
|
-
var pro = props.pro, data = props.data, donut = props.donut, isThreeD = props.isThreeD, semiCircle = props.semiCircle,
|
|
79
|
+
var pro = props.pro, data = props.data, donut = props.donut, isThreeD = props.isThreeD, semiCircle = props.semiCircle, _7 = props.inwardExtraLengthForFocused, inwardExtraLengthForFocused = _7 === void 0 ? 0 : _7, _8 = props.isAnimated, isAnimated = _8 === void 0 ? false : _8, edgesRadius = props.edgesRadius;
|
|
75
80
|
var endAngle = (_f = props.endAngle) !== null && _f !== void 0 ? _f : startAngle + Math.PI * (semiCircle ? 1 : 2);
|
|
76
81
|
var canvasWidth = radius * 2;
|
|
77
82
|
var canvasHeight = isThreeD ? radius * 2.3 : radius * 2;
|
|
@@ -96,6 +101,12 @@ export var usePieChart = function (props) {
|
|
|
96
101
|
var paddingVertical = ((_u = props.paddingVertical) !== null && _u !== void 0 ? _u : props.labelsPosition === 'onBorder')
|
|
97
102
|
? ((_v = props.textBackgroundRadius) !== null && _v !== void 0 ? _v : textSize) * 2 + 6
|
|
98
103
|
: 0;
|
|
104
|
+
var getTooltipText = function (index) {
|
|
105
|
+
var _a, _b;
|
|
106
|
+
var item = data[index];
|
|
107
|
+
var tooltipText = (_b = (_a = item.tooltipText) !== null && _a !== void 0 ? _a : item.text) !== null && _b !== void 0 ? _b : (showValuesAsTooltipText ? item.value.toString() : '');
|
|
108
|
+
return tooltipText;
|
|
109
|
+
};
|
|
99
110
|
return {
|
|
100
111
|
radius: radius,
|
|
101
112
|
extraRadius: extraRadius,
|
|
@@ -124,6 +135,22 @@ export var usePieChart = function (props) {
|
|
|
124
135
|
tiltAngle: tiltAngle,
|
|
125
136
|
isDataShifted: isDataShifted,
|
|
126
137
|
paddingHorizontal: paddingHorizontal,
|
|
127
|
-
paddingVertical: paddingVertical
|
|
138
|
+
paddingVertical: paddingVertical,
|
|
139
|
+
showTooltip: showTooltip,
|
|
140
|
+
tooltipHorizontalShift: tooltipHorizontalShift,
|
|
141
|
+
tooltipVerticalShift: tooltipVerticalShift,
|
|
142
|
+
tooltipComponent: tooltipComponent,
|
|
143
|
+
getTooltipText: getTooltipText,
|
|
144
|
+
tooltipBackgroundColor: tooltipBackgroundColor,
|
|
145
|
+
tooltipBorderRadius: tooltipBorderRadius,
|
|
146
|
+
tooltipWidth: tooltipWidth,
|
|
147
|
+
tooltipTextNoOfLines: tooltipTextNoOfLines,
|
|
148
|
+
textColor: textColor,
|
|
149
|
+
textSize: textSize,
|
|
150
|
+
font: font,
|
|
151
|
+
fontWeight: fontWeight,
|
|
152
|
+
fontStyle: fontStyle,
|
|
153
|
+
tooltipSelectedIndex: tooltipSelectedIndex,
|
|
154
|
+
setTooltipSelectedIndex: setTooltipSelectedIndex
|
|
128
155
|
};
|
|
129
156
|
};
|
package/dist/PieChart/main.d.ts
CHANGED
|
@@ -32,8 +32,7 @@ export declare const getPieChartMainProps: (props: PieChartMainProps) => {
|
|
|
32
32
|
tooltipBackgroundColor: import("react-native").ColorValue;
|
|
33
33
|
tooltipBorderRadius: number;
|
|
34
34
|
tooltipSelectedIndex: number;
|
|
35
|
-
setTooltipSelectedIndex:
|
|
36
|
-
getTooltipText: (index: number) => string;
|
|
35
|
+
setTooltipSelectedIndex: any;
|
|
37
36
|
showText: boolean;
|
|
38
37
|
textColor: string;
|
|
39
38
|
textSize: number;
|
|
@@ -104,4 +103,5 @@ export declare const getPieChartMainProps: (props: PieChartMainProps) => {
|
|
|
104
103
|
font: string | undefined;
|
|
105
104
|
fontWeight: string | undefined;
|
|
106
105
|
fontStyle: import("react-native-svg").FontStyle | undefined;
|
|
106
|
+
edgesPressable: boolean | undefined;
|
|
107
107
|
};
|
package/dist/PieChart/main.js
CHANGED
|
@@ -34,15 +34,15 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
34
34
|
}
|
|
35
35
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
36
36
|
};
|
|
37
|
-
import { useRef
|
|
37
|
+
import { useRef } from 'react';
|
|
38
38
|
import { defaultLabelLineConfig, emptyExternaLabelProperties, getTextSizeForPieLabels } from '../utils';
|
|
39
39
|
import { PieTooltipDefaults } from '../utils/constants';
|
|
40
40
|
export var getPieChartMainProps = function (props) {
|
|
41
41
|
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;
|
|
42
|
-
var isThreeD = props.isThreeD, isBiggerPie = props.isBiggerPie, paddingHorizontal = props.paddingHorizontal, paddingVertical = props.paddingVertical, extraRadius = props.extraRadius, showExternalLabels = props.showExternalLabels, externalLabelComponent = props.externalLabelComponent, showTooltip = props.showTooltip, tooltipWidth = props.tooltipWidth, persistTooltip = props.persistTooltip, tooltipComponent = props.tooltipComponent, _13 = props.tooltipDuration, tooltipDuration = _13 === void 0 ? PieTooltipDefaults.tooltipDuration : _13, _14 = props.tooltipVerticalShift, tooltipVerticalShift = _14 === void 0 ? PieTooltipDefaults.tooltipVerticalShift : _14, _15 = props.tooltipHorizontalShift, tooltipHorizontalShift = _15 === void 0 ? PieTooltipDefaults.tooltipHorizontalShift : _15, _16 = props.showValuesAsTooltipText, showValuesAsTooltipText = _16 === void 0 ? PieTooltipDefaults.showValuesAsTooltipText : _16, _17 = props.tooltipTextNoOfLines, tooltipTextNoOfLines = _17 === void 0 ? PieTooltipDefaults.tooltipTextNoOfLines : _17, _18 = props.tooltipBackgroundColor, tooltipBackgroundColor = _18 === void 0 ? PieTooltipDefaults.tooltipBackgroundColor : _18, _19 = props.tooltipBorderRadius, tooltipBorderRadius = _19 === void 0 ? PieTooltipDefaults.tooltipBorderRadius : _19, font = props.font, fontWeight = props.fontWeight, fontStyle = props.fontStyle;
|
|
42
|
+
var isThreeD = props.isThreeD, isBiggerPie = props.isBiggerPie, paddingHorizontal = props.paddingHorizontal, paddingVertical = props.paddingVertical, extraRadius = props.extraRadius, showExternalLabels = props.showExternalLabels, externalLabelComponent = props.externalLabelComponent, showTooltip = props.showTooltip, tooltipWidth = props.tooltipWidth, persistTooltip = props.persistTooltip, tooltipComponent = props.tooltipComponent, _13 = props.tooltipDuration, tooltipDuration = _13 === void 0 ? PieTooltipDefaults.tooltipDuration : _13, _14 = props.tooltipVerticalShift, tooltipVerticalShift = _14 === void 0 ? PieTooltipDefaults.tooltipVerticalShift : _14, _15 = props.tooltipHorizontalShift, tooltipHorizontalShift = _15 === void 0 ? PieTooltipDefaults.tooltipHorizontalShift : _15, _16 = props.showValuesAsTooltipText, showValuesAsTooltipText = _16 === void 0 ? PieTooltipDefaults.showValuesAsTooltipText : _16, _17 = props.tooltipTextNoOfLines, tooltipTextNoOfLines = _17 === void 0 ? PieTooltipDefaults.tooltipTextNoOfLines : _17, _18 = props.tooltipBackgroundColor, tooltipBackgroundColor = _18 === void 0 ? PieTooltipDefaults.tooltipBackgroundColor : _18, _19 = props.tooltipBorderRadius, tooltipBorderRadius = _19 === void 0 ? PieTooltipDefaults.tooltipBorderRadius : _19, font = props.font, fontWeight = props.fontWeight, fontStyle = props.fontStyle, edgesPressable = props.edgesPressable, tooltipSelectedIndex = props.tooltipSelectedIndex, setTooltipSelectedIndex = props.setTooltipSelectedIndex;
|
|
43
43
|
var propData = props.data;
|
|
44
44
|
var data = [];
|
|
45
|
-
|
|
45
|
+
// const [tooltipSelectedIndex, setTooltipSelectedIndex] = useState(-1)
|
|
46
46
|
var minisculeDataItem = props.data.map(function (item) { return item.value; }).reduce(function (v, a) { return v + a; }) / 160000;
|
|
47
47
|
var itemHasInnerComponent = false;
|
|
48
48
|
if (propData) {
|
|
@@ -228,6 +228,7 @@ export var getPieChartMainProps = function (props) {
|
|
|
228
228
|
coordinates[index] = { sx: sx, sy: sy, ax: ax, ay: ay };
|
|
229
229
|
});
|
|
230
230
|
var timer = useRef(setTimeout(function () { })); // timer for tooltip
|
|
231
|
+
console.log('showTooltip----->', showTooltip);
|
|
231
232
|
var onPressed = function (item, index) {
|
|
232
233
|
if (item.onPress) {
|
|
233
234
|
item.onPress();
|
|
@@ -246,6 +247,7 @@ export var getPieChartMainProps = function (props) {
|
|
|
246
247
|
}
|
|
247
248
|
}
|
|
248
249
|
if (showTooltip) {
|
|
250
|
+
console.log('tooltipSelectedIndex b4----->', tooltipSelectedIndex);
|
|
249
251
|
if (tooltipSelectedIndex === index) {
|
|
250
252
|
setTooltipSelectedIndex(-1);
|
|
251
253
|
}
|
|
@@ -258,14 +260,9 @@ export var getPieChartMainProps = function (props) {
|
|
|
258
260
|
}, tooltipDuration);
|
|
259
261
|
}
|
|
260
262
|
}
|
|
263
|
+
console.log('tooltipSelectedIndex after----->', tooltipSelectedIndex);
|
|
261
264
|
}
|
|
262
265
|
};
|
|
263
|
-
var getTooltipText = function (index) {
|
|
264
|
-
var _a, _b;
|
|
265
|
-
var item = data[index];
|
|
266
|
-
var tooltipText = (_b = (_a = item.tooltipText) !== null && _a !== void 0 ? _a : item.text) !== null && _b !== void 0 ? _b : (showValuesAsTooltipText ? item.value.toString() : '');
|
|
267
|
-
return tooltipText;
|
|
268
|
-
};
|
|
269
266
|
return {
|
|
270
267
|
isThreeD: isThreeD,
|
|
271
268
|
isBiggerPie: isBiggerPie,
|
|
@@ -300,7 +297,7 @@ export var getPieChartMainProps = function (props) {
|
|
|
300
297
|
tooltipBorderRadius: tooltipBorderRadius,
|
|
301
298
|
tooltipSelectedIndex: tooltipSelectedIndex,
|
|
302
299
|
setTooltipSelectedIndex: setTooltipSelectedIndex,
|
|
303
|
-
|
|
300
|
+
// getTooltipText,
|
|
304
301
|
showText: showText,
|
|
305
302
|
textColor: textColor,
|
|
306
303
|
textSize: textSize,
|
|
@@ -335,6 +332,7 @@ export var getPieChartMainProps = function (props) {
|
|
|
335
332
|
onPressed: onPressed,
|
|
336
333
|
font: font,
|
|
337
334
|
fontWeight: fontWeight,
|
|
338
|
-
fontStyle: fontStyle
|
|
335
|
+
fontStyle: fontStyle,
|
|
336
|
+
edgesPressable: edgesPressable
|
|
339
337
|
};
|
|
340
338
|
};
|
package/dist/PieChart/types.d.ts
CHANGED
|
@@ -73,6 +73,10 @@ export interface PieChartPropsType {
|
|
|
73
73
|
showExternalLabels?: boolean;
|
|
74
74
|
labelLineConfig?: LabelLineConfig;
|
|
75
75
|
externalLabelComponent?: (item?: pieDataItem, index?: number) => any;
|
|
76
|
+
/**
|
|
77
|
+
* @description If true, the edges of the pie will be pressable, but you may need to press twice for focus- once for unfocusing the already focused pie and then for focusing the new pie
|
|
78
|
+
*/
|
|
79
|
+
edgesPressable?: boolean;
|
|
76
80
|
}
|
|
77
81
|
export interface pieDataItem {
|
|
78
82
|
value: number;
|
|
@@ -116,4 +120,8 @@ export interface PieChartMainProps extends PieChartPropsType {
|
|
|
116
120
|
paddingHorizontal: number;
|
|
117
121
|
paddingVertical: number;
|
|
118
122
|
extraRadius: number;
|
|
123
|
+
setTouchX: Function;
|
|
124
|
+
setTouchY: Function;
|
|
125
|
+
tooltipSelectedIndex: number;
|
|
126
|
+
setTooltipSelectedIndex: any;
|
|
119
127
|
}
|
|
@@ -39,7 +39,7 @@ import { AxesAndRulesDefaults, BarDefaults } from '../../utils/constants';
|
|
|
39
39
|
import { computeMaxAndMinItems } from '../../utils';
|
|
40
40
|
export var useBarAndLineChartsWrapper = function (props) {
|
|
41
41
|
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;
|
|
42
|
-
var chartType = props.chartType, containerHeight = props.containerHeight, noOfSectionsBelowXAxis = props.noOfSectionsBelowXAxis, sectionColors = props.sectionColors, stepHeight = props.stepHeight, negativeStepHeight = props.negativeStepHeight, labelsExtraHeight = props.labelsExtraHeight, yAxisLabelWidth = props.yAxisLabelWidth, horizontal = props.horizontal, rtl = props.rtl, shiftX = props.shiftX, shiftY = props.shiftY, initialSpacing = props.initialSpacing, data = props.data, dataSet = props.dataSet, stackData = props.stackData, secondaryData = props.secondaryData, barWidth = props.barWidth, xAxisThickness = props.xAxisThickness, totalWidth = props.totalWidth, spacing = props.spacing, lineConfig = props.lineConfig, lineConfig2 = props.lineConfig2, maxValue = props.maxValue, lineData = props.lineData, lineData2 = props.lineData2, animatedWidth = props.animatedWidth, lineBehindBars = props.lineBehindBars, points = props.points, points2 = props.points2, arrowPoints = props.arrowPoints, width = props.width, horizSections = props.horizSections, endSpacing = props.endSpacing, horizontalRulesStyle = props.horizontalRulesStyle, noOfSections = props.noOfSections, showFractionalValues = props.showFractionalValues, axesAndRulesProps = props.axesAndRulesProps, yAxisLabelTexts = props.yAxisLabelTexts, yAxisOffset = props.yAxisOffset, rotateYAxisTexts = props.rotateYAxisTexts, pointerConfig = props.pointerConfig, getPointerProps = props.getPointerProps, pointerIndex = props.pointerIndex, pointerX = props.pointerX, pointerY = props.pointerY, scrollEventThrottle = props.scrollEventThrottle, endReachedOffset = props.endReachedOffset, isRTL = props.isRTL, selectedIndex = props.selectedIndex, onlyPositive = props.onlyPositive;
|
|
42
|
+
var chartType = props.chartType, containerHeight = props.containerHeight, noOfSectionsBelowXAxis = props.noOfSectionsBelowXAxis, sectionColors = props.sectionColors, stepHeight = props.stepHeight, negativeStepHeight = props.negativeStepHeight, labelsExtraHeight = props.labelsExtraHeight, yAxisLabelWidth = props.yAxisLabelWidth, horizontal = props.horizontal, rtl = props.rtl, shiftX = props.shiftX, shiftY = props.shiftY, initialSpacing = props.initialSpacing, data = props.data, dataSet = props.dataSet, stackData = props.stackData, secondaryData = props.secondaryData, barWidth = props.barWidth, xAxisThickness = props.xAxisThickness, totalWidth = props.totalWidth, spacing = props.spacing, lineConfig = props.lineConfig, lineConfig2 = props.lineConfig2, maxValue = props.maxValue, lineData = props.lineData, lineData2 = props.lineData2, animatedWidth = props.animatedWidth, lineBehindBars = props.lineBehindBars, points = props.points, points2 = props.points2, arrowPoints = props.arrowPoints, width = props.width, horizSections = props.horizSections, endSpacing = props.endSpacing, horizontalRulesStyle = props.horizontalRulesStyle, noOfSections = props.noOfSections, showFractionalValues = props.showFractionalValues, axesAndRulesProps = props.axesAndRulesProps, yAxisLabelTexts = props.yAxisLabelTexts, yAxisOffset = props.yAxisOffset, rotateYAxisTexts = props.rotateYAxisTexts, pointerConfig = props.pointerConfig, getPointerProps = props.getPointerProps, pointerIndex = props.pointerIndex, pointerX = props.pointerX, pointerY = props.pointerY, scrollEventThrottle = props.scrollEventThrottle, endReachedOffset = props.endReachedOffset, isRTL = props.isRTL, selectedIndex = props.selectedIndex, onlyPositive = props.onlyPositive, highlightEnabled = props.highlightEnabled, lowlightOpacity = props.lowlightOpacity;
|
|
43
43
|
var yAxisAtTop = rtl ? !props.yAxisAtTop : props.yAxisAtTop;
|
|
44
44
|
var hideOrigin = (_a = axesAndRulesProps.hideOrigin) !== null && _a !== void 0 ? _a : AxesAndRulesDefaults.hideOrigin;
|
|
45
45
|
var yAxisSide = (_b = axesAndRulesProps.yAxisSide) !== null && _b !== void 0 ? _b : AxesAndRulesDefaults.yAxisSide;
|
|
@@ -204,7 +204,9 @@ export var useBarAndLineChartsWrapper = function (props) {
|
|
|
204
204
|
yAxisOffset: (lineConfig === null || lineConfig === void 0 ? void 0 : lineConfig.isSecondary)
|
|
205
205
|
? (_16 = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.yAxisOffset) !== null && _16 !== void 0 ? _16 : 0
|
|
206
206
|
: yAxisOffset !== null && yAxisOffset !== void 0 ? yAxisOffset : 0,
|
|
207
|
-
strokeDashArray: (_17 = lineConfig === null || lineConfig === void 0 ? void 0 : lineConfig.strokeDashArray) !== null && _17 !== void 0 ? _17 : [0, 0]
|
|
207
|
+
strokeDashArray: (_17 = lineConfig === null || lineConfig === void 0 ? void 0 : lineConfig.strokeDashArray) !== null && _17 !== void 0 ? _17 : [0, 0],
|
|
208
|
+
highlightEnabled: highlightEnabled,
|
|
209
|
+
lowlightOpacity: lowlightOpacity
|
|
208
210
|
};
|
|
209
211
|
var lineInBarChartProps2 = __assign(__assign({}, lineInBarChartProps), { lineConfig: lineConfig2, points: points2, data: lineData2 !== null && lineData2 !== void 0 ? lineData2 : [], yAxisOffset: (lineConfig2 === null || lineConfig2 === void 0 ? void 0 : lineConfig2.isSecondary)
|
|
210
212
|
? (_18 = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.yAxisOffset) !== null && _18 !== void 0 ? _18 : 0
|
|
@@ -120,6 +120,9 @@ export declare const BarDefaults: {
|
|
|
120
120
|
focusedBarSideColor: string;
|
|
121
121
|
focusedBarTopColor: string;
|
|
122
122
|
renderTooltipConditions: string[];
|
|
123
|
+
highlightEnabled: boolean;
|
|
124
|
+
lowlightOpacity: number;
|
|
125
|
+
stackHighlightEnabled: boolean;
|
|
123
126
|
};
|
|
124
127
|
export declare const LineDefaults: {
|
|
125
128
|
color: string;
|
|
@@ -168,6 +171,8 @@ export declare const LineDefaults: {
|
|
|
168
171
|
edgePosition: EdgePosition;
|
|
169
172
|
endReachedOffset: number;
|
|
170
173
|
strokeLinecap: Linecap;
|
|
174
|
+
highlightEnabled: boolean;
|
|
175
|
+
lowlightOpacity: number;
|
|
171
176
|
};
|
|
172
177
|
export declare const defaultLineConfig: defaultLineConfigType;
|
|
173
178
|
export declare const defaultPointerConfig: {
|
package/dist/utils/constants.js
CHANGED
|
@@ -130,7 +130,10 @@ export var BarDefaults = {
|
|
|
130
130
|
focusedThreeDBarFrontColor: '#B0B929',
|
|
131
131
|
focusedBarSideColor: '#776913',
|
|
132
132
|
focusedBarTopColor: '#C8D565',
|
|
133
|
-
renderTooltipConditions: ['onClick', 'onHover']
|
|
133
|
+
renderTooltipConditions: ['onClick', 'onHover'],
|
|
134
|
+
highlightEnabled: false,
|
|
135
|
+
lowlightOpacity: 0.3,
|
|
136
|
+
stackHighlightEnabled: false
|
|
134
137
|
};
|
|
135
138
|
// Line chart specific
|
|
136
139
|
export var LineDefaults = {
|
|
@@ -179,7 +182,9 @@ export var LineDefaults = {
|
|
|
179
182
|
delayBeforeUnFocus: 300,
|
|
180
183
|
edgePosition: EdgePosition.AFTER_DATA_POINT,
|
|
181
184
|
endReachedOffset: defaultEndReachedOffset,
|
|
182
|
-
strokeLinecap: 'butt'
|
|
185
|
+
strokeLinecap: 'butt',
|
|
186
|
+
highlightEnabled: false,
|
|
187
|
+
lowlightOpacity: 0.3
|
|
183
188
|
};
|
|
184
189
|
export var defaultLineConfig = {
|
|
185
190
|
initialSpacing: BarDefaults.spacing, // gets updated to spacing before being used
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -150,6 +150,8 @@ export interface LineInBarChartPropsType {
|
|
|
150
150
|
selectedIndex: number;
|
|
151
151
|
yAxisOffset: number;
|
|
152
152
|
strokeDashArray: number[];
|
|
153
|
+
highlightEnabled: boolean;
|
|
154
|
+
lowlightOpacity: number;
|
|
153
155
|
}
|
|
154
156
|
export interface DataPointProps {
|
|
155
157
|
data: any[];
|
|
@@ -162,6 +164,7 @@ export interface DataPointProps {
|
|
|
162
164
|
spacing: number;
|
|
163
165
|
selectedIndex: number;
|
|
164
166
|
yAxisOffset: number;
|
|
167
|
+
opacity: number;
|
|
165
168
|
}
|
|
166
169
|
export interface referenceConfigType {
|
|
167
170
|
thickness?: number;
|
|
@@ -335,6 +338,8 @@ export interface BarAndLineChartsWrapperTypes {
|
|
|
335
338
|
dataSet?: DataSetNullSafe[];
|
|
336
339
|
customBackground?: CustomBackground;
|
|
337
340
|
onlyPositive?: boolean;
|
|
341
|
+
highlightEnabled: boolean;
|
|
342
|
+
lowlightOpacity: number;
|
|
338
343
|
}
|
|
339
344
|
export interface HorizontalStripConfig {
|
|
340
345
|
thickness?: number;
|