gifted-charts-core 0.0.34 → 0.0.35

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gifted-charts-core",
3
- "version": "0.0.34",
3
+ "version": "0.0.35",
4
4
  "description": "Mathematical and logical utilities used by react-gifted-charts and react-native-gifted-charts",
5
5
  "main": "./src/index.js",
6
6
  "files": [
@@ -160,6 +160,7 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
160
160
  areaChart4: boolean;
161
161
  areaChart5: boolean;
162
162
  atLeastOneAreaChart: boolean;
163
+ getIsNthAreaChart: (n: number) => boolean;
163
164
  stepChart: boolean;
164
165
  stepChart1: boolean;
165
166
  stepChart2: boolean;
@@ -192,6 +192,25 @@ export var useLineChart = function (props) {
192
192
  var areaChart4 = (_62 = props.areaChart4) !== null && _62 !== void 0 ? _62 : false;
193
193
  var areaChart5 = (_63 = props.areaChart5) !== null && _63 !== void 0 ? _63 : false;
194
194
  var atLeastOneAreaChart = (_69 = (_68 = (_67 = (_66 = (_65 = (_64 = dataSet === null || dataSet === void 0 ? void 0 : dataSet.some(function (set) { return set.areaChart; })) !== null && _64 !== void 0 ? _64 : areaChart) !== null && _65 !== void 0 ? _65 : areaChart1) !== null && _66 !== void 0 ? _66 : areaChart2) !== null && _67 !== void 0 ? _67 : areaChart3) !== null && _68 !== void 0 ? _68 : areaChart4) !== null && _69 !== void 0 ? _69 : areaChart5;
195
+ var getIsNthAreaChart = function (n) {
196
+ if (areaChart)
197
+ return true;
198
+ if (!(dataSet === null || dataSet === void 0 ? void 0 : dataSet.length)) {
199
+ switch (n) {
200
+ case 0:
201
+ return areaChart1;
202
+ case 1:
203
+ return areaChart2;
204
+ case 2:
205
+ return areaChart3;
206
+ case 3:
207
+ return areaChart4;
208
+ case 4:
209
+ return areaChart5;
210
+ }
211
+ }
212
+ return false;
213
+ };
195
214
  var stepChart = (_70 = props.stepChart) !== null && _70 !== void 0 ? _70 : false;
196
215
  var stepChart1 = (_71 = props.stepChart1) !== null && _71 !== void 0 ? _71 : false;
197
216
  var stepChart2 = (_72 = props.stepChart2) !== null && _72 !== void 0 ? _72 : false;
@@ -1208,6 +1227,7 @@ export var useLineChart = function (props) {
1208
1227
  areaChart4: areaChart4,
1209
1228
  areaChart5: areaChart5,
1210
1229
  atLeastOneAreaChart: atLeastOneAreaChart,
1230
+ getIsNthAreaChart: getIsNthAreaChart,
1211
1231
  stepChart: stepChart,
1212
1232
  stepChart1: stepChart1,
1213
1233
  stepChart2: stepChart2,
@@ -372,6 +372,25 @@ export const useLineChart = (props: extendedLineChartPropsType) => {
372
372
  areaChart4 ??
373
373
  areaChart5
374
374
 
375
+ const getIsNthAreaChart = (n: number): boolean => {
376
+ if (areaChart) return true
377
+ if (!dataSet?.length) {
378
+ switch (n) {
379
+ case 0:
380
+ return areaChart1
381
+ case 1:
382
+ return areaChart2
383
+ case 2:
384
+ return areaChart3
385
+ case 3:
386
+ return areaChart4
387
+ case 4:
388
+ return areaChart5
389
+ }
390
+ }
391
+ return false
392
+ }
393
+
375
394
  const stepChart = props.stepChart ?? false
376
395
  const stepChart1 = props.stepChart1 ?? false
377
396
  const stepChart2 = props.stepChart2 ?? false
@@ -638,7 +657,7 @@ export const useLineChart = (props: extendedLineChartPropsType) => {
638
657
  showArrow: props.secondaryLineConfig?.showArrow ?? props.showArrows,
639
658
  arrowConfig: props.secondaryLineConfig?.arrowConfig ?? props.arrowConfig
640
659
  }
641
-
660
+
642
661
  const yAxisExtraHeightAtTop = props.trimYAxisAtTop
643
662
  ? 0
644
663
  : props.yAxisExtraHeight ?? containerHeight / 20
@@ -1918,6 +1937,7 @@ export const useLineChart = (props: extendedLineChartPropsType) => {
1918
1937
  areaChart4,
1919
1938
  areaChart5,
1920
1939
  atLeastOneAreaChart,
1940
+ getIsNthAreaChart,
1921
1941
  stepChart,
1922
1942
  stepChart1,
1923
1943
  stepChart2,