@devgateway/dvz-ui-react
Version:
A modular, embeddable React component library for data visualization and UI, built with TypeScript. Provides reusable components for charts, maps, dashboards, and more, with built-in support for internationalization and Redux integration.
31 lines (30 loc) • 912 B
JavaScript
const n = (e) => {
const { metadata: t } = e || {}, r = {};
return t && t.measures.forEach((a) => {
r[a.value] = a;
}), r;
}, i = (e) => {
const { metadata: t } = e || {}, r = {};
return t && t.types.forEach((a) => {
r[a.dimension] = {
dimension: a.dimension,
category: a.category,
items: a.items
};
}), r;
}, l = (e, t) => e ? e.labels && e.labels[t.toUpperCase()] ? e.labels[t.toUpperCase()] : e.label ? e.label : e.value : null, o = (e, t, r, a) => new Intl.Collator(t, {
caseFirst: "upper",
numeric: !0,
sensitivity: "variant"
}).compare(e ? a : r, e ? r : a), u = (e, t, r) => e ? r - t : t - r, c = (e, t, r) => {
let a = Date.parse(t + ""), s = Date.parse(r + "");
return !isNaN(a) && !isNaN(s) ? e ? s - a : a - s : 0;
};
export {
o as alphaSort,
c as dateSort,
l as getTranslatedValue,
n as measuresMap,
u as numericSort,
i as typesMap
};