gifted-charts-core 0.1.55 → 0.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BarChart/RenderStackBars.d.ts +6 -1
- package/dist/BarChart/RenderStackBars.js +6 -4
- package/dist/BarChart/index.d.ts +1 -0
- package/dist/BarChart/index.js +12 -11
- package/dist/BarChart/types.d.ts +10 -0
- package/dist/LineChart/index.d.ts +13 -0
- package/dist/LineChart/index.js +195 -177
- package/dist/LineChart/types.d.ts +29 -0
- package/dist/RadarChart/index.d.ts +10 -0
- package/dist/RadarChart/index.js +56 -29
- package/dist/RadarChart/types.d.ts +5 -1
- package/dist/index.d.ts +2 -2
- package/dist/utils/constants.d.ts +7 -1
- package/dist/utils/constants.js +10 -4
- package/dist/utils/types.d.ts +11 -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;
|
package/dist/BarChart/index.js
CHANGED
|
@@ -472,7 +472,7 @@ export var useBarChart = function (props) {
|
|
|
472
472
|
outputRange: [0, initialSpacing + totalWidth]
|
|
473
473
|
});
|
|
474
474
|
var getPropsCommonForBarAndStack = function (item, index) {
|
|
475
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
475
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
476
476
|
return {
|
|
477
477
|
item: item,
|
|
478
478
|
index: index,
|
|
@@ -522,26 +522,27 @@ export var useBarChart = function (props) {
|
|
|
522
522
|
xAxisLabelsHeight: props.xAxisLabelsHeight,
|
|
523
523
|
xAxisLabelsVerticalShift: xAxisLabelsVerticalShift,
|
|
524
524
|
renderTooltip: props.renderTooltip,
|
|
525
|
-
|
|
525
|
+
renderTooltipConditions: (_e = props.renderTooltipConditions) !== null && _e !== void 0 ? _e : BarDefaults.renderTooltipConditions,
|
|
526
|
+
leftShiftForTooltip: (_f = props.leftShiftForTooltip) !== null && _f !== void 0 ? _f : 0,
|
|
526
527
|
autoCenterTooltip: autoCenterTooltip,
|
|
527
528
|
initialSpacing: initialSpacing,
|
|
528
529
|
selectedIndex: selectedIndex,
|
|
529
530
|
setSelectedIndex: setSelectedIndex,
|
|
530
|
-
activeOpacity: (
|
|
531
|
+
activeOpacity: (_g = props.activeOpacity) !== null && _g !== void 0 ? _g : 0.2,
|
|
531
532
|
noOfSectionsBelowXAxis: noOfSectionsBelowXAxis,
|
|
532
|
-
leftShiftForLastIndexTooltip: (
|
|
533
|
-
label: (
|
|
534
|
-
secondaryLabel: (
|
|
535
|
-
labelTextStyle: (
|
|
536
|
-
secondaryLabelTextStyle: (
|
|
533
|
+
leftShiftForLastIndexTooltip: (_h = props.leftShiftForLastIndexTooltip) !== null && _h !== void 0 ? _h : 0,
|
|
534
|
+
label: (_j = item.label) !== null && _j !== void 0 ? _j : (((_k = props.xAxisLabelTexts) === null || _k === void 0 ? void 0 : _k[index]) ? props.xAxisLabelTexts[index] : ''),
|
|
535
|
+
secondaryLabel: (_p = (_l = item.secondaryLabel) !== null && _l !== void 0 ? _l : (_o = (_m = props.secondaryXAxis) === null || _m === void 0 ? void 0 : _m.labelTexts) === null || _o === void 0 ? void 0 : _o[index]) !== null && _p !== void 0 ? _p : '',
|
|
536
|
+
labelTextStyle: (_q = item.labelTextStyle) !== null && _q !== void 0 ? _q : props.xAxisLabelTextStyle,
|
|
537
|
+
secondaryLabelTextStyle: (_u = (_t = (_r = item.secondaryLabelTextStyle) !== null && _r !== void 0 ? _r : (_s = props.secondaryXAxis) === null || _s === void 0 ? void 0 : _s.labelsTextStyle) !== null && _t !== void 0 ? _t : item.labelTextStyle) !== null && _u !== void 0 ? _u : props.xAxisLabelTextStyle,
|
|
537
538
|
pointerConfig: pointerConfig,
|
|
538
539
|
yAxisExtraHeightAtTop: yAxisExtraHeightAtTop,
|
|
539
540
|
yAxisOffset: yAxisOffset !== null && yAxisOffset !== void 0 ? yAxisOffset : 0,
|
|
540
541
|
focusedBarIndex: focusedBarIndex,
|
|
541
542
|
stepHeight: stepHeight,
|
|
542
543
|
stepValue: stepValue,
|
|
543
|
-
negativeStepHeight: (
|
|
544
|
-
negativeStepValue: (
|
|
544
|
+
negativeStepHeight: (_v = props.negativeStepHeight) !== null && _v !== void 0 ? _v : stepHeight,
|
|
545
|
+
negativeStepValue: (_w = props.negativeStepValue) !== null && _w !== void 0 ? _w : stepValue,
|
|
545
546
|
secondaryXAxis: props.secondaryXAxis,
|
|
546
547
|
secondaryYAxis: props.secondaryYAxis,
|
|
547
548
|
secondaryStepHeight: secondaryStepHeight,
|
|
@@ -549,7 +550,7 @@ export var useBarChart = function (props) {
|
|
|
549
550
|
secondaryNegativeStepHeight: secondaryNegativeStepHeight,
|
|
550
551
|
secondaryNegativeStepValue: secondaryNegativeStepValue,
|
|
551
552
|
secondaryNoOfSectionsBelowXAxis: secondaryNoOfSectionsBelowXAxis,
|
|
552
|
-
barMarginBottom: (
|
|
553
|
+
barMarginBottom: (_y = (_x = item.barMarginBottom) !== null && _x !== void 0 ? _x : props.barMarginBottom) !== null && _y !== void 0 ? _y : 0
|
|
553
554
|
};
|
|
554
555
|
};
|
|
555
556
|
var barAndLineChartsWrapperProps = {
|
package/dist/BarChart/types.d.ts
CHANGED
|
@@ -138,6 +138,12 @@ export interface StackedBarChartPropsType {
|
|
|
138
138
|
secondaryNoOfSectionsBelowXAxis: number;
|
|
139
139
|
containerHeightIncludingBelowXAxis: number;
|
|
140
140
|
}
|
|
141
|
+
export interface StackedBarChartPropsTypeForWeb extends StackedBarChartPropsType {
|
|
142
|
+
onContextMenu?: Function;
|
|
143
|
+
onMouseEnter?: Function;
|
|
144
|
+
onMouseLeave?: Function;
|
|
145
|
+
renderTooltipConditions?: string[];
|
|
146
|
+
}
|
|
141
147
|
export interface BarChartPropsType {
|
|
142
148
|
width?: number;
|
|
143
149
|
height?: number;
|
|
@@ -598,6 +604,9 @@ export interface RenderBarsPropsType {
|
|
|
598
604
|
secondaryNegativeStepValue: number;
|
|
599
605
|
secondaryNoOfSectionsBelowXAxis: number;
|
|
600
606
|
}
|
|
607
|
+
export interface RenderBarsPropsTypeForWeb extends RenderBarsPropsType {
|
|
608
|
+
renderTooltipConditions: string[];
|
|
609
|
+
}
|
|
601
610
|
export interface trianglePropTypes {
|
|
602
611
|
style: any;
|
|
603
612
|
width: number;
|
|
@@ -654,5 +663,6 @@ export interface BarChartPropsTypeForWeb extends BarChartPropsType {
|
|
|
654
663
|
onContextMenu?: Function;
|
|
655
664
|
onMouseEnter?: Function;
|
|
656
665
|
onMouseLeave?: Function;
|
|
666
|
+
renderTooltipConditions?: string[];
|
|
657
667
|
}
|
|
658
668
|
export {};
|
|
@@ -208,6 +208,11 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
|
|
|
208
208
|
strokeDashArray3: number[] | undefined;
|
|
209
209
|
strokeDashArray4: number[] | undefined;
|
|
210
210
|
strokeDashArray5: number[] | undefined;
|
|
211
|
+
strokeLinecap1: import("../utils/types").Linecap;
|
|
212
|
+
strokeLinecap2: import("../utils/types").Linecap;
|
|
213
|
+
strokeLinecap3: import("../utils/types").Linecap;
|
|
214
|
+
strokeLinecap4: import("../utils/types").Linecap;
|
|
215
|
+
strokeLinecap5: import("../utils/types").Linecap;
|
|
211
216
|
rotateLabel: boolean;
|
|
212
217
|
isAnimated: boolean;
|
|
213
218
|
hidePointers: boolean;
|
|
@@ -289,6 +294,7 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
|
|
|
289
294
|
thickness: number;
|
|
290
295
|
zIndex1: number;
|
|
291
296
|
strokeDashArray: number[] | undefined;
|
|
297
|
+
strokeLinecap: import("../utils/types").Linecap;
|
|
292
298
|
startIndex: number;
|
|
293
299
|
endIndex: number;
|
|
294
300
|
hideDataPoints: boolean;
|
|
@@ -404,4 +410,11 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
|
|
|
404
410
|
focusProximity: number;
|
|
405
411
|
handleFocus: (index: number, item: lineDataItemNullSafe, locationY: number, onStripPress: Function) => void;
|
|
406
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;
|
|
407
420
|
};
|
package/dist/LineChart/index.js
CHANGED
|
@@ -39,8 +39,8 @@ import { AxesAndRulesDefaults, LineDefaults, SEGMENT_END, SEGMENT_START, chartTy
|
|
|
39
39
|
import { computeMaxAndMinItems, getAllArrowProperties, getArrowPoints, getAxesAndRulesProps, getCurvePathWithSegments, getExtendedContainerHeightWithPadding, getLineSegmentsDueToNoExtrapolation, getLineSegmentsForMissingValues, getMaxValue, getNoOfSections, getPathWithHighlight, getSanitisedData, getSecondaryDataWithOffsetIncluded, getSegmentString, indexOfFirstNonZeroDigit, svgPath } from '../utils';
|
|
40
40
|
import { EdgePosition } from '../utils/types';
|
|
41
41
|
export var useLineChart = function (props) {
|
|
42
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, _126, _127, _128, _129, _130, _131, _132, _133, _134, _135, _136, _137, _138, _139, _140, _141, _142, _143, _144, _145, _146, _147, _148, _149, _150, _151, _152, _153, _154, _155, _156, _157, _158, _159, _160, _161, _162, _163, _164, _165, _166, _167, _168, _169, _170, _171, _172, _173, _174, _175, _176, _177, _178, _179, _180, _181, _182, _183, _184, _185, _186, _187, _188, _189, _190, _191, _192, _193, _194, _195, _196, _197, _198, _199, _200, _201, _202, _203, _204, _205, _206, _207, _208, _209, _210, _211, _212, _213, _214, _215, _216, _217, _218, _219, _220, _221, _222, _223, _224, _225, _226, _227, _228, _229, _230, _231, _232, _233, _234, _235, _236, _237, _238, _239, _240, _241, _242, _243, _244, _245, _246, _247, _248, _249, _250, _251, _252, _253, _254, _255, _256, _257, _258, _259, _260, _261, _262, _263, _264, _265, _266, _267, _268, _269, _270, _271, _272, _273, _274, _275, _276, _277, _278, _279, _280, _281, _282, _283, _284, _285, _286, _287, _288, _289, _290, _291, _292, _293, _294, _295, _296, _297, _298, _299, _300, _301, _302, _303, _304, _305, _306, _307, _308, _309, _310, _311, _312, _313, _314, _315;
|
|
43
|
-
var showDataPointsForMissingValues = props.showDataPointsForMissingValues,
|
|
42
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, _126, _127, _128, _129, _130, _131, _132, _133, _134, _135, _136, _137, _138, _139, _140, _141, _142, _143, _144, _145, _146, _147, _148, _149, _150, _151, _152, _153, _154, _155, _156, _157, _158, _159, _160, _161, _162, _163, _164, _165, _166, _167, _168, _169, _170, _171, _172, _173, _174, _175, _176, _177, _178, _179, _180, _181, _182, _183, _184, _185, _186, _187, _188, _189, _190, _191, _192, _193, _194, _195, _196, _197, _198, _199, _200, _201, _202, _203, _204, _205, _206, _207, _208, _209, _210, _211, _212, _213, _214, _215, _216, _217, _218, _219, _220, _221, _222, _223, _224, _225, _226, _227, _228, _229, _230, _231, _232, _233, _234, _235, _236, _237, _238, _239, _240, _241, _242, _243, _244, _245, _246, _247, _248, _249, _250, _251, _252, _253, _254, _255, _256, _257, _258, _259, _260, _261, _262, _263, _264, _265, _266, _267, _268, _269, _270, _271, _272, _273, _274, _275, _276, _277, _278, _279, _280, _281, _282, _283, _284, _285, _286, _287, _288, _289, _290, _291, _292, _293, _294, _295, _296, _297, _298, _299, _300, _301, _302, _303, _304, _305, _306, _307, _308, _309, _310, _311, _312, _313, _314, _315, _316, _317, _318, _319, _320, _321, _322, _323, _324, _325, _326, _327;
|
|
43
|
+
var showDataPointsForMissingValues = props.showDataPointsForMissingValues, _328 = props.interpolateMissingValues, interpolateMissingValues = _328 === void 0 ? true : _328, _329 = props.extrapolateMissingValues, extrapolateMissingValues = _329 === void 0 ? true : _329, yAxisOffset = props.yAxisOffset, parentWidth = props.parentWidth, negativeStepValue = props.negativeStepValue, renderTooltip = props.renderTooltip, _330 = props.renderTooltip1, renderTooltip1 = _330 === void 0 ? props.renderTooltip : _330, _331 = props.renderTooltip2, renderTooltip2 = _331 === void 0 ? props.renderTooltip : _331, _332 = props.renderTooltip3, renderTooltip3 = _332 === void 0 ? props.renderTooltip : _332, _333 = props.renderTooltip4, renderTooltip4 = _333 === void 0 ? props.renderTooltip : _333, _334 = props.renderTooltip5, renderTooltip5 = _334 === void 0 ? props.renderTooltip : _334, _335 = props.renderTooltipSecondary, renderTooltipSecondary = _335 === void 0 ? props.renderTooltip : _335;
|
|
44
44
|
var lastLineNumber = 1;
|
|
45
45
|
if (props.secondaryData) {
|
|
46
46
|
lastLineNumber = 6667; // lastLineNumber is 6667 for a secondary line, so the index or key of the secondary line is 6666
|
|
@@ -63,48 +63,48 @@ export var useLineChart = function (props) {
|
|
|
63
63
|
// because in absence of extrapolation we don't want the chart to unnecessarily show the 4th quadrant
|
|
64
64
|
var curvature = (_l = props.curvature) !== null && _l !== void 0 ? _l : LineDefaults.curvature;
|
|
65
65
|
var curveType = (_m = props.curveType) !== null && _m !== void 0 ? _m : LineDefaults.curveType;
|
|
66
|
-
var
|
|
67
|
-
var
|
|
68
|
-
var
|
|
69
|
-
var
|
|
70
|
-
var
|
|
71
|
-
var
|
|
72
|
-
var
|
|
73
|
-
var
|
|
74
|
-
var
|
|
75
|
-
var
|
|
76
|
-
var
|
|
77
|
-
var
|
|
78
|
-
var
|
|
79
|
-
var
|
|
80
|
-
var
|
|
81
|
-
var
|
|
82
|
-
var
|
|
83
|
-
var
|
|
84
|
-
var
|
|
85
|
-
var
|
|
86
|
-
var
|
|
87
|
-
var
|
|
88
|
-
var
|
|
89
|
-
var
|
|
90
|
-
var
|
|
91
|
-
var
|
|
92
|
-
var
|
|
93
|
-
var
|
|
94
|
-
var
|
|
95
|
-
var
|
|
96
|
-
var
|
|
97
|
-
var
|
|
98
|
-
var
|
|
99
|
-
var
|
|
100
|
-
var
|
|
101
|
-
var
|
|
102
|
-
var
|
|
103
|
-
var
|
|
104
|
-
var
|
|
105
|
-
var
|
|
106
|
-
var
|
|
107
|
-
var
|
|
66
|
+
var _336 = __read(useState(0), 2), scrollX = _336[0], setScrollX = _336[1];
|
|
67
|
+
var _337 = __read(useState(''), 2), arrow1Points = _337[0], setArrow1Points = _337[1];
|
|
68
|
+
var _338 = __read(useState(''), 2), arrow2Points = _338[0], setArrow2Points = _338[1];
|
|
69
|
+
var _339 = __read(useState(''), 2), arrow3Points = _339[0], setArrow3Points = _339[1];
|
|
70
|
+
var _340 = __read(useState(''), 2), arrow4Points = _340[0], setArrow4Points = _340[1];
|
|
71
|
+
var _341 = __read(useState(''), 2), arrow5Points = _341[0], setArrow5Points = _341[1];
|
|
72
|
+
var _342 = __read(useState(''), 2), secondaryArrowPoints = _342[0], setSecondaryArrowPoints = _342[1];
|
|
73
|
+
var _343 = __read(useState(-1), 2), pointerIndex = _343[0], setPointerIndex = _343[1];
|
|
74
|
+
var _344 = __read(useState(0), 2), pointerX = _344[0], setPointerX = _344[1];
|
|
75
|
+
var _345 = __read(useState(0), 2), pointerY = _345[0], setPointerY = _345[1];
|
|
76
|
+
var _346 = __read(useState(), 2), pointerItem = _346[0], setPointerItem = _346[1];
|
|
77
|
+
var _347 = __read(useState(0), 2), pointerY2 = _347[0], setPointerY2 = _347[1];
|
|
78
|
+
var _348 = __read(useState(), 2), pointerItem2 = _348[0], setPointerItem2 = _348[1];
|
|
79
|
+
var _349 = __read(useState(0), 2), pointerY3 = _349[0], setPointerY3 = _349[1];
|
|
80
|
+
var _350 = __read(useState(), 2), pointerItem3 = _350[0], setPointerItem3 = _350[1];
|
|
81
|
+
var _351 = __read(useState(0), 2), pointerY4 = _351[0], setPointerY4 = _351[1];
|
|
82
|
+
var _352 = __read(useState(), 2), pointerItem4 = _352[0], setPointerItem4 = _352[1];
|
|
83
|
+
var _353 = __read(useState(0), 2), pointerY5 = _353[0], setPointerY5 = _353[1];
|
|
84
|
+
var _354 = __read(useState([]), 2), pointerYsForDataSet = _354[0], setPointerYsForDataSet = _354[1];
|
|
85
|
+
var _355 = __read(useState(), 2), pointerItem5 = _355[0], setPointerItem5 = _355[1];
|
|
86
|
+
var _356 = __read(useState(0), 2), secondaryPointerY = _356[0], setSecondaryPointerY = _356[1];
|
|
87
|
+
var _357 = __read(useState(), 2), secondaryPointerItem = _357[0], setSecondaryPointerItem = _357[1];
|
|
88
|
+
var _358 = __read(useState([]), 2), pointerItemsForSet = _358[0], setPointerItemsForSet = _358[1];
|
|
89
|
+
var _359 = __read(useState([]), 2), secondaryPointerItemsForSet = _359[0], setSecondaryPointerItemsForSet = _359[1];
|
|
90
|
+
var _360 = __read(useState(0), 2), responderStartTime = _360[0], setResponderStartTime = _360[1];
|
|
91
|
+
var _361 = __read(useState(false), 2), responderActive = _361[0], setResponderActive = _361[1];
|
|
92
|
+
var _362 = __read(useState(''), 2), points = _362[0], setPoints = _362[1];
|
|
93
|
+
var _363 = __read(useState(''), 2), points2 = _363[0], setPoints2 = _363[1];
|
|
94
|
+
var _364 = __read(useState(''), 2), points3 = _364[0], setPoints3 = _364[1];
|
|
95
|
+
var _365 = __read(useState(''), 2), points4 = _365[0], setPoints4 = _365[1];
|
|
96
|
+
var _366 = __read(useState(''), 2), points5 = _366[0], setPoints5 = _366[1];
|
|
97
|
+
var _367 = __read(useState(''), 2), secondaryPoints = _367[0], setSecondaryPoints = _367[1];
|
|
98
|
+
var _368 = __read(useState(''), 2), fillPoints = _368[0], setFillPoints = _368[1];
|
|
99
|
+
var _369 = __read(useState(''), 2), fillPoints2 = _369[0], setFillPoints2 = _369[1];
|
|
100
|
+
var _370 = __read(useState(''), 2), fillPoints3 = _370[0], setFillPoints3 = _370[1];
|
|
101
|
+
var _371 = __read(useState(''), 2), fillPoints4 = _371[0], setFillPoints4 = _371[1];
|
|
102
|
+
var _372 = __read(useState(''), 2), fillPoints5 = _372[0], setFillPoints5 = _372[1];
|
|
103
|
+
var _373 = __read(useState(''), 2), secondaryFillPoints = _373[0], setSecondaryFillPoints = _373[1];
|
|
104
|
+
var _374 = __read(useState([]), 2), pointsFromSet = _374[0], setPointsFromSet = _374[1];
|
|
105
|
+
var _375 = __read(useState([]), 2), fillPointsFromSet = _375[0], setFillPointsFromSet = _375[1];
|
|
106
|
+
var _376 = __read(useState([]), 2), arrowPointsFromSet = _376[0], setArrowPointsFromSet = _376[1];
|
|
107
|
+
var _377 = __read(useState((_o = props.focusedDataPointIndex) !== null && _o !== void 0 ? _o : -1), 2), selectedIndex = _377[0], setSelectedIndex = _377[1];
|
|
108
108
|
useEffect(function () {
|
|
109
109
|
var _a;
|
|
110
110
|
setSelectedIndex((_a = props.focusedDataPointIndex) !== null && _a !== void 0 ? _a : -1);
|
|
@@ -415,7 +415,7 @@ export var useLineChart = function (props) {
|
|
|
415
415
|
Math, __spreadArray([], __read(mergedPrimaryDataArrays.map(function (i) { return Math.max(i.value, 0); })), false)); // find the smallest +ve number
|
|
416
416
|
var showFractionalValues = (_107 = props.showFractionalValues) !== null && _107 !== void 0 ? _107 : (isFinite(valuesRange) && valuesRange <= 1);
|
|
417
417
|
var roundToDigits = (_108 = props.roundToDigits) !== null && _108 !== void 0 ? _108 : (showFractionalValues ? indexOfFirstNonZeroDigit(valuesRange) + 1 : 0);
|
|
418
|
-
var
|
|
418
|
+
var _378 = computeMaxAndMinItems(mergedPrimaryDataArrays, extrapolateMissingValues, roundToDigits, showFractionalValues, mergedPrimaryDataArraysOriginals), maxItem = _378.maxItem, minItem = _378.minItem;
|
|
419
419
|
var maxValue = getMaxValue(props.maxValue, props.stepValue, noOfSections, maxItem) || 10;
|
|
420
420
|
var mostNegativeValue = (_109 = props.mostNegativeValue) !== null && _109 !== void 0 ? _109 : minItem;
|
|
421
421
|
var overflowTop = ((_110 = props.overflowTop) !== null && _110 !== void 0 ? _110 : props.secondaryXAxis)
|
|
@@ -435,7 +435,7 @@ export var useLineChart = function (props) {
|
|
|
435
435
|
var secondaryRoundToDigits = (_114 = (_113 = props.secondaryYAxis) === null || _113 === void 0 ? void 0 : _113.roundToDigits) !== null && _114 !== void 0 ? _114 : (showSecondaryFractionalValues
|
|
436
436
|
? indexOfFirstNonZeroDigit(secondaryValuesRange) + 1
|
|
437
437
|
: 0);
|
|
438
|
-
var
|
|
438
|
+
var _379 = computeMaxAndMinItems(mergedSecondaryDataArrays, extrapolateMissingValues, secondaryRoundToDigits, showSecondaryFractionalValues), secondaryMaxItem = _379.maxItem, secondaryMinItem = _379.minItem;
|
|
439
439
|
var secondaryMaxValue = (_116 = (_115 = props.secondaryYAxis) === null || _115 === void 0 ? void 0 : _115.maxValue) !== null && _116 !== void 0 ? _116 : (secondaryMaxItem || maxValue);
|
|
440
440
|
var getSecondaryY = function (value) {
|
|
441
441
|
return extendedContainerHeight - (value * containerHeight) / secondaryMaxValue;
|
|
@@ -457,74 +457,80 @@ export var useLineChart = function (props) {
|
|
|
457
457
|
var strokeDashArray3 = (_135 = props.strokeDashArray3) !== null && _135 !== void 0 ? _135 : props.strokeDashArray;
|
|
458
458
|
var strokeDashArray4 = (_136 = props.strokeDashArray4) !== null && _136 !== void 0 ? _136 : props.strokeDashArray;
|
|
459
459
|
var strokeDashArray5 = (_137 = props.strokeDashArray5) !== null && _137 !== void 0 ? _137 : props.strokeDashArray;
|
|
460
|
-
var
|
|
461
|
-
var
|
|
462
|
-
var
|
|
463
|
-
var
|
|
464
|
-
var
|
|
465
|
-
var
|
|
466
|
-
var
|
|
467
|
-
var
|
|
468
|
-
var
|
|
469
|
-
var
|
|
470
|
-
var
|
|
471
|
-
var
|
|
472
|
-
var
|
|
473
|
-
var
|
|
474
|
-
var
|
|
475
|
-
var
|
|
476
|
-
var
|
|
477
|
-
var
|
|
478
|
-
var
|
|
479
|
-
var
|
|
480
|
-
var
|
|
481
|
-
var
|
|
482
|
-
var
|
|
483
|
-
var
|
|
484
|
-
var
|
|
485
|
-
var
|
|
486
|
-
var
|
|
487
|
-
var
|
|
488
|
-
var
|
|
489
|
-
var
|
|
490
|
-
var
|
|
491
|
-
var
|
|
492
|
-
var
|
|
493
|
-
var
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
var
|
|
460
|
+
var strokeLinecap1 = (_139 = (_138 = props.strokeLinecap1) !== null && _138 !== void 0 ? _138 : props.strokeLinecap) !== null && _139 !== void 0 ? _139 : LineDefaults.strokeLinecap;
|
|
461
|
+
var strokeLinecap2 = (_141 = (_140 = props.strokeLinecap2) !== null && _140 !== void 0 ? _140 : props.strokeLinecap) !== null && _141 !== void 0 ? _141 : LineDefaults.strokeLinecap;
|
|
462
|
+
var strokeLinecap3 = (_143 = (_142 = props.strokeLinecap3) !== null && _142 !== void 0 ? _142 : props.strokeLinecap) !== null && _143 !== void 0 ? _143 : LineDefaults.strokeLinecap;
|
|
463
|
+
var strokeLinecap4 = (_145 = (_144 = props.strokeLinecap4) !== null && _144 !== void 0 ? _144 : props.strokeLinecap) !== null && _145 !== void 0 ? _145 : LineDefaults.strokeLinecap;
|
|
464
|
+
var strokeLinecap5 = (_147 = (_146 = props.strokeLinecap5) !== null && _146 !== void 0 ? _146 : props.strokeLinecap) !== null && _147 !== void 0 ? _147 : LineDefaults.strokeLinecap;
|
|
465
|
+
var rotateLabel = (_148 = props.rotateLabel) !== null && _148 !== void 0 ? _148 : false;
|
|
466
|
+
var isAnimated = (_149 = props.isAnimated) !== null && _149 !== void 0 ? _149 : false;
|
|
467
|
+
var hideDataPoints1 = (_151 = (_150 = props.hideDataPoints) !== null && _150 !== void 0 ? _150 : props.hideDataPoints1) !== null && _151 !== void 0 ? _151 : false;
|
|
468
|
+
var hideDataPoints2 = (_153 = (_152 = props.hideDataPoints) !== null && _152 !== void 0 ? _152 : props.hideDataPoints2) !== null && _153 !== void 0 ? _153 : false;
|
|
469
|
+
var hideDataPoints3 = (_155 = (_154 = props.hideDataPoints) !== null && _154 !== void 0 ? _154 : props.hideDataPoints3) !== null && _155 !== void 0 ? _155 : false;
|
|
470
|
+
var hideDataPoints4 = (_157 = (_156 = props.hideDataPoints) !== null && _156 !== void 0 ? _156 : props.hideDataPoints4) !== null && _157 !== void 0 ? _157 : false;
|
|
471
|
+
var hideDataPoints5 = (_159 = (_158 = props.hideDataPoints) !== null && _158 !== void 0 ? _158 : props.hideDataPoints5) !== null && _159 !== void 0 ? _159 : false;
|
|
472
|
+
var color1 = (_161 = (_160 = props.color1) !== null && _160 !== void 0 ? _160 : props.color) !== null && _161 !== void 0 ? _161 : LineDefaults.color;
|
|
473
|
+
var color2 = (_163 = (_162 = props.color2) !== null && _162 !== void 0 ? _162 : props.color) !== null && _163 !== void 0 ? _163 : LineDefaults.color;
|
|
474
|
+
var color3 = (_165 = (_164 = props.color3) !== null && _164 !== void 0 ? _164 : props.color) !== null && _165 !== void 0 ? _165 : LineDefaults.color;
|
|
475
|
+
var color4 = (_167 = (_166 = props.color4) !== null && _166 !== void 0 ? _166 : props.color) !== null && _167 !== void 0 ? _167 : LineDefaults.color;
|
|
476
|
+
var color5 = (_169 = (_168 = props.color5) !== null && _168 !== void 0 ? _168 : props.color) !== null && _169 !== void 0 ? _169 : LineDefaults.color;
|
|
477
|
+
var startFillColor1 = (_171 = (_170 = props.startFillColor1) !== null && _170 !== void 0 ? _170 : props.startFillColor) !== null && _171 !== void 0 ? _171 : LineDefaults.startFillColor;
|
|
478
|
+
var endFillColor1 = (_173 = (_172 = props.endFillColor1) !== null && _172 !== void 0 ? _172 : props.endFillColor) !== null && _173 !== void 0 ? _173 : LineDefaults.endFillColor;
|
|
479
|
+
var startOpacity = (_174 = props.startOpacity) !== null && _174 !== void 0 ? _174 : LineDefaults.startOpacity;
|
|
480
|
+
var endOpacity = (_175 = props.endOpacity) !== null && _175 !== void 0 ? _175 : LineDefaults.endOpacity;
|
|
481
|
+
var startOpacity1 = (_176 = props.startOpacity1) !== null && _176 !== void 0 ? _176 : startOpacity;
|
|
482
|
+
var endOpacity1 = (_177 = props.endOpacity1) !== null && _177 !== void 0 ? _177 : endOpacity;
|
|
483
|
+
var startFillColor2 = (_179 = (_178 = props.startFillColor2) !== null && _178 !== void 0 ? _178 : props.startFillColor) !== null && _179 !== void 0 ? _179 : LineDefaults.startFillColor;
|
|
484
|
+
var endFillColor2 = (_181 = (_180 = props.endFillColor2) !== null && _180 !== void 0 ? _180 : props.endFillColor) !== null && _181 !== void 0 ? _181 : LineDefaults.endFillColor;
|
|
485
|
+
var startOpacity2 = (_182 = props.startOpacity2) !== null && _182 !== void 0 ? _182 : startOpacity;
|
|
486
|
+
var endOpacity2 = (_183 = props.endOpacity2) !== null && _183 !== void 0 ? _183 : endOpacity;
|
|
487
|
+
var startFillColor3 = (_185 = (_184 = props.startFillColor3) !== null && _184 !== void 0 ? _184 : props.startFillColor) !== null && _185 !== void 0 ? _185 : LineDefaults.startFillColor;
|
|
488
|
+
var endFillColor3 = (_187 = (_186 = props.endFillColor3) !== null && _186 !== void 0 ? _186 : props.endFillColor) !== null && _187 !== void 0 ? _187 : LineDefaults.endFillColor;
|
|
489
|
+
var startOpacity3 = (_188 = props.startOpacity3) !== null && _188 !== void 0 ? _188 : startOpacity;
|
|
490
|
+
var endOpacity3 = (_189 = props.endOpacity3) !== null && _189 !== void 0 ? _189 : endOpacity;
|
|
491
|
+
var startFillColor4 = (_191 = (_190 = props.startFillColor4) !== null && _190 !== void 0 ? _190 : props.startFillColor) !== null && _191 !== void 0 ? _191 : LineDefaults.startFillColor;
|
|
492
|
+
var endFillColor4 = (_193 = (_192 = props.endFillColor4) !== null && _192 !== void 0 ? _192 : props.endFillColor) !== null && _193 !== void 0 ? _193 : LineDefaults.endFillColor;
|
|
493
|
+
var startOpacity4 = (_194 = props.startOpacity4) !== null && _194 !== void 0 ? _194 : startOpacity;
|
|
494
|
+
var endOpacity4 = (_195 = props.endOpacity4) !== null && _195 !== void 0 ? _195 : endOpacity;
|
|
495
|
+
var startFillColor5 = (_197 = (_196 = props.startFillColor5) !== null && _196 !== void 0 ? _196 : props.startFillColor) !== null && _197 !== void 0 ? _197 : LineDefaults.startFillColor;
|
|
496
|
+
var endFillColor5 = (_199 = (_198 = props.endFillColor5) !== null && _198 !== void 0 ? _198 : props.endFillColor) !== null && _199 !== void 0 ? _199 : LineDefaults.endFillColor;
|
|
497
|
+
var startOpacity5 = (_200 = props.startOpacity5) !== null && _200 !== void 0 ? _200 : startOpacity;
|
|
498
|
+
var endOpacity5 = (_201 = props.endOpacity5) !== null && _201 !== void 0 ? _201 : endOpacity;
|
|
499
|
+
defaultArrowConfig.strokeWidth = (_203 = (_202 = dataSet === null || dataSet === void 0 ? void 0 : dataSet[0]) === null || _202 === void 0 ? void 0 : _202.thickness) !== null && _203 !== void 0 ? _203 : thickness1;
|
|
500
|
+
defaultArrowConfig.strokeColor = (_205 = (_204 = dataSet === null || dataSet === void 0 ? void 0 : dataSet[0]) === null || _204 === void 0 ? void 0 : _204.color) !== null && _205 !== void 0 ? _205 : color1;
|
|
501
|
+
var _380 = getAllArrowProperties(props, defaultArrowConfig), arrowLength1 = _380.arrowLength1, arrowWidth1 = _380.arrowWidth1, arrowStrokeWidth1 = _380.arrowStrokeWidth1, arrowStrokeColor1 = _380.arrowStrokeColor1, arrowFillColor1 = _380.arrowFillColor1, showArrowBase1 = _380.showArrowBase1, arrowLength2 = _380.arrowLength2, arrowWidth2 = _380.arrowWidth2, arrowStrokeWidth2 = _380.arrowStrokeWidth2, arrowStrokeColor2 = _380.arrowStrokeColor2, arrowFillColor2 = _380.arrowFillColor2, showArrowBase2 = _380.showArrowBase2, arrowLength3 = _380.arrowLength3, arrowWidth3 = _380.arrowWidth3, arrowStrokeWidth3 = _380.arrowStrokeWidth3, arrowStrokeColor3 = _380.arrowStrokeColor3, arrowFillColor3 = _380.arrowFillColor3, showArrowBase3 = _380.showArrowBase3, arrowLength4 = _380.arrowLength4, arrowWidth4 = _380.arrowWidth4, arrowStrokeWidth4 = _380.arrowStrokeWidth4, arrowStrokeColor4 = _380.arrowStrokeColor4, arrowFillColor4 = _380.arrowFillColor4, showArrowBase4 = _380.showArrowBase4, arrowLength5 = _380.arrowLength5, arrowWidth5 = _380.arrowWidth5, arrowStrokeWidth5 = _380.arrowStrokeWidth5, arrowStrokeColor5 = _380.arrowStrokeColor5, arrowFillColor5 = _380.arrowFillColor5, showArrowBase5 = _380.showArrowBase5, arrowLengthsFromSet = _380.arrowLengthsFromSet, arrowWidthsFromSet = _380.arrowWidthsFromSet, arrowStrokeWidthsFromSet = _380.arrowStrokeWidthsFromSet, arrowStrokeColorsFromSet = _380.arrowStrokeColorsFromSet, arrowFillColorsFromSet = _380.arrowFillColorsFromSet, showArrowBasesFromSet = _380.showArrowBasesFromSet;
|
|
497
502
|
var secondaryLineConfig = {
|
|
498
|
-
zIndex: (
|
|
499
|
-
curved: (
|
|
500
|
-
curvature: (
|
|
501
|
-
curveType: (
|
|
502
|
-
areaChart: (
|
|
503
|
-
color: (
|
|
504
|
-
thickness: (
|
|
505
|
-
zIndex1: (
|
|
506
|
-
strokeDashArray: (
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
503
|
+
zIndex: (_207 = (_206 = props.secondaryLineConfig) === null || _206 === void 0 ? void 0 : _206.zIndex) !== null && _207 !== void 0 ? _207 : zIndex1,
|
|
504
|
+
curved: (_209 = (_208 = props.secondaryLineConfig) === null || _208 === void 0 ? void 0 : _208.curved) !== null && _209 !== void 0 ? _209 : props.curved,
|
|
505
|
+
curvature: (_211 = (_210 = props.secondaryLineConfig) === null || _210 === void 0 ? void 0 : _210.curvature) !== null && _211 !== void 0 ? _211 : curvature,
|
|
506
|
+
curveType: (_213 = (_212 = props.secondaryLineConfig) === null || _212 === void 0 ? void 0 : _212.curveType) !== null && _213 !== void 0 ? _213 : curveType,
|
|
507
|
+
areaChart: (_215 = (_214 = props.secondaryLineConfig) === null || _214 === void 0 ? void 0 : _214.areaChart) !== null && _215 !== void 0 ? _215 : areaChart,
|
|
508
|
+
color: (_217 = (_216 = props.secondaryLineConfig) === null || _216 === void 0 ? void 0 : _216.color) !== null && _217 !== void 0 ? _217 : color1,
|
|
509
|
+
thickness: (_219 = (_218 = props.secondaryLineConfig) === null || _218 === void 0 ? void 0 : _218.thickness) !== null && _219 !== void 0 ? _219 : thickness1,
|
|
510
|
+
zIndex1: (_221 = (_220 = props.secondaryLineConfig) === null || _220 === void 0 ? void 0 : _220.zIndex1) !== null && _221 !== void 0 ? _221 : zIndex1,
|
|
511
|
+
strokeDashArray: (_223 = (_222 = props.secondaryLineConfig) === null || _222 === void 0 ? void 0 : _222.strokeDashArray) !== null && _223 !== void 0 ? _223 : strokeDashArray1,
|
|
512
|
+
strokeLinecap: (_225 = (_224 = props.secondaryLineConfig) === null || _224 === void 0 ? void 0 : _224.strokeLinecap) !== null && _225 !== void 0 ? _225 : strokeLinecap1,
|
|
513
|
+
startIndex: (_227 = (_226 = props.secondaryLineConfig) === null || _226 === void 0 ? void 0 : _226.startIndex) !== null && _227 !== void 0 ? _227 : startIndex1,
|
|
514
|
+
endIndex: (_229 = (_228 = props.secondaryLineConfig) === null || _228 === void 0 ? void 0 : _228.endIndex) !== null && _229 !== void 0 ? _229 : endIndex1,
|
|
515
|
+
hideDataPoints: (_231 = (_230 = props.secondaryLineConfig) === null || _230 === void 0 ? void 0 : _230.hideDataPoints) !== null && _231 !== void 0 ? _231 : hideDataPoints1,
|
|
516
|
+
dataPointsHeight: (_233 = (_232 = props.secondaryLineConfig) === null || _232 === void 0 ? void 0 : _232.dataPointsHeight) !== null && _233 !== void 0 ? _233 : dataPointsHeight1,
|
|
517
|
+
dataPointsWidth: (_235 = (_234 = props.secondaryLineConfig) === null || _234 === void 0 ? void 0 : _234.dataPointsWidth) !== null && _235 !== void 0 ? _235 : dataPointsWidth1,
|
|
518
|
+
dataPointsRadius: (_237 = (_236 = props.secondaryLineConfig) === null || _236 === void 0 ? void 0 : _236.dataPointsRadius) !== null && _237 !== void 0 ? _237 : dataPointsRadius1,
|
|
519
|
+
dataPointsColor: (_239 = (_238 = props.secondaryLineConfig) === null || _238 === void 0 ? void 0 : _238.dataPointsColor) !== null && _239 !== void 0 ? _239 : dataPointsColor1,
|
|
520
|
+
dataPointsShape: (_241 = (_240 = props.secondaryLineConfig) === null || _240 === void 0 ? void 0 : _240.dataPointsShape) !== null && _241 !== void 0 ? _241 : dataPointsShape1,
|
|
521
|
+
showValuesAsDataPointsText: (_243 = (_242 = props.secondaryLineConfig) === null || _242 === void 0 ? void 0 : _242.showValuesAsDataPointsText) !== null && _243 !== void 0 ? _243 : showValuesAsDataPointsText,
|
|
522
|
+
startFillColor: (_245 = (_244 = props.secondaryLineConfig) === null || _244 === void 0 ? void 0 : _244.startFillColor) !== null && _245 !== void 0 ? _245 : startFillColor1,
|
|
523
|
+
endFillColor: (_247 = (_246 = props.secondaryLineConfig) === null || _246 === void 0 ? void 0 : _246.endFillColor) !== null && _247 !== void 0 ? _247 : endFillColor1,
|
|
524
|
+
startOpacity: (_249 = (_248 = props.secondaryLineConfig) === null || _248 === void 0 ? void 0 : _248.startOpacity) !== null && _249 !== void 0 ? _249 : startOpacity1,
|
|
525
|
+
endOpacity: (_251 = (_250 = props.secondaryLineConfig) === null || _250 === void 0 ? void 0 : _250.endOpacity) !== null && _251 !== void 0 ? _251 : endOpacity1,
|
|
526
|
+
textFontSize: (_253 = (_252 = props.secondaryLineConfig) === null || _252 === void 0 ? void 0 : _252.textFontSize) !== null && _253 !== void 0 ? _253 : textFontSize1,
|
|
527
|
+
textColor: (_255 = (_254 = props.secondaryLineConfig) === null || _254 === void 0 ? void 0 : _254.textColor) !== null && _255 !== void 0 ? _255 : textColor1,
|
|
528
|
+
showArrow: (_257 = (_256 = props.secondaryLineConfig) === null || _256 === void 0 ? void 0 : _256.showArrow) !== null && _257 !== void 0 ? _257 : props.showArrows,
|
|
529
|
+
arrowConfig: (_259 = (_258 = props.secondaryLineConfig) === null || _258 === void 0 ? void 0 : _258.arrowConfig) !== null && _259 !== void 0 ? _259 : props.arrowConfig
|
|
524
530
|
};
|
|
525
531
|
var yAxisExtraHeightAtTop = props.trimYAxisAtTop
|
|
526
532
|
? 0
|
|
527
|
-
: (
|
|
533
|
+
: (_260 = props.yAxisExtraHeight) !== null && _260 !== void 0 ? _260 : containerHeight / 20;
|
|
528
534
|
var addLeadingAndTrailingPathForAreaFill = function (initialPath, value, dataLength) {
|
|
529
535
|
return ('M ' +
|
|
530
536
|
initialSpacing +
|
|
@@ -1067,93 +1073,93 @@ export var useLineChart = function (props) {
|
|
|
1067
1073
|
}
|
|
1068
1074
|
}
|
|
1069
1075
|
}, [secondaryData, secondaryLineConfig]);
|
|
1070
|
-
var gradientDirection = (
|
|
1076
|
+
var gradientDirection = (_261 = props.gradientDirection) !== null && _261 !== void 0 ? _261 : 'vertical';
|
|
1071
1077
|
var horizSections = [{ value: '0' }];
|
|
1072
|
-
var stepHeight = (
|
|
1073
|
-
var stepValue = (
|
|
1074
|
-
var noOfSectionsBelowXAxis = (
|
|
1078
|
+
var stepHeight = (_262 = props.stepHeight) !== null && _262 !== void 0 ? _262 : containerHeight / noOfSections;
|
|
1079
|
+
var stepValue = (_263 = props.stepValue) !== null && _263 !== void 0 ? _263 : maxValue / noOfSections;
|
|
1080
|
+
var noOfSectionsBelowXAxis = (_264 = props.noOfSectionsBelowXAxis) !== null && _264 !== void 0 ? _264 : Math.round(Math.ceil(-mostNegativeValue / stepValue));
|
|
1075
1081
|
var axesAndRulesProps = getAxesAndRulesProps(props, containerHeight, stepHeight, stepValue, noOfSections, roundToDigits, negativeStepValue !== null && negativeStepValue !== void 0 ? negativeStepValue : stepValue, secondaryMaxValue, secondaryMinItem, showSecondaryFractionalValues, secondaryRoundToDigits);
|
|
1076
1082
|
var secondaryNoOfSectionsBelowXAxis = axesAndRulesProps.secondaryYAxisConfig.noOfSectionsBelowXAxis;
|
|
1077
1083
|
var containerHeightIncludingBelowXAxis = extendedContainerHeight +
|
|
1078
1084
|
Math.max(noOfSectionsBelowXAxis, secondaryNoOfSectionsBelowXAxis) *
|
|
1079
1085
|
stepHeight;
|
|
1080
|
-
var showXAxisIndices = (
|
|
1081
|
-
var xAxisIndicesHeight = (
|
|
1082
|
-
var xAxisIndicesWidth = (
|
|
1083
|
-
var xAxisIndicesColor = (
|
|
1084
|
-
var xAxisTextNumberOfLines = (
|
|
1085
|
-
var xAxisLabelsVerticalShift = (
|
|
1086
|
+
var showXAxisIndices = (_265 = props.showXAxisIndices) !== null && _265 !== void 0 ? _265 : AxesAndRulesDefaults.showXAxisIndices;
|
|
1087
|
+
var xAxisIndicesHeight = (_266 = props.xAxisIndicesHeight) !== null && _266 !== void 0 ? _266 : AxesAndRulesDefaults.xAxisIndicesHeight;
|
|
1088
|
+
var xAxisIndicesWidth = (_267 = props.xAxisIndicesWidth) !== null && _267 !== void 0 ? _267 : AxesAndRulesDefaults.xAxisIndicesWidth;
|
|
1089
|
+
var xAxisIndicesColor = (_268 = props.xAxisIndicesColor) !== null && _268 !== void 0 ? _268 : AxesAndRulesDefaults.xAxisIndicesColor;
|
|
1090
|
+
var xAxisTextNumberOfLines = (_269 = props.xAxisTextNumberOfLines) !== null && _269 !== void 0 ? _269 : AxesAndRulesDefaults.xAxisTextNumberOfLines;
|
|
1091
|
+
var xAxisLabelsVerticalShift = (_270 = props.xAxisLabelsVerticalShift) !== null && _270 !== void 0 ? _270 : AxesAndRulesDefaults.xAxisLabelsVerticalShift;
|
|
1086
1092
|
var horizontalRulesStyle = props.horizontalRulesStyle;
|
|
1087
1093
|
var horizontal = false;
|
|
1088
1094
|
var yAxisAtTop = false;
|
|
1089
1095
|
defaultPointerConfig.pointerStripHeight =
|
|
1090
1096
|
containerHeight + noOfSectionsBelowXAxis * stepHeight;
|
|
1091
1097
|
var pointerConfig = props.pointerConfig;
|
|
1092
|
-
var getPointerProps = (
|
|
1093
|
-
var pointerHeight = (
|
|
1094
|
-
var pointerWidth = (
|
|
1095
|
-
var pointerRadius = (
|
|
1096
|
-
var pointerColor = (
|
|
1097
|
-
var pointerComponent = (
|
|
1098
|
+
var getPointerProps = (_271 = props.getPointerProps) !== null && _271 !== void 0 ? _271 : null;
|
|
1099
|
+
var pointerHeight = (_272 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.height) !== null && _272 !== void 0 ? _272 : defaultPointerConfig.height;
|
|
1100
|
+
var pointerWidth = (_273 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.width) !== null && _273 !== void 0 ? _273 : defaultPointerConfig.width;
|
|
1101
|
+
var pointerRadius = (_274 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.radius) !== null && _274 !== void 0 ? _274 : defaultPointerConfig.radius;
|
|
1102
|
+
var pointerColor = (_275 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerColor) !== null && _275 !== void 0 ? _275 : defaultPointerConfig.pointerColor;
|
|
1103
|
+
var pointerComponent = (_276 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerComponent) !== null && _276 !== void 0 ? _276 : defaultPointerConfig.pointerComponent;
|
|
1098
1104
|
var showPointerStrip = (pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.showPointerStrip) === false
|
|
1099
1105
|
? false
|
|
1100
1106
|
: defaultPointerConfig.showPointerStrip;
|
|
1101
|
-
var pointerStripHeight = (
|
|
1102
|
-
var pointerStripWidth = (
|
|
1103
|
-
var pointerStripColor = (
|
|
1104
|
-
var pointerStripUptoDataPoint = (
|
|
1105
|
-
var pointerLabelComponent = (
|
|
1106
|
-
var stripOverPointer = (
|
|
1107
|
-
var shiftPointerLabelX = (
|
|
1108
|
-
var shiftPointerLabelY = (
|
|
1109
|
-
var pointerLabelWidth = (
|
|
1110
|
-
var pointerLabelHeight = (
|
|
1111
|
-
var autoAdjustPointerLabelPosition = (
|
|
1112
|
-
var pointerVanishDelay = (
|
|
1113
|
-
var activatePointersOnLongPress = (
|
|
1114
|
-
var activatePointersInstantlyOnTouch = (
|
|
1115
|
-
var activatePointersDelay = (
|
|
1116
|
-
var initialPointerIndex = (
|
|
1117
|
-
var initialPointerAppearDelay = (
|
|
1107
|
+
var pointerStripHeight = (_277 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripHeight) !== null && _277 !== void 0 ? _277 : defaultPointerConfig.pointerStripHeight;
|
|
1108
|
+
var pointerStripWidth = (_278 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripWidth) !== null && _278 !== void 0 ? _278 : defaultPointerConfig.pointerStripWidth;
|
|
1109
|
+
var pointerStripColor = (_279 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripColor) !== null && _279 !== void 0 ? _279 : defaultPointerConfig.pointerStripColor;
|
|
1110
|
+
var pointerStripUptoDataPoint = (_280 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerStripUptoDataPoint) !== null && _280 !== void 0 ? _280 : defaultPointerConfig.pointerStripUptoDataPoint;
|
|
1111
|
+
var pointerLabelComponent = (_281 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelComponent) !== null && _281 !== void 0 ? _281 : defaultPointerConfig.pointerLabelComponent;
|
|
1112
|
+
var stripOverPointer = (_282 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.stripOverPointer) !== null && _282 !== void 0 ? _282 : defaultPointerConfig.stripOverPointer;
|
|
1113
|
+
var shiftPointerLabelX = (_283 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.shiftPointerLabelX) !== null && _283 !== void 0 ? _283 : defaultPointerConfig.shiftPointerLabelX;
|
|
1114
|
+
var shiftPointerLabelY = (_284 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.shiftPointerLabelY) !== null && _284 !== void 0 ? _284 : defaultPointerConfig.shiftPointerLabelY;
|
|
1115
|
+
var pointerLabelWidth = (_285 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelWidth) !== null && _285 !== void 0 ? _285 : defaultPointerConfig.pointerLabelWidth;
|
|
1116
|
+
var pointerLabelHeight = (_286 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerLabelHeight) !== null && _286 !== void 0 ? _286 : defaultPointerConfig.pointerLabelHeight;
|
|
1117
|
+
var autoAdjustPointerLabelPosition = (_287 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.autoAdjustPointerLabelPosition) !== null && _287 !== void 0 ? _287 : defaultPointerConfig.autoAdjustPointerLabelPosition;
|
|
1118
|
+
var pointerVanishDelay = (_288 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerVanishDelay) !== null && _288 !== void 0 ? _288 : defaultPointerConfig.pointerVanishDelay;
|
|
1119
|
+
var activatePointersOnLongPress = (_289 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersOnLongPress) !== null && _289 !== void 0 ? _289 : defaultPointerConfig.activatePointersOnLongPress;
|
|
1120
|
+
var activatePointersInstantlyOnTouch = (_290 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersInstantlyOnTouch) !== null && _290 !== void 0 ? _290 : defaultPointerConfig.activatePointersInstantlyOnTouch;
|
|
1121
|
+
var activatePointersDelay = (_291 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.activatePointersDelay) !== null && _291 !== void 0 ? _291 : defaultPointerConfig.activatePointersDelay;
|
|
1122
|
+
var initialPointerIndex = (_292 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.initialPointerIndex) !== null && _292 !== void 0 ? _292 : defaultPointerConfig.initialPointerIndex;
|
|
1123
|
+
var initialPointerAppearDelay = (_293 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.initialPointerAppearDelay) !== null && _293 !== void 0 ? _293 : (isAnimated
|
|
1118
1124
|
? animationDuration
|
|
1119
1125
|
: defaultPointerConfig.initialPointerAppearDelay);
|
|
1120
|
-
var persistPointer = (
|
|
1121
|
-
var resetPointerIndexOnRelease = (
|
|
1122
|
-
var hidePointers = (
|
|
1123
|
-
var hidePointer1 = (
|
|
1124
|
-
var hidePointer2 = (
|
|
1125
|
-
var hidePointer3 = (
|
|
1126
|
-
var hidePointer4 = (
|
|
1127
|
-
var hidePointer5 = (
|
|
1128
|
-
var hideSecondaryPointer = (
|
|
1129
|
-
var resetPointerOnDataChange = (
|
|
1130
|
-
var hidePointerDataPointForMissingValues = (
|
|
1126
|
+
var persistPointer = (_294 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.persistPointer) !== null && _294 !== void 0 ? _294 : defaultPointerConfig.persistPointer;
|
|
1127
|
+
var resetPointerIndexOnRelease = (_295 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.resetPointerIndexOnRelease) !== null && _295 !== void 0 ? _295 : defaultPointerConfig.resetPointerIndexOnRelease;
|
|
1128
|
+
var hidePointers = (_296 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointers) !== null && _296 !== void 0 ? _296 : defaultPointerConfig.hidePointers;
|
|
1129
|
+
var hidePointer1 = (_297 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer1) !== null && _297 !== void 0 ? _297 : defaultPointerConfig.hidePointer1;
|
|
1130
|
+
var hidePointer2 = (_298 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer2) !== null && _298 !== void 0 ? _298 : defaultPointerConfig.hidePointer2;
|
|
1131
|
+
var hidePointer3 = (_299 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer3) !== null && _299 !== void 0 ? _299 : defaultPointerConfig.hidePointer3;
|
|
1132
|
+
var hidePointer4 = (_300 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer4) !== null && _300 !== void 0 ? _300 : defaultPointerConfig.hidePointer4;
|
|
1133
|
+
var hidePointer5 = (_301 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer5) !== null && _301 !== void 0 ? _301 : defaultPointerConfig.hidePointer5;
|
|
1134
|
+
var hideSecondaryPointer = (_302 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hideSecondaryPointer) !== null && _302 !== void 0 ? _302 : defaultPointerConfig.hideSecondaryPointer;
|
|
1135
|
+
var resetPointerOnDataChange = (_303 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.resetPointerOnDataChange) !== null && _303 !== void 0 ? _303 : defaultPointerConfig.resetPointerOnDataChange;
|
|
1136
|
+
var hidePointerDataPointForMissingValues = (_304 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointerDataPointForMissingValues) !== null && _304 !== void 0 ? _304 : ((pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointerForMissingValues) ? true : false);
|
|
1131
1137
|
var pointerEvents = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerEvents;
|
|
1132
|
-
var disableScroll = (
|
|
1138
|
+
var disableScroll = (_305 = props.disableScroll) !== null && _305 !== void 0 ? _305 : (pointerConfig
|
|
1133
1139
|
? activatePointersOnLongPress
|
|
1134
1140
|
? !!responderActive
|
|
1135
1141
|
: true
|
|
1136
1142
|
: false);
|
|
1137
|
-
var showScrollIndicator = (
|
|
1138
|
-
var focusEnabled = (
|
|
1139
|
-
var showDataPointOnFocus = (
|
|
1140
|
-
var showStripOnFocus = (
|
|
1141
|
-
var showTextOnFocus = (
|
|
1142
|
-
var showDataPointLabelOnFocus = (
|
|
1143
|
+
var showScrollIndicator = (_306 = props.showScrollIndicator) !== null && _306 !== void 0 ? _306 : LineDefaults.showScrollIndicator;
|
|
1144
|
+
var focusEnabled = (_307 = props.focusEnabled) !== null && _307 !== void 0 ? _307 : LineDefaults.focusEnabled;
|
|
1145
|
+
var showDataPointOnFocus = (_308 = props.showDataPointOnFocus) !== null && _308 !== void 0 ? _308 : LineDefaults.showDataPointOnFocus;
|
|
1146
|
+
var showStripOnFocus = (_309 = props.showStripOnFocus) !== null && _309 !== void 0 ? _309 : LineDefaults.showStripOnFocus;
|
|
1147
|
+
var showTextOnFocus = (_310 = props.showTextOnFocus) !== null && _310 !== void 0 ? _310 : LineDefaults.showTextOnFocus;
|
|
1148
|
+
var showDataPointLabelOnFocus = (_311 = props.showDataPointLabelOnFocus) !== null && _311 !== void 0 ? _311 : LineDefaults.showDataPointLabelOnFocus;
|
|
1143
1149
|
var stripHeight = props.stripHeight;
|
|
1144
|
-
var stripWidth = (
|
|
1145
|
-
var stripColor = (
|
|
1146
|
-
var stripOpacity = (
|
|
1150
|
+
var stripWidth = (_312 = props.stripWidth) !== null && _312 !== void 0 ? _312 : LineDefaults.stripWidth;
|
|
1151
|
+
var stripColor = (_313 = props.stripColor) !== null && _313 !== void 0 ? _313 : color1;
|
|
1152
|
+
var stripOpacity = (_314 = props.stripOpacity) !== null && _314 !== void 0 ? _314 : (startOpacity1 + endOpacity1) / 2;
|
|
1147
1153
|
var stripStrokeDashArray = props.stripStrokeDashArray;
|
|
1148
|
-
var unFocusOnPressOut = (
|
|
1149
|
-
var delayBeforeUnFocus = (
|
|
1150
|
-
var focusTogether = (
|
|
1151
|
-
var focusProximity = (
|
|
1152
|
-
var lineGradient = (
|
|
1153
|
-
var lineGradientDirection = (
|
|
1154
|
-
var lineGradientStartColor = (
|
|
1155
|
-
var lineGradientEndColor = (
|
|
1156
|
-
var
|
|
1154
|
+
var unFocusOnPressOut = (_315 = props.unFocusOnPressOut) !== null && _315 !== void 0 ? _315 : LineDefaults.unFocusOnPressOut;
|
|
1155
|
+
var delayBeforeUnFocus = (_316 = props.delayBeforeUnFocus) !== null && _316 !== void 0 ? _316 : LineDefaults.delayBeforeUnFocus;
|
|
1156
|
+
var focusTogether = (_317 = props.focusTogether) !== null && _317 !== void 0 ? _317 : true;
|
|
1157
|
+
var focusProximity = (_318 = props.focusProximity) !== null && _318 !== void 0 ? _318 : Infinity;
|
|
1158
|
+
var lineGradient = (_319 = props.lineGradient) !== null && _319 !== void 0 ? _319 : LineDefaults.lineGradient;
|
|
1159
|
+
var lineGradientDirection = (_320 = props.lineGradientDirection) !== null && _320 !== void 0 ? _320 : 'vertical';
|
|
1160
|
+
var lineGradientStartColor = (_321 = props.lineGradientStartColor) !== null && _321 !== void 0 ? _321 : LineDefaults.lineGradientStartColor;
|
|
1161
|
+
var lineGradientEndColor = (_322 = props.lineGradientEndColor) !== null && _322 !== void 0 ? _322 : LineDefaults.lineGradientEndColor;
|
|
1162
|
+
var _381 = __read(useState(-1), 2), selectedLineNumber = _381[0], setSelectedLineNumber = _381[1];
|
|
1157
1163
|
var getPointerY = function (value) {
|
|
1158
1164
|
return value
|
|
1159
1165
|
? containerHeight -
|
|
@@ -1293,8 +1299,8 @@ export var useLineChart = function (props) {
|
|
|
1293
1299
|
setTimeout(function () { return setSelectedIndex(-1); }, delayBeforeUnFocus);
|
|
1294
1300
|
}
|
|
1295
1301
|
};
|
|
1296
|
-
var dataPointsRadius = (
|
|
1297
|
-
var dataPointsWidth = (
|
|
1302
|
+
var dataPointsRadius = (_324 = (_323 = props.dataPointsRadius1) !== null && _323 !== void 0 ? _323 : props.dataPointsRadius) !== null && _324 !== void 0 ? _324 : LineDefaults.dataPointsRadius;
|
|
1303
|
+
var dataPointsWidth = (_326 = (_325 = props.dataPointsWidth1) !== null && _325 !== void 0 ? _325 : props.dataPointsWidth) !== null && _326 !== void 0 ? _326 : LineDefaults.dataPointsWidth;
|
|
1298
1304
|
var extraWidthDueToDataPoint = props.hideDataPoints
|
|
1299
1305
|
? 0
|
|
1300
1306
|
: dataPointsRadius !== null && dataPointsRadius !== void 0 ? dataPointsRadius : dataPointsWidth;
|
|
@@ -1362,7 +1368,7 @@ export var useLineChart = function (props) {
|
|
|
1362
1368
|
pointerY: pointerY,
|
|
1363
1369
|
onEndReached: props.onEndReached,
|
|
1364
1370
|
onStartReached: props.onStartReached,
|
|
1365
|
-
endReachedOffset: (
|
|
1371
|
+
endReachedOffset: (_327 = props.endReachedOffset) !== null && _327 !== void 0 ? _327 : LineDefaults.endReachedOffset,
|
|
1366
1372
|
onMomentumScrollEnd: props.onMomentumScrollEnd,
|
|
1367
1373
|
extraWidthDueToDataPoint: extraWidthDueToDataPoint,
|
|
1368
1374
|
customBackground: props.customBackground,
|
|
@@ -1573,6 +1579,11 @@ export var useLineChart = function (props) {
|
|
|
1573
1579
|
strokeDashArray3: strokeDashArray3,
|
|
1574
1580
|
strokeDashArray4: strokeDashArray4,
|
|
1575
1581
|
strokeDashArray5: strokeDashArray5,
|
|
1582
|
+
strokeLinecap1: strokeLinecap1,
|
|
1583
|
+
strokeLinecap2: strokeLinecap2,
|
|
1584
|
+
strokeLinecap3: strokeLinecap3,
|
|
1585
|
+
strokeLinecap4: strokeLinecap4,
|
|
1586
|
+
strokeLinecap5: strokeLinecap5,
|
|
1576
1587
|
rotateLabel: rotateLabel,
|
|
1577
1588
|
isAnimated: isAnimated,
|
|
1578
1589
|
hidePointers: hidePointers,
|
|
@@ -1739,7 +1750,14 @@ export var useLineChart = function (props) {
|
|
|
1739
1750
|
focusTogether: focusTogether,
|
|
1740
1751
|
focusProximity: focusProximity,
|
|
1741
1752
|
handleFocus: handleFocus,
|
|
1742
|
-
handleUnFocus: handleUnFocus
|
|
1753
|
+
handleUnFocus: handleUnFocus,
|
|
1754
|
+
renderTooltip: renderTooltip,
|
|
1755
|
+
renderTooltip1: renderTooltip1,
|
|
1756
|
+
renderTooltip2: renderTooltip2,
|
|
1757
|
+
renderTooltip3: renderTooltip3,
|
|
1758
|
+
renderTooltip4: renderTooltip4,
|
|
1759
|
+
renderTooltip5: renderTooltip5,
|
|
1760
|
+
renderTooltipSecondary: renderTooltipSecondary
|
|
1743
1761
|
// oldPoints
|
|
1744
1762
|
};
|
|
1745
1763
|
};
|
|
@@ -43,6 +43,12 @@ export interface LineChartPropsType {
|
|
|
43
43
|
strokeDashArray3?: number[];
|
|
44
44
|
strokeDashArray4?: number[];
|
|
45
45
|
strokeDashArray5?: number[];
|
|
46
|
+
strokeLinecap?: Linecap;
|
|
47
|
+
strokeLinecap1?: Linecap;
|
|
48
|
+
strokeLinecap2?: Linecap;
|
|
49
|
+
strokeLinecap3?: Linecap;
|
|
50
|
+
strokeLinecap4?: Linecap;
|
|
51
|
+
strokeLinecap5?: Linecap;
|
|
46
52
|
rotateLabel?: boolean;
|
|
47
53
|
isAnimated?: boolean;
|
|
48
54
|
animateOnDataChange?: boolean;
|
|
@@ -316,6 +322,13 @@ export interface LineChartPropsType {
|
|
|
316
322
|
onBackgroundPress?: (event: GestureResponderEvent) => void;
|
|
317
323
|
secondaryXAxis?: XAxisConfig;
|
|
318
324
|
intersectionAreaConfig?: IntersectionAreaConfig;
|
|
325
|
+
renderTooltip?: Function;
|
|
326
|
+
renderTooltip1?: Function;
|
|
327
|
+
renderTooltip2?: Function;
|
|
328
|
+
renderTooltip3?: Function;
|
|
329
|
+
renderTooltip4?: Function;
|
|
330
|
+
renderTooltip5?: Function;
|
|
331
|
+
renderTooltipSecondary?: Function;
|
|
319
332
|
}
|
|
320
333
|
export interface lineDataItem {
|
|
321
334
|
value?: number;
|
|
@@ -364,6 +377,9 @@ export interface lineDataItem {
|
|
|
364
377
|
pointerShiftX?: number;
|
|
365
378
|
pointerShiftY?: number;
|
|
366
379
|
onPress?: Function;
|
|
380
|
+
onContextMenu?: Function;
|
|
381
|
+
onMouseEnter?: Function;
|
|
382
|
+
onMouseLeave?: Function;
|
|
367
383
|
showXAxisIndex?: boolean;
|
|
368
384
|
hidePointer?: boolean;
|
|
369
385
|
}
|
|
@@ -413,6 +429,9 @@ export interface bicolorLineDataItem {
|
|
|
413
429
|
pointerShiftX?: number;
|
|
414
430
|
pointerShiftY?: number;
|
|
415
431
|
onPress?: Function;
|
|
432
|
+
onContextMenu?: Function;
|
|
433
|
+
onMouseEnter?: Function;
|
|
434
|
+
onMouseLeave?: Function;
|
|
416
435
|
}
|
|
417
436
|
export interface LineChartBicolorPropsType {
|
|
418
437
|
height?: number;
|
|
@@ -560,6 +579,16 @@ export interface LineChartBicolorPropsType {
|
|
|
560
579
|
endReachedOffset?: number;
|
|
561
580
|
parentWidth?: number;
|
|
562
581
|
}
|
|
582
|
+
export interface LineChartPropsTypeForWeb extends LineChartPropsType {
|
|
583
|
+
onContextMenu?: Function;
|
|
584
|
+
onMouseEnter?: Function;
|
|
585
|
+
onMouseLeave?: Function;
|
|
586
|
+
}
|
|
587
|
+
export interface LineChartBicolorPropsTypeForWeb extends LineChartBicolorPropsType {
|
|
588
|
+
onContextMenu?: Function;
|
|
589
|
+
onMouseEnter?: Function;
|
|
590
|
+
onMouseLeave?: Function;
|
|
591
|
+
}
|
|
563
592
|
export interface IDataSanitisationProps {
|
|
564
593
|
showDataPointsForMissingValues: boolean | undefined;
|
|
565
594
|
interpolateMissingValues: boolean;
|
|
@@ -49,6 +49,8 @@ export declare const useRadarChart: (props: RadarChartProps) => {
|
|
|
49
49
|
polygonOpacity: number;
|
|
50
50
|
polygonGradientOpacity: number;
|
|
51
51
|
polygonConfigArray: any[] | null;
|
|
52
|
+
polygonIsAnimated: boolean;
|
|
53
|
+
polygonAnimationDuration: number;
|
|
52
54
|
asterLinesStroke: string;
|
|
53
55
|
asterLinesStrokeWidth: number;
|
|
54
56
|
asterLinesStrokeDashArray: number[];
|
|
@@ -56,11 +58,18 @@ export declare const useRadarChart: (props: RadarChartProps) => {
|
|
|
56
58
|
x: number;
|
|
57
59
|
y: number;
|
|
58
60
|
}[];
|
|
61
|
+
initialPoints: {
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
}[];
|
|
59
65
|
polygonPoints: string;
|
|
66
|
+
initialPolygonPoints: string;
|
|
60
67
|
polygonPointsArray: string[];
|
|
68
|
+
initialPolygonPointsArray: string[];
|
|
61
69
|
angleStep: number;
|
|
62
70
|
circular: boolean;
|
|
63
71
|
hideGrid: boolean;
|
|
72
|
+
hideLabels: boolean;
|
|
64
73
|
hideAsterLines: boolean;
|
|
65
74
|
getGridLevelProps: (gridItem: GridConfig, ind: number) => {
|
|
66
75
|
level: number;
|
|
@@ -79,4 +88,5 @@ export declare const useRadarChart: (props: RadarChartProps) => {
|
|
|
79
88
|
levelPolygonPoints: string;
|
|
80
89
|
r: number;
|
|
81
90
|
};
|
|
91
|
+
animateTogether: boolean;
|
|
82
92
|
};
|
package/dist/RadarChart/index.js
CHANGED
|
@@ -36,8 +36,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
36
36
|
};
|
|
37
37
|
import { radarChartDefaults } from '../utils/constants';
|
|
38
38
|
export var useRadarChart = function (props) {
|
|
39
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
40
|
-
var
|
|
39
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
40
|
+
var _u = props.circular, circular = _u === void 0 ? false : _u, _v = props.gridConfig, gridConfig = _v === void 0 ? {} : _v, _w = props.polygonConfig, polygonConfig = _w === void 0 ? {} : _w, _x = props.data, data = _x === void 0 ? [] : _x, dataSet = props.dataSet, _y = props.noOfSections, noOfSections = _y === void 0 ? radarChartDefaults.noOfSections : _y, _z = props.chartSize, chartSize = _z === void 0 ? radarChartDefaults.chartSize : _z, _0 = props.labelConfig, labelConfig = _0 === void 0 ? {} : _0, labelConfigArray = props.labelConfigArray, _1 = props.asterLinesConfig, asterLinesConfig = _1 === void 0 ? {} : _1, _2 = props.hideGrid, hideGrid = _2 === void 0 ? radarChartDefaults.hideGrid : _2, _3 = props.hideLabels, hideLabels = _3 === void 0 ? radarChartDefaults.hideLabels : _3, _4 = props.hideAsterLines, hideAsterLines = _4 === void 0 ? (_a = props.hideGrid) !== null && _a !== void 0 ? _a : radarChartDefaults.hideAsterLines : _4, _5 = props.dataLabelsConfig, dataLabelsConfig = _5 === void 0 ? {} : _5, _6 = props.labelsPositionOffset, labelsPositionOffset = _6 === void 0 ? radarChartDefaults.labelsPositionOffset : _6, _7 = props.dataLabelsPositionOffset, dataLabelsPositionOffset = _7 === void 0 ? radarChartDefaults.dataLabelsPositionOffset : _7, _8 = props.isAnimated, isAnimated = _8 === void 0 ? radarChartDefaults.isAnimated : _8, _9 = props.animationDuration, animationDuration = _9 === void 0 ? radarChartDefaults.animationDuration : _9, _10 = props.animateTogether, animateTogether = _10 === void 0 ? radarChartDefaults.animateTogether : _10;
|
|
41
41
|
var labels = (_e = (_b = props.labels) !== null && _b !== void 0 ? _b : (_d = ((_c = dataSet === null || dataSet === void 0 ? void 0 : dataSet[0]) !== null && _c !== void 0 ? _c : data)) === null || _d === void 0 ? void 0 : _d.map(function (_, index) { return "Label".concat(index + 1); })) !== null && _e !== void 0 ? _e : [];
|
|
42
42
|
var getMax = function (dataSet) {
|
|
43
43
|
return dataSet.reduce(function (acc, set) {
|
|
@@ -58,33 +58,33 @@ export var useRadarChart = function (props) {
|
|
|
58
58
|
};
|
|
59
59
|
var center = chartSize / 2;
|
|
60
60
|
var radius = center * 0.8;
|
|
61
|
-
var
|
|
62
|
-
.strokeDashArray :
|
|
63
|
-
.gradientColor :
|
|
64
|
-
.showGradient :
|
|
65
|
-
.gradientOpacity :
|
|
61
|
+
var _11 = gridConfig.stroke, gridStroke = _11 === void 0 ? radarChartDefaults.gridSection.stroke : _11, _12 = gridConfig.strokeWidth, gridStrokeWidth = _12 === void 0 ? radarChartDefaults.gridSection.strokeWidth : _12, _13 = gridConfig.strokeDashArray, gridStrokeDashArray = _13 === void 0 ? radarChartDefaults.gridSection
|
|
62
|
+
.strokeDashArray : _13, _14 = gridConfig.fill, gridFill = _14 === void 0 ? radarChartDefaults.gridSection.fill : _14, _15 = gridConfig.gradientColor, gridGradientColor = _15 === void 0 ? radarChartDefaults.gridSection
|
|
63
|
+
.gradientColor : _15, _16 = gridConfig.showGradient, gridShowGradient = _16 === void 0 ? radarChartDefaults.gridSection
|
|
64
|
+
.showGradient : _16, _17 = gridConfig.opacity, gridOpacity = _17 === void 0 ? radarChartDefaults.gridSection.opacity : _17, _18 = gridConfig.gradientOpacity, gridGradientOpacity = _18 === void 0 ? radarChartDefaults.gridSection
|
|
65
|
+
.gradientOpacity : _18;
|
|
66
66
|
var gridSections = (_j = (_h = gridConfig.gridSections) === null || _h === void 0 ? void 0 : _h.map(function (i) { return (__assign(__assign({}, radarChartDefaults.gridSection), i)); })) !== null && _j !== void 0 ? _j : Array(noOfSections).fill({});
|
|
67
|
-
var
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
dataLabelsColor =
|
|
71
|
-
|
|
72
|
-
dataLabelsTextAnchor =
|
|
73
|
-
|
|
74
|
-
dataLabelsAlignmentBaseline =
|
|
75
|
-
|
|
76
|
-
dataLabelsFontWeight =
|
|
77
|
-
|
|
67
|
+
var _19 = labelConfig.fontSize, fontSize = _19 === void 0 ? radarChartDefaults.labelConfig.fontSize : _19, _20 = labelConfig.stroke, stroke = _20 === void 0 ? radarChartDefaults.labelConfig.stroke : _20, _21 = labelConfig.textAnchor, textAnchor = _21 === void 0 ? radarChartDefaults.labelConfig.textAnchor : _21, _22 = labelConfig.alignmentBaseline, alignmentBaseline = _22 === void 0 ? radarChartDefaults.labelConfig.alignmentBaseline : _22, _23 = labelConfig.fontWeight, fontWeight = _23 === void 0 ? radarChartDefaults.labelConfig.fontWeight : _23, _24 = labelConfig.fontFamily, fontFamily = _24 === void 0 ? radarChartDefaults.labelConfig.fontFamily : _24;
|
|
68
|
+
var _25 = dataLabelsConfig.fontSize, dataLabelsFontSize = _25 === void 0 ? fontSize : _25, // defaults to labelConfig (from above)
|
|
69
|
+
_26 = dataLabelsConfig.stroke, // defaults to labelConfig (from above)
|
|
70
|
+
dataLabelsColor = _26 === void 0 ? stroke : _26, // defaults to labelConfig (from above)
|
|
71
|
+
_27 = dataLabelsConfig.textAnchor, // defaults to labelConfig (from above)
|
|
72
|
+
dataLabelsTextAnchor = _27 === void 0 ? textAnchor : _27, // defaults to labelConfig (from above)
|
|
73
|
+
_28 = dataLabelsConfig.alignmentBaseline, // defaults to labelConfig (from above)
|
|
74
|
+
dataLabelsAlignmentBaseline = _28 === void 0 ? alignmentBaseline : _28, // defaults to labelConfig (from above)
|
|
75
|
+
_29 = dataLabelsConfig.fontWeight, // defaults to labelConfig (from above)
|
|
76
|
+
dataLabelsFontWeight = _29 === void 0 ? fontWeight : _29, // defaults to labelConfig (from above)
|
|
77
|
+
_30 = dataLabelsConfig.fontFamily // defaults to labelConfig (from above)
|
|
78
78
|
, // defaults to labelConfig (from above)
|
|
79
|
-
dataLabelsFontFamily =
|
|
79
|
+
dataLabelsFontFamily = _30 === void 0 ? fontFamily : _30 // defaults to labelConfig (from above)
|
|
80
80
|
;
|
|
81
|
-
var
|
|
82
|
-
.strokeWidth :
|
|
83
|
-
.strokeDashArray :
|
|
84
|
-
.gradientColor :
|
|
85
|
-
.showGradient :
|
|
81
|
+
var _31 = polygonConfig.stroke, polygonStroke = _31 === void 0 ? radarChartDefaults.polygonConfig.stroke : _31, _32 = polygonConfig.strokeWidth, polygonStrokeWidth = _32 === void 0 ? radarChartDefaults.polygonConfig
|
|
82
|
+
.strokeWidth : _32, _33 = polygonConfig.strokeDashArray, polygonStrokeDashArray = _33 === void 0 ? radarChartDefaults.polygonConfig
|
|
83
|
+
.strokeDashArray : _33, _34 = polygonConfig.fill, polygonFill = _34 === void 0 ? radarChartDefaults.polygonConfig.fill : _34, _35 = polygonConfig.gradientColor, polygonGradientColor = _35 === void 0 ? radarChartDefaults.polygonConfig
|
|
84
|
+
.gradientColor : _35, _36 = polygonConfig.showGradient, polygonShowGradient = _36 === void 0 ? radarChartDefaults.polygonConfig
|
|
85
|
+
.showGradient : _36, _37 = polygonConfig.opacity, polygonOpacity = _37 === void 0 ? radarChartDefaults.polygonConfig.opacity : _37, _38 = polygonConfig.gradientOpacity, polygonGradientOpacity = _38 === void 0 ? polygonOpacity : _38, showDataValuesAsLabels = polygonConfig.showDataValuesAsLabels, _39 = polygonConfig.isAnimated, polygonIsAnimated = _39 === void 0 ? isAnimated : _39, _40 = polygonConfig.animationDuration, polygonAnimationDuration = _40 === void 0 ? animationDuration : _40;
|
|
86
86
|
var polygonConfigArray = (_l = (_k = props.polygonConfigArray) === null || _k === void 0 ? void 0 : _k.map(function (set) {
|
|
87
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
87
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
88
88
|
return ({
|
|
89
89
|
stroke: (_a = set.stroke) !== null && _a !== void 0 ? _a : polygonStroke,
|
|
90
90
|
strokeWidth: (_b = set.strokeWidth) !== null && _b !== void 0 ? _b : polygonStrokeWidth,
|
|
@@ -94,7 +94,9 @@ export var useRadarChart = function (props) {
|
|
|
94
94
|
showGradient: (_f = set.showGradient) !== null && _f !== void 0 ? _f : polygonShowGradient,
|
|
95
95
|
opacity: (_g = set.opacity) !== null && _g !== void 0 ? _g : polygonOpacity,
|
|
96
96
|
gradientOpacity: (_h = set.gradientOpacity) !== null && _h !== void 0 ? _h : polygonGradientOpacity,
|
|
97
|
-
showDataValuesAsLabels: (_j = set.showDataValuesAsLabels) !== null && _j !== void 0 ? _j : showDataValuesAsLabels
|
|
97
|
+
showDataValuesAsLabels: (_j = set.showDataValuesAsLabels) !== null && _j !== void 0 ? _j : showDataValuesAsLabels,
|
|
98
|
+
isAnimated: (_k = set.isAnimated) !== null && _k !== void 0 ? _k : polygonIsAnimated,
|
|
99
|
+
animationDuration: (_l = set.animationDuration) !== null && _l !== void 0 ? _l : polygonAnimationDuration
|
|
98
100
|
});
|
|
99
101
|
})) !== null && _l !== void 0 ? _l : (dataSet
|
|
100
102
|
? Array(dataSet.length).fill({
|
|
@@ -106,7 +108,9 @@ export var useRadarChart = function (props) {
|
|
|
106
108
|
showGradient: polygonShowGradient,
|
|
107
109
|
opacity: polygonOpacity,
|
|
108
110
|
gradientOpacity: polygonGradientOpacity,
|
|
109
|
-
showDataValuesAsLabels: showDataValuesAsLabels
|
|
111
|
+
showDataValuesAsLabels: showDataValuesAsLabels,
|
|
112
|
+
isAnimated: polygonIsAnimated,
|
|
113
|
+
animationDuration: polygonAnimationDuration
|
|
110
114
|
})
|
|
111
115
|
: null);
|
|
112
116
|
var dataLabelsArray = (_m = props.dataLabelsArray) !== null && _m !== void 0 ? _m : polygonConfigArray === null || polygonConfigArray === void 0 ? void 0 : polygonConfigArray.map(function (polygonItem, index) {
|
|
@@ -143,7 +147,7 @@ export var useRadarChart = function (props) {
|
|
|
143
147
|
});
|
|
144
148
|
});
|
|
145
149
|
})) !== null && _r !== void 0 ? _r : (dataSet ? Array(dataSet.length).fill(dataLabelsConfigArray) : null);
|
|
146
|
-
var
|
|
150
|
+
var _41 = asterLinesConfig.stroke, asterLinesStroke = _41 === void 0 ? gridStroke : _41, _42 = asterLinesConfig.strokeWidth, asterLinesStrokeWidth = _42 === void 0 ? gridStrokeWidth : _42, _43 = asterLinesConfig.strokeDashArray, asterLinesStrokeDashArray = _43 === void 0 ? radarChartDefaults.asterLineStrokeDashArray : _43;
|
|
147
151
|
// Calculate angles for each category
|
|
148
152
|
var angleStep = 360 / labels.length;
|
|
149
153
|
// Generate coordinates for the data points
|
|
@@ -151,17 +155,33 @@ export var useRadarChart = function (props) {
|
|
|
151
155
|
var angle = index * angleStep;
|
|
152
156
|
return polarToCartesian(angle, value);
|
|
153
157
|
});
|
|
158
|
+
var initialPoints = data.map(function (value, index) {
|
|
159
|
+
var angle = index * angleStep;
|
|
160
|
+
return polarToCartesian(angle, 0);
|
|
161
|
+
});
|
|
154
162
|
var pointsArray = (_s = dataSet === null || dataSet === void 0 ? void 0 : dataSet.map(function (set) {
|
|
155
163
|
return set.map(function (value, index) {
|
|
156
164
|
var angle = index * angleStep;
|
|
157
165
|
return polarToCartesian(angle, value);
|
|
158
166
|
});
|
|
159
167
|
})) !== null && _s !== void 0 ? _s : [];
|
|
168
|
+
var initialPointsArray = (_t = dataSet === null || dataSet === void 0 ? void 0 : dataSet.map(function (set) {
|
|
169
|
+
return set.map(function (value, index) {
|
|
170
|
+
var angle = index * angleStep;
|
|
171
|
+
return polarToCartesian(angle, 0);
|
|
172
|
+
});
|
|
173
|
+
})) !== null && _t !== void 0 ? _t : [];
|
|
160
174
|
// Generate the polygon points for the radar chart (in SVG "x,y" format)
|
|
161
175
|
var polygonPoints = points.map(function (point) { return "".concat(point.x, ",").concat(point.y); }).join(' ');
|
|
176
|
+
var initialPolygonPoints = initialPoints
|
|
177
|
+
.map(function (point) { return "".concat(point.x, ",").concat(point.y); })
|
|
178
|
+
.join(' ');
|
|
162
179
|
var polygonPointsArray = pointsArray.map(function (set) {
|
|
163
180
|
return set.map(function (point) { return "".concat(point.x, ",").concat(point.y); }).join(' ');
|
|
164
181
|
});
|
|
182
|
+
var initialPolygonPointsArray = initialPointsArray.map(function (set) {
|
|
183
|
+
return set.map(function (point) { return "".concat(point.x, ",").concat(point.y); }).join(' ');
|
|
184
|
+
});
|
|
165
185
|
var getGridLevelProps = function (gridItem, ind) {
|
|
166
186
|
var level = noOfSections - ind;
|
|
167
187
|
var gridGradientColorLocal = gridItem.gradientColor || gridGradientColor;
|
|
@@ -242,16 +262,23 @@ export var useRadarChart = function (props) {
|
|
|
242
262
|
polygonOpacity: polygonOpacity,
|
|
243
263
|
polygonGradientOpacity: polygonGradientOpacity,
|
|
244
264
|
polygonConfigArray: polygonConfigArray,
|
|
265
|
+
polygonIsAnimated: polygonIsAnimated,
|
|
266
|
+
polygonAnimationDuration: polygonAnimationDuration,
|
|
245
267
|
asterLinesStroke: asterLinesStroke,
|
|
246
268
|
asterLinesStrokeWidth: asterLinesStrokeWidth,
|
|
247
269
|
asterLinesStrokeDashArray: asterLinesStrokeDashArray,
|
|
248
270
|
points: points,
|
|
271
|
+
initialPoints: initialPoints,
|
|
249
272
|
polygonPoints: polygonPoints,
|
|
273
|
+
initialPolygonPoints: initialPolygonPoints,
|
|
250
274
|
polygonPointsArray: polygonPointsArray,
|
|
275
|
+
initialPolygonPointsArray: initialPolygonPointsArray,
|
|
251
276
|
angleStep: angleStep,
|
|
252
277
|
circular: circular,
|
|
253
278
|
hideGrid: hideGrid,
|
|
279
|
+
hideLabels: hideLabels,
|
|
254
280
|
hideAsterLines: hideAsterLines,
|
|
255
|
-
getGridLevelProps: getGridLevelProps
|
|
281
|
+
getGridLevelProps: getGridLevelProps,
|
|
282
|
+
animateTogether: animateTogether
|
|
256
283
|
};
|
|
257
284
|
};
|
|
@@ -22,7 +22,6 @@ export interface RadarChartProps {
|
|
|
22
22
|
labels?: string[];
|
|
23
23
|
dataLabels?: string[];
|
|
24
24
|
dataLabelsArray?: string[][];
|
|
25
|
-
dataLabelConfig?: LabelConfig;
|
|
26
25
|
dataLabelsConfigArray?: LabelConfig[];
|
|
27
26
|
polygonConfig?: PolygonConfig;
|
|
28
27
|
polygonConfigArray?: PolygonConfig[];
|
|
@@ -34,6 +33,9 @@ export interface RadarChartProps {
|
|
|
34
33
|
dataLabelsConfigSet?: LabelConfig[][];
|
|
35
34
|
labelsPositionOffset?: number;
|
|
36
35
|
dataLabelsPositionOffset?: number;
|
|
36
|
+
isAnimated?: boolean;
|
|
37
|
+
animationDuration?: number;
|
|
38
|
+
animateTogether?: boolean;
|
|
37
39
|
}
|
|
38
40
|
export interface StrokeConfig {
|
|
39
41
|
stroke?: string;
|
|
@@ -49,6 +51,8 @@ export interface StrokeFillAndGradient extends StrokeConfig {
|
|
|
49
51
|
}
|
|
50
52
|
export interface PolygonConfig extends StrokeFillAndGradient {
|
|
51
53
|
showDataValuesAsLabels?: boolean;
|
|
54
|
+
isAnimated?: boolean;
|
|
55
|
+
animationDuration?: number;
|
|
52
56
|
}
|
|
53
57
|
export interface GridSectionConfig extends StrokeFillAndGradient {
|
|
54
58
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,13 +5,13 @@ export { useBarChart } from './BarChart';
|
|
|
5
5
|
export { getPropsForAnimated2DWithGradient } from './BarChart/Animated2DWithGradient';
|
|
6
6
|
export { useRenderStackBars } from './BarChart/RenderStackBars';
|
|
7
7
|
export { useRenderBars } from './BarChart/RenderBars';
|
|
8
|
-
export { type stackDataItem, type StackedBarChartPropsType, type BarChartPropsType, type defaultLineConfigType, type barDataItem, type barDataItemNullSafe, type Animated2DWithGradientPropsType, type RenderBarsPropsType, type trianglePropTypes, type animatedBarPropTypes, type FocusedBarConfig, type CommonPropsFor2dand3dBarsType } from './BarChart/types';
|
|
8
|
+
export { type stackDataItem, type StackedBarChartPropsType, type StackedBarChartPropsTypeForWeb, type BarChartPropsType, type defaultLineConfigType, type barDataItem, type barDataItemNullSafe, type Animated2DWithGradientPropsType, type RenderBarsPropsType, type trianglePropTypes, type animatedBarPropTypes, type FocusedBarConfig, type CommonPropsFor2dand3dBarsType } from './BarChart/types';
|
|
9
9
|
/************************************************************************************************************************
|
|
10
10
|
/***************************************** Line Chart *****************************************
|
|
11
11
|
/************************************************************************************************************************/
|
|
12
12
|
export { useLineChart } from './LineChart';
|
|
13
13
|
export { useLineChartBiColor } from './LineChart/LineChartBiColor';
|
|
14
|
-
export { type LineChartPropsType, type lineDataItem, type lineDataItemNullSafe, type bicolorLineDataItem, type LineChartBicolorPropsType } from './LineChart/types';
|
|
14
|
+
export { type LineChartPropsType, type LineChartPropsTypeForWeb, type lineDataItem, type lineDataItemNullSafe, type bicolorLineDataItem, type LineChartBicolorPropsType, type LineChartBicolorPropsTypeForWeb } from './LineChart/types';
|
|
15
15
|
/***********************************************************************************************************************
|
|
16
16
|
/***************************************** Pie Chart *****************************************
|
|
17
17
|
/***********************************************************************************************************************/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type defaultLineConfigType } from '../BarChart/types';
|
|
2
|
-
import { CurveType, EdgePosition, type RuleTypes } from './types';
|
|
2
|
+
import { CurveType, EdgePosition, Linecap, type RuleTypes } from './types';
|
|
3
3
|
import { type FontStyle } from 'react-native-svg';
|
|
4
4
|
export declare enum chartTypes {
|
|
5
5
|
BAR = 0,
|
|
@@ -119,6 +119,7 @@ export declare const BarDefaults: {
|
|
|
119
119
|
focusedThreeDBarFrontColor: string;
|
|
120
120
|
focusedBarSideColor: string;
|
|
121
121
|
focusedBarTopColor: string;
|
|
122
|
+
renderTooltipConditions: string[];
|
|
122
123
|
};
|
|
123
124
|
export declare const LineDefaults: {
|
|
124
125
|
color: string;
|
|
@@ -166,6 +167,7 @@ export declare const LineDefaults: {
|
|
|
166
167
|
delayBeforeUnFocus: number;
|
|
167
168
|
edgePosition: EdgePosition;
|
|
168
169
|
endReachedOffset: number;
|
|
170
|
+
strokeLinecap: Linecap;
|
|
169
171
|
};
|
|
170
172
|
export declare const defaultLineConfig: defaultLineConfigType;
|
|
171
173
|
export declare const defaultPointerConfig: {
|
|
@@ -271,6 +273,7 @@ export declare const radarChartDefaults: {
|
|
|
271
273
|
chartSize: number;
|
|
272
274
|
hideAsterLines: boolean;
|
|
273
275
|
hideGrid: boolean;
|
|
276
|
+
hideLabels: boolean;
|
|
274
277
|
labelsPositionOffset: number;
|
|
275
278
|
dataLabelsPositionOffset: number;
|
|
276
279
|
gridSection: {
|
|
@@ -301,4 +304,7 @@ export declare const radarChartDefaults: {
|
|
|
301
304
|
opacity: number;
|
|
302
305
|
};
|
|
303
306
|
asterLineStrokeDashArray: number[];
|
|
307
|
+
isAnimated: boolean;
|
|
308
|
+
animationDuration: number;
|
|
309
|
+
animateTogether: boolean;
|
|
304
310
|
};
|
package/dist/utils/constants.js
CHANGED
|
@@ -129,7 +129,8 @@ export var BarDefaults = {
|
|
|
129
129
|
focusedBarFrontColor: 'lightgreen',
|
|
130
130
|
focusedThreeDBarFrontColor: '#B0B929',
|
|
131
131
|
focusedBarSideColor: '#776913',
|
|
132
|
-
focusedBarTopColor: '#C8D565'
|
|
132
|
+
focusedBarTopColor: '#C8D565',
|
|
133
|
+
renderTooltipConditions: ['onClick', 'onHover']
|
|
133
134
|
};
|
|
134
135
|
// Line chart specific
|
|
135
136
|
export var LineDefaults = {
|
|
@@ -177,7 +178,8 @@ export var LineDefaults = {
|
|
|
177
178
|
unFocusOnPressOut: true,
|
|
178
179
|
delayBeforeUnFocus: 300,
|
|
179
180
|
edgePosition: EdgePosition.AFTER_DATA_POINT,
|
|
180
|
-
endReachedOffset: defaultEndReachedOffset
|
|
181
|
+
endReachedOffset: defaultEndReachedOffset,
|
|
182
|
+
strokeLinecap: 'butt'
|
|
181
183
|
};
|
|
182
184
|
export var defaultLineConfig = {
|
|
183
185
|
initialSpacing: BarDefaults.spacing, // gets updated to spacing before being used
|
|
@@ -324,6 +326,7 @@ export var radarChartDefaults = {
|
|
|
324
326
|
chartSize: 300,
|
|
325
327
|
hideAsterLines: false,
|
|
326
328
|
hideGrid: false,
|
|
329
|
+
hideLabels: false,
|
|
327
330
|
labelsPositionOffset: 5,
|
|
328
331
|
dataLabelsPositionOffset: 5,
|
|
329
332
|
gridSection: {
|
|
@@ -351,7 +354,10 @@ export var radarChartDefaults = {
|
|
|
351
354
|
fill: 'skyblue',
|
|
352
355
|
gradientColor: 'lightgray',
|
|
353
356
|
showGradient: false,
|
|
354
|
-
opacity: 0.7
|
|
357
|
+
opacity: 0.7
|
|
355
358
|
},
|
|
356
|
-
asterLineStrokeDashArray: [4, 4]
|
|
359
|
+
asterLineStrokeDashArray: [4, 4],
|
|
360
|
+
isAnimated: false,
|
|
361
|
+
animationDuration: 800,
|
|
362
|
+
animateTogether: false
|
|
357
363
|
};
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -103,6 +103,7 @@ export interface secondaryLineConfigType {
|
|
|
103
103
|
thickness?: number;
|
|
104
104
|
zIndex1?: number;
|
|
105
105
|
strokeDashArray?: number[];
|
|
106
|
+
strokeLinecap?: Linecap;
|
|
106
107
|
startIndex?: number;
|
|
107
108
|
endIndex?: number;
|
|
108
109
|
hideDataPoints?: boolean;
|
|
@@ -395,6 +396,13 @@ export interface Pointer {
|
|
|
395
396
|
pointerEvents?: PointerEvents;
|
|
396
397
|
stripBehindBars?: boolean;
|
|
397
398
|
resetPointerOnDataChange?: boolean;
|
|
399
|
+
onTouchStart?: Function;
|
|
400
|
+
onTouchEnd?: Function;
|
|
401
|
+
onResponderGrant?: Function;
|
|
402
|
+
onResponderMove?: Function;
|
|
403
|
+
onResponderEnd?: Function;
|
|
404
|
+
onPointerEnter?: Function;
|
|
405
|
+
onPointerLeave?: Function;
|
|
398
406
|
}
|
|
399
407
|
export interface HighlightedRange {
|
|
400
408
|
from: number;
|
|
@@ -417,6 +425,7 @@ export interface LineSvgProps {
|
|
|
417
425
|
strokeWidth: number;
|
|
418
426
|
strokeDasharray?: number[];
|
|
419
427
|
clipPath?: string;
|
|
428
|
+
strokeLinecap: Linecap;
|
|
420
429
|
}
|
|
421
430
|
export interface LineProperties {
|
|
422
431
|
d: string;
|
|
@@ -429,6 +438,7 @@ export interface DataSet {
|
|
|
429
438
|
zIndex?: number;
|
|
430
439
|
thickness?: number;
|
|
431
440
|
strokeDashArray?: number[];
|
|
441
|
+
strokeLinecap?: Linecap;
|
|
432
442
|
areaChart?: boolean;
|
|
433
443
|
stepChart?: boolean;
|
|
434
444
|
startIndex?: number;
|
|
@@ -455,6 +465,7 @@ export interface DataSet {
|
|
|
455
465
|
isSecondary?: boolean;
|
|
456
466
|
hidePointers?: boolean;
|
|
457
467
|
spacing?: number;
|
|
468
|
+
renderTooltip?: Function;
|
|
458
469
|
}
|
|
459
470
|
export interface DataSetNullSafe extends DataSet {
|
|
460
471
|
data: lineDataItemNullSafe[];
|