gifted-charts-core 0.1.69 → 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/index.js +2 -1
- package/dist/BarChart/types.d.ts +20 -0
- package/dist/LineChart/LineChartBiColor.js +2 -1
- package/dist/LineChart/index.js +2 -1
- package/dist/LineChart/types.d.ts +7 -2
- package/dist/components/BarAndLineChartsWrapper/index.d.ts +13 -1
- package/dist/components/BarAndLineChartsWrapper/index.js +16 -1
- package/dist/utils/index.js +10 -10
- package/dist/utils/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/BarChart/index.js
CHANGED
|
@@ -654,7 +654,8 @@ export var useBarChart = function (props) {
|
|
|
654
654
|
xAxisLabelsAtBottom: xAxisLabelsAtBottom,
|
|
655
655
|
onScrollEndDrag: props.onScrollEndDrag,
|
|
656
656
|
floatingYAxisLabels: floatingYAxisLabels,
|
|
657
|
-
allowFontScaling: allowFontScaling
|
|
657
|
+
allowFontScaling: allowFontScaling,
|
|
658
|
+
showVerticalLines: props.showVerticalLines
|
|
658
659
|
};
|
|
659
660
|
return {
|
|
660
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,
|
package/dist/LineChart/index.js
CHANGED
|
@@ -1401,7 +1401,8 @@ export var useLineChart = function (props) {
|
|
|
1401
1401
|
lowlightOpacity: LineDefaults.lowlightOpacity,
|
|
1402
1402
|
xAxisLabelsAtBottom: xAxisLabelsAtBottom,
|
|
1403
1403
|
onScrollEndDrag: props.onScrollEndDrag,
|
|
1404
|
-
allowFontScaling: allowFontScaling
|
|
1404
|
+
allowFontScaling: allowFontScaling,
|
|
1405
|
+
showVerticalLines: props.showVerticalLines
|
|
1405
1406
|
};
|
|
1406
1407
|
var pointerItemLocal = [];
|
|
1407
1408
|
if (pointerConfig) {
|
|
@@ -383,9 +383,14 @@ export interface lineDataItem {
|
|
|
383
383
|
showVerticalLine?: boolean;
|
|
384
384
|
verticalLineHeight?: number;
|
|
385
385
|
verticalLineUptoDataPoint?: boolean;
|
|
386
|
-
verticalLineColor?:
|
|
386
|
+
verticalLineColor?: ColorValue;
|
|
387
387
|
verticalLineThickness?: number;
|
|
388
388
|
verticalLineStrokeDashArray?: number[];
|
|
389
|
+
verticalLineShift?: number;
|
|
390
|
+
verticalLineZIndex?: number;
|
|
391
|
+
noOfVerticalLine?: number;
|
|
392
|
+
verticalLineSpacing?: number;
|
|
393
|
+
verticalLineStrokeLinecap?: Linecap;
|
|
389
394
|
pointerShiftX?: number;
|
|
390
395
|
pointerShiftY?: number;
|
|
391
396
|
onPress?: Function;
|
|
@@ -436,7 +441,7 @@ export interface bicolorLineDataItem {
|
|
|
436
441
|
showStrip?: boolean;
|
|
437
442
|
showVerticalLine?: boolean;
|
|
438
443
|
verticalLineUptoDataPoint?: boolean;
|
|
439
|
-
verticalLineColor?:
|
|
444
|
+
verticalLineColor?: ColorValue;
|
|
440
445
|
verticalLineThickness?: number;
|
|
441
446
|
pointerShiftX?: number;
|
|
442
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/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;
|