@oliasoft-open-source/charts-library 4.2.2-beta-1 → 4.2.2

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/index.js CHANGED
@@ -39271,41 +39271,32 @@ const useBarChartConfig = (chartRef, chart2) => {
39271
39271
  [chartRef, chart2]
39272
39272
  );
39273
39273
  };
39274
- const getStackedOptions = (axisType, { stacked, stackedX, stackedY }) => {
39275
- if (axisType === AxisType.X) {
39276
- return stackedX ?? stacked;
39277
- } else if (axisType === AxisType.Y) {
39278
- return stackedY ?? stacked;
39279
- }
39280
- return stacked;
39281
- };
39282
39274
  const getBarChartAxis = ({
39283
39275
  chart: chart2,
39284
39276
  axisType = AxisType.X,
39285
39277
  currentScale,
39286
39278
  i: i2
39287
39279
  }) => {
39288
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
39289
- const { data, options } = chart2 ?? {};
39290
- const isDirectionVertical = isVertical(options.direction);
39291
- const axisData = currentScale || ((_b2 = (_a2 = options == null ? void 0 : options.axes) == null ? void 0 : _a2[axisType]) == null ? void 0 : _b2[0]);
39280
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2;
39281
+ const isDirectionVertical = isVertical(chart2.options.direction);
39282
+ const axisData = currentScale || ((_c2 = (_b2 = (_a2 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _a2.axes) == null ? void 0 : _b2[axisType]) == null ? void 0 : _c2[0]);
39292
39283
  const isDirectionCompatibleWithAxisType = isDirectionVertical && axisType === AxisType.Y || !isDirectionVertical && axisType === AxisType.X;
39293
39284
  const grid = (axisData == null ? void 0 : axisData.gridLines) || {};
39294
39285
  const getScaleType = () => {
39295
- var _a3;
39296
- const scaleType = data.labels ? ScaleType.Category : ScaleType.Linear;
39286
+ var _a3, _b3;
39287
+ const scaleType = chart2.data.labels ? ScaleType.Category : ScaleType.Linear;
39297
39288
  const axisWithScale = isDirectionVertical ? AxisType.X : AxisType.Y;
39298
- return axisType === axisWithScale ? scaleType : (_a3 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _a3.chartScaleType;
39289
+ return axisType === axisWithScale ? scaleType : (_b3 = (_a3 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _a3.additionalAxesOptions) == null ? void 0 : _b3.chartScaleType;
39299
39290
  };
39300
39291
  const getReverse = () => {
39301
- var _a3;
39292
+ var _a3, _b3;
39302
39293
  const axisWithReverse = isDirectionVertical ? AxisType.Y : AxisType.X;
39303
- return axisType === axisWithReverse ? (_a3 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _a3.reverse : false;
39294
+ return axisType === axisWithReverse ? (_b3 = (_a3 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _a3.additionalAxesOptions) == null ? void 0 : _b3.reverse : false;
39304
39295
  };
39305
39296
  const getTicks = () => {
39306
- var _a3, _b3;
39307
- const additionalAxesOptions = options == null ? void 0 : options.additionalAxesOptions;
39308
- const ticksConfigFromProps = (_b3 = (_a3 = options == null ? void 0 : options.scales) == null ? void 0 : _a3[`${i2 === 0 ? axisType : axisType + i2}`]) == null ? void 0 : _b3.ticks;
39297
+ var _a3, _b3, _c3, _d3;
39298
+ const additionalAxesOptions = (_a3 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _a3.additionalAxesOptions;
39299
+ const ticksConfigFromProps = (_d3 = (_c3 = (_b3 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _b3.scales) == null ? void 0 : _c3[`${i2 === 0 ? axisType : axisType + i2}`]) == null ? void 0 : _d3.ticks;
39309
39300
  const isLogarithmic = isDirectionCompatibleWithAxisType && (additionalAxesOptions == null ? void 0 : additionalAxesOptions.chartScaleType) === ScaleType.Logarithmic;
39310
39301
  const ticksFormattingCallback = (tick, _2, ticks2) => {
39311
39302
  return isLogarithmic ? LOGARITHMIC_STEPS.includes(Number(tick)) ? formatAxisLabelNumbers(tick, ticks2) : "" : formatAxisLabelNumbers(tick, ticks2);
@@ -39330,14 +39321,14 @@ const getBarChartAxis = ({
39330
39321
  return {
39331
39322
  type: getScaleType(),
39332
39323
  position: axisData == null ? void 0 : axisData.position,
39333
- beginAtZero: (_c2 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _c2.beginAtZero,
39324
+ beginAtZero: (_e2 = (_d2 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _d2.additionalAxesOptions) == null ? void 0 : _e2.beginAtZero,
39334
39325
  reverse: getReverse(),
39335
- suggestedMax: (_d2 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _d2.suggestedMax,
39336
- suggestedMin: (_e2 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _e2.suggestedMin,
39337
- min: isDirectionCompatibleWithAxisType ? (_f2 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _f2.min : void 0,
39338
- max: isDirectionCompatibleWithAxisType ? (_g2 = options == null ? void 0 : options.additionalAxesOptions) == null ? void 0 : _g2.max : void 0,
39326
+ suggestedMax: (_g2 = (_f2 = chart2.options) == null ? void 0 : _f2.additionalAxesOptions) == null ? void 0 : _g2.suggestedMax,
39327
+ suggestedMin: (_i2 = (_h2 = chart2.options) == null ? void 0 : _h2.additionalAxesOptions) == null ? void 0 : _i2.suggestedMin,
39328
+ min: isDirectionCompatibleWithAxisType ? (_k2 = (_j2 = chart2.options) == null ? void 0 : _j2.additionalAxesOptions) == null ? void 0 : _k2.min : void 0,
39329
+ max: isDirectionCompatibleWithAxisType ? (_m2 = (_l2 = chart2.options) == null ? void 0 : _l2.additionalAxesOptions) == null ? void 0 : _m2.max : void 0,
39339
39330
  title: {
39340
- display: ((_h2 = axisData == null ? void 0 : axisData.label) == null ? void 0 : _h2.length) || ((_i2 = axisData == null ? void 0 : axisData.unit) == null ? void 0 : _i2.length),
39331
+ display: ((_n2 = axisData == null ? void 0 : axisData.label) == null ? void 0 : _n2.length) || ((_o2 = axisData == null ? void 0 : axisData.unit) == null ? void 0 : _o2.length),
39341
39332
  text: (axisData == null ? void 0 : axisData.label) || (axisData == null ? void 0 : axisData.unit),
39342
39333
  padding: 0
39343
39334
  },
@@ -39345,7 +39336,7 @@ const getBarChartAxis = ({
39345
39336
  grid: {
39346
39337
  ...grid
39347
39338
  },
39348
- stacked: getStackedOptions(axisType, options == null ? void 0 : options.additionalAxesOptions)
39339
+ stacked: (_q2 = (_p2 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _p2.additionalAxesOptions) == null ? void 0 : _q2.stacked
39349
39340
  };
39350
39341
  };
39351
39342
  const getBarChartAxes = (chart2, axisType) => {
@@ -39565,9 +39556,7 @@ const defaultAdditionalAxesOptions$1 = (options) => ({
39565
39556
  suggestedMin: options == null ? void 0 : options.suggestedMin,
39566
39557
  suggestedMax: options == null ? void 0 : options.suggestedMax,
39567
39558
  min: options == null ? void 0 : options.min,
39568
- max: options == null ? void 0 : options.max,
39569
- stackedX: options == null ? void 0 : options.stackedX,
39570
- stackedY: options == null ? void 0 : options.stackedY
39559
+ max: options == null ? void 0 : options.max
39571
39560
  });
39572
39561
  const defaultChartStyling$1 = (styling) => ({
39573
39562
  width: styling == null ? void 0 : styling.width,
@@ -39646,6 +39635,8 @@ const getDefaultProps$1 = (props) => {
39646
39635
  };
39647
39636
  Chart$2.register(
39648
39637
  LinearScale$1,
39638
+ PointElement$1,
39639
+ LineElement$1,
39649
39640
  CategoryScale$1,
39650
39641
  LogarithmicScale$1,
39651
39642
  BarElement$1,