gifted-charts-core 0.1.47 → 0.1.48

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.
@@ -308,18 +308,18 @@ export var useBarChart = function (props) {
308
308
  ? (_50 = (_49 = props.secondaryYAxis) === null || _49 === void 0 ? void 0 : _49.yAxisOffset) !== null && _50 !== void 0 ? _50 : 0
309
309
  : yAxisOffset !== null && yAxisOffset !== void 0 ? yAxisOffset : 0;
310
310
  useEffect(function () {
311
- 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;
311
+ 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;
312
312
  if (showLine) {
313
313
  var pp = '';
314
314
  var pp2 = '';
315
- var firstBarWidth = (_c = (_b = (_a = (stackData !== null && stackData !== void 0 ? stackData : data)) === null || _a === void 0 ? void 0 : _a[0].barWidth) !== null && _b !== void 0 ? _b : props.barWidth) !== null && _c !== void 0 ? _c : 30;
315
+ var firstBarWidth = (_c = (_b = (_a = (stackData !== null && stackData !== void 0 ? stackData : data)) === null || _a === void 0 ? void 0 : _a[0].barWidth) !== null && _b !== void 0 ? _b : props.barWidth) !== null && _c !== void 0 ? _c : defaultBarWidth;
316
316
  if (!lineConfig.curved) {
317
317
  for (var i = 0; i < lineData.length; i++) {
318
318
  if (i < ((_d = lineConfig.startIndex) !== null && _d !== void 0 ? _d : 0) ||
319
319
  i > ((_e = lineConfig.endIndex) !== null && _e !== void 0 ? _e : 0)) {
320
320
  continue;
321
321
  }
322
- var currentBarWidth = (_h = (_g = (_f = data === null || data === void 0 ? void 0 : data[i]) === null || _f === void 0 ? void 0 : _f.barWidth) !== null && _g !== void 0 ? _g : props.barWidth) !== null && _h !== void 0 ? _h : defaultBarWidth;
322
+ var currentBarWidth = (_j = (_h = (_g = (_f = (stackData !== null && stackData !== void 0 ? stackData : data)) === null || _f === void 0 ? void 0 : _f[i]) === null || _g === void 0 ? void 0 : _g.barWidth) !== null && _h !== void 0 ? _h : props.barWidth) !== null && _j !== void 0 ? _j : defaultBarWidth;
323
323
  var currentValue = props.lineData
324
324
  ? props.lineData[i].value
325
325
  : stackData
@@ -339,18 +339,18 @@ export var useBarChart = function (props) {
339
339
  var arrowTipX = parseInt(ppArray[ppArray.length - 2].replace('L', ''));
340
340
  var y1 = parseInt(ppArray[ppArray.length - 3]);
341
341
  var x1 = parseInt(ppArray[ppArray.length - 4].replace('L', ''));
342
- var arrowPoints_1 = getArrowPoints(arrowTipX, arrowTipY, x1, y1, (_j = lineConfig.arrowConfig) === null || _j === void 0 ? void 0 : _j.length, (_k = lineConfig.arrowConfig) === null || _k === void 0 ? void 0 : _k.width, (_l = lineConfig.arrowConfig) === null || _l === void 0 ? void 0 : _l.showArrowBase);
342
+ var arrowPoints_1 = getArrowPoints(arrowTipX, arrowTipY, x1, y1, (_k = lineConfig.arrowConfig) === null || _k === void 0 ? void 0 : _k.length, (_l = lineConfig.arrowConfig) === null || _l === void 0 ? void 0 : _l.width, (_m = lineConfig.arrowConfig) === null || _m === void 0 ? void 0 : _m.showArrowBase);
343
343
  setArrowPoints(arrowPoints_1);
344
344
  }
345
345
  }
346
346
  else {
347
347
  var p1Array = [];
348
348
  for (var i = 0; i < lineData.length; i++) {
349
- if (i < ((_m = lineConfig.startIndex) !== null && _m !== void 0 ? _m : 0) ||
350
- i > ((_o = lineConfig.endIndex) !== null && _o !== void 0 ? _o : 0)) {
349
+ if (i < ((_o = lineConfig.startIndex) !== null && _o !== void 0 ? _o : 0) ||
350
+ i > ((_p = lineConfig.endIndex) !== null && _p !== void 0 ? _p : 0)) {
351
351
  continue;
352
352
  }
353
- var currentBarWidth = (_r = (_q = (_p = data === null || data === void 0 ? void 0 : data[i]) === null || _p === void 0 ? void 0 : _p.barWidth) !== null && _q !== void 0 ? _q : props.barWidth) !== null && _r !== void 0 ? _r : defaultBarWidth;
353
+ var currentBarWidth = (_s = (_r = (_q = data === null || data === void 0 ? void 0 : data[i]) === null || _q === void 0 ? void 0 : _q.barWidth) !== null && _r !== void 0 ? _r : props.barWidth) !== null && _s !== void 0 ? _s : defaultBarWidth;
354
354
  var currentValue = props.lineData
355
355
  ? props.lineData[i].value
356
356
  : stackData
@@ -367,11 +367,11 @@ export var useBarChart = function (props) {
367
367
  if (lineData2 === null || lineData2 === void 0 ? void 0 : lineData2.length) {
368
368
  if (!(lineConfig2 === null || lineConfig2 === void 0 ? void 0 : lineConfig2.curved)) {
369
369
  for (var i = 0; i < lineData2.length; i++) {
370
- if (i < ((_s = lineConfig2.startIndex) !== null && _s !== void 0 ? _s : 0) ||
371
- i > ((_t = lineConfig2.endIndex) !== null && _t !== void 0 ? _t : 0)) {
370
+ if (i < ((_t = lineConfig2.startIndex) !== null && _t !== void 0 ? _t : 0) ||
371
+ i > ((_u = lineConfig2.endIndex) !== null && _u !== void 0 ? _u : 0)) {
372
372
  continue;
373
373
  }
374
- var currentBarWidth = (_w = (_v = (_u = data === null || data === void 0 ? void 0 : data[i]) === null || _u === void 0 ? void 0 : _u.barWidth) !== null && _v !== void 0 ? _v : props.barWidth) !== null && _w !== void 0 ? _w : defaultBarWidth;
374
+ var currentBarWidth = (_x = (_w = (_v = data === null || data === void 0 ? void 0 : data[i]) === null || _v === void 0 ? void 0 : _v.barWidth) !== null && _w !== void 0 ? _w : props.barWidth) !== null && _x !== void 0 ? _x : defaultBarWidth;
375
375
  var currentValue = lineData2[i].value;
376
376
  pp2 +=
377
377
  'L' +
@@ -385,11 +385,11 @@ export var useBarChart = function (props) {
385
385
  else {
386
386
  var p2Array = [];
387
387
  for (var i = 0; i < lineData2.length; i++) {
388
- if (i < ((_x = lineConfig2.startIndex) !== null && _x !== void 0 ? _x : 0) ||
389
- i > ((_y = lineConfig2.endIndex) !== null && _y !== void 0 ? _y : 0)) {
388
+ if (i < ((_y = lineConfig2.startIndex) !== null && _y !== void 0 ? _y : 0) ||
389
+ i > ((_z = lineConfig2.endIndex) !== null && _z !== void 0 ? _z : 0)) {
390
390
  continue;
391
391
  }
392
- var currentBarWidth = (_1 = (_0 = (_z = data === null || data === void 0 ? void 0 : data[i]) === null || _z === void 0 ? void 0 : _z.barWidth) !== null && _0 !== void 0 ? _0 : props.barWidth) !== null && _1 !== void 0 ? _1 : defaultBarWidth;
392
+ var currentBarWidth = (_2 = (_1 = (_0 = data === null || data === void 0 ? void 0 : data[i]) === null || _0 === void 0 ? void 0 : _0.barWidth) !== null && _1 !== void 0 ? _1 : props.barWidth) !== null && _2 !== void 0 ? _2 : defaultBarWidth;
393
393
  var currentValue = lineData2[i].value;
394
394
  p2Array.push([
395
395
  getXForLineInBar(i, firstBarWidth, currentBarWidth, yAxisLabelWidth, lineConfig2, spacing),
@@ -135,6 +135,7 @@ export interface StackedBarChartPropsType {
135
135
  secondaryNegativeStepHeight: number;
136
136
  secondaryNegativeStepValue: number;
137
137
  secondaryNoOfSectionsBelowXAxis: number;
138
+ containerHeightIncludingBelowXAxis?: number;
138
139
  }
139
140
  export interface BarChartPropsType {
140
141
  width?: number;
@@ -352,6 +352,7 @@ export interface lineDataItem {
352
352
  dataPointLabelShiftY?: number;
353
353
  showStrip?: boolean;
354
354
  showVerticalLine?: boolean;
355
+ verticalLineHeight?: number;
355
356
  verticalLineUptoDataPoint?: boolean;
356
357
  verticalLineColor?: string;
357
358
  verticalLineThickness?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gifted-charts-core",
3
- "version": "0.1.47",
3
+ "version": "0.1.48",
4
4
  "description": "Mathematical and logical utilities used by react-gifted-charts and react-native-gifted-charts",
5
5
  "main": "./dist/index.js",
6
6
  "files": [