@frontify/fondue-charts
Version:
Frontify's data viz library
23 lines (22 loc) • 668 B
JavaScript
import { getRoundFactor as g } from "./getNonZeroLinearScaleDomain.es.js";
const x = (n) => {
if (!n[0])
return 0;
let t = 0;
const o = n[0].dataPoints.length;
for (let a = 0; a < o; a++) {
const c = n.reduce((u, m) => {
var r;
return u + (((r = m == null ? void 0 : m.dataPoints[a]) == null ? void 0 : r.value) || 0);
}, 0);
t = Math.max(t, c);
}
return t;
}, d = (n, t) => {
const o = x(n), a = g(Math.max(o, t ?? 0)), c = Math.ceil(Math.max(o, t || 0) / a) * a;
return c === 0 ? [0, 1] : [0, c];
};
export {
d as getNonZeroLinearStackingScaleDomain
};
//# sourceMappingURL=getNonZeroLinearStackingScaleDomain.es.js.map