gifted-charts-core 0.1.67 → 0.1.69

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.
@@ -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, negativeStepValue = 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;
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, negativeStepValue = props.negativeStepValue, secondaryStepHeight = props.secondaryStepHeight, secondaryStepValue = props.secondaryStepValue, secondaryNegativeStepHeight = props.secondaryNegativeStepHeight, secondaryNegativeStepValue = props.secondaryNegativeStepValue;
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; });
@@ -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, negativeStepValue = props.negativeStepValue, autoCenterTooltip = props.autoCenterTooltip, floatingYAxisLabels = props.floatingYAxisLabels;
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];
@@ -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;