impaktapps-design 0.2.994-offset.8 → 0.2.995
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/impaktapps-design.es.js +31 -31
- package/dist/impaktapps-design.es.js.map +1 -1
- package/dist/impaktapps-design.umd.js +8 -8
- package/dist/impaktapps-design.umd.js.map +1 -1
- package/dist/src/component/BottomAxis.d.ts +1 -1
- package/dist/src/component/LeftAxis.d.ts +1 -1
- package/package.json +1 -1
- package/src/component/BarGraph/BarGraph.tsx +21 -11
- package/src/component/BarGraph/DrawBarGraph.tsx +15 -9
- package/src/component/BarGraph/DrawHorizontalBarGraph.tsx +6 -6
- package/src/component/BarGraph/HorizontalBarGraph.tsx +19 -10
- package/src/component/BottomAxis.tsx +1 -2
- package/src/component/LeftAxis.tsx +1 -2
- package/src/component/LineGraph/DrawLineGraph.tsx +37 -24
- package/src/component/LineGraph/LineGraph.tsx +16 -8
|
@@ -8132,8 +8132,7 @@ function AxisBottom(_ref) {
|
|
|
8132
8132
|
}
|
|
8133
8133
|
const LeftAxis = ({
|
|
8134
8134
|
value,
|
|
8135
|
-
yScale
|
|
8136
|
-
parentWidth
|
|
8135
|
+
yScale
|
|
8137
8136
|
}) => {
|
|
8138
8137
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t5, _u, _v, _w;
|
|
8139
8138
|
const isBandScale = typeof yScale.bandwidth === "function";
|
|
@@ -8165,11 +8164,9 @@ const LeftAxis = ({
|
|
|
8165
8164
|
});
|
|
8166
8165
|
};
|
|
8167
8166
|
const BottomAxis = ({
|
|
8168
|
-
data,
|
|
8169
8167
|
yMax,
|
|
8170
8168
|
value,
|
|
8171
8169
|
xScale,
|
|
8172
|
-
parentWidth,
|
|
8173
8170
|
left: left2
|
|
8174
8171
|
}) => {
|
|
8175
8172
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
@@ -9711,7 +9708,7 @@ function DrawBarGraph({
|
|
|
9711
9708
|
margin: margin2 = defaultMargin$1,
|
|
9712
9709
|
value
|
|
9713
9710
|
}) {
|
|
9714
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
9711
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
9715
9712
|
const data = (_a = value.main) == null ? void 0 : _a.data;
|
|
9716
9713
|
const keys2 = Object.keys(data[0]).filter((d2) => d2 !== value.main.xAxisValue);
|
|
9717
9714
|
const [hoveredBar, setHoveredBar] = useState({
|
|
@@ -9742,6 +9739,7 @@ function DrawBarGraph({
|
|
|
9742
9739
|
domain: keys2,
|
|
9743
9740
|
range: value.style.barStyle.colorRange
|
|
9744
9741
|
});
|
|
9742
|
+
margin2.bottom = ((_c = value.main) == null ? void 0 : _c.bottomAxisAngle) ? 50 + 40 : margin2.bottom;
|
|
9745
9743
|
const xMax = width2 - margin2.left - margin2.right;
|
|
9746
9744
|
const yMax = height2 - margin2.top - margin2.bottom;
|
|
9747
9745
|
dateScale.rangeRound([0, xMax]);
|
|
@@ -9794,7 +9792,7 @@ function DrawBarGraph({
|
|
|
9794
9792
|
return date2 == null ? void 0 : date2.bars.reduce((totalWidth, bar) => totalWidth + Math.min(bar.width, 15), 0);
|
|
9795
9793
|
}
|
|
9796
9794
|
return width2 < 10 ? null : /* @__PURE__ */ jsxs("div", {
|
|
9797
|
-
children: [((
|
|
9795
|
+
children: [((_d = value == null ? void 0 : value.main) == null ? void 0 : _d.legendAvailable) && keys2.length > 1 && /* @__PURE__ */ jsx(Legend, {
|
|
9798
9796
|
dataKeyArray: keys2,
|
|
9799
9797
|
colorRange: value.style.barStyle.colorRange,
|
|
9800
9798
|
value,
|
|
@@ -9827,16 +9825,16 @@ function DrawBarGraph({
|
|
|
9827
9825
|
style: {
|
|
9828
9826
|
display: hoveredBar.date ? "block" : "none"
|
|
9829
9827
|
},
|
|
9830
|
-
x: value.main.type === "StackBarGraph" ? ((
|
|
9831
|
-
width: value.main.type !== "StackBarGraph" ? calcWidthofBar(hoveredBar == null ? void 0 : hoveredBar.date) : Math.min((
|
|
9828
|
+
x: value.main.type === "StackBarGraph" ? ((_e = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _e.bars[hoveredBar.city].x) - (Math.min((_f = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _f.bars[0].width, 15) - ((_g = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _g.bars[0].width)) / 2 : ((_h = hoveredBar.date) == null ? void 0 : _h.x0) - (Math.min((_i = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _i.bars[0].width, 15) - ((_j = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _j.bars[0].width)) || 0,
|
|
9829
|
+
width: value.main.type !== "StackBarGraph" ? calcWidthofBar(hoveredBar == null ? void 0 : hoveredBar.date) : Math.min((_k = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _k.bars[0].width, 15),
|
|
9832
9830
|
height: yMax,
|
|
9833
|
-
fill: (
|
|
9831
|
+
fill: (_m = (_l = value.style) == null ? void 0 : _l.barStyle) == null ? void 0 : _m.hoverBackgroundColor,
|
|
9834
9832
|
opacity: 1
|
|
9835
9833
|
}), /* @__PURE__ */ jsx(LeftAxis, {
|
|
9836
9834
|
value,
|
|
9837
9835
|
yScale: tempScale,
|
|
9838
9836
|
parentWidth: width2
|
|
9839
|
-
}), ((
|
|
9837
|
+
}), ((_n = value == null ? void 0 : value.main) == null ? void 0 : _n.type) === "StackBarGraph" ? /* @__PURE__ */ jsx(BarStack, {
|
|
9840
9838
|
data,
|
|
9841
9839
|
keys: keys2,
|
|
9842
9840
|
x: getDate,
|
|
@@ -10407,7 +10405,7 @@ const BarGraph = ({
|
|
|
10407
10405
|
const barData = finalDataProvider((_a = value == null ? void 0 : value.main) == null ? void 0 : _a.type, value, theme);
|
|
10408
10406
|
let GraphRender = /* @__PURE__ */ jsx(ParentSize$1, {
|
|
10409
10407
|
children: (parent) => {
|
|
10410
|
-
var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n
|
|
10408
|
+
var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
10411
10409
|
return /* @__PURE__ */ jsx(DrawBarGraph, {
|
|
10412
10410
|
theme,
|
|
10413
10411
|
width: parent.width || 800,
|
|
@@ -10415,8 +10413,8 @@ const BarGraph = ({
|
|
|
10415
10413
|
margin: {
|
|
10416
10414
|
top: ((_e2 = (_d2 = (_c2 = barData == null ? void 0 : barData.style) == null ? void 0 : _c2.labelStyle) == null ? void 0 : _d2.margin) == null ? void 0 : _e2.top) || 10,
|
|
10417
10415
|
right: ((_h = (_g = (_f = barData == null ? void 0 : barData.style) == null ? void 0 : _f.labelStyle) == null ? void 0 : _g.margin) == null ? void 0 : _h.right) || 10,
|
|
10418
|
-
bottom:
|
|
10419
|
-
left: ((
|
|
10416
|
+
bottom: ((_k = (_j = (_i = barData == null ? void 0 : barData.style) == null ? void 0 : _i.labelStyle) == null ? void 0 : _j.margin) == null ? void 0 : _k.bottom) || 40,
|
|
10417
|
+
left: ((_n = (_m = (_l = barData == null ? void 0 : barData.style) == null ? void 0 : _l.labelStyle) == null ? void 0 : _m.margin) == null ? void 0 : _n.left) || 60
|
|
10420
10418
|
},
|
|
10421
10419
|
value: barData
|
|
10422
10420
|
});
|
|
@@ -20729,7 +20727,7 @@ const DrawGraph = ({
|
|
|
20729
20727
|
margin: margin2 = defaultMargin,
|
|
20730
20728
|
value
|
|
20731
20729
|
}) => {
|
|
20732
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
20730
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
20733
20731
|
const data = (_a = value == null ? void 0 : value.main) == null ? void 0 : _a.data;
|
|
20734
20732
|
const arr = Object.keys(data[0]).filter((d2) => d2 !== value.main.xAxisValue);
|
|
20735
20733
|
const xValues = data.map((d2) => d2[value.main.xAxisValue]);
|
|
@@ -20739,10 +20737,11 @@ const DrawGraph = ({
|
|
|
20739
20737
|
const yScale = createLinearScale({
|
|
20740
20738
|
domain: [0, Math.max(...data.flatMap((d2) => arr.map((key) => d2[key])))]
|
|
20741
20739
|
});
|
|
20740
|
+
margin2.bottom = ((_b = value.main) == null ? void 0 : _b.bottomAxisAngle) ? 50 + 40 : margin2.bottom;
|
|
20742
20741
|
const xMax = width2 - margin2.left - margin2.right;
|
|
20743
20742
|
const yMax = height2 - margin2.top - margin2.bottom;
|
|
20744
|
-
yScale.
|
|
20745
|
-
xScale.rangeRound([margin2.left, xMax + margin2.left]);
|
|
20743
|
+
yScale.rangeRound([yMax + 10, 10]);
|
|
20744
|
+
xScale.rangeRound([Number(margin2.left), xMax + Number(margin2.left)]);
|
|
20746
20745
|
return /* @__PURE__ */ jsxs(Fragment, {
|
|
20747
20746
|
children: [value.main.legendAvailable && /* @__PURE__ */ jsx(Legend, {
|
|
20748
20747
|
value,
|
|
@@ -20764,10 +20763,10 @@ const DrawGraph = ({
|
|
|
20764
20763
|
orientation: "left",
|
|
20765
20764
|
hideAxisLine: value.main.hideLeftAxisLine,
|
|
20766
20765
|
label: value.main.leftLabel,
|
|
20767
|
-
labelOffset: margin2.left -
|
|
20766
|
+
labelOffset: margin2.left - 30 || ((_d = (_c = value.style) == null ? void 0 : _c.labelStyle) == null ? void 0 : _d.leftLabelOffset) || 20,
|
|
20768
20767
|
labelProps: {
|
|
20769
|
-
fill: ((
|
|
20770
|
-
fontSize: ((
|
|
20768
|
+
fill: ((_f = (_e = value.style) == null ? void 0 : _e.labelStyle) == null ? void 0 : _f.labelColor) || "black",
|
|
20769
|
+
fontSize: ((_h = (_g = value.style) == null ? void 0 : _g.labelStyle) == null ? void 0 : _h.fontSize) || "12px",
|
|
20771
20770
|
fontWeight: "normal"
|
|
20772
20771
|
},
|
|
20773
20772
|
tickLabelProps: (e3) => {
|
|
@@ -20784,8 +20783,8 @@ const DrawGraph = ({
|
|
|
20784
20783
|
hideAxisLine: value.main.hideBottomAxisLine,
|
|
20785
20784
|
label: value.main.bottomLabel,
|
|
20786
20785
|
labelProps: {
|
|
20787
|
-
fill: ((
|
|
20788
|
-
fontSize: ((
|
|
20786
|
+
fill: ((_j = (_i = value.style) == null ? void 0 : _i.labelStyle) == null ? void 0 : _j.labelColor) || "black",
|
|
20787
|
+
fontSize: ((_l = (_k = value.style) == null ? void 0 : _k.labelStyle) == null ? void 0 : _l.fontSize) || "12px",
|
|
20789
20788
|
fontWeight: "normal"
|
|
20790
20789
|
},
|
|
20791
20790
|
tickLabelProps: (e3) => {
|
|
@@ -20798,7 +20797,7 @@ const DrawGraph = ({
|
|
|
20798
20797
|
};
|
|
20799
20798
|
},
|
|
20800
20799
|
tickStroke: "black",
|
|
20801
|
-
labelOffset: ((
|
|
20800
|
+
labelOffset: ((_m = value.main) == null ? void 0 : _m.bottomAxisAngle) ? 45 : ((_o = (_n = value.style) == null ? void 0 : _n.labelStyle) == null ? void 0 : _o.bottomLabelOffset) || 20
|
|
20802
20801
|
}), /* @__PURE__ */ jsx(Grid, {
|
|
20803
20802
|
stroke: "black",
|
|
20804
20803
|
lineStyle: {
|
|
@@ -20864,7 +20863,7 @@ const DrawGraph = ({
|
|
|
20864
20863
|
fontWeight: "normal",
|
|
20865
20864
|
color: "black"
|
|
20866
20865
|
},
|
|
20867
|
-
children: [d2, ": "]
|
|
20866
|
+
children: [d2, ":", " "]
|
|
20868
20867
|
})
|
|
20869
20868
|
}), /* @__PURE__ */ jsx("span", {
|
|
20870
20869
|
style: {
|
|
@@ -20918,7 +20917,7 @@ var DrawHorizontalBarGraph = ({
|
|
|
20918
20917
|
margin: margin2,
|
|
20919
20918
|
barValue
|
|
20920
20919
|
}) => {
|
|
20921
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
20920
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
20922
20921
|
const [hoveredBar, setHoveredBar] = useState({
|
|
20923
20922
|
date: null,
|
|
20924
20923
|
city: null
|
|
@@ -20949,6 +20948,7 @@ var DrawHorizontalBarGraph = ({
|
|
|
20949
20948
|
domain: keys2,
|
|
20950
20949
|
range: barValue.style.barStyle.colorRange
|
|
20951
20950
|
});
|
|
20951
|
+
margin2.bottom = ((_c = barValue.main) == null ? void 0 : _c.bottomAxisAngle) ? 50 + 40 : margin2.bottom;
|
|
20952
20952
|
const xMax = width2 - margin2.left - margin2.right;
|
|
20953
20953
|
const yMax = height2 - margin2.top - margin2.bottom;
|
|
20954
20954
|
temperatureScale.rangeRound([0, xMax]);
|
|
@@ -21001,7 +21001,7 @@ var DrawHorizontalBarGraph = ({
|
|
|
21001
21001
|
return date2 == null ? void 0 : date2.bars.reduce((totalWidth, bar) => totalWidth + Math.min(bar.height, 15), 0);
|
|
21002
21002
|
}
|
|
21003
21003
|
return width2 < 10 ? null : /* @__PURE__ */ jsxs("div", {
|
|
21004
|
-
children: [((
|
|
21004
|
+
children: [((_d = barValue == null ? void 0 : barValue.main) == null ? void 0 : _d.legendAvailable) && keys2.length > 1 && /* @__PURE__ */ jsx(Legend, {
|
|
21005
21005
|
dataKeyArray: keys2,
|
|
21006
21006
|
colorRange: barValue.style.barStyle.colorRange,
|
|
21007
21007
|
value: barValue,
|
|
@@ -21034,10 +21034,10 @@ var DrawHorizontalBarGraph = ({
|
|
|
21034
21034
|
style: {
|
|
21035
21035
|
display: hoveredBar.date ? "block" : "none"
|
|
21036
21036
|
},
|
|
21037
|
-
y: barValue.main.type === "HorizontalStackBarGraph" ? ((
|
|
21037
|
+
y: barValue.main.type === "HorizontalStackBarGraph" ? ((_e = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _e.bars[hoveredBar.city].y) - (Math.min((_f = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _f.bars[0].height, 15) - ((_g = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _g.bars[0].height)) / 2 : ((_h = hoveredBar.date) == null ? void 0 : _h.y0) - (Math.min((_i = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _i.bars[0].height, 15) - ((_j = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _j.bars[0].height)) || 0,
|
|
21038
21038
|
width: xMax,
|
|
21039
|
-
height: barValue.main.type !== "HorizontalStackBarGraph" ? calcWidthofBar(hoveredBar == null ? void 0 : hoveredBar.date) : Math.min((
|
|
21040
|
-
fill: (
|
|
21039
|
+
height: barValue.main.type !== "HorizontalStackBarGraph" ? calcWidthofBar(hoveredBar == null ? void 0 : hoveredBar.date) : Math.min((_k = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _k.bars[0].height, 15),
|
|
21040
|
+
fill: (_m = (_l = barValue.style) == null ? void 0 : _l.barStyle) == null ? void 0 : _m.hoverBackgroundColor,
|
|
21041
21041
|
opacity: 1
|
|
21042
21042
|
}), barValue.main.type === "HorizontalStackBarGraph" ? /* @__PURE__ */ jsx(BarStackHorizontal, {
|
|
21043
21043
|
data,
|
|
@@ -21117,7 +21117,7 @@ const HorizontalBarGraph = ({
|
|
|
21117
21117
|
const barData = finalDataProvider("HorizontalBarGraph", value, theme);
|
|
21118
21118
|
let GraphRender = /* @__PURE__ */ jsx(ParentSize$1, {
|
|
21119
21119
|
children: (parent) => {
|
|
21120
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n
|
|
21120
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
21121
21121
|
return /* @__PURE__ */ jsx(DrawHorizontalBarGraph, {
|
|
21122
21122
|
theme,
|
|
21123
21123
|
width: parent.width,
|
|
@@ -21125,8 +21125,8 @@ const HorizontalBarGraph = ({
|
|
|
21125
21125
|
margin: {
|
|
21126
21126
|
top: ((_e = (_d = (_c = barData == null ? void 0 : barData.style) == null ? void 0 : _c.labelStyle) == null ? void 0 : _d.margin) == null ? void 0 : _e.top) || 10,
|
|
21127
21127
|
right: ((_h = (_g = (_f = barData == null ? void 0 : barData.style) == null ? void 0 : _f.labelStyle) == null ? void 0 : _g.margin) == null ? void 0 : _h.right) || 40,
|
|
21128
|
-
bottom:
|
|
21129
|
-
left: ((
|
|
21128
|
+
bottom: ((_k = (_j = (_i = barData == null ? void 0 : barData.style) == null ? void 0 : _i.labelStyle) == null ? void 0 : _j.margin) == null ? void 0 : _k.bottom) || 40,
|
|
21129
|
+
left: ((_n = (_m = (_l = barData == null ? void 0 : barData.style) == null ? void 0 : _l.labelStyle) == null ? void 0 : _m.margin) == null ? void 0 : _n.left) || 60
|
|
21130
21130
|
},
|
|
21131
21131
|
barValue: barData
|
|
21132
21132
|
});
|