gifted-charts-core 0.1.68 → 0.1.70
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/RenderBars.js +2 -1
- package/dist/BarChart/RenderStackBars.js +2 -1
- package/dist/BarChart/index.js +4 -2
- package/dist/BarChart/types.d.ts +20 -0
- package/dist/LineChart/LineChartBiColor.js +2 -1
- package/dist/LineChart/index.d.ts +1 -0
- package/dist/LineChart/index.js +8 -4
- package/dist/LineChart/types.d.ts +9 -3
- package/dist/components/BarAndLineChartsWrapper/index.d.ts +13 -1
- package/dist/components/BarAndLineChartsWrapper/index.js +16 -1
- package/dist/index.d.ts +1 -1
- package/dist/utils/index.js +10 -10
- package/dist/utils/types.d.ts +6 -0
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AxesAndRulesDefaults } from '../utils/constants';
|
|
2
2
|
export var useRenderBars = function (props) {
|
|
3
3
|
var _a, _b, _c;
|
|
4
|
-
var data = props.data, item = props.item, index = props.index, barWidth = props.barWidth, initialSpacing = props.initialSpacing, propSpacing = props.propSpacing, secondaryNegativeStepHeight = props.secondaryNegativeStepHeight, secondaryStepHeight = props.secondaryStepHeight, secondaryNegativeStepValue = props.secondaryNegativeStepValue, secondaryStepValue = props.secondaryStepValue, negativeStepHeight = props.negativeStepHeight,
|
|
4
|
+
var data = props.data, item = props.item, index = props.index, barWidth = props.barWidth, initialSpacing = props.initialSpacing, propSpacing = props.propSpacing, secondaryNegativeStepHeight = props.secondaryNegativeStepHeight, secondaryStepHeight = props.secondaryStepHeight, secondaryNegativeStepValue = props.secondaryNegativeStepValue, secondaryStepValue = props.secondaryStepValue, negativeStepHeight = props.negativeStepHeight, nsv = props.negativeStepValue, stepHeight = props.stepHeight, stepValue = props.stepValue, minHeight = props.minHeight, _d = props.xAxisThickness, xAxisThickness = _d === void 0 ? AxesAndRulesDefaults.xAxisThickness : _d, leftShiftForLastIndexTooltip = props.leftShiftForLastIndexTooltip, leftShiftForTooltip = props.leftShiftForTooltip, renderTooltip = props.renderTooltip, autoCenterTooltip = props.autoCenterTooltip, horizontal = props.horizontal, containerHeight = props.containerHeight, containerHeightIncludingBelowXAxis = props.containerHeightIncludingBelowXAxis;
|
|
5
|
+
var negativeStepValue = Math.abs(nsv);
|
|
5
6
|
var heightFactor = item.isSecondary
|
|
6
7
|
? item.value < 0
|
|
7
8
|
? (secondaryNegativeStepHeight !== null && secondaryNegativeStepHeight !== void 0 ? secondaryNegativeStepHeight : secondaryStepHeight) /
|
|
@@ -18,7 +18,8 @@ import { useState } from 'react';
|
|
|
18
18
|
import { BarDefaults } from '../utils/constants';
|
|
19
19
|
export var useRenderStackBars = function (props) {
|
|
20
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,
|
|
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, nsv = props.negativeStepValue, secondaryStepHeight = props.secondaryStepHeight, secondaryStepValue = props.secondaryStepValue, secondaryNegativeStepHeight = props.secondaryNegativeStepHeight, secondaryNegativeStepValue = props.secondaryNegativeStepValue;
|
|
22
|
+
var negativeStepValue = Math.abs(nsv);
|
|
22
23
|
var containsNegativeValue = item.stacks.some(function (item) { return item.value < 0; });
|
|
23
24
|
var anyStackContainsNegativeValue = stackData.some(function (item) {
|
|
24
25
|
return item.stacks.some(function (stack) { return stack.value < 0; });
|
package/dist/BarChart/index.js
CHANGED
|
@@ -30,7 +30,8 @@ import { getArrowPoints, getAxesAndRulesProps, getExtendedContainerHeightWithPad
|
|
|
30
30
|
import { AxesAndRulesDefaults, BarDefaults, chartTypes, defaultLineConfig, defaultPointerConfig } from '../utils/constants';
|
|
31
31
|
export var useBarChart = function (props) {
|
|
32
32
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69;
|
|
33
|
-
var heightValue = props.heightValue, widthValue = props.widthValue, opacityValue = props.opacityValue, yAxisOffset = props.yAxisOffset, adjustToWidth = props.adjustToWidth, parentWidth = props.parentWidth, labelsDistanceFromXaxis = props.labelsDistanceFromXaxis, autoShiftLabelsForNegativeStacks = props.autoShiftLabelsForNegativeStacks, focusedBarIndex = props.focusedBarIndex,
|
|
33
|
+
var heightValue = props.heightValue, widthValue = props.widthValue, opacityValue = props.opacityValue, yAxisOffset = props.yAxisOffset, adjustToWidth = props.adjustToWidth, parentWidth = props.parentWidth, labelsDistanceFromXaxis = props.labelsDistanceFromXaxis, autoShiftLabelsForNegativeStacks = props.autoShiftLabelsForNegativeStacks, focusedBarIndex = props.focusedBarIndex, nsv = props.negativeStepValue, autoCenterTooltip = props.autoCenterTooltip, floatingYAxisLabels = props.floatingYAxisLabels;
|
|
34
|
+
var negativeStepValue = nsv ? Math.abs(nsv) : undefined;
|
|
34
35
|
var allowFontScaling = (_a = props.allowFontScaling) !== null && _a !== void 0 ? _a : AxesAndRulesDefaults.allowFontScaling;
|
|
35
36
|
var _70 = __read(useState(''), 2), points = _70[0], setPoints = _70[1];
|
|
36
37
|
var _71 = __read(useState(''), 2), points2 = _71[0], setPoints2 = _71[1];
|
|
@@ -653,7 +654,8 @@ export var useBarChart = function (props) {
|
|
|
653
654
|
xAxisLabelsAtBottom: xAxisLabelsAtBottom,
|
|
654
655
|
onScrollEndDrag: props.onScrollEndDrag,
|
|
655
656
|
floatingYAxisLabels: floatingYAxisLabels,
|
|
656
|
-
allowFontScaling: allowFontScaling
|
|
657
|
+
allowFontScaling: allowFontScaling,
|
|
658
|
+
showVerticalLines: props.showVerticalLines
|
|
657
659
|
};
|
|
658
660
|
return {
|
|
659
661
|
lineConfig: lineConfig,
|
package/dist/BarChart/types.d.ts
CHANGED
|
@@ -57,6 +57,16 @@ export interface stackDataItem {
|
|
|
57
57
|
onMouseEnter?: Function;
|
|
58
58
|
onMouseLeave?: Function;
|
|
59
59
|
isSecondary?: boolean;
|
|
60
|
+
showVerticalLine?: boolean;
|
|
61
|
+
verticalLineThickness?: number;
|
|
62
|
+
verticalLineHeight?: number;
|
|
63
|
+
verticalLineColor?: ColorValue;
|
|
64
|
+
verticalLineStrokeDashArray?: number[];
|
|
65
|
+
verticalLineShift?: number;
|
|
66
|
+
verticalLineZIndex?: number;
|
|
67
|
+
noOfVerticalLine?: number;
|
|
68
|
+
verticalLineSpacing?: number;
|
|
69
|
+
verticalLineStrokeLinecap?: Linecap;
|
|
60
70
|
}
|
|
61
71
|
export interface StackedBarChartPropsType {
|
|
62
72
|
style?: any;
|
|
@@ -482,6 +492,16 @@ export interface barDataItem {
|
|
|
482
492
|
onContextMenu?: Function;
|
|
483
493
|
onMouseEnter?: Function;
|
|
484
494
|
onMouseLeave?: Function;
|
|
495
|
+
showVerticalLine?: boolean;
|
|
496
|
+
verticalLineThickness?: number;
|
|
497
|
+
verticalLineHeight?: number;
|
|
498
|
+
verticalLineColor?: ColorValue;
|
|
499
|
+
verticalLineStrokeDashArray?: number[];
|
|
500
|
+
verticalLineShift?: number;
|
|
501
|
+
verticalLineZIndex?: number;
|
|
502
|
+
noOfVerticalLine?: number;
|
|
503
|
+
verticalLineSpacing?: number;
|
|
504
|
+
verticalLineStrokeLinecap?: Linecap;
|
|
485
505
|
}
|
|
486
506
|
export interface barDataItemNullSafe extends barDataItem {
|
|
487
507
|
value: number;
|
|
@@ -445,7 +445,8 @@ export var useLineChartBiColor = function (props) {
|
|
|
445
445
|
xAxisLabelsAtBottom: false,
|
|
446
446
|
onScrollEndDrag: props.onScrollEndDrag,
|
|
447
447
|
floatingYAxisLabels: props.floatingYAxisLabels,
|
|
448
|
-
allowFontScaling: allowFontScaling
|
|
448
|
+
allowFontScaling: allowFontScaling,
|
|
449
|
+
showVerticalLines: props.showVerticalLines
|
|
449
450
|
};
|
|
450
451
|
return {
|
|
451
452
|
toggle: toggle,
|
|
@@ -226,6 +226,7 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
|
|
|
226
226
|
color3: string;
|
|
227
227
|
color4: string;
|
|
228
228
|
color5: string;
|
|
229
|
+
colors: import("../utils/types").ColorFromToY[] | undefined;
|
|
229
230
|
startFillColor1: string;
|
|
230
231
|
endFillColor1: string;
|
|
231
232
|
startOpacity: number;
|
package/dist/LineChart/index.js
CHANGED
|
@@ -40,7 +40,7 @@ import { colorsToLowerCase, computeMaxAndMinItems, getAllArrowProperties, getArr
|
|
|
40
40
|
import { EdgePosition } from '../utils/types';
|
|
41
41
|
export var useLineChart = function (props) {
|
|
42
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, _328, _329, _330, _331, _332, _333, _334, _335, _336, _337, _338;
|
|
43
|
-
var showDataPointsForMissingValues = props.showDataPointsForMissingValues, _339 = props.interpolateMissingValues, interpolateMissingValues = _339 === void 0 ? true : _339, _340 = props.extrapolateMissingValues, extrapolateMissingValues = _340 === void 0 ? true : _340, yAxisOffset = props.yAxisOffset, parentWidth = props.parentWidth, renderTooltip = props.renderTooltip, _341 = props.renderTooltip1, renderTooltip1 = _341 === void 0 ? props.renderTooltip : _341, _342 = props.renderTooltip2, renderTooltip2 = _342 === void 0 ? props.renderTooltip : _342, _343 = props.renderTooltip3, renderTooltip3 = _343 === void 0 ? props.renderTooltip : _343, _344 = props.renderTooltip4, renderTooltip4 = _344 === void 0 ? props.renderTooltip : _344, _345 = props.renderTooltip5, renderTooltip5 = _345 === void 0 ? props.renderTooltip : _345, _346 = props.renderTooltipSecondary, renderTooltipSecondary = _346 === void 0 ? props.renderTooltip : _346;
|
|
43
|
+
var showDataPointsForMissingValues = props.showDataPointsForMissingValues, _339 = props.interpolateMissingValues, interpolateMissingValues = _339 === void 0 ? true : _339, _340 = props.extrapolateMissingValues, extrapolateMissingValues = _340 === void 0 ? true : _340, yAxisOffset = props.yAxisOffset, parentWidth = props.parentWidth, renderTooltip = props.renderTooltip, _341 = props.renderTooltip1, renderTooltip1 = _341 === void 0 ? props.renderTooltip : _341, _342 = props.renderTooltip2, renderTooltip2 = _342 === void 0 ? props.renderTooltip : _342, _343 = props.renderTooltip3, renderTooltip3 = _343 === void 0 ? props.renderTooltip : _343, _344 = props.renderTooltip4, renderTooltip4 = _344 === void 0 ? props.renderTooltip : _344, _345 = props.renderTooltip5, renderTooltip5 = _345 === void 0 ? props.renderTooltip : _345, _346 = props.renderTooltipSecondary, renderTooltipSecondary = _346 === void 0 ? props.renderTooltip : _346, colors = props.colors;
|
|
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
|
|
@@ -141,7 +141,9 @@ export var useLineChart = function (props) {
|
|
|
141
141
|
var labelsExtraHeight = (_x = props.labelsExtraHeight) !== null && _x !== void 0 ? _x : 0;
|
|
142
142
|
var animationDuration = (_y = props.animationDuration) !== null && _y !== void 0 ? _y : LineDefaults.animationDuration;
|
|
143
143
|
var onDataChangeAnimationDuration = (_z = props.onDataChangeAnimationDuration) !== null && _z !== void 0 ? _z : 400;
|
|
144
|
-
var animateTogether =
|
|
144
|
+
var animateTogether = colors
|
|
145
|
+
? true
|
|
146
|
+
: (_0 = props.animateTogether) !== null && _0 !== void 0 ? _0 : LineDefaults.animateTogether;
|
|
145
147
|
var renderDataPointsAfterAnimationEnds = (_1 = props.renderDataPointsAfterAnimationEnds) !== null && _1 !== void 0 ? _1 : LineDefaults.renderDataPointsAfterAnimationEnds;
|
|
146
148
|
var animateOnDataChange = (_2 = props.animateOnDataChange) !== null && _2 !== void 0 ? _2 : false;
|
|
147
149
|
var startIndex1 = (_4 = (_3 = props.startIndex1) !== null && _3 !== void 0 ? _3 : props.startIndex) !== null && _4 !== void 0 ? _4 : 0;
|
|
@@ -1089,7 +1091,7 @@ export var useLineChart = function (props) {
|
|
|
1089
1091
|
var getY = function (value) {
|
|
1090
1092
|
if (containsNegativeValue && value < 0 && stepValue !== negativeStepValue) {
|
|
1091
1093
|
return (extendedContainerHeight +
|
|
1092
|
-
(value * fourthQuadrantHeight) /
|
|
1094
|
+
(value * fourthQuadrantHeight) / mostNegativeValueOnYAxis);
|
|
1093
1095
|
}
|
|
1094
1096
|
return extendedContainerHeight - (value * containerHeight) / maxValue;
|
|
1095
1097
|
};
|
|
@@ -1399,7 +1401,8 @@ export var useLineChart = function (props) {
|
|
|
1399
1401
|
lowlightOpacity: LineDefaults.lowlightOpacity,
|
|
1400
1402
|
xAxisLabelsAtBottom: xAxisLabelsAtBottom,
|
|
1401
1403
|
onScrollEndDrag: props.onScrollEndDrag,
|
|
1402
|
-
allowFontScaling: allowFontScaling
|
|
1404
|
+
allowFontScaling: allowFontScaling,
|
|
1405
|
+
showVerticalLines: props.showVerticalLines
|
|
1403
1406
|
};
|
|
1404
1407
|
var pointerItemLocal = [];
|
|
1405
1408
|
if (pointerConfig) {
|
|
@@ -1642,6 +1645,7 @@ export var useLineChart = function (props) {
|
|
|
1642
1645
|
color3: color3,
|
|
1643
1646
|
color4: color4,
|
|
1644
1647
|
color5: color5,
|
|
1648
|
+
colors: colors,
|
|
1645
1649
|
startFillColor1: startFillColor1,
|
|
1646
1650
|
endFillColor1: endFillColor1,
|
|
1647
1651
|
startOpacity: startOpacity,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GestureResponderEvent, StyleProp, TextStyle, ViewStyle, type ColorValue } from 'react-native';
|
|
2
2
|
import { type yAxisSides } from '../utils/constants';
|
|
3
|
-
import { XAxisConfig, type CurveType, type DataSet, type EdgePosition, type HighlightedRange, type LineSegment, type Pointer, type RuleType, type RulesConfig, type arrowConfigType, type referenceConfigType, type secondaryLineConfigType, type secondaryYAxisType, type Linecap, type IntersectionAreaConfig, CustomBackground, SpreadData } from '../utils/types';
|
|
3
|
+
import { XAxisConfig, type CurveType, type DataSet, type EdgePosition, type HighlightedRange, type LineSegment, type Pointer, type RuleType, type RulesConfig, type arrowConfigType, type referenceConfigType, type secondaryLineConfigType, type secondaryYAxisType, type Linecap, type IntersectionAreaConfig, CustomBackground, SpreadData, ColorFromToY } from '../utils/types';
|
|
4
4
|
export interface LineChartPropsType {
|
|
5
5
|
height?: number;
|
|
6
6
|
overflowTop?: number;
|
|
@@ -154,6 +154,7 @@ export interface LineChartPropsType {
|
|
|
154
154
|
color3?: string;
|
|
155
155
|
color4?: string;
|
|
156
156
|
color5?: string;
|
|
157
|
+
colors?: ColorFromToY[];
|
|
157
158
|
yAxisThickness?: number;
|
|
158
159
|
yAxisColor?: ColorValue;
|
|
159
160
|
yAxisExtraHeight?: number;
|
|
@@ -382,9 +383,14 @@ export interface lineDataItem {
|
|
|
382
383
|
showVerticalLine?: boolean;
|
|
383
384
|
verticalLineHeight?: number;
|
|
384
385
|
verticalLineUptoDataPoint?: boolean;
|
|
385
|
-
verticalLineColor?:
|
|
386
|
+
verticalLineColor?: ColorValue;
|
|
386
387
|
verticalLineThickness?: number;
|
|
387
388
|
verticalLineStrokeDashArray?: number[];
|
|
389
|
+
verticalLineShift?: number;
|
|
390
|
+
verticalLineZIndex?: number;
|
|
391
|
+
noOfVerticalLine?: number;
|
|
392
|
+
verticalLineSpacing?: number;
|
|
393
|
+
verticalLineStrokeLinecap?: Linecap;
|
|
388
394
|
pointerShiftX?: number;
|
|
389
395
|
pointerShiftY?: number;
|
|
390
396
|
onPress?: Function;
|
|
@@ -435,7 +441,7 @@ export interface bicolorLineDataItem {
|
|
|
435
441
|
showStrip?: boolean;
|
|
436
442
|
showVerticalLine?: boolean;
|
|
437
443
|
verticalLineUptoDataPoint?: boolean;
|
|
438
|
-
verticalLineColor?:
|
|
444
|
+
verticalLineColor?: ColorValue;
|
|
439
445
|
verticalLineThickness?: number;
|
|
440
446
|
pointerShiftX?: number;
|
|
441
447
|
pointerShiftY?: number;
|
|
@@ -35,7 +35,19 @@ export declare const useBarAndLineChartsWrapper: (props: BarAndLineChartsWrapper
|
|
|
35
35
|
yAxisSide: any;
|
|
36
36
|
showVerticalLines: any;
|
|
37
37
|
verticalLinesProps: {
|
|
38
|
-
|
|
38
|
+
showVerticalLines: boolean | undefined;
|
|
39
|
+
verticalLinesAr: number[] | {
|
|
40
|
+
showVerticalLine: any;
|
|
41
|
+
verticalLineThickness: any;
|
|
42
|
+
verticalLineHeight: any;
|
|
43
|
+
verticalLineColor: any;
|
|
44
|
+
verticalLineStrokeDashArray: any;
|
|
45
|
+
verticalLineShift: any;
|
|
46
|
+
verticalLineZIndex: any;
|
|
47
|
+
noOfVerticalLine: any;
|
|
48
|
+
verticalLineSpacing: any;
|
|
49
|
+
verticalLineStrokeLinecap: any;
|
|
50
|
+
}[];
|
|
39
51
|
verticalLinesSpacing: any;
|
|
40
52
|
spacing: any;
|
|
41
53
|
initialSpacing: number;
|
|
@@ -98,7 +98,21 @@ export var useBarAndLineChartsWrapper = function (props) {
|
|
|
98
98
|
var noOfVerticalLines = axesAndRulesProps.noOfVerticalLines;
|
|
99
99
|
var secondaryXAxis = axesAndRulesProps.secondaryXAxis;
|
|
100
100
|
var verticalLinesAr = noOfVerticalLines
|
|
101
|
-
? __spreadArray([], __read(Array(noOfVerticalLines).keys()), false) :
|
|
101
|
+
? __spreadArray([], __read(Array(noOfVerticalLines).keys()), false) : (stackData !== null && stackData !== void 0 ? stackData : data).map(function (item) {
|
|
102
|
+
var showVerticalLine = item.showVerticalLine, verticalLineThickness = item.verticalLineThickness, verticalLineHeight = item.verticalLineHeight, verticalLineColor = item.verticalLineColor, verticalLineStrokeDashArray = item.verticalLineStrokeDashArray, verticalLineShift = item.verticalLineShift, verticalLineZIndex = item.verticalLineZIndex, noOfVerticalLine = item.noOfVerticalLine, verticalLineSpacing = item.verticalLineSpacing, verticalLineStrokeLinecap = item.verticalLineStrokeLinecap;
|
|
103
|
+
return {
|
|
104
|
+
showVerticalLine: showVerticalLine,
|
|
105
|
+
verticalLineThickness: verticalLineThickness,
|
|
106
|
+
verticalLineHeight: verticalLineHeight,
|
|
107
|
+
verticalLineColor: verticalLineColor,
|
|
108
|
+
verticalLineStrokeDashArray: verticalLineStrokeDashArray,
|
|
109
|
+
verticalLineShift: verticalLineShift,
|
|
110
|
+
verticalLineZIndex: verticalLineZIndex,
|
|
111
|
+
noOfVerticalLine: noOfVerticalLine,
|
|
112
|
+
verticalLineSpacing: verticalLineSpacing,
|
|
113
|
+
verticalLineStrokeLinecap: verticalLineStrokeLinecap
|
|
114
|
+
};
|
|
115
|
+
});
|
|
102
116
|
var extendedContainerHeight = containerHeight + overflowTop + 10;
|
|
103
117
|
var dataSetArray = __spreadArray([], __read((dataSet !== null && dataSet !== void 0 ? dataSet : [])), false);
|
|
104
118
|
var setWithMinValueInDataset = (_12 = (_11 = dataSetArray
|
|
@@ -218,6 +232,7 @@ export var useBarAndLineChartsWrapper = function (props) {
|
|
|
218
232
|
? (_18 = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.yAxisOffset) !== null && _18 !== void 0 ? _18 : 0
|
|
219
233
|
: yAxisOffset !== null && yAxisOffset !== void 0 ? yAxisOffset : 0 });
|
|
220
234
|
var verticalLinesProps = {
|
|
235
|
+
showVerticalLines: props.showVerticalLines,
|
|
221
236
|
verticalLinesAr: verticalLinesAr,
|
|
222
237
|
verticalLinesSpacing: verticalLinesSpacing,
|
|
223
238
|
spacing: (_19 = lineConfig === null || lineConfig === void 0 ? void 0 : lineConfig.spacing) !== null && _19 !== void 0 ? _19 : spacing,
|
package/dist/index.d.ts
CHANGED
|
@@ -42,4 +42,4 @@ export { type StripAndLabelProps } from './components/common/types';
|
|
|
42
42
|
/***********************************************************************************************************************/
|
|
43
43
|
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, pointsWithPaddedRepititions } from './utils';
|
|
44
44
|
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';
|
|
45
|
-
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, type DataSetNullSafe, Framework, type XAxisConfig, type LineInBarChartPropsType, type DataPointProps, type Linecap, type IntersectionAreaConfig, type LabelLineConfig, type TooltipProps, type SpreadData } from './utils/types';
|
|
45
|
+
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, type DataSetNullSafe, Framework, type XAxisConfig, type LineInBarChartPropsType, type DataPointProps, type Linecap, type IntersectionAreaConfig, type LabelLineConfig, type TooltipProps, type SpreadData, type ColorFromToY } from './utils/types';
|
package/dist/utils/index.js
CHANGED
|
@@ -494,7 +494,7 @@ export var getArrowPoints = function (arrowTipX, arrowTipY, x1, y1, arrowLength,
|
|
|
494
494
|
return arrowPoints;
|
|
495
495
|
};
|
|
496
496
|
export var getAxesAndRulesProps = function (props, containerHeight, stepHeight, stepValue, noOfSections, roundToDigits, negativeStepValue, secondaryMaxValue, secondaryMinItem, showSecondaryFractionalValues, secondaryRoundToDigits) {
|
|
497
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
497
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
498
498
|
var secondaryYAxis = typeof props.secondaryYAxis === 'boolean' ? {} : props.secondaryYAxis;
|
|
499
499
|
var axesAndRulesProps = {
|
|
500
500
|
yAxisSide: props.yAxisSide,
|
|
@@ -544,7 +544,7 @@ export var getAxesAndRulesProps = function (props, containerHeight, stepHeight,
|
|
|
544
544
|
referenceLine3Config: props.referenceLine3Config,
|
|
545
545
|
referenceLinesOverChartContent: props.referenceLinesOverChartContent
|
|
546
546
|
},
|
|
547
|
-
showVerticalLines: props.showVerticalLines,
|
|
547
|
+
showVerticalLines: (_d = props.showVerticalLines) !== null && _d !== void 0 ? _d : (_f = ((_e = props.stackData) !== null && _e !== void 0 ? _e : props.data)) === null || _f === void 0 ? void 0 : _f.some(function (item) { return item.showVerticalLine; }),
|
|
548
548
|
verticalLinesThickness: props.verticalLinesThickness,
|
|
549
549
|
verticalLinesHeight: props.verticalLinesHeight,
|
|
550
550
|
verticalLinesColor: props.verticalLinesColor,
|
|
@@ -570,21 +570,21 @@ export var getAxesAndRulesProps = function (props, containerHeight, stepHeight,
|
|
|
570
570
|
noOfSectionsBelowXAxis: 0
|
|
571
571
|
}
|
|
572
572
|
};
|
|
573
|
-
if (((
|
|
573
|
+
if (((_g = props.secondaryYAxis) !== null && _g !== void 0 ? _g : (_h = props.lineConfig) === null || _h === void 0 ? void 0 : _h.isSecondary) &&
|
|
574
574
|
secondaryMaxValue !== undefined &&
|
|
575
575
|
secondaryYAxis &&
|
|
576
576
|
secondaryYAxis.maxValue === undefined) {
|
|
577
577
|
axesAndRulesProps.secondaryYAxis = __assign(__assign({}, secondaryYAxis), { maxValue: secondaryMaxValue });
|
|
578
578
|
}
|
|
579
|
-
var secondaryNoOfSections = (
|
|
580
|
-
var secondaryStepValue = (
|
|
581
|
-
var secondaryStepHeight = (
|
|
582
|
-
var secondaryNegativeStepValue = (
|
|
583
|
-
var secondaryNoOfSectionsBelowXAxis = (
|
|
584
|
-
? Math.ceil(((
|
|
579
|
+
var secondaryNoOfSections = (_j = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.noOfSections) !== null && _j !== void 0 ? _j : noOfSections;
|
|
580
|
+
var secondaryStepValue = (_k = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.stepValue) !== null && _k !== void 0 ? _k : ((_l = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.maxValue) !== null && _l !== void 0 ? _l : secondaryMaxValue) / secondaryNoOfSections;
|
|
581
|
+
var secondaryStepHeight = (_m = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.stepHeight) !== null && _m !== void 0 ? _m : containerHeight / secondaryNoOfSections;
|
|
582
|
+
var secondaryNegativeStepValue = (_o = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.negativeStepValue) !== null && _o !== void 0 ? _o : secondaryStepValue;
|
|
583
|
+
var secondaryNoOfSectionsBelowXAxis = (_p = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.noOfSectionsBelowXAxis) !== null && _p !== void 0 ? _p : (secondaryNegativeStepValue
|
|
584
|
+
? Math.ceil(((_q = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.mostNegativeValue) !== null && _q !== void 0 ? _q : secondaryMinItem) /
|
|
585
585
|
-secondaryNegativeStepValue)
|
|
586
586
|
: 0);
|
|
587
|
-
axesAndRulesProps.secondaryYAxisConfig = __assign(__assign({}, secondaryYAxis), { stepHeight: secondaryStepHeight, stepValue: secondaryStepValue, negativeStepHeight: (
|
|
587
|
+
axesAndRulesProps.secondaryYAxisConfig = __assign(__assign({}, secondaryYAxis), { stepHeight: secondaryStepHeight, stepValue: secondaryStepValue, negativeStepHeight: (_r = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.negativeStepHeight) !== null && _r !== void 0 ? _r : secondaryStepHeight, negativeStepValue: secondaryNegativeStepValue, noOfSectionsBelowXAxis: secondaryNoOfSectionsBelowXAxis, showFractionalValues: showSecondaryFractionalValues, roundToDigits: secondaryRoundToDigits });
|
|
588
588
|
return axesAndRulesProps;
|
|
589
589
|
};
|
|
590
590
|
export var getExtendedContainerHeightWithPadding = function (containerHeight, overflowTop) { return containerHeight + (overflowTop !== null && overflowTop !== void 0 ? overflowTop : 0) + 10; };
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -351,6 +351,7 @@ export interface BarAndLineChartsWrapperTypes {
|
|
|
351
351
|
lowlightOpacity: number;
|
|
352
352
|
xAxisLabelsAtBottom: boolean;
|
|
353
353
|
onScrollEndDrag?: (event: any, direction: any) => void;
|
|
354
|
+
showVerticalLines?: boolean;
|
|
354
355
|
}
|
|
355
356
|
export interface HorizontalStripConfig {
|
|
356
357
|
thickness?: number;
|
|
@@ -499,4 +500,9 @@ export interface LabelLineConfig {
|
|
|
499
500
|
labelComponentMargin?: number;
|
|
500
501
|
avoidOverlappingOfLabels?: boolean;
|
|
501
502
|
}
|
|
503
|
+
export interface ColorFromToY {
|
|
504
|
+
from: number;
|
|
505
|
+
to: number;
|
|
506
|
+
color: ColorValue;
|
|
507
|
+
}
|
|
502
508
|
export {};
|