UNPKG

laif-ds

Version:

Design System di Laif con componenti React basati su principi di Atomic Design

130 lines (129 loc) 3.72 kB
"use client"; import { createSelector as n } from "../../../../reselect/dist/reselect.js"; import { selectChartWidth as f, selectChartHeight as m } from "./containerSelectors.js"; import { selectChartOffsetInternal as k } from "./selectChartOffsetInternal.js"; import { getMaxRadius as D } from "../../util/PolarUtils.js"; import { getPercentValue as t } from "../../util/DataUtils.js"; import { defaultPolarAngleAxisProps as i } from "../../polar/defaultPolarAngleAxisProps.js"; import { defaultPolarRadiusAxisProps as a } 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: i.angleAxisId, includeHidden: !1, name: void 0, reversed: i.reversed, scale: i.scale, tick: i.tick, tickCount: void 0, ticks: void 0, type: i.type, unit: void 0 }, O = { allowDataOverflow: a.allowDataOverflow, allowDecimals: !1, allowDuplicatedCategory: a.allowDuplicatedCategory, dataKey: void 0, domain: void 0, id: a.radiusAxisId, includeHidden: !1, name: void 0, reversed: !1, scale: a.scale, tick: a.tick, tickCount: a.tickCount, ticks: void 0, type: a.type, unit: void 0 }, P = { allowDataOverflow: !1, allowDecimals: !1, allowDuplicatedCategory: i.allowDuplicatedCategory, dataKey: void 0, domain: void 0, id: i.angleAxisId, includeHidden: !1, name: void 0, reversed: !1, scale: i.scale, tick: i.tick, tickCount: void 0, ticks: void 0, type: "number", unit: void 0 }, H = { allowDataOverflow: a.allowDataOverflow, allowDecimals: !1, allowDuplicatedCategory: a.allowDuplicatedCategory, dataKey: void 0, domain: void 0, id: a.radiusAxisId, includeHidden: !1, name: void 0, reversed: !1, scale: a.scale, tick: a.tick, tickCount: a.tickCount, ticks: void 0, type: "category", unit: void 0 }, I = (e, l) => e.polarAxis.angleAxis[l] != null ? e.polarAxis.angleAxis[l] : e.layout.layoutType === "radial" ? P : R, K = (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); }), b = (e) => { if (e == null) return [0, 0]; var { startAngle: l, endAngle: r } = e; return [l, r]; }, W = n([d], b); n([I, W], A); var h = n([u, p, g], (e, l, r) => { if (!(e == null || l == null || r == null)) return [l, r]; }); n([K, 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 // this property look useful, why not use it? }; } }); export { R as implicitAngleAxis, P as implicitRadialBarAngleAxis, H as implicitRadialBarRadiusAxis, O as implicitRadiusAxis, I as selectAngleAxis, W as selectAngleAxisRange, u as selectMaxRadius, g as selectOuterRadius, d as selectPolarOptions, K as selectRadiusAxis, h as selectRadiusAxisRange };