laif-ds
Version:
Design System di Laif con componenti React basati su principi di Atomic Design
76 lines (75 loc) • 5.1 kB
JavaScript
"use client";
import { createSelector as e } from "../../../../reselect/dist/reselect.js";
import { selectAxisSettings as L, combineScaleFunction as P, combineDisplayedData as O, selectHasBar as W, combineRealScaleType as w, selectAxisRange as F, combineDuplicateDomain as H, combineCategoricalDomain as z, combineAxisDomainWithNiceTicks as K, combineGraphicalItemsData as U, combineAppliedValues as j, combineAxisDomain as q, combineNiceTicks as J, combineGraphicalItemsSettings as M, combineNumericalDomain as Q, itemAxisPredicate as X, getDomainDefinition as Y, combineDomainOfStackGroups as Z, combineAppliedNumericalValuesIncludingErrorValues as _, mergeDomains as $, combineStackGroups as ee, filterGraphicalNotStackedItems as ie, combineDotsDomain as te, combineLinesDomain as oe, combineAreasDomain as re, selectReferenceDots as ae, filterReferenceElements as u, selectReferenceLines as le, selectReferenceAreas as se } from "./axisSelectors.js";
import { selectChartLayout as c } from "../../context/chartLayoutContext.js";
import { isCategoricalAxis as ce } from "../../util/ChartUtils.js";
import { selectChartDataWithIndexes as I } from "./dataSelectors.js";
import { selectChartName as ne, selectStackOffsetType as y } from "./rootPropsSelectors.js";
import { mathSign as me } from "../../util/DataUtils.js";
import { combineAxisRangeWithReverse as pe } from "./combiners/combineAxisRangeWithReverse.js";
import { selectDefaultTooltipEventType as ve, selectValidateTooltipEventTypes as fe, combineTooltipEventType as Te } from "./selectTooltipEventType.js";
import { combineActiveLabel as de } from "./combiners/combineActiveLabel.js";
import { selectTooltipSettings as ue } from "./selectTooltipSettings.js";
import { combineTooltipInteractionState as Ae } from "./combiners/combineTooltipInteractionState.js";
import { combineActiveTooltipIndex as xe } from "./combiners/combineActiveTooltipIndex.js";
import { combineCoordinateForDefaultIndex as De } from "./combiners/combineCoordinateForDefaultIndex.js";
import { selectChartWidth as be, selectChartHeight as ge } from "./containerSelectors.js";
import { selectChartOffset as he } from "./selectChartOffset.js";
import { combineTooltipPayloadConfigurations as Ie } from "./combiners/combineTooltipPayloadConfigurations.js";
import { selectTooltipPayloadSearcher as ye } from "./selectTooltipPayloadSearcher.js";
import { selectTooltipState as R } from "./selectTooltipState.js";
var t = (i) => {
var o = c(i);
return o === "horizontal" ? "xAxis" : o === "vertical" ? "yAxis" : o === "centric" ? "angleAxis" : "radiusAxis";
}, p = (i) => i.tooltip.settings.axisId, r = (i) => {
var o = t(i), l = p(i);
return L(i, o, l);
}, A = e([r, c, W, ne, t], w), Re = e([(i) => i.graphicalItems.cartesianItems, (i) => i.graphicalItems.polarItems], (i, o) => [...i, ...o]), Se = e([t, p], X), f = e([Re, r, Se], M), Ce = e([f], U), v = e([Ce, I], O), x = e([v, r, f], j), ke = e([r], Y), Ge = e([v, f, y], ee), Ne = e([Ge, I, t], Z), Ee = e([f], ie), Ve = e([v, r, Ee, t], _), Be = e([ae, t, p], u), Le = e([Be, t], te), Pe = e([se, t, p], u), Oe = e([Pe, t], re), We = e([le, t, p], u), we = e([We, t], oe), Fe = e([Le, we, Oe], $), He = e([r, ke, Ne, Ve, Fe], Q), S = e([r, c, v, x, y, t, He], q), ze = e([S, r, A], J), Ke = e([r, S, ze, t], K), C = (i) => {
var o = t(i), l = p(i), a = !1;
return F(i, o, l, a);
}, Ue = e([r, C], pe), je = e([r, A, Ke, Ue], P), qe = e([c, x, r, t], H), Je = e([c, x, r, t], z), Me = (i, o, l, a, n, b, g, h) => {
if (o) {
var {
type: E
} = o, V = ce(i, h);
if (a) {
var B = l === "scaleBand" && a.bandwidth ? a.bandwidth() / 2 : 2, s = E === "category" && a.bandwidth ? a.bandwidth() / B : 0;
return s = h === "angleAxis" && n != null && n?.length >= 2 ? me(n[0] - n[1]) * 2 * s : s, V && g ? g.map((m, d) => ({
coordinate: a(m) + s,
value: m,
index: d,
offset: s
})) : a.domain().map((m, d) => ({
coordinate: a(m) + s,
value: b ? b[m] : m,
index: d,
offset: s
}));
}
}
}, k = e([c, r, A, je, C, qe, Je, t], Me), G = e([ve, fe, ue], (i, o, l) => Te(l.shared, i, o)), N = (i) => i.tooltip.settings.trigger, D = (i) => i.tooltip.settings.defaultIndex, T = e([R, G, N, D], Ae), Qe = e([T, v], xe);
e([k, Qe], de);
e([T], (i) => {
if (i)
return i.dataKey;
});
var Xe = e([R, G, N, D], Ie), Ye = e([be, ge, c, he, k, D, Xe, ye], De);
e([T, Ye], (i, o) => i != null && i.coordinate ? i.coordinate : o);
e([T], (i) => i.active);
export {
Qe as selectActiveTooltipIndex,
f as selectAllGraphicalItemsSettings,
Re as selectAllUnfilteredGraphicalItems,
r as selectTooltipAxis,
S as selectTooltipAxisDomain,
Ke as selectTooltipAxisDomainIncludingNiceTicks,
p as selectTooltipAxisId,
Ue as selectTooltipAxisRangeWithReverse,
A as selectTooltipAxisRealScaleType,
je as selectTooltipAxisScale,
k as selectTooltipAxisTicks,
t as selectTooltipAxisType,
Je as selectTooltipCategoricalDomain,
v as selectTooltipDisplayedData,
Ce as selectTooltipGraphicalItemsData
};