gifted-charts-core 0.1.20 → 0.1.22

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.
Files changed (86) hide show
  1. package/{src → dist}/BarChart/types.d.ts +2 -1
  2. package/{src → dist}/LineChart/index.d.ts +0 -3
  3. package/{src → dist}/LineChart/index.js +5 -54
  4. package/{src → dist}/LineChart/types.d.ts +2 -1
  5. package/{src → dist}/PopulationPyramid/index.js +4 -3
  6. package/{src → dist}/PopulationPyramid/types.d.ts +3 -1
  7. package/{src → dist}/components/BarAndLineChartsWrapper/index.d.ts +1 -0
  8. package/{src → dist}/components/BarAndLineChartsWrapper/index.js +6 -4
  9. package/{src → dist}/components/common/types.d.ts +9 -8
  10. package/{src → dist}/index.d.ts +2 -1
  11. package/{src → dist}/utils/constants.d.ts +2 -0
  12. package/{src → dist}/utils/constants.js +2 -0
  13. package/{src → dist}/utils/index.js +1 -0
  14. package/{src → dist}/utils/types.d.ts +1 -0
  15. package/package.json +4 -4
  16. package/src/BarChart/Animated2DWithGradient.js.map +0 -1
  17. package/src/BarChart/Animated2DWithGradient.ts +0 -192
  18. package/src/BarChart/RenderStackBars.js.map +0 -1
  19. package/src/BarChart/RenderStackBars.ts +0 -160
  20. package/src/BarChart/index.js.map +0 -1
  21. package/src/BarChart/index.ts +0 -909
  22. package/src/BarChart/types.js.map +0 -1
  23. package/src/BarChart/types.ts +0 -666
  24. package/src/LineChart/LineChartBiColor.js.map +0 -1
  25. package/src/LineChart/LineChartBiColor.ts +0 -613
  26. package/src/LineChart/index.js.map +0 -1
  27. package/src/LineChart/index.ts +0 -2205
  28. package/src/LineChart/types.js.map +0 -1
  29. package/src/LineChart/types.ts +0 -614
  30. package/src/PieChart/index.js.map +0 -1
  31. package/src/PieChart/index.ts +0 -180
  32. package/src/PieChart/main.js.map +0 -1
  33. package/src/PieChart/main.ts +0 -173
  34. package/src/PieChart/pro.ts +0 -309
  35. package/src/PieChart/types.js.map +0 -1
  36. package/src/PieChart/types.ts +0 -105
  37. package/src/PopulationPyramid/index.js.map +0 -1
  38. package/src/PopulationPyramid/index.ts +0 -358
  39. package/src/PopulationPyramid/types.js.map +0 -1
  40. package/src/PopulationPyramid/types.ts +0 -256
  41. package/src/components/AnimatedThreeDBar/index.js.map +0 -1
  42. package/src/components/AnimatedThreeDBar/index.ts +0 -60
  43. package/src/components/BarAndLineChartsWrapper/getHorizSectionsVals.js.map +0 -1
  44. package/src/components/BarAndLineChartsWrapper/getHorizSectionsVals.ts +0 -408
  45. package/src/components/BarAndLineChartsWrapper/index.js.map +0 -1
  46. package/src/components/BarAndLineChartsWrapper/index.ts +0 -404
  47. package/src/components/common/StripAndLabel.js.map +0 -1
  48. package/src/components/common/StripAndLabel.ts +0 -80
  49. package/src/components/common/types.ts +0 -32
  50. package/src/index.ts +0 -152
  51. package/src/utils/constants.js.map +0 -1
  52. package/src/utils/constants.ts +0 -347
  53. package/src/utils/index.js.map +0 -1
  54. package/src/utils/index.ts +0 -1562
  55. package/src/utils/types.js.map +0 -1
  56. package/src/utils/types.ts +0 -436
  57. /package/{src → dist}/BarChart/Animated2DWithGradient.d.ts +0 -0
  58. /package/{src → dist}/BarChart/Animated2DWithGradient.js +0 -0
  59. /package/{src → dist}/BarChart/RenderStackBars.d.ts +0 -0
  60. /package/{src → dist}/BarChart/RenderStackBars.js +0 -0
  61. /package/{src → dist}/BarChart/index.d.ts +0 -0
  62. /package/{src → dist}/BarChart/index.js +0 -0
  63. /package/{src → dist}/BarChart/types.js +0 -0
  64. /package/{src → dist}/LineChart/LineChartBiColor.d.ts +0 -0
  65. /package/{src → dist}/LineChart/LineChartBiColor.js +0 -0
  66. /package/{src → dist}/LineChart/types.js +0 -0
  67. /package/{src → dist}/PieChart/index.d.ts +0 -0
  68. /package/{src → dist}/PieChart/index.js +0 -0
  69. /package/{src → dist}/PieChart/main.d.ts +0 -0
  70. /package/{src → dist}/PieChart/main.js +0 -0
  71. /package/{src → dist}/PieChart/pro.d.ts +0 -0
  72. /package/{src → dist}/PieChart/pro.js +0 -0
  73. /package/{src → dist}/PieChart/types.d.ts +0 -0
  74. /package/{src → dist}/PieChart/types.js +0 -0
  75. /package/{src → dist}/PopulationPyramid/index.d.ts +0 -0
  76. /package/{src → dist}/PopulationPyramid/types.js +0 -0
  77. /package/{src → dist}/components/AnimatedThreeDBar/index.d.ts +0 -0
  78. /package/{src → dist}/components/AnimatedThreeDBar/index.js +0 -0
  79. /package/{src → dist}/components/BarAndLineChartsWrapper/getHorizSectionsVals.d.ts +0 -0
  80. /package/{src → dist}/components/BarAndLineChartsWrapper/getHorizSectionsVals.js +0 -0
  81. /package/{src → dist}/components/common/StripAndLabel.d.ts +0 -0
  82. /package/{src → dist}/components/common/StripAndLabel.js +0 -0
  83. /package/{src → dist}/components/common/types.js +0 -0
  84. /package/{src → dist}/index.js +0 -0
  85. /package/{src → dist}/utils/index.d.ts +0 -0
  86. /package/{src → dist}/utils/types.js +0 -0
@@ -1,6 +1,6 @@
1
1
  import { type ColorValue, type GestureResponderEvent, type ViewStyle } from 'react-native';
2
2
  import { type yAxisSides } from '../utils/constants';
3
- import { XAxisConfig, type CurveType, type Pointer, type RuleType, type RulesConfig, type referenceConfigType, type secondaryYAxisType } from '../utils/types';
3
+ import { XAxisConfig, type CurveType, type Pointer, type RuleType, type RulesConfig, type referenceConfigType, type secondaryYAxisType, type Linecap } from '../utils/types';
4
4
  import { type Component, type ReactNode } from 'react';
5
5
  import { type lineDataItem } from '../LineChart/types';
