laif-ds
Version:
Design System di Laif con componenti React basati su principi di Atomic Design
129 lines (128 loc) • 3.65 kB
JavaScript
"use client";
import { createSelector as n } from "../../../../reselect/dist/reselect.js";
import { selectChartWidth as f, selectChartHeight as m } from "./containerSelectors.js";
import { selectChartOffset as k } from "./selectChartOffset.js";
import { getMaxRadius as D } from "../../util/PolarUtils.js";
import { getPercentValue as t } from "../../util/DataUtils.js";
import { defaultPolarAngleAxisProps as a } from "../../polar/defaultPolarAngleAxisProps.js";
import { defaultPolarRadiusAxisProps as i } from "../../polar/defaultPolarRadiusAxisProps.js";
import { combineAxisRangeWithReverse as A } from "./combiners/combineAxisRangeWithReverse.js";
import { selectChartLayout as C } from "../../context/chartLayoutContext.js";
var R = {
allowDataOverflow: !1,
allowDecimals: !1,
allowDuplicatedCategory: !1,
// defaultPolarAngleAxisProps.allowDuplicatedCategory has it set to true but the actual axis rendering ignores the prop because reasons,
dataKey: void 0,
domain: void 0,
id: a.angleAxisId,
includeHidden: !1,
name: void 0,
reversed: a.reversed,
scale: a.scale,
tick: a.tick,
tickCount: void 0,
ticks: void 0,
type: a.type,
unit: void 0
}, O = {
allowDataOverflow: i.allowDataOverflow,
allowDecimals: !1,
allowDuplicatedCategory: i.allowDuplicatedCategory,
dataKey: void 0,
domain: void 0,
id: i.radiusAxisId,
includeHidden: !1,
name: void 0,
reversed: !1,
scale: i.scale,
tick: i.tick,
tickCount: i.tickCount,
ticks: void 0,
type: i.type,
unit: void 0
}, P = {
allowDataOverflow: !1,
allowDecimals: !1,
allowDuplicatedCategory: a.allowDuplicatedCategory,
dataKey: void 0,
domain: void 0,
id: a.angleAxisId,
includeHidden: !1,
name: void 0,
reversed: !1,
scale: a.scale,
tick: a.tick,
tickCount: void 0,
ticks: void 0,
type: "number",
unit: void 0
}, H = {
allowDataOverflow: i.allowDataOverflow,
allowDecimals: !1,
allowDuplicatedCategory: i.allowDuplicatedCategory,
dataKey: void 0,
domain: void 0,
id: i.radiusAxisId,
includeHidden: !1,
name: void 0,
reversed: !1,
scale: i.scale,
tick: i.tick,
tickCount: i.tickCount,
ticks: void 0,
type: "category",
unit: void 0
}, K = (e, l) => e.polarAxis.angleAxis[l] != null ? e.polarAxis.angleAxis[l] : e.layout.layoutType === "radial" ? P : R, b = (e, l) => e.polarAxis.radiusAxis[l] != null ? e.polarAxis.radiusAxis[l] : e.layout.layoutType === "radial" ? H : O, d = (e) => e.polarOptions, u = n([f, m, k], D), p = n([d, u], (e, l) => {
if (e != null)
return t(e.innerRadius, l, 0);
}), g = n([d, u], (e, l) => {
if (e != null)
return t(e.outerRadius, l, l * 0.8);
}), I = (e) => {
if (e == null)
return [0, 0];
var {
startAngle: l,
endAngle: r
} = e;
return [l, r];
}, W = n([d], I);
n([K, W], A);
var h = n([u, p, g], (e, l, r) => {
if (!(e == null || l == null || r == null))
return [l, r];
});
n([b, h], A);
n([C, d, p, g, f, m], (e, l, r, s, c, o) => {
if (!(e !== "centric" && e !== "radial" || l == null || r == null || s == null)) {
var {
cx: v,
cy: x,
startAngle: y,
endAngle: w
} = l;
return {
cx: t(v, c, c / 2),
cy: t(x, o, o / 2),
innerRadius: r,
outerRadius: s,
startAngle: y,
endAngle: w,
clockWise: !1
};
}
});
export {
R as implicitAngleAxis,
P as implicitRadialBarAngleAxis,
H as implicitRadialBarRadiusAxis,
O as implicitRadiusAxis,
K as selectAngleAxis,
W as selectAngleAxisRange,
u as selectMaxRadius,
g as selectOuterRadius,
d as selectPolarOptions,
b as selectRadiusAxis,
h as selectRadiusAxisRange
};