@oliasoft-open-source/charts-library 3.5.3-beta-6 → 3.5.3
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 +5 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22275,12 +22275,9 @@ const initialState = ({ options, persistenceId }) => {
|
|
|
22275
22275
|
} = options;
|
|
22276
22276
|
const getStateAxesByType = (axisType, customAxesRange2) => {
|
|
22277
22277
|
var _a2, _b2, _c2, _d2, _e2;
|
|
22278
|
-
console.log("axisType", axisType);
|
|
22279
|
-
console.log("axes", axes);
|
|
22280
22278
|
if (!axes[axisType]) {
|
|
22281
22279
|
return [];
|
|
22282
22280
|
}
|
|
22283
|
-
console.log("getStateAxesByType");
|
|
22284
22281
|
if (((_a2 = axes[axisType]) == null ? void 0 : _a2.length) > 1) {
|
|
22285
22282
|
return axes[axisType].map(
|
|
22286
22283
|
(axisObj, index2) => {
|
|
@@ -22303,7 +22300,6 @@ const initialState = ({ options, persistenceId }) => {
|
|
|
22303
22300
|
const customMin = (_b2 = customAxesRange2 == null ? void 0 : customAxesRange2[id]) == null ? void 0 : _b2.min;
|
|
22304
22301
|
const customMax = (_c2 = customAxesRange2 == null ? void 0 : customAxesRange2[id]) == null ? void 0 : _c2.max;
|
|
22305
22302
|
const unit = (_e2 = (_d2 = axes == null ? void 0 : axes[id]) == null ? void 0 : _d2[0]) == null ? void 0 : _e2.unit;
|
|
22306
|
-
console.log("id", id);
|
|
22307
22303
|
return [
|
|
22308
22304
|
{
|
|
22309
22305
|
id,
|
|
@@ -22318,7 +22314,6 @@ const initialState = ({ options, persistenceId }) => {
|
|
|
22318
22314
|
const xStateAxes = getStateAxesByType(AxisType.X, customAxesRange);
|
|
22319
22315
|
const yStateAxes = getStateAxesByType(AxisType.Y, customAxesRange);
|
|
22320
22316
|
const stateAxes = [...xStateAxes, ...yStateAxes];
|
|
22321
|
-
console.log("stateAxes", stateAxes);
|
|
22322
22317
|
const {
|
|
22323
22318
|
zoomEnabled,
|
|
22324
22319
|
panEnabled,
|
|
@@ -23716,9 +23711,9 @@ const useChartFunctions = ({
|
|
|
23716
23711
|
const onResetAxes = useCallback(() => {
|
|
23717
23712
|
dispatch({ type: RESET_AXES_RANGES });
|
|
23718
23713
|
}, []);
|
|
23719
|
-
const onUpdateAxes = ({ axes: axes2 }) => {
|
|
23714
|
+
const onUpdateAxes = useCallback(({ axes: axes2 }) => {
|
|
23720
23715
|
dispatch({ type: UPDATE_AXES_RANGES, payload: { axes: axes2 } });
|
|
23721
|
-
};
|
|
23716
|
+
}, []);
|
|
23722
23717
|
return {
|
|
23723
23718
|
legendClick,
|
|
23724
23719
|
resetZoom: resetZoom2,
|
|
@@ -25270,7 +25265,7 @@ const useChartOptions = ({
|
|
|
25270
25265
|
);
|
|
25271
25266
|
const scales = useMemo(
|
|
25272
25267
|
() => autoScale(options, state, generatedDatasets, chartRef),
|
|
25273
|
-
[options, state, generatedDatasets
|
|
25268
|
+
[options, state, generatedDatasets]
|
|
25274
25269
|
);
|
|
25275
25270
|
const dragData = useMemo(
|
|
25276
25271
|
() => enableDragPoints && getDraggableData(options),
|
|
@@ -25353,7 +25348,7 @@ const useChartOptions = ({
|
|
|
25353
25348
|
plugins,
|
|
25354
25349
|
events: Object.values(Events)
|
|
25355
25350
|
}),
|
|
25356
|
-
[state, options
|
|
25351
|
+
[state, options]
|
|
25357
25352
|
);
|
|
25358
25353
|
};
|
|
25359
25354
|
const useChartPlugins = ({ options, resetZoom: resetZoom2 }) => {
|
|
@@ -25434,12 +25429,7 @@ const useUpdateAxesRanges = (range, dispatch) => {
|
|
|
25434
25429
|
min: min ?? 0,
|
|
25435
25430
|
max: max ?? 0
|
|
25436
25431
|
})) : null;
|
|
25437
|
-
if (!isEqual(axes, prevAxes.current)
|
|
25438
|
-
console.log("------------");
|
|
25439
|
-
console.log("WRONG");
|
|
25440
|
-
console.log(axes);
|
|
25441
|
-
console.log(prevAxes.current);
|
|
25442
|
-
console.log("------------");
|
|
25432
|
+
if (!isEqual(axes, prevAxes.current)) {
|
|
25443
25433
|
dispatch({
|
|
25444
25434
|
type: UPDATE_AXES_RANGES,
|
|
25445
25435
|
payload: { axes }
|
|
@@ -25452,7 +25442,6 @@ const useSaveInitialAxesRanges = (chartRef, axes, generatedDatasets, dispatch) =
|
|
|
25452
25442
|
const saveInitialAxesRanges = useCallback(() => {
|
|
25453
25443
|
if (chartRef && !isEqual(generatedDatasets, prevGeneratedDatasets.current)) {
|
|
25454
25444
|
const initialAxesRanges = getAxesRangesFromChart(chartRef, axes);
|
|
25455
|
-
console.log("initialAxesRanges", initialAxesRanges);
|
|
25456
25445
|
dispatch({
|
|
25457
25446
|
type: SAVE_INITIAL_AXES_RANGES,
|
|
25458
25447
|
payload: { initialAxesRanges }
|
|
@@ -25735,8 +25724,6 @@ const LineChart = (props) => {
|
|
|
25735
25724
|
generatedDatasets
|
|
25736
25725
|
});
|
|
25737
25726
|
const usePlugins = useChartPlugins({ options, resetZoom: resetZoom2 });
|
|
25738
|
-
console.log("State", state);
|
|
25739
|
-
console.log("options", options);
|
|
25740
25727
|
return /* @__PURE__ */ jsxs(
|
|
25741
25728
|
"div",
|
|
25742
25729
|
{
|