@esic-lab/data-core-ui 0.0.69 → 0.0.71
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/index.css +5 -6
- package/dist/index.d.mts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +36 -10
- package/dist/index.mjs +36 -10
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -71,7 +71,6 @@
|
|
|
71
71
|
--default-font-family: var(--font-sans);
|
|
72
72
|
--default-mono-font-family: var(--font-mono);
|
|
73
73
|
--color-primary-800: #2b3587;
|
|
74
|
-
--color-primary-700: #3745af;
|
|
75
74
|
--color-primary-500: #4e61f6;
|
|
76
75
|
--color-primary-400: #7181f8;
|
|
77
76
|
--color-primary-200: #aeb6fb;
|
|
@@ -978,8 +977,8 @@
|
|
|
978
977
|
.border-b-gray-200 {
|
|
979
978
|
border-bottom-color: var(--color-gray-200);
|
|
980
979
|
}
|
|
981
|
-
.border-b-primary-
|
|
982
|
-
border-bottom-color: var(--color-primary-
|
|
980
|
+
.border-b-primary-500 {
|
|
981
|
+
border-bottom-color: var(--color-primary-500);
|
|
983
982
|
}
|
|
984
983
|
.\!bg-gray-300 {
|
|
985
984
|
background-color: var(--color-gray-300) !important;
|
|
@@ -1110,6 +1109,9 @@
|
|
|
1110
1109
|
.pb-2 {
|
|
1111
1110
|
padding-bottom: calc(var(--spacing) * 2);
|
|
1112
1111
|
}
|
|
1112
|
+
.pb-\[10px\] {
|
|
1113
|
+
padding-bottom: 10px;
|
|
1114
|
+
}
|
|
1113
1115
|
.pb-\[16px\] {
|
|
1114
1116
|
padding-bottom: 16px;
|
|
1115
1117
|
}
|
|
@@ -1225,9 +1227,6 @@
|
|
|
1225
1227
|
.text-primary-500 {
|
|
1226
1228
|
color: var(--color-primary-500);
|
|
1227
1229
|
}
|
|
1228
|
-
.text-primary-700 {
|
|
1229
|
-
color: var(--color-primary-700);
|
|
1230
|
-
}
|
|
1231
1230
|
.text-red-500 {
|
|
1232
1231
|
color: var(--color-red-500);
|
|
1233
1232
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -58,7 +58,7 @@ interface ParamTabSelection {
|
|
|
58
58
|
now: string;
|
|
59
59
|
onClickGoto: (path: string) => void;
|
|
60
60
|
}
|
|
61
|
-
declare const TabSelectionButton: ({ title, now, onClickGoto }: ParamTabSelection) => react_jsx_runtime.JSX.Element;
|
|
61
|
+
declare const TabSelectionButton: ({ title, now, onClickGoto, }: ParamTabSelection) => react_jsx_runtime.JSX.Element;
|
|
62
62
|
|
|
63
63
|
interface TertiaryButtonProps {
|
|
64
64
|
title: string;
|
|
@@ -220,8 +220,9 @@ interface TextInputProps {
|
|
|
220
220
|
value?: string;
|
|
221
221
|
onChange: (value: string) => void;
|
|
222
222
|
disabled?: boolean;
|
|
223
|
+
className?: string;
|
|
223
224
|
}
|
|
224
|
-
declare function TextInput({ label, placeholder, type, maxLength, required, error, value, onChange, disabled, }: TextInputProps): react_jsx_runtime.JSX.Element;
|
|
225
|
+
declare function TextInput({ label, placeholder, type, maxLength, required, error, value, onChange, disabled, className, }: TextInputProps): react_jsx_runtime.JSX.Element;
|
|
225
226
|
|
|
226
227
|
interface TextAreaProps {
|
|
227
228
|
label?: string;
|
|
@@ -642,9 +643,10 @@ type Props = {
|
|
|
642
643
|
};
|
|
643
644
|
yLabel?: string;
|
|
644
645
|
xLabel?: string;
|
|
646
|
+
modeLabel?: "line" | "45";
|
|
645
647
|
colorPalette?: string[];
|
|
646
648
|
};
|
|
647
|
-
declare const BarChart: ({ data, height, margin, yLabel, xLabel, colorPalette, }: Props) => react_jsx_runtime.JSX.Element;
|
|
649
|
+
declare const BarChart: ({ data, height, margin, yLabel, xLabel, modeLabel, colorPalette, }: Props) => react_jsx_runtime.JSX.Element;
|
|
648
650
|
|
|
649
651
|
interface PieChartProps {
|
|
650
652
|
title?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ interface ParamTabSelection {
|
|
|
58
58
|
now: string;
|
|
59
59
|
onClickGoto: (path: string) => void;
|
|
60
60
|
}
|
|
61
|
-
declare const TabSelectionButton: ({ title, now, onClickGoto }: ParamTabSelection) => react_jsx_runtime.JSX.Element;
|
|
61
|
+
declare const TabSelectionButton: ({ title, now, onClickGoto, }: ParamTabSelection) => react_jsx_runtime.JSX.Element;
|
|
62
62
|
|
|
63
63
|
interface TertiaryButtonProps {
|
|
64
64
|
title: string;
|
|
@@ -220,8 +220,9 @@ interface TextInputProps {
|
|
|
220
220
|
value?: string;
|
|
221
221
|
onChange: (value: string) => void;
|
|
222
222
|
disabled?: boolean;
|
|
223
|
+
className?: string;
|
|
223
224
|
}
|
|
224
|
-
declare function TextInput({ label, placeholder, type, maxLength, required, error, value, onChange, disabled, }: TextInputProps): react_jsx_runtime.JSX.Element;
|
|
225
|
+
declare function TextInput({ label, placeholder, type, maxLength, required, error, value, onChange, disabled, className, }: TextInputProps): react_jsx_runtime.JSX.Element;
|
|
225
226
|
|
|
226
227
|
interface TextAreaProps {
|
|
227
228
|
label?: string;
|
|
@@ -642,9 +643,10 @@ type Props = {
|
|
|
642
643
|
};
|
|
643
644
|
yLabel?: string;
|
|
644
645
|
xLabel?: string;
|
|
646
|
+
modeLabel?: "line" | "45";
|
|
645
647
|
colorPalette?: string[];
|
|
646
648
|
};
|
|
647
|
-
declare const BarChart: ({ data, height, margin, yLabel, xLabel, colorPalette, }: Props) => react_jsx_runtime.JSX.Element;
|
|
649
|
+
declare const BarChart: ({ data, height, margin, yLabel, xLabel, modeLabel, colorPalette, }: Props) => react_jsx_runtime.JSX.Element;
|
|
648
650
|
|
|
649
651
|
interface PieChartProps {
|
|
650
652
|
title?: string;
|
package/dist/index.js
CHANGED
|
@@ -529,13 +529,17 @@ function GhostButton({ title, onClick, iconLeft, iconRight, disabled }) {
|
|
|
529
529
|
|
|
530
530
|
// src/Button/TabSelectionButton/TabSelectionButton.tsx
|
|
531
531
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
532
|
-
var TabSelectionButton = ({
|
|
532
|
+
var TabSelectionButton = ({
|
|
533
|
+
title,
|
|
534
|
+
now,
|
|
535
|
+
onClickGoto
|
|
536
|
+
}) => {
|
|
533
537
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex subtitle-2", children: [
|
|
534
538
|
title.map((text) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
535
539
|
"button",
|
|
536
540
|
{
|
|
537
541
|
onClick: () => onClickGoto(text.path),
|
|
538
|
-
className: `text-nowrap px-2 cursor-pointer ${now === text.path ? "border-b-primary-
|
|
542
|
+
className: `text-nowrap px-2 cursor-pointer pb-[10px] ${now === text.path ? "border-b-primary-500 text-primary-500 border-b-2" : "border-b-gray-200 border-b-2"}`,
|
|
539
543
|
children: text.name
|
|
540
544
|
}
|
|
541
545
|
)),
|
|
@@ -1187,15 +1191,16 @@ function TextInput({
|
|
|
1187
1191
|
error,
|
|
1188
1192
|
value,
|
|
1189
1193
|
onChange,
|
|
1190
|
-
disabled
|
|
1194
|
+
disabled,
|
|
1195
|
+
className
|
|
1191
1196
|
}) {
|
|
1192
1197
|
const [showPassword, setShowPassword] = (0, import_react7.useState)(false);
|
|
1193
1198
|
const onShowPassword = () => {
|
|
1194
1199
|
setShowPassword(!showPassword);
|
|
1195
1200
|
};
|
|
1196
1201
|
const inputType = type === "password" ? showPassword ? "text" : "password" : "text";
|
|
1197
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
|
|
1198
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { className: "body-1
|
|
1202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex-col flex gap-2", children: [
|
|
1203
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { className: "body-1", children: [
|
|
1199
1204
|
label,
|
|
1200
1205
|
required && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-red-500", children: "\xA0*" })
|
|
1201
1206
|
] }),
|
|
@@ -1203,7 +1208,7 @@ function TextInput({
|
|
|
1203
1208
|
"div",
|
|
1204
1209
|
{
|
|
1205
1210
|
className: `border-[1px] rounded-[8px] w-full h-[40px] flex justify-center items-center
|
|
1206
|
-
${disabled ? "bg-gray-100 text-gray-400" : error ? "border-red-500" : ""}`,
|
|
1211
|
+
${disabled ? "bg-gray-100 text-gray-400" : error ? "border-red-500" : ""} ${className ?? ""}`,
|
|
1207
1212
|
children: [
|
|
1208
1213
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1209
1214
|
"input",
|
|
@@ -1218,11 +1223,23 @@ function TextInput({
|
|
|
1218
1223
|
disabled
|
|
1219
1224
|
}
|
|
1220
1225
|
),
|
|
1221
|
-
type === "password" && (showPassword ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1226
|
+
type === "password" && (showPassword ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1227
|
+
import_icons_react7.IconEye,
|
|
1228
|
+
{
|
|
1229
|
+
className: "text-gray-600 mr-[8px] cursor-pointer",
|
|
1230
|
+
onClick: onShowPassword
|
|
1231
|
+
}
|
|
1232
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1233
|
+
import_icons_react7.IconEyeOff,
|
|
1234
|
+
{
|
|
1235
|
+
className: "text-gray-600 mr-[8px] cursor-pointer",
|
|
1236
|
+
onClick: onShowPassword
|
|
1237
|
+
}
|
|
1238
|
+
))
|
|
1222
1239
|
]
|
|
1223
1240
|
}
|
|
1224
1241
|
),
|
|
1225
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-red-500
|
|
1242
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1226
1243
|
] });
|
|
1227
1244
|
}
|
|
1228
1245
|
|
|
@@ -4691,6 +4708,7 @@ var BarChart = ({
|
|
|
4691
4708
|
margin = defaultMargin,
|
|
4692
4709
|
yLabel,
|
|
4693
4710
|
xLabel,
|
|
4711
|
+
modeLabel,
|
|
4694
4712
|
colorPalette = defaultColorPalette
|
|
4695
4713
|
}) => {
|
|
4696
4714
|
const svgRef = (0, import_react21.useRef)(null);
|
|
@@ -4737,6 +4755,14 @@ var BarChart = ({
|
|
|
4737
4755
|
);
|
|
4738
4756
|
svg.select(".grid").lower();
|
|
4739
4757
|
xAxisG.attr("transform", `translate(${margin.left},${height - margin.bottom})`).call(xAxis).selectAll("text").style("text-anchor", "middle").attr("dy", "1.5em").attr("fill", "currentColor").style("font-size", "14px").style("font-family", "Arial, sans-serif");
|
|
4758
|
+
const labels = xAxisG.selectAll("text").attr("fill", "currentColor").style("font-size", "14px").style("font-family", "Arial, sans-serif");
|
|
4759
|
+
if (modeLabel === "45") {
|
|
4760
|
+
labels.attr("transform", "rotate(-45)").style("overflow", "visible").style("text-anchor", "end").attr("dx", "-0.8em").attr("dy", "0.15em");
|
|
4761
|
+
} else if (modeLabel === "line") {
|
|
4762
|
+
labels.attr("transform", "rotate(0)").style("text-anchor", "middle").attr("dx", "0").attr("dy", "1.5em");
|
|
4763
|
+
} else {
|
|
4764
|
+
labels.style("text-anchor", "middle").attr("dy", "1.5em");
|
|
4765
|
+
}
|
|
4740
4766
|
yAxisG.selectAll(".y-axis-label").data(yLabel ? [yLabel] : []).join(
|
|
4741
4767
|
(enter) => enter.append("text").attr("class", "y-axis-label").attr("fill", "currentColor").attr("x", -margin.left + 8).attr("y", -margin.top + 20).attr("text-anchor", "start").style("font-size", "14px").style("font-family", "Arial").text((d) => d),
|
|
4742
4768
|
(update) => update.text((d) => d)
|
|
@@ -4776,14 +4802,14 @@ var BarChart = ({
|
|
|
4776
4802
|
(exit) => exit.transition(t).attr("y", margin.top + y(0)).attr("height", innerH - y(0)).remove()
|
|
4777
4803
|
);
|
|
4778
4804
|
g.selectAll("text.bar-label").data(data).join(
|
|
4779
|
-
(enter) => enter.append("text").attr("class", "bar-label").attr("x", (d) => (x(d.x) ?? 0) + x.bandwidth() / 2).attr("y", (d) => y(d.y) - 6).attr("text-anchor", "middle").style("font-size", "50px").style("font-weight", "bold").style("font-family", "Arial, sans-serif").style("fill", (d, i) => colorPalette[i % colorPalette.length]).text((d) => d.y),
|
|
4805
|
+
(enter) => enter.append("text").attr("class", "bar-label").attr("x", (d) => (x(d.x) ?? 0) + x.bandwidth() / 2).attr("y", (d) => y(d.y) - 6).attr("text-anchor", "middle").style("font-size", "50px").style("font-weight", "bold").style("font-family", "Arial, sans-serif").style("fill", (d, i) => colorPalette[i % colorPalette.length]).style("overflow", "visible").text((d) => d.y),
|
|
4780
4806
|
(update) => update.transition(t).attr("x", (d) => (x(d.x) ?? 0) + x.bandwidth() / 2).attr("y", (d) => y(d.y) - 6).text((d) => d.y),
|
|
4781
4807
|
(exit) => exit.remove()
|
|
4782
4808
|
);
|
|
4783
4809
|
};
|
|
4784
4810
|
(0, import_react21.useEffect)(() => {
|
|
4785
4811
|
render();
|
|
4786
|
-
}, [data, height, margin, xDomain.toString(), yDomain.toString()]);
|
|
4812
|
+
}, [data, height, margin, modeLabel, xDomain.toString(), yDomain.toString()]);
|
|
4787
4813
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { ref: containerRef, style: { width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("svg", { ref: svgRef, role: "img", "aria-label": "Bar chart", style: { display: "block", width: "100%", height }, children: [
|
|
4788
4814
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("g", { ref: gRef, transform: `translate(${margin.left},${margin.top})` }),
|
|
4789
4815
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("g", { ref: xAxisRef }),
|
package/dist/index.mjs
CHANGED
|
@@ -463,13 +463,17 @@ function GhostButton({ title, onClick, iconLeft, iconRight, disabled }) {
|
|
|
463
463
|
|
|
464
464
|
// src/Button/TabSelectionButton/TabSelectionButton.tsx
|
|
465
465
|
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
466
|
-
var TabSelectionButton = ({
|
|
466
|
+
var TabSelectionButton = ({
|
|
467
|
+
title,
|
|
468
|
+
now,
|
|
469
|
+
onClickGoto
|
|
470
|
+
}) => {
|
|
467
471
|
return /* @__PURE__ */ jsxs2("div", { className: "flex subtitle-2", children: [
|
|
468
472
|
title.map((text) => /* @__PURE__ */ jsx4(
|
|
469
473
|
"button",
|
|
470
474
|
{
|
|
471
475
|
onClick: () => onClickGoto(text.path),
|
|
472
|
-
className: `text-nowrap px-2 cursor-pointer ${now === text.path ? "border-b-primary-
|
|
476
|
+
className: `text-nowrap px-2 cursor-pointer pb-[10px] ${now === text.path ? "border-b-primary-500 text-primary-500 border-b-2" : "border-b-gray-200 border-b-2"}`,
|
|
473
477
|
children: text.name
|
|
474
478
|
}
|
|
475
479
|
)),
|
|
@@ -1121,15 +1125,16 @@ function TextInput({
|
|
|
1121
1125
|
error,
|
|
1122
1126
|
value,
|
|
1123
1127
|
onChange,
|
|
1124
|
-
disabled
|
|
1128
|
+
disabled,
|
|
1129
|
+
className
|
|
1125
1130
|
}) {
|
|
1126
1131
|
const [showPassword, setShowPassword] = useState5(false);
|
|
1127
1132
|
const onShowPassword = () => {
|
|
1128
1133
|
setShowPassword(!showPassword);
|
|
1129
1134
|
};
|
|
1130
1135
|
const inputType = type === "password" ? showPassword ? "text" : "password" : "text";
|
|
1131
|
-
return /* @__PURE__ */ jsxs13("div", { children: [
|
|
1132
|
-
label && /* @__PURE__ */ jsxs13("p", { className: "body-1
|
|
1136
|
+
return /* @__PURE__ */ jsxs13("div", { className: "flex-col flex gap-2", children: [
|
|
1137
|
+
label && /* @__PURE__ */ jsxs13("p", { className: "body-1", children: [
|
|
1133
1138
|
label,
|
|
1134
1139
|
required && /* @__PURE__ */ jsx20("span", { className: "text-red-500", children: "\xA0*" })
|
|
1135
1140
|
] }),
|
|
@@ -1137,7 +1142,7 @@ function TextInput({
|
|
|
1137
1142
|
"div",
|
|
1138
1143
|
{
|
|
1139
1144
|
className: `border-[1px] rounded-[8px] w-full h-[40px] flex justify-center items-center
|
|
1140
|
-
${disabled ? "bg-gray-100 text-gray-400" : error ? "border-red-500" : ""}`,
|
|
1145
|
+
${disabled ? "bg-gray-100 text-gray-400" : error ? "border-red-500" : ""} ${className ?? ""}`,
|
|
1141
1146
|
children: [
|
|
1142
1147
|
/* @__PURE__ */ jsx20(
|
|
1143
1148
|
"input",
|
|
@@ -1152,11 +1157,23 @@ function TextInput({
|
|
|
1152
1157
|
disabled
|
|
1153
1158
|
}
|
|
1154
1159
|
),
|
|
1155
|
-
type === "password" && (showPassword ? /* @__PURE__ */ jsx20(
|
|
1160
|
+
type === "password" && (showPassword ? /* @__PURE__ */ jsx20(
|
|
1161
|
+
IconEye,
|
|
1162
|
+
{
|
|
1163
|
+
className: "text-gray-600 mr-[8px] cursor-pointer",
|
|
1164
|
+
onClick: onShowPassword
|
|
1165
|
+
}
|
|
1166
|
+
) : /* @__PURE__ */ jsx20(
|
|
1167
|
+
IconEyeOff,
|
|
1168
|
+
{
|
|
1169
|
+
className: "text-gray-600 mr-[8px] cursor-pointer",
|
|
1170
|
+
onClick: onShowPassword
|
|
1171
|
+
}
|
|
1172
|
+
))
|
|
1156
1173
|
]
|
|
1157
1174
|
}
|
|
1158
1175
|
),
|
|
1159
|
-
error && /* @__PURE__ */ jsx20("p", { className: "text-red-500
|
|
1176
|
+
error && /* @__PURE__ */ jsx20("p", { className: "text-red-500 caption-1", children: error })
|
|
1160
1177
|
] });
|
|
1161
1178
|
}
|
|
1162
1179
|
|
|
@@ -4625,6 +4642,7 @@ var BarChart = ({
|
|
|
4625
4642
|
margin = defaultMargin,
|
|
4626
4643
|
yLabel,
|
|
4627
4644
|
xLabel,
|
|
4645
|
+
modeLabel,
|
|
4628
4646
|
colorPalette = defaultColorPalette
|
|
4629
4647
|
}) => {
|
|
4630
4648
|
const svgRef = useRef8(null);
|
|
@@ -4671,6 +4689,14 @@ var BarChart = ({
|
|
|
4671
4689
|
);
|
|
4672
4690
|
svg.select(".grid").lower();
|
|
4673
4691
|
xAxisG.attr("transform", `translate(${margin.left},${height - margin.bottom})`).call(xAxis).selectAll("text").style("text-anchor", "middle").attr("dy", "1.5em").attr("fill", "currentColor").style("font-size", "14px").style("font-family", "Arial, sans-serif");
|
|
4692
|
+
const labels = xAxisG.selectAll("text").attr("fill", "currentColor").style("font-size", "14px").style("font-family", "Arial, sans-serif");
|
|
4693
|
+
if (modeLabel === "45") {
|
|
4694
|
+
labels.attr("transform", "rotate(-45)").style("overflow", "visible").style("text-anchor", "end").attr("dx", "-0.8em").attr("dy", "0.15em");
|
|
4695
|
+
} else if (modeLabel === "line") {
|
|
4696
|
+
labels.attr("transform", "rotate(0)").style("text-anchor", "middle").attr("dx", "0").attr("dy", "1.5em");
|
|
4697
|
+
} else {
|
|
4698
|
+
labels.style("text-anchor", "middle").attr("dy", "1.5em");
|
|
4699
|
+
}
|
|
4674
4700
|
yAxisG.selectAll(".y-axis-label").data(yLabel ? [yLabel] : []).join(
|
|
4675
4701
|
(enter) => enter.append("text").attr("class", "y-axis-label").attr("fill", "currentColor").attr("x", -margin.left + 8).attr("y", -margin.top + 20).attr("text-anchor", "start").style("font-size", "14px").style("font-family", "Arial").text((d) => d),
|
|
4676
4702
|
(update) => update.text((d) => d)
|
|
@@ -4710,14 +4736,14 @@ var BarChart = ({
|
|
|
4710
4736
|
(exit) => exit.transition(t).attr("y", margin.top + y(0)).attr("height", innerH - y(0)).remove()
|
|
4711
4737
|
);
|
|
4712
4738
|
g.selectAll("text.bar-label").data(data).join(
|
|
4713
|
-
(enter) => enter.append("text").attr("class", "bar-label").attr("x", (d) => (x(d.x) ?? 0) + x.bandwidth() / 2).attr("y", (d) => y(d.y) - 6).attr("text-anchor", "middle").style("font-size", "50px").style("font-weight", "bold").style("font-family", "Arial, sans-serif").style("fill", (d, i) => colorPalette[i % colorPalette.length]).text((d) => d.y),
|
|
4739
|
+
(enter) => enter.append("text").attr("class", "bar-label").attr("x", (d) => (x(d.x) ?? 0) + x.bandwidth() / 2).attr("y", (d) => y(d.y) - 6).attr("text-anchor", "middle").style("font-size", "50px").style("font-weight", "bold").style("font-family", "Arial, sans-serif").style("fill", (d, i) => colorPalette[i % colorPalette.length]).style("overflow", "visible").text((d) => d.y),
|
|
4714
4740
|
(update) => update.transition(t).attr("x", (d) => (x(d.x) ?? 0) + x.bandwidth() / 2).attr("y", (d) => y(d.y) - 6).text((d) => d.y),
|
|
4715
4741
|
(exit) => exit.remove()
|
|
4716
4742
|
);
|
|
4717
4743
|
};
|
|
4718
4744
|
useEffect9(() => {
|
|
4719
4745
|
render();
|
|
4720
|
-
}, [data, height, margin, xDomain.toString(), yDomain.toString()]);
|
|
4746
|
+
}, [data, height, margin, modeLabel, xDomain.toString(), yDomain.toString()]);
|
|
4721
4747
|
return /* @__PURE__ */ jsx46("div", { ref: containerRef, style: { width: "100%" }, children: /* @__PURE__ */ jsxs37("svg", { ref: svgRef, role: "img", "aria-label": "Bar chart", style: { display: "block", width: "100%", height }, children: [
|
|
4722
4748
|
/* @__PURE__ */ jsx46("g", { ref: gRef, transform: `translate(${margin.left},${margin.top})` }),
|
|
4723
4749
|
/* @__PURE__ */ jsx46("g", { ref: xAxisRef }),
|