laif-ds
Version:
Design System di Laif con componenti React basati su principi di Atomic Design
45 lines (44 loc) • 1.3 kB
JavaScript
"use client";
import "react";
import { useAppSelector as r } from "../state/hooks.js";
import { selectChartViewBox as s, selectChartOffset as n } from "../state/selectors/selectChartOffset.js";
import { selectChartWidth as h, selectChartHeight as u } from "../state/selectors/containerSelectors.js";
import { useIsPanorama as l } from "./PanoramaContext.js";
import { selectBrushDimensions as m, selectBrushSettings as p } from "../state/selectors/brushSelectors.js";
var B = () => {
var t, o = l(), i = r(s), a = r(m), e = (t = r(p)) === null || t === void 0 ? void 0 : t.padding;
return !o || !a || !e ? i : {
width: a.width - e.left - e.right,
height: a.height - e.top - e.bottom,
x: e.left,
y: e.top
};
}, f = {
top: 0,
bottom: 0,
left: 0,
right: 0,
width: 0,
height: 0,
brushBottom: 0
}, x = () => {
var t;
return (t = r(n)) !== null && t !== void 0 ? t : f;
}, I = () => r(h), S = () => r(u), v = {
top: 0,
right: 0,
bottom: 0,
left: 0
}, A = () => {
var t;
return (t = r((o) => o.layout.margin)) !== null && t !== void 0 ? t : v;
}, d = (t) => t.layout.layoutType, O = () => r(d);
export {
d as selectChartLayout,
S as useChartHeight,
O as useChartLayout,
I as useChartWidth,
A as useMargin,
x as useOffset,
B as useViewBox
};