6
6
  export interface stackDataItem {
@@ -202,6 +202,7 @@ export interface BarChartPropsType {
202
202
  verticalLinesZIndex?: number;
203
203
  noOfVerticalLines?: number;
204
204
  verticalLinesSpacing?: number;
205
+ verticalLinesStrokeLinecap?: Linecap;
205
206
  showYAxisIndices?: boolean;
206
207
  showXAxisIndices?: boolean;
207
208
  yAxisIndicesHeight?: number;
@@ -1,8 +1,6 @@
1
1
  import { type LineChartPropsType, type lineDataItem } from './types';
2
2
  import { type BarAndLineChartsWrapperTypes, EdgePosition, type LineSegment } from '../utils/types';
3
- import { type Animated } from 'react-native';
4
3
  export interface extendedLineChartPropsType extends LineChartPropsType {
5
- animations?: Animated.Value[];
6
4
  parentWidth: number;
7
5
  }
8
6
  export declare const useLineChart: (props: extendedLineChartPropsType) => {
@@ -189,7 +187,6 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
189
187
  secondaryMaxValue: number;
190
188
  getSecondaryY: (value: number) => number;
191
189
  heightUptoXaxis: number;
192
- setPointsOnChange: () => void;
193
190
  showValuesAsDataPointsText: boolean;
194
191
  thickness1: number;
195
192
  thickness2: number;
@@ -31,7 +31,7 @@ import { adjustToOffset, computeMaxAndMinItems, getAllArrowProperties, getArrowP
31
31
  import { EdgePosition } from '../utils/types';
32
32
  export var useLineChart = function (props) {
33
33
  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;
34
- var animations = props.animations, showDataPointsForMissingValues = props.showDataPointsForMissingValues, _298 = props.interpolateMissingValues, interpolateMissingValues = _298 === void 0 ? true : _298, onlyPositive = props.onlyPositive, yAxisOffset = props.yAxisOffset, parentWidth = props.parentWidth;
34
+ var showDataPointsForMissingValues = props.showDataPointsForMissingValues, _298 = props.interpolateMissingValues, interpolateMissingValues = _298 === void 0 ? true : _298, onlyPositive = props.onlyPositive, yAxisOffset = props.yAxisOffset, parentWidth = props.parentWidth;
35
35
  var curvature = (_a = props.curvature) !== null && _a !== void 0 ? _a : LineDefaults.curvature;
36
36
  var curveType = (_b = props.curveType) !== null && _b !== void 0 ? _b : LineDefaults.curveType;
37
37
  var _299 = __read(useState(0), 2), scrollX = _299[0], setScrollX = _299[1];
@@ -251,51 +251,6 @@ export var useLineChart = function (props) {
251
251
  return extendedContainerHeight - (value * containerHeight) / secondaryMaxValue;
252
252
  };
253
253
  var heightUptoXaxis = extendedContainerHeight - xAxisThickness;
254
- if (animateOnDataChange && animations) {
255
- animations.forEach(function (item, index) {
256
- item.addListener(function (val) {
257
- var _a, _b, _c, _d, _e, _f, _g, _h;
258
- if (typeof data[index] === 'undefined') {
259
- return;
260
- }
261
- var temp = (_b = (_a = data[index]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 0;
262
- data[index].value = (_c = val === null || val === void 0 ? void 0 : val.value) !== null && _c !== void 0 ? _c : 0;
263
- var pp = '';
264
- var ppp = '';
265
- if (!((_d = dataSet === null || dataSet === void 0 ? void 0 : dataSet[0].curved) !== null && _d !== void 0 ? _d : props.curved)) {
266
- for (var i = 0; i < (data0 !== null && data0 !== void 0 ? data0 : data).length; i++) {
267
- pp +=
268
- 'L' + getX(i) + ' ' + getY((_f = (_e = (data0 !== null && data0 !== void 0 ? data0 : data)[i]) === null || _e === void 0 ? void 0 : _e.value) !== null && _f !== void 0 ? _f : 0) + ' ';
269
- }
270
- if ((_h = (_g = dataSet === null || dataSet === void 0 ? void 0 : dataSet[0]) === null || _g === void 0 ? void 0 : _g.areaChart) !== null && _h !== void 0 ? _h : areaChart) {
271
- ppp = 'L' + initialSpacing + ' ' + heightUptoXaxis + ' ';
272
- ppp += pp;
273
- ppp +=
274
- 'L' +
275
- (initialSpacing + spacing * (data.length - 1)) +
276
- ' ' +
277
- heightUptoXaxis;
278
- ppp += 'L' + initialSpacing + ' ' + heightUptoXaxis + ' ';
279
- }
280
- newPoints = pp;
281
- newFillPoints = ppp;
282
- setPointsOnChange();
283
- }
284
- counter++;
285
- data[index].value = temp;
286
- });
287
- });
288
- }
289
- var setPointsOnChange = function () {
290
- if (counter === data.length) {
291
- if (!props.curved) {
292
- setPoints(newPoints.replace('L', 'M'));
293
- if (areaChart) {
294
- setFillPoints(newFillPoints.replace('L', 'M'));
295
- }
296
- }
297
- }
298
- };
299
254
  var showValuesAsDataPointsText = (_104 = props.showValuesAsDataPointsText) !== null && _104 !== void 0 ? _104 : LineDefaults.showValuesAsDataPointsText;
300
255
  var thickness1 = (_106 = (_105 = props.thickness1) !== null && _105 !== void 0 ? _105 : props.thickness) !== null && _106 !== void 0 ? _106 : LineDefaults.thickness;
301
256
  var thickness2 = (_108 = (_107 = props.thickness2) !== null && _107 !== void 0 ? _107 : props.thickness) !== null && _108 !== void 0 ? _108 : LineDefaults.thickness;
@@ -526,7 +481,7 @@ export var useLineChart = function (props) {
526
481
  var pp5 = '';
527
482
  if (!props.curved) {
528
483
  for (var i = 0; i < data.length; i++) {
529
- if (i >= startIndex1 && i <= endIndex1 && !animateOnDataChange) {
484
+ if (i >= startIndex1 && i <= endIndex1) {
530
485
  if (stepChart !== null && stepChart !== void 0 ? stepChart : stepChart1) {
531
486
  pp += getStepPath(data, i);
532
487
  }
@@ -624,9 +579,7 @@ export var useLineChart = function (props) {
624
579
  var ppp3 = '';
625
580
  var ppp4 = '';
626
581
  var ppp5 = '';
627
- if ((areaChart !== null && areaChart !== void 0 ? areaChart : areaChart1) &&
628
- data.length > 0 &&
629
- !animateOnDataChange) {
582
+ if ((areaChart !== null && areaChart !== void 0 ? areaChart : areaChart1) && data.length > 0) {
630
583
  ppp = 'L' + initialSpacing + ' ' + heightUptoXaxis + ' ';
631
584
  ppp += pp;
632
585
  ppp +=
@@ -843,8 +796,7 @@ export var useLineChart = function (props) {
843
796
  if (!secondaryLineConfig.curved) {
844
797
  for (var i = 0; i < secondaryData.length; i++) {
845
798
  if (i >= secondaryLineConfig.startIndex &&
846
- i <= secondaryLineConfig.endIndex &&
847
- !animateOnDataChange) {
799
+ i <= secondaryLineConfig.endIndex) {
848
800
  pp +=
849
801
  'L' + getX(i) + ' ' + getSecondaryY(secondaryData[i].value) + ' ';
850
802
  }
@@ -862,7 +814,7 @@ export var useLineChart = function (props) {
862
814
  /** ************************* For Area Chart *************************/
863
815
  if (secondaryLineConfig.areaChart) {
864
816
  var ppp = '';
865
- if (secondaryData.length > 0 && !animateOnDataChange) {
817
+ if (secondaryData.length > 0) {
866
818
  ppp = 'L' + initialSpacing + ' ' + heightUptoXaxis + ' ';
867
819
  ppp += pp;
868
820
  ppp +=
@@ -1306,7 +1258,6 @@ export var useLineChart = function (props) {
1306
1258
  secondaryMaxValue: secondaryMaxValue,
1307
1259
  getSecondaryY: getSecondaryY,
1308
1260
  heightUptoXaxis: heightUptoXaxis,
1309
- setPointsOnChange: setPointsOnChange,
1310
1261
  showValuesAsDataPointsText: showValuesAsDataPointsText,
1311
1262
  thickness1: thickness1,
1312
1263
  thickness2: thickness2,
@@ -1,6 +1,6 @@
1
1
  import { GestureResponderEvent, 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 } 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 } from '../utils/types';
4
4
  export interface LineChartPropsType {
5
5
  height?: number;
6
6
  overflowTop?: number;
@@ -91,6 +91,7 @@ export interface LineChartPropsType {
91
91
  verticalLinesZIndex?: number;
92
92
  noOfVerticalLines?: number;
93
93
  verticalLinesSpacing?: number;
94
+ verticalLinesStrokeLinecap?: Linecap;
94
95
  hideAxesAndRules?: boolean;
95
96
  areaChart?: boolean;
96
97
  areaChart1?: boolean;
@@ -28,8 +28,8 @@ import { AxesAndRulesDefaults, populationDefaults } from '../utils/constants';
28
28
  import { Framework } from '../utils/types';
29
29
  export var usePopulationPyramid = function (props) {
30
30
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
31
- var framework = props.framework, _v = props.height, height = _v === void 0 ? populationDefaults.height : _v, _w = props.width, width = _w === void 0 ? props.screenWidth : _w, _x = props.verticalMarginBetweenBars, verticalMarginBetweenBars = _x === void 0 ? populationDefaults.verticalMarginBetweenBars : _x, _y = props.barsMapToYAxisSections, barsMapToYAxisSections = _y === void 0 ? populationDefaults.barsMapToYAxisSections : _y, data = props.data, _z = props.hideRules, hideRules = _z === void 0 ? AxesAndRulesDefaults.hideRules : _z, _0 = props.hideYAxisText, hideYAxisText = _0 === void 0 ? AxesAndRulesDefaults.hideYAxisText : _0, _1 = props.yAxisThickness, yAxisThickness = _1 === void 0 ? AxesAndRulesDefaults.yAxisThickness : _1, _2 = props.xAxisThickness, xAxisThickness = _2 === void 0 ? AxesAndRulesDefaults.xAxisThickness : _2, _3 = props.xAxisType, xAxisType = _3 === void 0 ? AxesAndRulesDefaults.xAxisType : _3, _4 = props.xAxisNoOfSections, xAxisNoOfSections = _4 === void 0 ? populationDefaults.xAxisNoOfSections : _4, _5 = props.showXAxisIndices, showXAxisIndices = _5 === void 0 ? populationDefaults.showXAxisIndices : _5, _6 = props.xAxisIndicesWidth, xAxisIndicesWidth = _6 === void 0 ? populationDefaults.xAxisIndicesWidth : _6, _7 = props.xAxisIndicesHeight, xAxisIndicesHeight = _7 === void 0 ? populationDefaults.xAxisIndicesHeight : _7, _8 = props.xAxisIndicesShiftY, xAxisIndicesShiftY = _8 === void 0 ? 0 : _8, _9 = props.showXAxisLabelTexts, showXAxisLabelTexts = _9 === void 0 ? populationDefaults.showXAxisLabelTexts : _9, _10 = props.xAxisLabelFontSize, xAxisLabelFontSize = _10 === void 0 ? populationDefaults.defaultFontSize : _10, _11 = props.xAxisLabelFontStyle, xAxisLabelFontStyle = _11 === void 0 ? populationDefaults.defaultFontStyle : _11, _12 = props.xAxisLabelFontWeight, xAxisLabelFontWeight = _12 === void 0 ? populationDefaults.defaultFontWeight : _12, _13 = props.xAxisLabelFontFamily, xAxisLabelFontFamily = _13 === void 0 ? populationDefaults.defaultFontFamily : _13, _14 = props.xAxisLabelShiftX, xAxisLabelShiftX = _14 === void 0 ? 0 : _14, _15 = props.xAxisLabelShiftY, xAxisLabelShiftY = _15 === void 0 ? 0 : _15, _16 = props.xAxisLabelPrefix, xAxisLabelPrefix = _16 === void 0 ? populationDefaults.prefix : _16, _17 = props.xAxisLabelSuffix, xAxisLabelSuffix = _17 === void 0 ? populationDefaults.suffix : _17, formatXAxisLabels = props.formatXAxisLabels, _18 = props.showVerticalLines, showVerticalLines = _18 === void 0 ? populationDefaults.showVerticalLines : _18, _19 = props.verticalLinesThickness, verticalLinesThickness = _19 === void 0 ? populationDefaults.verticalLinesThickness : _19, _20 = props.verticalLinesType, verticalLinesType = _20 === void 0 ? populationDefaults.verticalLinesType : _20, _21 = props.verticalLinesStrokeDashArray, verticalLinesStrokeDashArray = _21 === void 0 ? populationDefaults.verticalLinesStrokeDashArray : _21, _22 = props.showYAxisIndices, showYAxisIndices = _22 === void 0 ? AxesAndRulesDefaults.showYAxisIndices : _22, _23 = props.yAxisIndicesWidth, yAxisIndicesWidth = _23 === void 0 ? AxesAndRulesDefaults.yAxisIndicesWidth : _23, _24 = props.yAxisIndicesHeight, yAxisIndicesHeight = _24 === void 0 ? AxesAndRulesDefaults.yAxisIndicesHeight : _24, _25 = props.yAxisLabelFontSize, yAxisLabelFontSize = _25 === void 0 ? populationDefaults.defaultFontSize : _25, _26 = props.yAxisLabelFontStyle, yAxisLabelFontStyle = _26 === void 0 ? populationDefaults.defaultFontStyle : _26, _27 = props.yAxisLabelFontWeight, yAxisLabelFontWeight = _27 === void 0 ? populationDefaults.defaultFontWeight : _27, _28 = props.yAxisLabelFontFamily, yAxisLabelFontFamily = _28 === void 0 ? populationDefaults.defaultFontFamily : _28, _29 = props.yAxisLabelTextMarginRight, yAxisLabelTextMarginRight = _29 === void 0 ? populationDefaults.yAxisLabelTextMarginRight : _29, _30 = props.yAxisLabelTexts, yAxisLabelTexts = _30 === void 0 ? [] : _30, _31 = props.showValuesAsBarLabels, showValuesAsBarLabels = _31 === void 0 ? populationDefaults.showValuesAsBarLabels : _31, _32 = props.rulesThickness, rulesThickness = _32 === void 0 ? AxesAndRulesDefaults.rulesThickness : _32, _33 = props.rulesType, rulesType = _33 === void 0 ? AxesAndRulesDefaults.rulesType : _33, _34 = props.dashWidth, dashWidth = _34 === void 0 ? AxesAndRulesDefaults.dashWidth : _34, _35 = props.dashGap, dashGap = _35 === void 0 ? AxesAndRulesDefaults.dashGap : _35, _36 = props.leftBarLabelWidth, leftBarLabelWidth = _36 === void 0 ? populationDefaults.leftBarLabelWidth : _36, _37 = props.leftBarLabelFontSize, leftBarLabelFontSize = _37 === void 0 ? (_a = props.barLabelFontSize) !== null && _a !== void 0 ? _a : populationDefaults.defaultFontSize : _37, _38 = props.leftBarLabelFontStyle, leftBarLabelFontStyle = _38 === void 0 ? (_b = props.barLabelFontStyle) !== null && _b !== void 0 ? _b : populationDefaults.defaultFontStyle : _38, _39 = props.leftBarLabelFontWeight, leftBarLabelFontWeight = _39 === void 0 ? (_c = props.barLabelFontWeight) !== null && _c !== void 0 ? _c : populationDefaults.defaultFontWeight : _39, _40 = props.leftBarLabelFontFamily, leftBarLabelFontFamily = _40 === void 0 ? (_d = props.barLabelFontFamily) !== null && _d !== void 0 ? _d : populationDefaults.defaultFontFamily : _40, _41 = props.leftBarLabelPrefix, leftBarLabelPrefix = _41 === void 0 ? populationDefaults.prefix : _41, _42 = props.leftBarLabelSuffix, leftBarLabelSuffix = _42 === void 0 ? populationDefaults.suffix : _42, _43 = props.rightBarLabelWidth, rightBarLabelWidth = _43 === void 0 ? populationDefaults.rightBarLabelWidth : _43, _44 = props.rightBarLabelFontSize, rightBarLabelFontSize = _44 === void 0 ? (_e = props.barLabelFontSize) !== null && _e !== void 0 ? _e : populationDefaults.defaultFontSize : _44, _45 = props.rightBarLabelFontStyle, rightBarLabelFontStyle = _45 === void 0 ? (_f = props.barLabelFontStyle) !== null && _f !== void 0 ? _f : populationDefaults.defaultFontStyle : _45, _46 = props.rightBarLabelFontWeight, rightBarLabelFontWeight = _46 === void 0 ? (_g = props.barLabelFontWeight) !== null && _g !== void 0 ? _g : populationDefaults.defaultFontWeight : _46, _47 = props.rightBarLabelFontFamily, rightBarLabelFontFamily = _47 === void 0 ? (_h = props.barLabelFontFamily) !== null && _h !== void 0 ? _h : populationDefaults.defaultFontFamily : _47, _48 = props.rightBarLabelPrefix, rightBarLabelPrefix = _48 === void 0 ? populationDefaults.prefix : _48, _49 = props.rightBarLabelSuffix, rightBarLabelSuffix = _49 === void 0 ? populationDefaults.suffix : _49, formatBarLabels = props.formatBarLabels, _50 = props.showMidAxis, showMidAxis = _50 === void 0 ? populationDefaults.showMidAxis : _50, _51 = props.midAxisLabelWidth, midAxisLabelWidth = _51 === void 0 ? populationDefaults.midAxisLabelWidth : _51, _52 = props.midAxisLabelFontSize, midAxisLabelFontSize = _52 === void 0 ? populationDefaults.defaultFontSize : _52, _53 = props.midAxisLabelFontStyle, midAxisLabelFontStyle = _53 === void 0 ? populationDefaults.defaultFontStyle : _53, _54 = props.midAxisLabelFontWeight, midAxisLabelFontWeight = _54 === void 0 ? populationDefaults.defaultFontWeight : _54, _55 = props.midAxisLabelFontFamily, midAxisLabelFontFamily = _55 === void 0 ? populationDefaults.defaultFontFamily : _55, _56 = props.leftBarBorderWidth, leftBarBorderWidth = _56 === void 0 ? (_j = props.barBorderWidth) !== null && _j !== void 0 ? _j : populationDefaults.leftBarBorderWidth : _56, _57 = props.rightBarBorderWidth, rightBarBorderWidth = _57 === void 0 ? (_k = props.barBorderWidth) !== null && _k !== void 0 ? _k : populationDefaults.rightBarBorderWidth : _57, _58 = props.leftBarBorderRadius, leftBarBorderRadius = _58 === void 0 ? (_l = props.barBorderRadius) !== null && _l !== void 0 ? _l : populationDefaults.leftBarBorderRadius : _58, _59 = props.rightBarBorderRadius, rightBarBorderRadius = _59 === void 0 ? (_m = props.barBorderRadius) !== null && _m !== void 0 ? _m : populationDefaults.rightBarBorderRadius : _59, _60 = props.allCornersRounded, allCornersRounded = _60 === void 0 ? populationDefaults.allCornersRounded : _60, _61 = props.showSurplus, showSurplus = _61 === void 0 ? populationDefaults.showSurplus : _61, _62 = props.showSurplusLeft, showSurplusLeft = _62 === void 0 ? populationDefaults.showSurplusLeft : _62, _63 = props.showSurplusRight, showSurplusRight = _63 === void 0 ? populationDefaults.showSurplusRight : _63, _64 = props.leftSurplusBorderWidth, leftSurplusBorderWidth = _64 === void 0 ? populationDefaults.leftSurplusBorderWidth : _64, _65 = props.rightSurplusBorderWidth, rightSurplusBorderWidth = _65 === void 0 ? populationDefaults.rightSurplusBorderWidth : _65;
32
- var _66 = props.yAxisColor, yAxisColor = _66 === void 0 ? AxesAndRulesDefaults.yAxisColor : _66, _67 = props.xAxisColor, xAxisColor = _67 === void 0 ? AxesAndRulesDefaults.xAxisColor : _67, _68 = props.xAxisIndicesColor, xAxisIndicesColor = _68 === void 0 ? populationDefaults.xAxisIndicesColor : _68, _69 = props.xAxisLabelColor, xAxisLabelColor = _69 === void 0 ? populationDefaults.defaultFontColor : _69, _70 = props.verticalLinesColor, verticalLinesColor = _70 === void 0 ? populationDefaults.verticalLinesColor : _70, _71 = props.yAxisIndicesColor, yAxisIndicesColor = _71 === void 0 ? AxesAndRulesDefaults.yAxisIndicesColor : _71, _72 = props.yAxisLabelColor, yAxisLabelColor = _72 === void 0 ? populationDefaults.defaultFontColor : _72, _73 = props.rulesColor, rulesColor = _73 === void 0 ? AxesAndRulesDefaults.rulesColor : _73, _74 = props.leftBarLabelColor, leftBarLabelColor = _74 === void 0 ? (_o = props.barLabelColor) !== null && _o !== void 0 ? _o : populationDefaults.defaultFontColor : _74, _75 = props.rightBarLabelColor, rightBarLabelColor = _75 === void 0 ? (_p = props.barLabelColor) !== null && _p !== void 0 ? _p : populationDefaults.defaultFontColor : _75, _76 = props.midAxisLabelColor, midAxisLabelColor = _76 === void 0 ? populationDefaults.defaultFontColor : _76, _77 = props.leftBarColor, leftBarColor = _77 === void 0 ? populationDefaults.leftBarColor : _77, _78 = props.rightBarColor, rightBarColor = _78 === void 0 ? populationDefaults.rightBarColor : _78, _79 = props.leftBarBorderColor, leftBarBorderColor = _79 === void 0 ? populationDefaults.leftBarBorderColor : _79, _80 = props.rightBarBorderColor, rightBarBorderColor = _80 === void 0 ? populationDefaults.rightBarBorderColor : _80, _81 = props.leftSurplusColor, leftSurplusColor = _81 === void 0 ? populationDefaults.leftSurplusColor : _81, _82 = props.leftSurplusBorderColor, leftSurplusBorderColor = _82 === void 0 ? populationDefaults.leftSurplusBorderColor : _82, _83 = props.rightSurplusColor, rightSurplusColor = _83 === void 0 ? populationDefaults.rightSurplusColor : _83, _84 = props.rightSurplusBorderColor, rightSurplusBorderColor = _84 === void 0 ? populationDefaults.rightSurplusBorderColor : _84;
31
+ var framework = props.framework, _v = props.height, height = _v === void 0 ? populationDefaults.height : _v, _w = props.width, width = _w === void 0 ? props.screenWidth : _w, _x = props.verticalMarginBetweenBars, verticalMarginBetweenBars = _x === void 0 ? populationDefaults.verticalMarginBetweenBars : _x, _y = props.barsMapToYAxisSections, barsMapToYAxisSections = _y === void 0 ? populationDefaults.barsMapToYAxisSections : _y, data = props.data, _z = props.hideRules, hideRules = _z === void 0 ? AxesAndRulesDefaults.hideRules : _z, _0 = props.hideYAxisText, hideYAxisText = _0 === void 0 ? AxesAndRulesDefaults.hideYAxisText : _0, _1 = props.yAxisThickness, yAxisThickness = _1 === void 0 ? AxesAndRulesDefaults.yAxisThickness : _1, _2 = props.xAxisThickness, xAxisThickness = _2 === void 0 ? AxesAndRulesDefaults.xAxisThickness : _2, _3 = props.xAxisType, xAxisType = _3 === void 0 ? AxesAndRulesDefaults.xAxisType : _3, _4 = props.xAxisNoOfSections, xAxisNoOfSections = _4 === void 0 ? populationDefaults.xAxisNoOfSections : _4, _5 = props.showXAxisIndices, showXAxisIndices = _5 === void 0 ? populationDefaults.showXAxisIndices : _5, _6 = props.xAxisIndicesWidth, xAxisIndicesWidth = _6 === void 0 ? populationDefaults.xAxisIndicesWidth : _6, _7 = props.xAxisIndicesHeight, xAxisIndicesHeight = _7 === void 0 ? populationDefaults.xAxisIndicesHeight : _7, _8 = props.xAxisIndicesShiftY, xAxisIndicesShiftY = _8 === void 0 ? 0 : _8, _9 = props.showXAxisLabelTexts, showXAxisLabelTexts = _9 === void 0 ? populationDefaults.showXAxisLabelTexts : _9, _10 = props.xAxisLabelFontSize, xAxisLabelFontSize = _10 === void 0 ? populationDefaults.defaultFontSize : _10, _11 = props.xAxisLabelFontStyle, xAxisLabelFontStyle = _11 === void 0 ? populationDefaults.defaultFontStyle : _11, _12 = props.xAxisLabelFontWeight, xAxisLabelFontWeight = _12 === void 0 ? populationDefaults.defaultFontWeight : _12, _13 = props.xAxisLabelFontFamily, xAxisLabelFontFamily = _13 === void 0 ? populationDefaults.defaultFontFamily : _13, _14 = props.xAxisLabelShiftX, xAxisLabelShiftX = _14 === void 0 ? 0 : _14, _15 = props.xAxisLabelShiftY, xAxisLabelShiftY = _15 === void 0 ? 0 : _15, _16 = props.xAxisLabelPrefix, xAxisLabelPrefix = _16 === void 0 ? populationDefaults.prefix : _16, _17 = props.xAxisLabelSuffix, xAxisLabelSuffix = _17 === void 0 ? populationDefaults.suffix : _17, formatXAxisLabels = props.formatXAxisLabels, _18 = props.showVerticalLines, showVerticalLines = _18 === void 0 ? populationDefaults.showVerticalLines : _18, _19 = props.verticalLinesThickness, verticalLinesThickness = _19 === void 0 ? populationDefaults.verticalLinesThickness : _19, _20 = props.verticalLinesType, verticalLinesType = _20 === void 0 ? populationDefaults.verticalLinesType : _20, _21 = props.verticalLinesStrokeDashArray, verticalLinesStrokeDashArray = _21 === void 0 ? populationDefaults.verticalLinesStrokeDashArray : _21, _22 = props.verticalLinesStrokeLinecap, verticalLinesStrokeLinecap = _22 === void 0 ? populationDefaults.verticalLinesStrokeLinecap : _22, _23 = props.showYAxisIndices, showYAxisIndices = _23 === void 0 ? AxesAndRulesDefaults.showYAxisIndices : _23, _24 = props.yAxisIndicesWidth, yAxisIndicesWidth = _24 === void 0 ? AxesAndRulesDefaults.yAxisIndicesWidth : _24, _25 = props.yAxisIndicesHeight, yAxisIndicesHeight = _25 === void 0 ? AxesAndRulesDefaults.yAxisIndicesHeight : _25, _26 = props.yAxisLabelFontSize, yAxisLabelFontSize = _26 === void 0 ? populationDefaults.defaultFontSize : _26, _27 = props.yAxisLabelFontStyle, yAxisLabelFontStyle = _27 === void 0 ? populationDefaults.defaultFontStyle : _27, _28 = props.yAxisLabelFontWeight, yAxisLabelFontWeight = _28 === void 0 ? populationDefaults.defaultFontWeight : _28, _29 = props.yAxisLabelFontFamily, yAxisLabelFontFamily = _29 === void 0 ? populationDefaults.defaultFontFamily : _29, _30 = props.yAxisLabelTextMarginRight, yAxisLabelTextMarginRight = _30 === void 0 ? populationDefaults.yAxisLabelTextMarginRight : _30, _31 = props.yAxisLabelTexts, yAxisLabelTexts = _31 === void 0 ? [] : _31, _32 = props.showValuesAsBarLabels, showValuesAsBarLabels = _32 === void 0 ? populationDefaults.showValuesAsBarLabels : _32, _33 = props.rulesThickness, rulesThickness = _33 === void 0 ? AxesAndRulesDefaults.rulesThickness : _33, _34 = props.rulesType, rulesType = _34 === void 0 ? AxesAndRulesDefaults.rulesType : _34, _35 = props.dashWidth, dashWidth = _35 === void 0 ? AxesAndRulesDefaults.dashWidth : _35, _36 = props.dashGap, dashGap = _36 === void 0 ? AxesAndRulesDefaults.dashGap : _36, _37 = props.leftBarLabelWidth, leftBarLabelWidth = _37 === void 0 ? populationDefaults.leftBarLabelWidth : _37, _38 = props.leftBarLabelFontSize, leftBarLabelFontSize = _38 === void 0 ? (_a = props.barLabelFontSize) !== null && _a !== void 0 ? _a : populationDefaults.defaultFontSize : _38, _39 = props.leftBarLabelFontStyle, leftBarLabelFontStyle = _39 === void 0 ? (_b = props.barLabelFontStyle) !== null && _b !== void 0 ? _b : populationDefaults.defaultFontStyle : _39, _40 = props.leftBarLabelFontWeight, leftBarLabelFontWeight = _40 === void 0 ? (_c = props.barLabelFontWeight) !== null && _c !== void 0 ? _c : populationDefaults.defaultFontWeight : _40, _41 = props.leftBarLabelFontFamily, leftBarLabelFontFamily = _41 === void 0 ? (_d = props.barLabelFontFamily) !== null && _d !== void 0 ? _d : populationDefaults.defaultFontFamily : _41, _42 = props.leftBarLabelPrefix, leftBarLabelPrefix = _42 === void 0 ? populationDefaults.prefix : _42, _43 = props.leftBarLabelSuffix, leftBarLabelSuffix = _43 === void 0 ? populationDefaults.suffix : _43, _44 = props.rightBarLabelWidth, rightBarLabelWidth = _44 === void 0 ? populationDefaults.rightBarLabelWidth : _44, _45 = props.rightBarLabelFontSize, rightBarLabelFontSize = _45 === void 0 ? (_e = props.barLabelFontSize) !== null && _e !== void 0 ? _e : populationDefaults.defaultFontSize : _45, _46 = props.rightBarLabelFontStyle, rightBarLabelFontStyle = _46 === void 0 ? (_f = props.barLabelFontStyle) !== null && _f !== void 0 ? _f : populationDefaults.defaultFontStyle : _46, _47 = props.rightBarLabelFontWeight, rightBarLabelFontWeight = _47 === void 0 ? (_g = props.barLabelFontWeight) !== null && _g !== void 0 ? _g : populationDefaults.defaultFontWeight : _47, _48 = props.rightBarLabelFontFamily, rightBarLabelFontFamily = _48 === void 0 ? (_h = props.barLabelFontFamily) !== null && _h !== void 0 ? _h : populationDefaults.defaultFontFamily : _48, _49 = props.rightBarLabelPrefix, rightBarLabelPrefix = _49 === void 0 ? populationDefaults.prefix : _49, _50 = props.rightBarLabelSuffix, rightBarLabelSuffix = _50 === void 0 ? populationDefaults.suffix : _50, formatBarLabels = props.formatBarLabels, _51 = props.showMidAxis, showMidAxis = _51 === void 0 ? populationDefaults.showMidAxis : _51, _52 = props.midAxisLabelWidth, midAxisLabelWidth = _52 === void 0 ? populationDefaults.midAxisLabelWidth : _52, _53 = props.midAxisLabelFontSize, midAxisLabelFontSize = _53 === void 0 ? populationDefaults.defaultFontSize : _53, _54 = props.midAxisLabelFontStyle, midAxisLabelFontStyle = _54 === void 0 ? populationDefaults.defaultFontStyle : _54, _55 = props.midAxisLabelFontWeight, midAxisLabelFontWeight = _55 === void 0 ? populationDefaults.defaultFontWeight : _55, _56 = props.midAxisLabelFontFamily, midAxisLabelFontFamily = _56 === void 0 ? populationDefaults.defaultFontFamily : _56, _57 = props.leftBarBorderWidth, leftBarBorderWidth = _57 === void 0 ? (_j = props.barBorderWidth) !== null && _j !== void 0 ? _j : populationDefaults.leftBarBorderWidth : _57, _58 = props.rightBarBorderWidth, rightBarBorderWidth = _58 === void 0 ? (_k = props.barBorderWidth) !== null && _k !== void 0 ? _k : populationDefaults.rightBarBorderWidth : _58, _59 = props.leftBarBorderRadius, leftBarBorderRadius = _59 === void 0 ? (_l = props.barBorderRadius) !== null && _l !== void 0 ? _l : populationDefaults.leftBarBorderRadius : _59, _60 = props.rightBarBorderRadius, rightBarBorderRadius = _60 === void 0 ? (_m = props.barBorderRadius) !== null && _m !== void 0 ? _m : populationDefaults.rightBarBorderRadius : _60, _61 = props.allCornersRounded, allCornersRounded = _61 === void 0 ? populationDefaults.allCornersRounded : _61, _62 = props.showSurplus, showSurplus = _62 === void 0 ? populationDefaults.showSurplus : _62, _63 = props.showSurplusLeft, showSurplusLeft = _63 === void 0 ? populationDefaults.showSurplusLeft : _63, _64 = props.showSurplusRight, showSurplusRight = _64 === void 0 ? populationDefaults.showSurplusRight : _64, _65 = props.leftSurplusBorderWidth, leftSurplusBorderWidth = _65 === void 0 ? populationDefaults.leftSurplusBorderWidth : _65, _66 = props.rightSurplusBorderWidth, rightSurplusBorderWidth = _66 === void 0 ? populationDefaults.rightSurplusBorderWidth : _66;
32
+ var _67 = props.yAxisColor, yAxisColor = _67 === void 0 ? AxesAndRulesDefaults.yAxisColor : _67, _68 = props.xAxisColor, xAxisColor = _68 === void 0 ? AxesAndRulesDefaults.xAxisColor : _68, _69 = props.xAxisIndicesColor, xAxisIndicesColor = _69 === void 0 ? populationDefaults.xAxisIndicesColor : _69, _70 = props.xAxisLabelColor, xAxisLabelColor = _70 === void 0 ? populationDefaults.defaultFontColor : _70, _71 = props.verticalLinesColor, verticalLinesColor = _71 === void 0 ? populationDefaults.verticalLinesColor : _71, _72 = props.yAxisIndicesColor, yAxisIndicesColor = _72 === void 0 ? AxesAndRulesDefaults.yAxisIndicesColor : _72, _73 = props.yAxisLabelColor, yAxisLabelColor = _73 === void 0 ? populationDefaults.defaultFontColor : _73, _74 = props.rulesColor, rulesColor = _74 === void 0 ? AxesAndRulesDefaults.rulesColor : _74, _75 = props.leftBarLabelColor, leftBarLabelColor = _75 === void 0 ? (_o = props.barLabelColor) !== null && _o !== void 0 ? _o : populationDefaults.defaultFontColor : _75, _76 = props.rightBarLabelColor, rightBarLabelColor = _76 === void 0 ? (_p = props.barLabelColor) !== null && _p !== void 0 ? _p : populationDefaults.defaultFontColor : _76, _77 = props.midAxisLabelColor, midAxisLabelColor = _77 === void 0 ? populationDefaults.defaultFontColor : _77, _78 = props.leftBarColor, leftBarColor = _78 === void 0 ? populationDefaults.leftBarColor : _78, _79 = props.rightBarColor, rightBarColor = _79 === void 0 ? populationDefaults.rightBarColor : _79, _80 = props.leftBarBorderColor, leftBarBorderColor = _80 === void 0 ? populationDefaults.leftBarBorderColor : _80, _81 = props.rightBarBorderColor, rightBarBorderColor = _81 === void 0 ? populationDefaults.rightBarBorderColor : _81, _82 = props.leftSurplusColor, leftSurplusColor = _82 === void 0 ? populationDefaults.leftSurplusColor : _82, _83 = props.leftSurplusBorderColor, leftSurplusBorderColor = _83 === void 0 ? populationDefaults.leftSurplusBorderColor : _83, _84 = props.rightSurplusColor, rightSurplusColor = _84 === void 0 ? populationDefaults.rightSurplusColor : _84, _85 = props.rightSurplusBorderColor, rightSurplusBorderColor = _85 === void 0 ? populationDefaults.rightSurplusBorderColor : _85;
33
33
  if (framework === Framework.reactJS) {
34
34
  yAxisColor = yAxisColor.toString();
35
35
  xAxisColor = xAxisColor.toString();
@@ -97,7 +97,8 @@ export var usePopulationPyramid = function (props) {
97
97
  y1: 0,
98
98
  y2: containerHeight,
99
99
  stroke: verticalLinesColor,
100
- strokeWidth: verticalLinesThickness
100
+ strokeWidth: verticalLinesThickness,
101
+ strokeLinecap: verticalLinesStrokeLinecap
101
102
  };
102
103
  verticalLinesCommonProps.strokeDasharray = getStrokeDashArray(verticalLinesStrokeDashArray);
103
104
  var xAxisLabelsCommonProps = {
@@ -1,5 +1,5 @@
1
1
  import { type ColorValue } from 'react-native';
2
- import { type Framework, type RuleTypes } from '../utils/types';
2
+ import { type Linecap, type Framework, type RuleTypes } from '../utils/types';
3
3
  import { type FontStyle, type FontWeight } from 'react-native-svg';
4
4
  export interface popnPyramidDataItem {
5
5
  left: number;
@@ -75,6 +75,7 @@ export interface RulesProps {
75
75
  stroke?: ColorValue;
76
76
  strokeWidth?: number;
77
77
  strokeDasharray?: number[] | string;
78
+ strokeLinecap?: Linecap;
78
79
  }
79
80
  export type RulesPropsReactJS = RulesProps & {
80
81
  stroke?: string;
@@ -117,6 +118,7 @@ export interface PopulationPyramidPropsType {
117
118
  verticalLinesThickness?: number;
118
119
  verticalLinesType?: RuleTypes;
119
120
  verticalLinesStrokeDashArray?: number[] | string;
121
+ verticalLinesStrokeLinecap?: Linecap;
120
122
  noOfSections?: number;
121
123
  barsMapToYAxisSections?: boolean;
122
124
  showYAxisIndices?: boolean;
@@ -45,6 +45,7 @@ export declare const useBarAndLineChartsWrapper: (props: BarAndLineChartsWrapper
45
45
  verticalLinesStrokeDashArray: any;
46
46
  verticalLinesShift: any;
47
47
  verticalLinesUptoDataPoint: any;
48
+ verticalLinesStrokeLinecap: any;
48
49
  xAxisThickness: number;
49
50
  labelsExtraHeight: number;
50
51
  containerHeight: number;
@@ -37,7 +37,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
37
37
  import { useEffect, useState } from 'react';
38
38
  import { AxesAndRulesDefaults, BarDefaults } from '../../utils/constants';
39
39
  export var useBarAndLineChartsWrapper = function (props) {
40
- 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;
40
+ 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;
41
41
  var chartType = props.chartType, containerHeight = props.containerHeight, noOfSectionsBelowXAxis = props.noOfSectionsBelowXAxis, sectionColors = props.sectionColors, stepHeight = props.stepHeight, negativeStepHeight = props.negativeStepHeight, labelsExtraHeight = props.labelsExtraHeight, yAxisLabelWidth = props.yAxisLabelWidth, horizontal = props.horizontal, rtl = props.rtl, shiftX = props.shiftX, shiftY = props.shiftY, initialSpacing = props.initialSpacing, data = props.data, stackData = props.stackData, secondaryData = props.secondaryData, barWidth = props.barWidth, xAxisThickness = props.xAxisThickness, totalWidth = props.totalWidth, spacing = props.spacing, lineConfig = props.lineConfig, lineConfig2 = props.lineConfig2, maxValue = props.maxValue, lineData = props.lineData, lineData2 = props.lineData2, animatedWidth = props.animatedWidth, lineBehindBars = props.lineBehindBars, points = props.points, points2 = props.points2, arrowPoints = props.arrowPoints, width = props.width, horizSections = props.horizSections, endSpacing = props.endSpacing, horizontalRulesStyle = props.horizontalRulesStyle, noOfSections = props.noOfSections, showFractionalValues = props.showFractionalValues, axesAndRulesProps = props.axesAndRulesProps, yAxisLabelTexts = props.yAxisLabelTexts, yAxisOffset = props.yAxisOffset, rotateYAxisTexts = props.rotateYAxisTexts, pointerConfig = props.pointerConfig, getPointerProps = props.getPointerProps, pointerIndex = props.pointerIndex, pointerX = props.pointerX, pointerY = props.pointerY, scrollEventThrottle = props.scrollEventThrottle, endReachedOffset = props.endReachedOffset, isRTL = props.isRTL, selectedIndex = props.selectedIndex;
42
42
  var yAxisAtTop = rtl ? !props.yAxisAtTop : props.yAxisAtTop;
43
43
  var hideOrigin = (_a = axesAndRulesProps.hideOrigin) !== null && _a !== void 0 ? _a : AxesAndRulesDefaults.hideOrigin;
@@ -87,6 +87,7 @@ export var useBarAndLineChartsWrapper = function (props) {
87
87
  var verticalLinesZIndex = (_7 = axesAndRulesProps.verticalLinesZIndex) !== null && _7 !== void 0 ? _7 : AxesAndRulesDefaults.verticalLinesZIndex;
88
88
  var verticalLinesSpacing = (_8 = axesAndRulesProps.verticalLinesSpacing) !== null && _8 !== void 0 ? _8 : AxesAndRulesDefaults.verticalLinesSpacing;
89
89
  var verticalLinesUptoDataPoint = (_9 = axesAndRulesProps.verticalLinesUptoDataPoint) !== null && _9 !== void 0 ? _9 : AxesAndRulesDefaults.verticalLinesUptoDataPoint;
90
+ var verticalLinesStrokeLinecap = (_10 = axesAndRulesProps.verticalLinesStrokeLinecap) !== null && _10 !== void 0 ? _10 : AxesAndRulesDefaults.verticalLinesStrokeLinecap;
90
91
  var noOfVerticalLines = axesAndRulesProps.noOfVerticalLines;
91
92
  var secondaryXAxis = axesAndRulesProps.secondaryXAxis;
92
93
  var verticalLinesAr = noOfVerticalLines
@@ -159,7 +160,7 @@ export var useBarAndLineChartsWrapper = function (props) {
159
160
  spacing: spacing,
160
161
  containerHeight: containerHeight,
161
162
  lineConfig: lineConfig,
162
- maxValue: (_10 = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.maxValue) !== null && _10 !== void 0 ? _10 : maxValue,
163
+ maxValue: (_11 = secondaryYAxis === null || secondaryYAxis === void 0 ? void 0 : secondaryYAxis.maxValue) !== null && _11 !== void 0 ? _11 : maxValue,
163
164
  animatedWidth: animatedWidth,
164
165
  lineBehindBars: lineBehindBars,
165
166
  points: points,
@@ -178,7 +179,7 @@ export var useBarAndLineChartsWrapper = function (props) {
178
179
  var verticalLinesProps = {
179
180
  verticalLinesAr: verticalLinesAr,
180
181
  verticalLinesSpacing: verticalLinesSpacing,
181
- spacing: (_11 = lineConfig === null || lineConfig === void 0 ? void 0 : lineConfig.spacing) !== null && _11 !== void 0 ? _11 : spacing,
182
+ spacing: (_12 = lineConfig === null || lineConfig === void 0 ? void 0 : lineConfig.spacing) !== null && _12 !== void 0 ? _12 : spacing,
182
183
  initialSpacing: initialSpacing,
183
184
  verticalLinesZIndex: verticalLinesZIndex,
184
185
  verticalLinesHeight: verticalLinesHeight,
@@ -187,6 +188,7 @@ export var useBarAndLineChartsWrapper = function (props) {
187
188
  verticalLinesStrokeDashArray: verticalLinesStrokeDashArray,
188
189
  verticalLinesShift: verticalLinesShift,
189
190
  verticalLinesUptoDataPoint: verticalLinesUptoDataPoint,
191
+ verticalLinesStrokeLinecap: verticalLinesStrokeLinecap,
190
192
  xAxisThickness: xAxisThickness,
191
193
  labelsExtraHeight: labelsExtraHeight,
192
194
  containerHeight: containerHeight,
@@ -232,7 +234,7 @@ export var useBarAndLineChartsWrapper = function (props) {
232
234
  : difBwWidthHeight - 40) /
233
235
  2 +
234
236
  (yAxisAtTop ? (rtl ? (props.width ? 12 : 40) : 12) : 52), ")");
235
- var _12 = __read(useState(false), 2), canMomentum = _12[0], setCanMomentum = _12[1];
237
+ var _13 = __read(useState(false), 2), canMomentum = _13[0], setCanMomentum = _13[1];
236
238
  var isCloseToEnd = function (_a) {
237
239
  var layoutMeasurement = _a.layoutMeasurement, contentOffset = _a.contentOffset, contentSize = _a.contentSize;
238
240
  return isRTL
@@ -1,6 +1,5 @@
1
- import { type ColorValue, type PointerEvent } from 'react-native';
2
- import { type Pointer } from '../../utils/types';
3
- import { type barDataItem, type stackDataItem } from '../../BarChart/types';
1
+ import { type ColorValue } from 'react-native';
2
+ import { PointerEvents, type Pointer } from '../../utils/types';
4
3
  export interface StripAndLabelProps {
5
4
  autoAdjustPointerLabelPosition: boolean;
6
5
  pointerX: number;
@@ -15,17 +14,19 @@ export interface StripAndLabelProps {
15
14
  pointerStripUptoDataPoint: boolean;
16
15
  pointerStripHeight: number;
17
16
  shiftPointerLabelY: number;
18
- pointerItemLocal: barDataItem | stackDataItem;
17
+ pointerItemLocal: any[];
19
18
  showPointerStrip: boolean;
20
19
  pointerStripWidth: number;
21
20
  containerHeight: number;
22
21
  xAxisThickness: number;
23
22
  pointerStripColor: ColorValue;
24
- pointerConfig: Pointer;
25
- pointerLabelComponent: Function;
26
- secondaryPointerItem: barDataItem | stackDataItem;
23
+ pointerConfig?: Pointer;
24
+ pointerLabelComponent: Function | null;
25
+ secondaryPointerItem?: any[];
27
26
  scrollX: number;
28
- pointerEvents: PointerEvent;
27
+ pointerEvents?: PointerEvents;
29
28
  width: number;
30
29
  screenWidth: number;
30
+ isBarChart: boolean;
31
+ pointerIndex: number;
31
32
  }
@@ -30,9 +30,10 @@ export { useAnimatedThreeDBar } from './components/AnimatedThreeDBar';
30
30
  export { getHorizSectionVals } from './components/BarAndLineChartsWrapper/getHorizSectionsVals';
31
31
  export { useBarAndLineChartsWrapper } from './components/BarAndLineChartsWrapper';
32
32
  export { getTopAndLeftForStripAndLabel } from './components/common/StripAndLabel';
33
+ export { type StripAndLabelProps } from './components/common/types';
33
34
  /***********************************************************************************************************************
34
35
  /********************************* common utils, constants and types ********************************
35
36
  /***********************************************************************************************************************/
36
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';
37
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';
38
- 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 } 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 } from './utils/types';
@@ -64,6 +64,7 @@ export declare const AxesAndRulesDefaults: {
64
64
  verticalLinesZIndex: number;
65
65
  verticalLinesSpacing: number;
66
66
  verticalLinesUptoDataPoint: boolean;
67
+ verticalLinesStrokeLinecap: string;
67
68
  noOfSections: number;
68
69
  containerHeight: number;
69
70
  width: number;
@@ -217,6 +218,7 @@ export declare const populationDefaults: {
217
218
  verticalLinesThickness: number;
218
219
  verticalLinesType: string;
219
220
  verticalLinesStrokeDashArray: number[];
221
+ verticalLinesStrokeLinecap: string;
220
222
  defaultFontSize: number;
221
223
  defaultFontColor: string;
222
224
  defaultFontStyle: FontStyle;
@@ -74,6 +74,7 @@ export var AxesAndRulesDefaults = {
74
74
  verticalLinesZIndex: -1,
75
75
  verticalLinesSpacing: 0,
76
76
  verticalLinesUptoDataPoint: false,
77
+ verticalLinesStrokeLinecap: 'butt',
77
78
  noOfSections: 10,
78
79
  containerHeight: 200,
79
80
  width: 200,
@@ -270,6 +271,7 @@ export var populationDefaults = {
270
271
  verticalLinesThickness: 1,
271
272
  verticalLinesType: ruleTypes.DASHED,
272
273
  verticalLinesStrokeDashArray: [4, 8],
274
+ verticalLinesStrokeLinecap: 'butt',
273
275
  defaultFontSize: 12,
274
276
  defaultFontColor: 'black',
275
277
  defaultFontStyle: 'normal',
@@ -537,6 +537,7 @@ export var getAxesAndRulesProps = function (props, stepValue, negativeStepValue,
537
537
  verticalLinesZIndex: props.verticalLinesZIndex,
538
538
  verticalLinesSpacing: props.verticalLinesSpacing,
539
539
  noOfVerticalLines: props.noOfVerticalLines,
540
+ verticalLinesStrokeLinecap: props.verticalLinesStrokeLinecap,
540
541
  // specific to Line charts-
541
542
  verticalLinesUptoDataPoint: props.verticalLinesUptoDataPoint,
542
543
  roundToDigits: props.roundToDigits,
@@ -8,6 +8,7 @@ export declare enum Framework {
8
8
  }
9
9
  export type RuleType = 'solid' | 'dashed' | 'dotted' | string;
10
10
  export type LabelsPosition = 'onBorder' | 'outward' | 'inward' | 'mid';
11
+ export type Linecap = 'butt' | 'square' | 'round';
11
12
  export interface RuleTypes {
12
13
  SOLID: RuleType;
13
14
  DASHED: RuleType;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "gifted-charts-core",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "description": "Mathematical and logical utilities used by react-gifted-charts and react-native-gifted-charts",
5
- "main": "./src/index.js",
5
+ "main": "./dist/index.js",
6
6
  "files": [
7
- "src"
7
+ "dist"
8
8
  ],
9
9
  "scripts": {
10
- "build": "tsc -p .",
10
+ "build": "tsc -p . && ./build.sh",
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
12
  "lint": "eslint src/**/*.ts"
13
13
  },
@@ -1 +0,0 @@
1
- {"version":3,"file":"Animated2DWithGradient.js","sourceRoot":"","sources":["Animated2DWithGradient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;YAIA,+CAAa,iCAAiC,GAAG,UAAC,KAAK;;gBAEnD,IAAA,cAAc,GA+BZ,KAAK,eA/BO,EACd,cAAc,GA8BZ,KAAK,eA9BO,EACd,eAAe,GA6Bb,KAAK,gBA7BQ,EACf,IAAI,GA4BF,KAAK,KA5BH,EACJ,sBAAsB,GA2BpB,KAAK,uBA3Be,EACtB,uBAAuB,GA0BrB,KAAK,wBA1BgB,EACvB,yBAAyB,GAyBvB,KAAK,0BAzBkB,EACzB,0BAA0B,GAwBxB,KAAK,2BAxBmB,EAC1B,QAAQ,GAuBN,KAAK,SAvBC,EACR,iBAAiB,GAsBf,KAAK,kBAtBU,EACjB,QAAQ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