gifted-charts-core 0.1.27 → 0.1.29
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/LineChart/index.d.ts +1 -0
- package/dist/LineChart/index.js +74 -72
- package/dist/LineChart/types.d.ts +2 -0
- package/dist/PieChart/index.d.ts +1 -1
- package/dist/PieChart/index.js +6 -2
- package/dist/PieChart/main.d.ts +35 -1
- package/dist/PieChart/main.js +68 -11
- package/dist/PieChart/types.d.ts +8 -3
- package/dist/index.d.ts +1 -1
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.js +1 -0
- package/dist/utils/index.d.ts +21 -0
- package/dist/utils/index.js +24 -1
- package/dist/utils/types.d.ts +11 -0
- package/package.json +1 -1
|
@@ -209,6 +209,7 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
|
|
|
209
209
|
strokeDashArray5: number[] | undefined;
|
|
210
210
|
rotateLabel: boolean;
|
|
211
211
|
isAnimated: boolean;
|
|
212
|
+
hidePointers: boolean;
|
|
212
213
|
hideDataPoints1: boolean;
|
|
213
214
|
hideDataPoints2: boolean;
|
|
214
215
|
hideDataPoints3: boolean;
|
package/dist/LineChart/index.js
CHANGED
|
@@ -39,52 +39,52 @@ import { AxesAndRulesDefaults, LineDefaults, SEGMENT_END, SEGMENT_START, chartTy
|
|
|
39
39
|
import { adjustToOffset, computeMaxAndMinItems, getAllArrowProperties, getArrowPoints, getAxesAndRulesProps, getCurvePathWithSegments, getExtendedContainerHeightWithPadding, getInterpolatedData, getLineSegmentsForMissingValues, getMaxValue, getNoOfSections, getPathWithHighlight, getSanitisedData, getSecondaryDataWithOffsetIncluded, getSegmentString, 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;
|
|
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;
|
|
43
|
+
var showDataPointsForMissingValues = props.showDataPointsForMissingValues, _299 = props.interpolateMissingValues, interpolateMissingValues = _299 === void 0 ? true : _299, onlyPositive = props.onlyPositive, yAxisOffset = props.yAxisOffset, parentWidth = props.parentWidth;
|
|
44
44
|
var curvature = (_a = props.curvature) !== null && _a !== void 0 ? _a : LineDefaults.curvature;
|
|
45
45
|
var curveType = (_b = props.curveType) !== null && _b !== void 0 ? _b : LineDefaults.curveType;
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
var
|
|
58
|
-
var
|
|
59
|
-
var
|
|
60
|
-
var
|
|
61
|
-
var
|
|
62
|
-
var
|
|
63
|
-
var
|
|
64
|
-
var
|
|
65
|
-
var
|
|
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
|
|
46
|
+
var _300 = __read(useState(0), 2), scrollX = _300[0], setScrollX = _300[1];
|
|
47
|
+
var _301 = __read(useState(''), 2), arrow1Points = _301[0], setArrow1Points = _301[1];
|
|
48
|
+
var _302 = __read(useState(''), 2), arrow2Points = _302[0], setArrow2Points = _302[1];
|
|
49
|
+
var _303 = __read(useState(''), 2), arrow3Points = _303[0], setArrow3Points = _303[1];
|
|
50
|
+
var _304 = __read(useState(''), 2), arrow4Points = _304[0], setArrow4Points = _304[1];
|
|
51
|
+
var _305 = __read(useState(''), 2), arrow5Points = _305[0], setArrow5Points = _305[1];
|
|
52
|
+
var _306 = __read(useState(''), 2), secondaryArrowPoints = _306[0], setSecondaryArrowPoints = _306[1];
|
|
53
|
+
var _307 = __read(useState(-1), 2), pointerIndex = _307[0], setPointerIndex = _307[1];
|
|
54
|
+
var _308 = __read(useState(0), 2), pointerX = _308[0], setPointerX = _308[1];
|
|
55
|
+
var _309 = __read(useState(0), 2), pointerY = _309[0], setPointerY = _309[1];
|
|
56
|
+
var _310 = __read(useState(), 2), pointerItem = _310[0], setPointerItem = _310[1];
|
|
57
|
+
var _311 = __read(useState(0), 2), pointerY2 = _311[0], setPointerY2 = _311[1];
|
|
58
|
+
var _312 = __read(useState(), 2), pointerItem2 = _312[0], setPointerItem2 = _312[1];
|
|
59
|
+
var _313 = __read(useState(0), 2), pointerY3 = _313[0], setPointerY3 = _313[1];
|
|
60
|
+
var _314 = __read(useState(), 2), pointerItem3 = _314[0], setPointerItem3 = _314[1];
|
|
61
|
+
var _315 = __read(useState(0), 2), pointerY4 = _315[0], setPointerY4 = _315[1];
|
|
62
|
+
var _316 = __read(useState(), 2), pointerItem4 = _316[0], setPointerItem4 = _316[1];
|
|
63
|
+
var _317 = __read(useState(0), 2), pointerY5 = _317[0], setPointerY5 = _317[1];
|
|
64
|
+
var _318 = __read(useState([]), 2), pointerYsForDataSet = _318[0], setPointerYsForDataSet = _318[1];
|
|
65
|
+
var _319 = __read(useState(), 2), pointerItem5 = _319[0], setPointerItem5 = _319[1];
|
|
66
|
+
var _320 = __read(useState(0), 2), secondaryPointerY = _320[0], setSecondaryPointerY = _320[1];
|
|
67
|
+
var _321 = __read(useState(), 2), secondaryPointerItem = _321[0], setSecondaryPointerItem = _321[1];
|
|
68
|
+
var _322 = __read(useState([]), 2), pointerItemsForSet = _322[0], setPointerItemsForSet = _322[1];
|
|
69
|
+
var _323 = __read(useState([]), 2), secondaryPointerItemsForSet = _323[0], setSecondaryPointerItemsForSet = _323[1];
|
|
70
|
+
var _324 = __read(useState(0), 2), responderStartTime = _324[0], setResponderStartTime = _324[1];
|
|
71
|
+
var _325 = __read(useState(false), 2), responderActive = _325[0], setResponderActive = _325[1];
|
|
72
|
+
var _326 = __read(useState(''), 2), points = _326[0], setPoints = _326[1];
|
|
73
|
+
var _327 = __read(useState(''), 2), points2 = _327[0], setPoints2 = _327[1];
|
|
74
|
+
var _328 = __read(useState(''), 2), points3 = _328[0], setPoints3 = _328[1];
|
|
75
|
+
var _329 = __read(useState(''), 2), points4 = _329[0], setPoints4 = _329[1];
|
|
76
|
+
var _330 = __read(useState(''), 2), points5 = _330[0], setPoints5 = _330[1];
|
|
77
|
+
var _331 = __read(useState(''), 2), secondaryPoints = _331[0], setSecondaryPoints = _331[1];
|
|
78
|
+
var _332 = __read(useState(''), 2), fillPoints = _332[0], setFillPoints = _332[1];
|
|
79
|
+
var _333 = __read(useState(''), 2), fillPoints2 = _333[0], setFillPoints2 = _333[1];
|
|
80
|
+
var _334 = __read(useState(''), 2), fillPoints3 = _334[0], setFillPoints3 = _334[1];
|
|
81
|
+
var _335 = __read(useState(''), 2), fillPoints4 = _335[0], setFillPoints4 = _335[1];
|
|
82
|
+
var _336 = __read(useState(''), 2), fillPoints5 = _336[0], setFillPoints5 = _336[1];
|
|
83
|
+
var _337 = __read(useState(''), 2), secondaryFillPoints = _337[0], setSecondaryFillPoints = _337[1];
|
|
84
|
+
var _338 = __read(useState([]), 2), pointsFromSet = _338[0], setPointsFromSet = _338[1];
|
|
85
|
+
var _339 = __read(useState([]), 2), fillPointsFromSet = _339[0], setFillPointsFromSet = _339[1];
|
|
86
|
+
var _340 = __read(useState([]), 2), arrowPointsFromSet = _340[0], setArrowPointsFromSet = _340[1];
|
|
87
|
+
var _341 = __read(useState((_c = props.focusedDataPointIndex) !== null && _c !== void 0 ? _c : -1), 2), selectedIndex = _341[0], setSelectedIndex = _341[1];
|
|
88
88
|
useEffect(function () {
|
|
89
89
|
var _a;
|
|
90
90
|
setSelectedIndex((_a = props.focusedDataPointIndex) !== null && _a !== void 0 ? _a : -1);
|
|
@@ -245,7 +245,7 @@ export var useLineChart = function (props) {
|
|
|
245
245
|
var textColor4 = (_95 = (_94 = props.textColor4) !== null && _94 !== void 0 ? _94 : props.textColor) !== null && _95 !== void 0 ? _95 : LineDefaults.textColor;
|
|
246
246
|
var textColor5 = (_97 = (_96 = props.textColor5) !== null && _96 !== void 0 ? _96 : props.textColor) !== null && _97 !== void 0 ? _97 : LineDefaults.textColor;
|
|
247
247
|
var totalWidth = initialSpacing + spacing * maxLengthOfDataOrSet - 1 + endSpacing;
|
|
248
|
-
var
|
|
248
|
+
var _342 = computeMaxAndMinItems(data0 !== null && data0 !== void 0 ? data0 : data, props.roundToDigits, props.showFractionalValues), maxItem = _342.maxItem, minItem = _342.minItem;
|
|
249
249
|
var maxValue = getMaxValue(props.maxValue, props.stepValue, noOfSections, maxItem);
|
|
250
250
|
var mostNegativeValue = (_98 = props.mostNegativeValue) !== null && _98 !== void 0 ? _98 : minItem;
|
|
251
251
|
var overflowTop = ((_99 = props.overflowTop) !== null && _99 !== void 0 ? _99 : props.secondaryXAxis)
|
|
@@ -314,7 +314,7 @@ export var useLineChart = function (props) {
|
|
|
314
314
|
var endOpacity5 = (_178 = props.endOpacity5) !== null && _178 !== void 0 ? _178 : endOpacity;
|
|
315
315
|
defaultArrowConfig.strokeWidth = (_180 = (_179 = dataSet === null || dataSet === void 0 ? void 0 : dataSet[0]) === null || _179 === void 0 ? void 0 : _179.thickness) !== null && _180 !== void 0 ? _180 : thickness1;
|
|
316
316
|
defaultArrowConfig.strokeColor = (_182 = (_181 = dataSet === null || dataSet === void 0 ? void 0 : dataSet[0]) === null || _181 === void 0 ? void 0 : _181.color) !== null && _182 !== void 0 ? _182 : color1;
|
|
317
|
-
var
|
|
317
|
+
var _343 = getAllArrowProperties(props, defaultArrowConfig), arrowLength1 = _343.arrowLength1, arrowWidth1 = _343.arrowWidth1, arrowStrokeWidth1 = _343.arrowStrokeWidth1, arrowStrokeColor1 = _343.arrowStrokeColor1, arrowFillColor1 = _343.arrowFillColor1, showArrowBase1 = _343.showArrowBase1, arrowLength2 = _343.arrowLength2, arrowWidth2 = _343.arrowWidth2, arrowStrokeWidth2 = _343.arrowStrokeWidth2, arrowStrokeColor2 = _343.arrowStrokeColor2, arrowFillColor2 = _343.arrowFillColor2, showArrowBase2 = _343.showArrowBase2, arrowLength3 = _343.arrowLength3, arrowWidth3 = _343.arrowWidth3, arrowStrokeWidth3 = _343.arrowStrokeWidth3, arrowStrokeColor3 = _343.arrowStrokeColor3, arrowFillColor3 = _343.arrowFillColor3, showArrowBase3 = _343.showArrowBase3, arrowLength4 = _343.arrowLength4, arrowWidth4 = _343.arrowWidth4, arrowStrokeWidth4 = _343.arrowStrokeWidth4, arrowStrokeColor4 = _343.arrowStrokeColor4, arrowFillColor4 = _343.arrowFillColor4, showArrowBase4 = _343.showArrowBase4, arrowLength5 = _343.arrowLength5, arrowWidth5 = _343.arrowWidth5, arrowStrokeWidth5 = _343.arrowStrokeWidth5, arrowStrokeColor5 = _343.arrowStrokeColor5, arrowFillColor5 = _343.arrowFillColor5, showArrowBase5 = _343.showArrowBase5, arrowLengthsFromSet = _343.arrowLengthsFromSet, arrowWidthsFromSet = _343.arrowWidthsFromSet, arrowStrokeWidthsFromSet = _343.arrowStrokeWidthsFromSet, arrowStrokeColorsFromSet = _343.arrowStrokeColorsFromSet, arrowFillColorsFromSet = _343.arrowFillColorsFromSet, showArrowBasesFromSet = _343.showArrowBasesFromSet;
|
|
318
318
|
var secondaryLineConfig = {
|
|
319
319
|
zIndex: (_184 = (_183 = props.secondaryLineConfig) === null || _183 === void 0 ? void 0 : _183.zIndex) !== null && _184 !== void 0 ? _184 : zIndex1,
|
|
320
320
|
curved: (_186 = (_185 = props.secondaryLineConfig) === null || _185 === void 0 ? void 0 : _185.curved) !== null && _186 !== void 0 ? _186 : props.curved,
|
|
@@ -911,37 +911,38 @@ export var useLineChart = function (props) {
|
|
|
911
911
|
? animationDuration
|
|
912
912
|
: defaultPointerConfig.initialPointerAppearDelay);
|
|
913
913
|
var persistPointer = (_269 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.persistPointer) !== null && _269 !== void 0 ? _269 : defaultPointerConfig.persistPointer;
|
|
914
|
-
var
|
|
915
|
-
var
|
|
916
|
-
var
|
|
917
|
-
var
|
|
918
|
-
var
|
|
919
|
-
var
|
|
920
|
-
var
|
|
914
|
+
var hidePointers = (_270 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointers) !== null && _270 !== void 0 ? _270 : defaultPointerConfig.hidePointers;
|
|
915
|
+
var hidePointer1 = (_271 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer1) !== null && _271 !== void 0 ? _271 : defaultPointerConfig.hidePointer1;
|
|
916
|
+
var hidePointer2 = (_272 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer2) !== null && _272 !== void 0 ? _272 : defaultPointerConfig.hidePointer2;
|
|
917
|
+
var hidePointer3 = (_273 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer3) !== null && _273 !== void 0 ? _273 : defaultPointerConfig.hidePointer3;
|
|
918
|
+
var hidePointer4 = (_274 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer4) !== null && _274 !== void 0 ? _274 : defaultPointerConfig.hidePointer4;
|
|
919
|
+
var hidePointer5 = (_275 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hidePointer5) !== null && _275 !== void 0 ? _275 : defaultPointerConfig.hidePointer5;
|
|
920
|
+
var hideSecondaryPointer = (_276 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.hideSecondaryPointer) !== null && _276 !== void 0 ? _276 : defaultPointerConfig.hideSecondaryPointer;
|
|
921
|
+
var resetPointerOnDataChange = (_277 = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.resetPointerOnDataChange) !== null && _277 !== void 0 ? _277 : defaultPointerConfig.resetPointerOnDataChange;
|
|
921
922
|
var pointerEvents = pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointerEvents;
|
|
922
|
-
var disableScroll = (
|
|
923
|
+
var disableScroll = (_278 = props.disableScroll) !== null && _278 !== void 0 ? _278 : (pointerConfig
|
|
923
924
|
? activatePointersOnLongPress
|
|
924
925
|
? !!responderActive
|
|
925
926
|
: true
|
|
926
927
|
: false);
|
|
927
|
-
var showScrollIndicator = (
|
|
928
|
-
var focusEnabled = (
|
|
929
|
-
var showDataPointOnFocus = (
|
|
930
|
-
var showStripOnFocus = (
|
|
931
|
-
var showTextOnFocus = (
|
|
932
|
-
var showDataPointLabelOnFocus = (
|
|
928
|
+
var showScrollIndicator = (_279 = props.showScrollIndicator) !== null && _279 !== void 0 ? _279 : LineDefaults.showScrollIndicator;
|
|
929
|
+
var focusEnabled = (_280 = props.focusEnabled) !== null && _280 !== void 0 ? _280 : LineDefaults.focusEnabled;
|
|
930
|
+
var showDataPointOnFocus = (_281 = props.showDataPointOnFocus) !== null && _281 !== void 0 ? _281 : LineDefaults.showDataPointOnFocus;
|
|
931
|
+
var showStripOnFocus = (_282 = props.showStripOnFocus) !== null && _282 !== void 0 ? _282 : LineDefaults.showStripOnFocus;
|
|
932
|
+
var showTextOnFocus = (_283 = props.showTextOnFocus) !== null && _283 !== void 0 ? _283 : LineDefaults.showTextOnFocus;
|
|
933
|
+
var showDataPointLabelOnFocus = (_284 = props.showDataPointLabelOnFocus) !== null && _284 !== void 0 ? _284 : LineDefaults.showDataPointLabelOnFocus;
|
|
933
934
|
var stripHeight = props.stripHeight;
|
|
934
|
-
var stripWidth = (
|
|
935
|
-
var stripColor = (
|
|
936
|
-
var stripOpacity = (
|
|
935
|
+
var stripWidth = (_285 = props.stripWidth) !== null && _285 !== void 0 ? _285 : LineDefaults.stripWidth;
|
|
936
|
+
var stripColor = (_286 = props.stripColor) !== null && _286 !== void 0 ? _286 : color1;
|
|
937
|
+
var stripOpacity = (_287 = props.stripOpacity) !== null && _287 !== void 0 ? _287 : (startOpacity1 + endOpacity1) / 2;
|
|
937
938
|
var stripStrokeDashArray = props.stripStrokeDashArray;
|
|
938
|
-
var unFocusOnPressOut = (
|
|
939
|
-
var delayBeforeUnFocus = (
|
|
939
|
+
var unFocusOnPressOut = (_288 = props.unFocusOnPressOut) !== null && _288 !== void 0 ? _288 : LineDefaults.unFocusOnPressOut;
|
|
940
|
+
var delayBeforeUnFocus = (_289 = props.delayBeforeUnFocus) !== null && _289 !== void 0 ? _289 : LineDefaults.delayBeforeUnFocus;
|
|
940
941
|
var containerHeightIncludingBelowXAxis = extendedContainerHeight + noOfSectionsBelowXAxis * stepHeight;
|
|
941
|
-
var lineGradient = (
|
|
942
|
-
var lineGradientDirection = (
|
|
943
|
-
var lineGradientStartColor = (
|
|
944
|
-
var lineGradientEndColor = (
|
|
942
|
+
var lineGradient = (_290 = props.lineGradient) !== null && _290 !== void 0 ? _290 : LineDefaults.lineGradient;
|
|
943
|
+
var lineGradientDirection = (_291 = props.lineGradientDirection) !== null && _291 !== void 0 ? _291 : 'vertical';
|
|
944
|
+
var lineGradientStartColor = (_292 = props.lineGradientStartColor) !== null && _292 !== void 0 ? _292 : LineDefaults.lineGradientStartColor;
|
|
945
|
+
var lineGradientEndColor = (_293 = props.lineGradientEndColor) !== null && _293 !== void 0 ? _293 : LineDefaults.lineGradientEndColor;
|
|
945
946
|
var getPointerY = function (value) {
|
|
946
947
|
return value
|
|
947
948
|
? containerHeight -
|
|
@@ -1012,8 +1013,8 @@ export var useLineChart = function (props) {
|
|
|
1012
1013
|
var initialPointerYs = (_a = dataSet === null || dataSet === void 0 ? void 0 : dataSet.map(function (set) { return getPointerY(set.data[initialPointerIndex].value); })) !== null && _a !== void 0 ? _a : [];
|
|
1013
1014
|
setPointerYsForDataSet(initialPointerYs);
|
|
1014
1015
|
};
|
|
1015
|
-
var dataPointsRadius = (
|
|
1016
|
-
var dataPointsWidth = (
|
|
1016
|
+
var dataPointsRadius = (_295 = (_294 = props.dataPointsRadius1) !== null && _294 !== void 0 ? _294 : props.dataPointsRadius) !== null && _295 !== void 0 ? _295 : LineDefaults.dataPointsRadius;
|
|
1017
|
+
var dataPointsWidth = (_297 = (_296 = props.dataPointsWidth1) !== null && _296 !== void 0 ? _296 : props.dataPointsWidth) !== null && _297 !== void 0 ? _297 : LineDefaults.dataPointsWidth;
|
|
1017
1018
|
var extraWidthDueToDataPoint = props.hideDataPoints
|
|
1018
1019
|
? 0
|
|
1019
1020
|
: dataPointsRadius !== null && dataPointsRadius !== void 0 ? dataPointsRadius : dataPointsWidth;
|
|
@@ -1081,7 +1082,7 @@ export var useLineChart = function (props) {
|
|
|
1081
1082
|
pointerY: pointerY,
|
|
1082
1083
|
onEndReached: props.onEndReached,
|
|
1083
1084
|
onStartReached: props.onStartReached,
|
|
1084
|
-
endReachedOffset: (
|
|
1085
|
+
endReachedOffset: (_298 = props.endReachedOffset) !== null && _298 !== void 0 ? _298 : LineDefaults.endReachedOffset,
|
|
1085
1086
|
onMomentumScrollEnd: props.onMomentumScrollEnd,
|
|
1086
1087
|
extraWidthDueToDataPoint: extraWidthDueToDataPoint
|
|
1087
1088
|
};
|
|
@@ -1291,6 +1292,7 @@ export var useLineChart = function (props) {
|
|
|
1291
1292
|
strokeDashArray5: strokeDashArray5,
|
|
1292
1293
|
rotateLabel: rotateLabel,
|
|
1293
1294
|
isAnimated: isAnimated,
|
|
1295
|
+
hidePointers: hidePointers,
|
|
1294
1296
|
hideDataPoints1: hideDataPoints1,
|
|
1295
1297
|
hideDataPoints2: hideDataPoints2,
|
|
1296
1298
|
hideDataPoints3: hideDataPoints3,
|
|
@@ -81,6 +81,7 @@ export interface LineChartPropsType {
|
|
|
81
81
|
showReferenceLine3?: boolean;
|
|
82
82
|
referenceLine3Config?: referenceConfigType;
|
|
83
83
|
referenceLine3Position?: number;
|
|
84
|
+
referenceLinesOverChartContent?: boolean;
|
|
84
85
|
showVerticalLines?: boolean;
|
|
85
86
|
verticalLinesUptoDataPoint?: boolean;
|
|
86
87
|
verticalLinesThickness?: number;
|
|
@@ -350,6 +351,7 @@ export interface lineDataItem {
|
|
|
350
351
|
pointerShiftY?: number;
|
|
351
352
|
onPress?: Function;
|
|
352
353
|
showXAxisIndex?: boolean;
|
|
354
|
+
hidePointer?: boolean;
|
|
353
355
|
}
|
|
354
356
|
interface sectionType {
|
|
355
357
|
value: string;
|
package/dist/PieChart/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type pieDataItem, type PieChartPropsType } from './types';
|
|
|
2
2
|
import { type ColorValue } from 'react-native';
|
|
3
3
|
interface IusePieChart {
|
|
4
4
|
radius: number;
|
|
5
|
-
|
|
5
|
+
extraRadius: number;
|
|
6
6
|
pi: number;
|
|
7
7
|
selectedIndex: number;
|
|
8
8
|
setSelectedIndex: (index: number) => void;
|
package/dist/PieChart/index.js
CHANGED
|
@@ -19,7 +19,11 @@ import { getTextSizeForPieLabels } from '../utils';
|
|
|
19
19
|
export var usePieChart = function (props) {
|
|
20
20
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
21
21
|
var radius = (_a = props.radius) !== null && _a !== void 0 ? _a : 120;
|
|
22
|
-
var
|
|
22
|
+
var extraRadius = (_b = props.extraRadius) !== null && _b !== void 0 ? _b : (props.showExternalLabels
|
|
23
|
+
? 40
|
|
24
|
+
: ((_c = props.focusOnPress) !== null && _c !== void 0 ? _c : props.sectionAutoFocus)
|
|
25
|
+
? radius / 10
|
|
26
|
+
: 0);
|
|
23
27
|
var pi = props.semiCircle ? Math.PI / 2 : Math.PI;
|
|
24
28
|
var _w = __read(useState((_d = props.focusedPieIndex) !== null && _d !== void 0 ? _d : -1), 2), selectedIndex = _w[0], setSelectedIndex = _w[1]; // at the start, nothing is selected
|
|
25
29
|
// because we're going to use a useEffect, we need startAngle and total to be state variables
|
|
@@ -94,7 +98,7 @@ export var usePieChart = function (props) {
|
|
|
94
98
|
: 0;
|
|
95
99
|
return {
|
|
96
100
|
radius: radius,
|
|
97
|
-
|
|
101
|
+
extraRadius: extraRadius,
|
|
98
102
|
pi: pi,
|
|
99
103
|
selectedIndex: selectedIndex,
|
|
100
104
|
setSelectedIndex: setSelectedIndex,
|
package/dist/PieChart/main.d.ts
CHANGED
|
@@ -45,5 +45,39 @@ export declare const getPieChartMainProps: (props: PieChartMainProps) => {
|
|
|
45
45
|
acc: number;
|
|
46
46
|
paddingHorizontal: number;
|
|
47
47
|
paddingVertical: number;
|
|
48
|
-
|
|
48
|
+
extraRadius: number;
|
|
49
|
+
showExternalLabels: boolean | undefined;
|
|
50
|
+
labelLineConfig: {
|
|
51
|
+
length: number;
|
|
52
|
+
tailLength: number;
|
|
53
|
+
color: import("react-native").ColorValue;
|
|
54
|
+
thickness: number;
|
|
55
|
+
labelComponentWidth: number;
|
|
56
|
+
labelComponentHeight: number;
|
|
57
|
+
labelComponentMargin: number;
|
|
58
|
+
};
|
|
59
|
+
externalLabelComponent: ((item?: pieDataItem, index?: number) => any) | undefined;
|
|
60
|
+
getExternaLabelProperties: (item: pieDataItem, mx: number, my: number, cx: number, cy: number) => {
|
|
61
|
+
labelLineColor: string;
|
|
62
|
+
labelLineThickness: number;
|
|
63
|
+
labelComponentHeight: number;
|
|
64
|
+
inX: number;
|
|
65
|
+
inY: number;
|
|
66
|
+
outX: number;
|
|
67
|
+
outY: number;
|
|
68
|
+
finalX: number;
|
|
69
|
+
labelComponentX: number;
|
|
70
|
+
localExternalLabelComponent: null;
|
|
71
|
+
} | {
|
|
72
|
+
labelLineColor: import("react-native").ColorValue;
|
|
73
|
+
labelLineThickness: number;
|
|
74
|
+
labelComponentHeight: number;
|
|
75
|
+
inX: number;
|
|
76
|
+
inY: number;
|
|
77
|
+
outX: number;
|
|
78
|
+
outY: number;
|
|
79
|
+
finalX: number;
|
|
80
|
+
labelComponentX: number;
|
|
81
|
+
localExternalLabelComponent: ((item?: pieDataItem, index?: number) => any) | undefined;
|
|
82
|
+
};
|
|
49
83
|
};
|
package/dist/PieChart/main.js
CHANGED
|
@@ -34,10 +34,10 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
34
34
|
}
|
|
35
35
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
36
36
|
};
|
|
37
|
-
import { getTextSizeForPieLabels } from '../utils';
|
|
37
|
+
import { emptyExternaLabelProperties, getTextSizeForPieLabels } from '../utils';
|
|
38
38
|
export var getPieChartMainProps = function (props) {
|
|
39
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
40
|
-
var isThreeD = props.isThreeD, isBiggerPie = props.isBiggerPie, paddingHorizontal = props.paddingHorizontal, paddingVertical = props.paddingVertical,
|
|
39
|
+
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;
|
|
40
|
+
var isThreeD = props.isThreeD, isBiggerPie = props.isBiggerPie, paddingHorizontal = props.paddingHorizontal, paddingVertical = props.paddingVertical, extraRadius = props.extraRadius, showExternalLabels = props.showExternalLabels, externalLabelComponent = props.externalLabelComponent;
|
|
41
41
|
var propData = props.data;
|
|
42
42
|
var data = [];
|
|
43
43
|
var itemHasInnerComponent = false;
|
|
@@ -72,7 +72,16 @@ export var getPieChartMainProps = function (props) {
|
|
|
72
72
|
var showText = (_m = props.showText) !== null && _m !== void 0 ? _m : false;
|
|
73
73
|
var textColor = (_o = props.textColor) !== null && _o !== void 0 ? _o : '';
|
|
74
74
|
var textSize = getTextSizeForPieLabels((_p = props.textSize) !== null && _p !== void 0 ? _p : 0, radius);
|
|
75
|
-
var
|
|
75
|
+
var labelLineConfig = {
|
|
76
|
+
length: (_r = (_q = props.labelLineConfig) === null || _q === void 0 ? void 0 : _q.length) !== null && _r !== void 0 ? _r : 10,
|
|
77
|
+
tailLength: (_t = (_s = props.labelLineConfig) === null || _s === void 0 ? void 0 : _s.tailLength) !== null && _t !== void 0 ? _t : 8,
|
|
78
|
+
color: (_v = (_u = props.labelLineConfig) === null || _u === void 0 ? void 0 : _u.color) !== null && _v !== void 0 ? _v : 'black',
|
|
79
|
+
thickness: (_x = (_w = props.labelLineConfig) === null || _w === void 0 ? void 0 : _w.thickness) !== null && _x !== void 0 ? _x : 1,
|
|
80
|
+
labelComponentWidth: (_z = (_y = props.labelLineConfig) === null || _y === void 0 ? void 0 : _y.labelComponentWidth) !== null && _z !== void 0 ? _z : 20,
|
|
81
|
+
labelComponentHeight: (_1 = (_0 = props.labelLineConfig) === null || _0 === void 0 ? void 0 : _0.labelComponentHeight) !== null && _1 !== void 0 ? _1 : 10,
|
|
82
|
+
labelComponentMargin: (_3 = (_2 = props.labelLineConfig) === null || _2 === void 0 ? void 0 : _2.labelComponentMargin) !== null && _3 !== void 0 ? _3 : 4
|
|
83
|
+
};
|
|
84
|
+
var tiltAngle = (_4 = props.tiltAngle) !== null && _4 !== void 0 ? _4 : '55deg';
|
|
76
85
|
if (tiltAngle &&
|
|
77
86
|
!isNaN(Number(tiltAngle)) &&
|
|
78
87
|
!(tiltAngle + '').endsWith('deg')) {
|
|
@@ -84,12 +93,12 @@ export var getPieChartMainProps = function (props) {
|
|
|
84
93
|
: donut || props.centerLabelComponent
|
|
85
94
|
? 'outward'
|
|
86
95
|
: 'mid';
|
|
87
|
-
var showTextBackground = (
|
|
88
|
-
var textBackgroundColor = (
|
|
89
|
-
var showValuesAsLabels = (
|
|
90
|
-
var showGradient = (
|
|
91
|
-
var gradientCenterColor = (
|
|
92
|
-
var toggleFocusOnPress = (
|
|
96
|
+
var showTextBackground = (_5 = props.showTextBackground) !== null && _5 !== void 0 ? _5 : false;
|
|
97
|
+
var textBackgroundColor = (_6 = props.textBackgroundColor) !== null && _6 !== void 0 ? _6 : 'white';
|
|
98
|
+
var showValuesAsLabels = (_7 = props.showValuesAsLabels) !== null && _7 !== void 0 ? _7 : false;
|
|
99
|
+
var showGradient = (_8 = props.showGradient) !== null && _8 !== void 0 ? _8 : false;
|
|
100
|
+
var gradientCenterColor = (_9 = props.gradientCenterColor) !== null && _9 !== void 0 ? _9 : 'white';
|
|
101
|
+
var toggleFocusOnPress = (_10 = props.toggleFocusOnPress) !== null && _10 !== void 0 ? _10 : true;
|
|
93
102
|
var minShiftX = 0;
|
|
94
103
|
var maxShiftX = 0;
|
|
95
104
|
var minShiftY = 0;
|
|
@@ -134,6 +143,50 @@ export var getPieChartMainProps = function (props) {
|
|
|
134
143
|
return pAcc + (acc - pAcc) / 2;
|
|
135
144
|
});
|
|
136
145
|
pData = __spreadArray([0], __read(pData), false);
|
|
146
|
+
var getExternaLabelProperties = function (item, mx, my, cx, cy) {
|
|
147
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
148
|
+
if (!showExternalLabels)
|
|
149
|
+
return emptyExternaLabelProperties;
|
|
150
|
+
var labelLineLength = (_b = (_a = item.labelLineConfig) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : labelLineConfig.length;
|
|
151
|
+
var labelTailLength = (_d = (_c = item.labelLineConfig) === null || _c === void 0 ? void 0 : _c.tailLength) !== null && _d !== void 0 ? _d : labelLineConfig.tailLength;
|
|
152
|
+
var labelLineColor = (_f = (_e = item.labelLineConfig) === null || _e === void 0 ? void 0 : _e.color) !== null && _f !== void 0 ? _f : labelLineConfig.color;
|
|
153
|
+
var labelLineThickness = (_h = (_g = item.labelLineConfig) === null || _g === void 0 ? void 0 : _g.thickness) !== null && _h !== void 0 ? _h : labelLineConfig.thickness;
|
|
154
|
+
var labelComponentWidth = (_k = (_j = item.labelLineConfig) === null || _j === void 0 ? void 0 : _j.labelComponentWidth) !== null && _k !== void 0 ? _k : labelLineConfig.labelComponentWidth;
|
|
155
|
+
var labelComponentHeight = (_m = (_l = item.labelLineConfig) === null || _l === void 0 ? void 0 : _l.labelComponentHeight) !== null && _m !== void 0 ? _m : labelLineConfig.labelComponentHeight;
|
|
156
|
+
var labelComponentMargin = (_p = (_o = item.labelLineConfig) === null || _o === void 0 ? void 0 : _o.labelComponentMargin) !== null && _p !== void 0 ? _p : labelLineConfig.labelComponentMargin;
|
|
157
|
+
var isRightHalf = mx > cx;
|
|
158
|
+
var slope = (my - cy) / (mx - cx);
|
|
159
|
+
var xFactor = labelTailLength / Math.sqrt(1 + slope * slope);
|
|
160
|
+
var yFactor = (labelTailLength * slope) / Math.sqrt(1 + slope * slope);
|
|
161
|
+
var outX = mx + (isRightHalf ? xFactor : -xFactor);
|
|
162
|
+
var outY = my + (isRightHalf ? yFactor : -yFactor);
|
|
163
|
+
var inX = mx + (isRightHalf ? -xFactor : xFactor);
|
|
164
|
+
var inY = my + (isRightHalf ? -yFactor : yFactor);
|
|
165
|
+
var finalX = isRightHalf ? cx * 2 + labelLineLength : -labelLineLength;
|
|
166
|
+
finalX = isRightHalf
|
|
167
|
+
? finalX > outX
|
|
168
|
+
? finalX
|
|
169
|
+
: outX
|
|
170
|
+
: finalX < outX
|
|
171
|
+
? finalX
|
|
172
|
+
: outX;
|
|
173
|
+
var labelComponentX = isRightHalf
|
|
174
|
+
? finalX + labelComponentMargin
|
|
175
|
+
: finalX - labelComponentWidth - labelComponentMargin;
|
|
176
|
+
var localExternalLabelComponent = (_q = item.externalLabelComponent) !== null && _q !== void 0 ? _q : props.externalLabelComponent;
|
|
177
|
+
return {
|
|
178
|
+
labelLineColor: labelLineColor,
|
|
179
|
+
labelLineThickness: labelLineThickness,
|
|
180
|
+
labelComponentHeight: labelComponentHeight,
|
|
181
|
+
inX: inX,
|
|
182
|
+
inY: inY,
|
|
183
|
+
outX: outX,
|
|
184
|
+
outY: outY,
|
|
185
|
+
finalX: finalX,
|
|
186
|
+
labelComponentX: labelComponentX,
|
|
187
|
+
localExternalLabelComponent: localExternalLabelComponent
|
|
188
|
+
};
|
|
189
|
+
};
|
|
137
190
|
return {
|
|
138
191
|
isThreeD: isThreeD,
|
|
139
192
|
isBiggerPie: isBiggerPie,
|
|
@@ -180,6 +233,10 @@ export var getPieChartMainProps = function (props) {
|
|
|
180
233
|
acc: acc,
|
|
181
234
|
paddingHorizontal: paddingHorizontal,
|
|
182
235
|
paddingVertical: paddingVertical,
|
|
183
|
-
|
|
236
|
+
extraRadius: extraRadius,
|
|
237
|
+
showExternalLabels: showExternalLabels,
|
|
238
|
+
labelLineConfig: labelLineConfig,
|
|
239
|
+
externalLabelComponent: externalLabelComponent,
|
|
240
|
+
getExternaLabelProperties: getExternaLabelProperties
|
|
184
241
|
};
|
|
185
242
|
};
|
package/dist/PieChart/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ColorValue } from 'react-native';
|
|
2
2
|
import { type FontStyle } from 'react-native-svg';
|
|
3
|
-
import { LabelsPosition } from '../utils/types';
|
|
3
|
+
import { LabelLineConfig, LabelsPosition } from '../utils/types';
|
|
4
4
|
export interface PieChartPropsType {
|
|
5
5
|
radius?: number;
|
|
6
6
|
isThreeD?: boolean;
|
|
@@ -44,7 +44,7 @@ export interface PieChartPropsType {
|
|
|
44
44
|
setSelectedIndex?: Function;
|
|
45
45
|
sectionAutoFocus?: boolean;
|
|
46
46
|
onLabelPress?: Function;
|
|
47
|
-
|
|
47
|
+
extraRadius?: number;
|
|
48
48
|
inwardExtraLengthForFocused?: number;
|
|
49
49
|
pieInnerComponent?: (item?: pieDataItem, index?: number) => any;
|
|
50
50
|
pieInnerComponentHeight?: number;
|
|
@@ -59,6 +59,9 @@ export interface PieChartPropsType {
|
|
|
59
59
|
isAnimated?: boolean;
|
|
60
60
|
animationDuration?: number;
|
|
61
61
|
focusedPieIndex?: number;
|
|
62
|
+
showExternalLabels?: boolean;
|
|
63
|
+
labelLineConfig?: LabelLineConfig;
|
|
64
|
+
externalLabelComponent?: (item?: pieDataItem, index?: number) => any;
|
|
62
65
|
}
|
|
63
66
|
export interface pieDataItem {
|
|
64
67
|
value: number;
|
|
@@ -91,11 +94,13 @@ export interface pieDataItem {
|
|
|
91
94
|
isEndEdgeCurved?: boolean;
|
|
92
95
|
startEdgeRadius?: number;
|
|
93
96
|
endEdgeRadius?: number;
|
|
97
|
+
labelLineConfig?: LabelLineConfig;
|
|
98
|
+
externalLabelComponent?: (item?: pieDataItem, index?: number) => any;
|
|
94
99
|
}
|
|
95
100
|
export interface PieChartMainProps extends PieChartPropsType {
|
|
96
101
|
setSelectedIndex: Function;
|
|
97
102
|
isBiggerPie?: boolean;
|
|
98
103
|
paddingHorizontal: number;
|
|
99
104
|
paddingVertical: number;
|
|
100
|
-
|
|
105
|
+
extraRadius: number;
|
|
101
106
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -36,4 +36,4 @@ export { type StripAndLabelProps } from './components/common/types';
|
|
|
36
36
|
/***********************************************************************************************************************/
|
|
37
37
|
export { getCumulativeWidth, getLighterColor, svgQuadraticCurvePath, svgPath, bezierCommand, getSegmentString, getCurvePathWithSegments, getPreviousSegmentsLastPoint, getPathWithHighlight, getRegionPathObjects, getSegmentedPathObjects, getArrowPoints, getAxesAndRulesProps, getExtendedContainerHeightWithPadding, getSecondaryDataWithOffsetIncluded, getArrowProperty, getAllArrowProperties, maxAndMinUtil, computeMaxAndMinItems, getLabelTextUtil, getXForLineInBar, getYForLineInBar, clone, getLineConfigForBarChart, adjustToOffset } from './utils';
|
|
38
38
|
export { chartTypes, yAxisSides, loc, SEGMENT_START, SEGMENT_END, RANGE_ENTER, RANGE_EXIT, STOP, ruleTypes, AxesAndRulesDefaults, defaultArrowConfig, BarDefaults, defaultLineConfig, LineDefaults, defaultPointerConfig, pieColors, populationDefaults, defaultAnimationDuration } from './utils/constants';
|
|
39
|
-
export { type RuleType, type RuleTypes, type RulesConfig, CurveType, EdgePosition, type LabelsPosition, type PointerEvents, type secondaryYAxisType, type secondaryLineConfigType, type referenceConfigType, type arrowConfigType, type horizSectionPropTypes, type HorizSectionsType, type BarAndLineChartsWrapperTypes, type Pointer, type HighlightedRange, type LineSegment, type LineSvgProps, type LineProperties, type DataSet, Framework, type XAxisConfig, type LineInBarChartPropsType, type DataPointProps, type Linecap, type IntersectionAreaConfig } from './utils/types';
|
|
39
|
+
export { type RuleType, type RuleTypes, type RulesConfig, CurveType, EdgePosition, type LabelsPosition, type PointerEvents, type secondaryYAxisType, type secondaryLineConfigType, type referenceConfigType, type arrowConfigType, type horizSectionPropTypes, type HorizSectionsType, type BarAndLineChartsWrapperTypes, type Pointer, type HighlightedRange, type LineSegment, type LineSvgProps, type LineProperties, type DataSet, Framework, type XAxisConfig, type LineInBarChartPropsType, type DataPointProps, type Linecap, type IntersectionAreaConfig, type LabelLineConfig } from './utils/types';
|
package/dist/utils/constants.js
CHANGED
package/dist/utils/index.d.ts
CHANGED
|
@@ -99,4 +99,25 @@ export declare const getTextSizeForPieLabels: (textSize: number, radius: number)
|
|
|
99
99
|
export declare const adjustToOffset: (data: lineDataItem[], yAxisOffset?: number) => lineDataItem[];
|
|
100
100
|
export declare const getSanitisedData: (data: lineDataItem[] | undefined, dataSanitisationProps: IDataSanitisationProps) => lineDataItem[];
|
|
101
101
|
export declare const getStrokeDashArray: (strokeDash?: number[] | string, framework?: Framework) => number[] | string | undefined;
|
|
102
|
+
export declare const emptyExternaLabelProperties: {
|
|
103
|
+
labelLineColor: string;
|
|
104
|
+
labelLineThickness: number;
|
|
105
|
+
labelComponentHeight: number;
|
|
106
|
+
inX: number;
|
|
107
|
+
inY: number;
|
|
108
|
+
outX: number;
|
|
109
|
+
outY: number;
|
|
110
|
+
finalX: number;
|
|
111
|
+
labelComponentX: number;
|
|
112
|
+
localExternalLabelComponent: null;
|
|
113
|
+
};
|
|
114
|
+
export declare const defaultLabelLineConfig: {
|
|
115
|
+
length: number;
|
|
116
|
+
tailLength: number;
|
|
117
|
+
color: string;
|
|
118
|
+
thickness: number;
|
|
119
|
+
labelComponentWidth: number;
|
|
120
|
+
labelComponentHeight: number;
|
|
121
|
+
labelComponentMargin: number;
|
|
122
|
+
};
|
|
102
123
|
export {};
|
package/dist/utils/index.js
CHANGED
|
@@ -910,7 +910,9 @@ export var getInterpolatedData = function (dataParam, showDataPointsForMissingVa
|
|
|
910
910
|
.slice()
|
|
911
911
|
.reverse()
|
|
912
912
|
.findIndex(function (item) { return typeof item.value === 'number'; });
|
|
913
|
-
var secondPreIndex = tempSecondPreIndex >= 0
|
|
913
|
+
var secondPreIndex = tempSecondPreIndex >= 0
|
|
914
|
+
? secondPreCount - tempSecondPreIndex
|
|
915
|
+
: tempSecondPreIndex;
|
|
914
916
|
count = preValidIndex - secondPreIndex;
|
|
915
917
|
step = (data[secondPreIndex].value - data[preValidIndex].value) / count;
|
|
916
918
|
data[index].value =
|
|
@@ -1024,3 +1026,24 @@ export var getStrokeDashArray = function (strokeDash, framework) {
|
|
|
1024
1026
|
}
|
|
1025
1027
|
return strokeDashArrayOrString;
|
|
1026
1028
|
};
|
|
1029
|
+
export var emptyExternaLabelProperties = {
|
|
1030
|
+
labelLineColor: '',
|
|
1031
|
+
labelLineThickness: 0,
|
|
1032
|
+
labelComponentHeight: 0,
|
|
1033
|
+
inX: 0,
|
|
1034
|
+
inY: 0,
|
|
1035
|
+
outX: 0,
|
|
1036
|
+
outY: 0,
|
|
1037
|
+
finalX: 0,
|
|
1038
|
+
labelComponentX: 0,
|
|
1039
|
+
localExternalLabelComponent: null
|
|
1040
|
+
};
|
|
1041
|
+
export var defaultLabelLineConfig = {
|
|
1042
|
+
length: 10,
|
|
1043
|
+
tailLength: 8,
|
|
1044
|
+
color: 'black',
|
|
1045
|
+
thickness: 1,
|
|
1046
|
+
labelComponentWidth: 20,
|
|
1047
|
+
labelComponentHeight: 10,
|
|
1048
|
+
labelComponentMargin: 4
|
|
1049
|
+
};
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -325,6 +325,7 @@ export interface Pointer {
|
|
|
325
325
|
initialPointerIndex?: number;
|
|
326
326
|
initialPointerAppearDelay?: number;
|
|
327
327
|
persistPointer?: boolean;
|
|
328
|
+
hidePointers?: boolean;
|
|
328
329
|
hidePointer1?: boolean;
|
|
329
330
|
hidePointer2?: boolean;
|
|
330
331
|
hidePointer3?: boolean;
|
|
@@ -394,8 +395,18 @@ export interface DataSet {
|
|
|
394
395
|
curveType?: CurveType;
|
|
395
396
|
lineSegments?: LineSegment[];
|
|
396
397
|
isSecondary?: boolean;
|
|
398
|
+
hidePointers?: boolean;
|
|
397
399
|
}
|
|
398
400
|
export interface IntersectionAreaConfig {
|
|
399
401
|
fillColor?: ColorValue;
|
|
400
402
|
}
|
|
403
|
+
export interface LabelLineConfig {
|
|
404
|
+
length?: number;
|
|
405
|
+
tailLength?: number;
|
|
406
|
+
color?: ColorValue;
|
|
407
|
+
thickness?: number;
|
|
408
|
+
labelComponentWidth?: number;
|
|
409
|
+
labelComponentHeight?: number;
|
|
410
|
+
labelComponentMargin?: number;
|
|
411
|
+
}
|
|
401
412
|
export {};
|