@oliasoft-open-source/charts-library 9.1.0-beta-4 → 9.1.0
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 +12 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34244,11 +34244,6 @@ var AxesOptionsPopover = (optionsPopover) => {
|
|
|
34244
34244
|
onChange: onToggleEqualScale
|
|
34245
34245
|
})
|
|
34246
34246
|
}),
|
|
34247
|
-
equalScaleEnabled && /* @__PURE__ */ jsx(Text, {
|
|
34248
|
-
small: true,
|
|
34249
|
-
muted: true,
|
|
34250
|
-
children: translations.equalAxisScaleReadOnly
|
|
34251
|
-
}),
|
|
34252
34247
|
formState.localAxes.map((axis) => {
|
|
34253
34248
|
const axisLabel = controlsAxesLabels.find((el) => el.id === axis.id)?.label || startCase(axis.id);
|
|
34254
34249
|
const axisErrors = errors.find((err) => err.id === axis.id);
|
|
@@ -34303,6 +34298,7 @@ var AxesOptionsPopover = (optionsPopover) => {
|
|
|
34303
34298
|
}, axis.id);
|
|
34304
34299
|
}),
|
|
34305
34300
|
depthType?.options?.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ButtonGroup, {
|
|
34301
|
+
disabled: equalScaleEnabled,
|
|
34306
34302
|
items: depthType.options.map((depth, i) => ({
|
|
34307
34303
|
key: i,
|
|
34308
34304
|
label: depth
|
|
@@ -34317,6 +34313,11 @@ var AxesOptionsPopover = (optionsPopover) => {
|
|
|
34317
34313
|
small: true,
|
|
34318
34314
|
value: depthType.options.indexOf(formState.depthType)
|
|
34319
34315
|
}), /* @__PURE__ */ jsx(Spacer, {})] }),
|
|
34316
|
+
equalScaleEnabled && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Text, {
|
|
34317
|
+
small: true,
|
|
34318
|
+
muted: true,
|
|
34319
|
+
children: translations.equalAxisScaleReadOnly
|
|
34320
|
+
}), /* @__PURE__ */ jsx(Spacer, {})] }),
|
|
34320
34321
|
/* @__PURE__ */ jsxs(Flex, {
|
|
34321
34322
|
gap: "8px",
|
|
34322
34323
|
alignItems: "center",
|
|
@@ -36691,6 +36692,7 @@ var getEqualScaleRanges = (x, y, width, height) => {
|
|
|
36691
36692
|
*/
|
|
36692
36693
|
var createEqualScalePlugin = (onAxesUpdate) => {
|
|
36693
36694
|
let fitting = false;
|
|
36695
|
+
let wasEnabled = false;
|
|
36694
36696
|
return {
|
|
36695
36697
|
id: "equalAxisScale",
|
|
36696
36698
|
beforeRender() {
|
|
@@ -36700,9 +36702,13 @@ var createEqualScalePlugin = (onAxesUpdate) => {
|
|
|
36700
36702
|
if (fitting) return;
|
|
36701
36703
|
const { x, y } = chart.scales;
|
|
36702
36704
|
if (!enabled || Object.keys(chart.scales).length !== 2 || x?.type !== "linear" || y?.type !== "linear") {
|
|
36703
|
-
|
|
36705
|
+
if (wasEnabled) {
|
|
36706
|
+
wasEnabled = false;
|
|
36707
|
+
onAxesUpdate();
|
|
36708
|
+
}
|
|
36704
36709
|
return;
|
|
36705
36710
|
}
|
|
36711
|
+
wasEnabled = true;
|
|
36706
36712
|
const baseX = {
|
|
36707
36713
|
min: x.min,
|
|
36708
36714
|
max: x.max
|
package/package.json
CHANGED