gifted-charts-core 0.1.3 → 0.1.4
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/package.json +1 -1
- package/src/BarChart/index.js +68 -65
- package/src/BarChart/index.ts +6 -2
- package/src/BarChart/types.d.ts +1 -0
- package/src/BarChart/types.ts +1 -0
- package/src/LineChart/index.js +2 -1
- package/src/LineChart/index.ts +2 -1
- package/src/LineChart/types.d.ts +1 -0
- package/src/LineChart/types.ts +1 -0
- package/src/utils/types.d.ts +1 -0
- package/src/utils/types.ts +1 -0
package/package.json
CHANGED
package/src/BarChart/index.js
CHANGED
|
@@ -29,12 +29,12 @@ import { useEffect, useMemo, useState } from 'react';
|
|
|
29
29
|
import { getArrowPoints, getAxesAndRulesProps, getExtendedContainerHeightWithPadding, getLineConfigForBarChart, getMaxValue, getNoOfSections, getSecondaryDataWithOffsetIncluded, getXForLineInBar, getYForLineInBar, 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;
|
|
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;
|
|
33
33
|
var heightValue = props.heightValue, widthValue = props.widthValue, opacValue = props.opacValue, yAxisOffset = props.yAxisOffset;
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
34
|
+
var _48 = __read(useState(''), 2), points = _48[0], setPoints = _48[1];
|
|
35
|
+
var _49 = __read(useState(''), 2), points2 = _49[0], setPoints2 = _49[1];
|
|
36
|
+
var _50 = __read(useState(''), 2), arrowPoints = _50[0], setArrowPoints = _50[1];
|
|
37
|
+
var _51 = __read(useState(-1), 2), selectedIndex = _51[0], setSelectedIndex = _51[1];
|
|
38
38
|
var showLine = (_a = props.showLine) !== null && _a !== void 0 ? _a : BarDefaults.showLine;
|
|
39
39
|
var spacing = (_b = props.spacing) !== null && _b !== void 0 ? _b : BarDefaults.spacing;
|
|
40
40
|
var initialSpacing = (_c = props.initialSpacing) !== null && _c !== void 0 ? _c : spacing;
|
|
@@ -145,78 +145,80 @@ export var useBarChart = function (props) {
|
|
|
145
145
|
var secondaryMaxAndMin = maxAndMinUtil(secondaryMaxItem, secondaryMinItem, props.roundToDigits, props.showFractionalValues);
|
|
146
146
|
var maxValue = getMaxValue(props.maxValue, props.stepValue, noOfSections, maxAndMin.maxItem);
|
|
147
147
|
var secondaryMaxValue = lineConfig.isSecondary
|
|
148
|
-
?
|
|
148
|
+
? typeof props.secondaryYAxis !== 'boolean'
|
|
149
|
+
? (_u = props.secondaryYAxis.maxValue) !== null && _u !== void 0 ? _u : secondaryMaxAndMin.maxItem
|
|
150
|
+
: secondaryMaxAndMin.maxItem
|
|
149
151
|
: maxValue;
|
|
150
|
-
var mostNegativeValue = (
|
|
151
|
-
var stepValue = (
|
|
152
|
-
var noOfSectionsBelowXAxis = (
|
|
153
|
-
var showScrollIndicator = (
|
|
154
|
-
var side = (
|
|
155
|
-
var rotateLabel = (
|
|
156
|
-
var opacity = (
|
|
157
|
-
var isThreeD = (
|
|
158
|
-
var showXAxisIndices = (
|
|
159
|
-
var xAxisIndicesHeight = (
|
|
160
|
-
var xAxisIndicesWidth = (
|
|
161
|
-
var xAxisIndicesColor = (
|
|
162
|
-
var xAxisThickness = (
|
|
163
|
-
var xAxisTextNumberOfLines = (
|
|
164
|
-
var xAxisLabelsVerticalShift = (
|
|
152
|
+
var mostNegativeValue = (_v = props.mostNegativeValue) !== null && _v !== void 0 ? _v : maxAndMin.minItem;
|
|
153
|
+
var stepValue = (_w = props.stepValue) !== null && _w !== void 0 ? _w : maxValue / noOfSections;
|
|
154
|
+
var noOfSectionsBelowXAxis = (_x = props.noOfSectionsBelowXAxis) !== null && _x !== void 0 ? _x : -mostNegativeValue / stepValue;
|
|
155
|
+
var showScrollIndicator = (_y = props.showScrollIndicator) !== null && _y !== void 0 ? _y : BarDefaults.showScrollIndicator;
|
|
156
|
+
var side = (_z = props.side) !== null && _z !== void 0 ? _z : BarDefaults.side;
|
|
157
|
+
var rotateLabel = (_0 = props.rotateLabel) !== null && _0 !== void 0 ? _0 : AxesAndRulesDefaults.rotateLabel;
|
|
158
|
+
var opacity = (_1 = props.opacity) !== null && _1 !== void 0 ? _1 : BarDefaults.opacity;
|
|
159
|
+
var isThreeD = (_2 = props.isThreeD) !== null && _2 !== void 0 ? _2 : BarDefaults.isThreeD;
|
|
160
|
+
var showXAxisIndices = (_3 = props.showXAxisIndices) !== null && _3 !== void 0 ? _3 : AxesAndRulesDefaults.showXAxisIndices;
|
|
161
|
+
var xAxisIndicesHeight = (_4 = props.xAxisIndicesHeight) !== null && _4 !== void 0 ? _4 : AxesAndRulesDefaults.xAxisIndicesHeight;
|
|
162
|
+
var xAxisIndicesWidth = (_5 = props.xAxisIndicesWidth) !== null && _5 !== void 0 ? _5 : AxesAndRulesDefaults.xAxisIndicesWidth;
|
|
163
|
+
var xAxisIndicesColor = (_6 = props.xAxisIndicesColor) !== null && _6 !== void 0 ? _6 : AxesAndRulesDefaults.xAxisIndicesColor;
|
|
164
|
+
var xAxisThickness = (_7 = props.xAxisThickness) !== null && _7 !== void 0 ? _7 : AxesAndRulesDefaults.xAxisThickness;
|
|
165
|
+
var xAxisTextNumberOfLines = (_8 = props.xAxisTextNumberOfLines) !== null && _8 !== void 0 ? _8 : AxesAndRulesDefaults.xAxisTextNumberOfLines;
|
|
166
|
+
var xAxisLabelsVerticalShift = (_9 = props.xAxisLabelsVerticalShift) !== null && _9 !== void 0 ? _9 : AxesAndRulesDefaults.xAxisLabelsVerticalShift;
|
|
165
167
|
var horizontalRulesStyle = props.horizontalRulesStyle;
|
|
166
|
-
var yAxisLabelWidth = (
|
|
168
|
+
var yAxisLabelWidth = (_10 = props.yAxisLabelWidth) !== null && _10 !== void 0 ? _10 : (props.hideYAxisText
|
|
167
169
|
? AxesAndRulesDefaults.yAxisEmptyLabelWidth
|
|
168
170
|
: AxesAndRulesDefaults.yAxisLabelWidth);
|
|
169
|
-
var autoShiftLabels = (
|
|
170
|
-
var barWidth = (
|
|
171
|
-
var barBorderColor = (
|
|
171
|
+
var autoShiftLabels = (_11 = props.autoShiftLabels) !== null && _11 !== void 0 ? _11 : false;
|
|
172
|
+
var barWidth = (_12 = props.barWidth) !== null && _12 !== void 0 ? _12 : BarDefaults.barWidth;
|
|
173
|
+
var barBorderColor = (_13 = props.barBorderColor) !== null && _13 !== void 0 ? _13 : BarDefaults.barBorderColor;
|
|
172
174
|
var extendedContainerHeight = getExtendedContainerHeightWithPadding(containerHeight, 0);
|
|
173
175
|
var containerHeightIncludingBelowXAxis = extendedContainerHeight + noOfSectionsBelowXAxis * stepHeight;
|
|
174
|
-
var
|
|
175
|
-
var
|
|
176
|
-
var
|
|
177
|
-
var
|
|
178
|
-
var
|
|
179
|
-
var
|
|
176
|
+
var _52 = __read(useState(-1), 2), pointerIndex = _52[0], setPointerIndex = _52[1];
|
|
177
|
+
var _53 = __read(useState(0), 2), pointerX = _53[0], setPointerX = _53[1];
|
|
178
|
+
var _54 = __read(useState(0), 2), pointerY = _54[0], setPointerY = _54[1];
|
|
179
|
+
var _55 = __read(useState(), 2), pointerItem = _55[0], setPointerItem = _55[1];
|
|
180
|
+
var _56 = __read(useState(0), 2), responderStartTime = _56[0], setResponderStartTime = _56[1];
|
|
181
|
+
var _57 = __read(useState(false), 2), responderActive = _57[0], setResponderActive = _57[1];
|
|
180
182
|
var pointerConfig = props.pointerConfig;
|
|
181
|
-
var getPointerProps = (
|
|
182
|
-
var pointerHeight = (
|
|
183
|
-
var pointerWidth = (
|
|
184
|
-
var pointerRadius = (
|
|
185
|
-
var pointerColor = (
|
|
186
|
-
var pointerComponent = (
|
|
183
|
+
var getPointerProps = (_14 = props.getPointerProps) !== null && _14 !== void 0 ? _14 : null;
|
|
184
|
+
var pointerHeight = (_15 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.height) !== null && _15 !== void 0 ? _15 : defaultPointerConfig.height;
|
|
185
|
+
var pointerWidth = (_16 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.width) !== null && _16 !== void 0 ? _16 : defaultPointerConfig.width;
|
|
186
|
+
var pointerRadius = (_17 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.radius) !== null && _17 !== void 0 ? _17 : defaultPointerConfig.radius;
|
|
187
|
+
var pointerColor = (_18 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerColor) !== null && _18 !== void 0 ? _18 : defaultPointerConfig.pointerColor;
|
|
188
|
+
var pointerComponent = (_19 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerComponent) !== null && _19 !== void 0 ? _19 : defaultPointerConfig.pointerComponent;
|
|
187
189
|
var showPointerStrip = (pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.showPointerStrip) === false
|
|
188
190
|
? false
|
|
189
191
|
: defaultPointerConfig.showPointerStrip;
|
|
190
|
-
var pointerStripHeight = (
|
|
191
|
-
var pointerStripWidth = (
|
|
192
|
-
var pointerStripColor = (
|
|
193
|
-
var pointerStripUptoDataPoint = (
|
|
194
|
-
var pointerLabelComponent = (
|
|
195
|
-
var stripOverPointer = (
|
|
196
|
-
var shiftPointerLabelX = (
|
|
197
|
-
var shiftPointerLabelY = (
|
|
198
|
-
var pointerLabelWidth = (
|
|
199
|
-
var pointerLabelHeight = (
|
|
200
|
-
var autoAdjustPointerLabelPosition = (
|
|
201
|
-
var pointerVanishDelay = (
|
|
202
|
-
var activatePointersOnLongPress = (
|
|
203
|
-
var activatePointersDelay = (
|
|
204
|
-
var initialPointerIndex = (
|
|
205
|
-
var initialPointerAppearDelay = (
|
|
192
|
+
var pointerStripHeight = (_20 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripHeight) !== null && _20 !== void 0 ? _20 : defaultPointerConfig.pointerStripHeight;
|
|
193
|
+
var pointerStripWidth = (_21 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripWidth) !== null && _21 !== void 0 ? _21 : defaultPointerConfig.pointerStripWidth;
|
|
194
|
+
var pointerStripColor = (_22 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripColor) !== null && _22 !== void 0 ? _22 : defaultPointerConfig.pointerStripColor;
|
|
195
|
+
var pointerStripUptoDataPoint = (_23 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripUptoDataPoint) !== null && _23 !== void 0 ? _23 : defaultPointerConfig.pointerStripUptoDataPoint;
|
|
196
|
+
var pointerLabelComponent = (_24 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelComponent) !== null && _24 !== void 0 ? _24 : defaultPointerConfig.pointerLabelComponent;
|
|
197
|
+
var stripOverPointer = (_25 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.stripOverPointer) !== null && _25 !== void 0 ? _25 : defaultPointerConfig.stripOverPointer;
|
|
198
|
+
var shiftPointerLabelX = (_26 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.shiftPointerLabelX) !== null && _26 !== void 0 ? _26 : defaultPointerConfig.shiftPointerLabelX;
|
|
199
|
+
var shiftPointerLabelY = (_27 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.shiftPointerLabelY) !== null && _27 !== void 0 ? _27 : defaultPointerConfig.shiftPointerLabelY;
|
|
200
|
+
var pointerLabelWidth = (_28 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelWidth) !== null && _28 !== void 0 ? _28 : defaultPointerConfig.pointerLabelWidth;
|
|
201
|
+
var pointerLabelHeight = (_29 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelHeight) !== null && _29 !== void 0 ? _29 : defaultPointerConfig.pointerLabelHeight;
|
|
202
|
+
var autoAdjustPointerLabelPosition = (_30 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.autoAdjustPointerLabelPosition) !== null && _30 !== void 0 ? _30 : defaultPointerConfig.autoAdjustPointerLabelPosition;
|
|
203
|
+
var pointerVanishDelay = (_31 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerVanishDelay) !== null && _31 !== void 0 ? _31 : defaultPointerConfig.pointerVanishDelay;
|
|
204
|
+
var activatePointersOnLongPress = (_32 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersOnLongPress) !== null && _32 !== void 0 ? _32 : defaultPointerConfig.activatePointersOnLongPress;
|
|
205
|
+
var activatePointersDelay = (_33 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersDelay) !== null && _33 !== void 0 ? _33 : defaultPointerConfig.activatePointersDelay;
|
|
206
|
+
var initialPointerIndex = (_34 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.initialPointerIndex) !== null && _34 !== void 0 ? _34 : defaultPointerConfig.initialPointerIndex;
|
|
207
|
+
var initialPointerAppearDelay = (_35 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.initialPointerAppearDelay) !== null && _35 !== void 0 ? _35 : (isAnimated
|
|
206
208
|
? animationDuration
|
|
207
209
|
: defaultPointerConfig.initialPointerAppearDelay);
|
|
208
|
-
var persistPointer = (
|
|
209
|
-
var hidePointer1 = (
|
|
210
|
+
var persistPointer = (_36 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.persistPointer) !== null && _36 !== void 0 ? _36 : defaultPointerConfig.persistPointer;
|
|
211
|
+
var hidePointer1 = (_37 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer1) !== null && _37 !== void 0 ? _37 : defaultPointerConfig.hidePointer1;
|
|
210
212
|
var pointerEvents = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerEvents;
|
|
211
|
-
var stripBehindBars = (
|
|
212
|
-
var disableScroll = (
|
|
213
|
+
var stripBehindBars = (_38 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.stripBehindBars) !== null && _38 !== void 0 ? _38 : defaultPointerConfig.stripBehindBars;
|
|
214
|
+
var disableScroll = (_39 = props.disableScroll) !== null && _39 !== void 0 ? _39 : (pointerConfig
|
|
213
215
|
? activatePointersOnLongPress
|
|
214
216
|
? !!responderActive
|
|
215
217
|
: true
|
|
216
218
|
: false);
|
|
217
219
|
var yAxisExtraHeightAtTop = props.trimYAxisAtTop
|
|
218
220
|
? 0
|
|
219
|
-
: (
|
|
221
|
+
: (_40 = props.yAxisExtraHeight) !== null && _40 !== void 0 ? _40 : containerHeight / 20;
|
|
220
222
|
var barInnerComponent = props.barInnerComponent;
|
|
221
223
|
useEffect(function () {
|
|
222
224
|
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;
|
|
@@ -332,9 +334,9 @@ export var useBarChart = function (props) {
|
|
|
332
334
|
spacing,
|
|
333
335
|
yAxisLabelWidth,
|
|
334
336
|
lineConfig.showArrow,
|
|
335
|
-
(
|
|
336
|
-
(
|
|
337
|
-
(
|
|
337
|
+
(_41 = lineConfig.arrowConfig) === null || _41 === void 0 ? void 0 : _41.length,
|
|
338
|
+
(_42 = lineConfig.arrowConfig) === null || _42 === void 0 ? void 0 : _42.width,
|
|
339
|
+
(_43 = lineConfig.arrowConfig) === null || _43 === void 0 ? void 0 : _43.showArrowBase
|
|
338
340
|
]);
|
|
339
341
|
useEffect(function () {
|
|
340
342
|
var _a, _b, _c, _d;
|
|
@@ -449,14 +451,14 @@ export var useBarChart = function (props) {
|
|
|
449
451
|
yAxisLabelWidth: yAxisLabelWidth,
|
|
450
452
|
horizontal: horizontal,
|
|
451
453
|
rtl: rtl,
|
|
452
|
-
shiftX: (
|
|
453
|
-
shiftY: (
|
|
454
|
+
shiftX: (_44 = props.shiftX) !== null && _44 !== void 0 ? _44 : 0,
|
|
455
|
+
shiftY: (_45 = props.shiftY) !== null && _45 !== void 0 ? _45 : 0,
|
|
454
456
|
yAxisAtTop: yAxisAtTop,
|
|
455
457
|
initialSpacing: initialSpacing,
|
|
456
458
|
data: data,
|
|
457
459
|
stackData: props.stackData,
|
|
458
460
|
secondaryData: secondaryData,
|
|
459
|
-
barWidth: (
|
|
461
|
+
barWidth: (_46 = props.barWidth) !== null && _46 !== void 0 ? _46 : BarDefaults.barWidth,
|
|
460
462
|
xAxisThickness: xAxisThickness,
|
|
461
463
|
totalWidth: totalWidth,
|
|
462
464
|
disableScroll: disableScroll,
|
|
@@ -503,7 +505,8 @@ export var useBarChart = function (props) {
|
|
|
503
505
|
pointerY: pointerY,
|
|
504
506
|
onEndReached: props.onEndReached,
|
|
505
507
|
onStartReached: props.onStartReached,
|
|
506
|
-
endReachedOffset: (
|
|
508
|
+
endReachedOffset: (_47 = props.endReachedOffset) !== null && _47 !== void 0 ? _47 : BarDefaults.endReachedOffset,
|
|
509
|
+
onMomentumScrollEnd: props.onMomentumScrollEnd
|
|
507
510
|
};
|
|
508
511
|
return {
|
|
509
512
|
lineConfig: lineConfig,
|
package/src/BarChart/index.ts
CHANGED
|
@@ -204,7 +204,10 @@ export const useBarChart = (props: extendedBarChartPropsType) => {
|
|
|
204
204
|
maxAndMin.maxItem
|
|
205
205
|
)
|
|
206
206
|
const secondaryMaxValue = lineConfig.isSecondary
|
|
207
|
-
?
|
|
207
|
+
? typeof props.secondaryYAxis !== 'boolean'
|
|
208
|
+
? (props.secondaryYAxis as secondaryYAxisType).maxValue ??
|
|
209
|
+
secondaryMaxAndMin.maxItem
|
|
210
|
+
: secondaryMaxAndMin.maxItem
|
|
208
211
|
: maxValue
|
|
209
212
|
const mostNegativeValue = props.mostNegativeValue ?? maxAndMin.minItem
|
|
210
213
|
|
|
@@ -733,7 +736,8 @@ export const useBarChart = (props: extendedBarChartPropsType) => {
|
|
|
733
736
|
|
|
734
737
|
onEndReached: props.onEndReached,
|
|
735
738
|
onStartReached: props.onStartReached,
|
|
736
|
-
endReachedOffset: props.endReachedOffset ?? BarDefaults.endReachedOffset
|
|
739
|
+
endReachedOffset: props.endReachedOffset ?? BarDefaults.endReachedOffset,
|
|
740
|
+
onMomentumScrollEnd: props.onMomentumScrollEnd
|
|
737
741
|
}
|
|
738
742
|
|
|
739
743
|
return {
|
package/src/BarChart/types.d.ts
CHANGED
package/src/BarChart/types.ts
CHANGED
package/src/LineChart/index.js
CHANGED
|
@@ -1076,7 +1076,8 @@ export var useLineChart = function (props) {
|
|
|
1076
1076
|
pointerY: pointerY,
|
|
1077
1077
|
onEndReached: props.onEndReached,
|
|
1078
1078
|
onStartReached: props.onStartReached,
|
|
1079
|
-
endReachedOffset: (_291 = props.endReachedOffset) !== null && _291 !== void 0 ? _291 : LineDefaults.endReachedOffset
|
|
1079
|
+
endReachedOffset: (_291 = props.endReachedOffset) !== null && _291 !== void 0 ? _291 : LineDefaults.endReachedOffset,
|
|
1080
|
+
onMomentumScrollEnd: props.onMomentumScrollEnd
|
|
1080
1081
|
};
|
|
1081
1082
|
return {
|
|
1082
1083
|
curvature: curvature,
|
package/src/LineChart/index.ts
CHANGED
|
@@ -1787,7 +1787,8 @@ export const useLineChart = (props: extendedLineChartPropsType) => {
|
|
|
1787
1787
|
|
|
1788
1788
|
onEndReached: props.onEndReached,
|
|
1789
1789
|
onStartReached: props.onStartReached,
|
|
1790
|
-
endReachedOffset: props.endReachedOffset ?? LineDefaults.endReachedOffset
|
|
1790
|
+
endReachedOffset: props.endReachedOffset ?? LineDefaults.endReachedOffset,
|
|
1791
|
+
onMomentumScrollEnd: props.onMomentumScrollEnd
|
|
1791
1792
|
}
|
|
1792
1793
|
|
|
1793
1794
|
return {
|
package/src/LineChart/types.d.ts
CHANGED
|
@@ -288,6 +288,7 @@ export interface LineChartPropsType {
|
|
|
288
288
|
onStartReached?: () => void;
|
|
289
289
|
endReachedOffset?: number;
|
|
290
290
|
onScroll?: Function;
|
|
291
|
+
onMomentumScrollEnd?: Function;
|
|
291
292
|
showDataPointsForMissingValues?: boolean;
|
|
292
293
|
interpolateMissingValues?: boolean;
|
|
293
294
|
onlyPositive?: boolean;
|
package/src/LineChart/types.ts
CHANGED
package/src/utils/types.d.ts
CHANGED