@esic-lab/data-core-ui 0.0.74 → 0.0.75
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.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4783,7 +4783,7 @@ var BarChart = ({
|
|
|
4783
4783
|
} else {
|
|
4784
4784
|
xTickTexts.attr("transform", "rotate(0)").style("text-anchor", "middle");
|
|
4785
4785
|
}
|
|
4786
|
-
const maxLabelWidth = isHorizontal ?
|
|
4786
|
+
const maxLabelWidth = isHorizontal ? 50 : Math.max(40, (xBand.bandwidth?.() ?? 0) - 30);
|
|
4787
4787
|
ellipsizeTickText(xTickTexts, maxLabelWidth);
|
|
4788
4788
|
const grid = !isHorizontal ? d3.axisLeft(yLin).ticks(5).tickSize(-innerW).tickFormat(() => "") : d3.axisBottom(xLin).ticks(5).tickSize(-innerH).tickFormat(() => "");
|
|
4789
4789
|
const gridG = svg.selectAll("g.grid").data([null]).join("g").attr("class", "grid").attr(
|
|
@@ -4843,7 +4843,7 @@ var BarChart = ({
|
|
|
4843
4843
|
);
|
|
4844
4844
|
const labels = g.selectAll("text.bar-label").data(data, (d) => d.x);
|
|
4845
4845
|
labels.join(
|
|
4846
|
-
(enter) => enter.append("text").attr("class", "bar-label").style("font-weight", "bold").style("font-family", "Kanit, sans-serif").style("font-size", "
|
|
4846
|
+
(enter) => enter.append("text").attr("class", "bar-label").style("font-weight", "bold").style("font-family", "Kanit, sans-serif").style("font-size", "50px").style("fill", (d, i) => colorPalette[i % colorPalette.length]).attr("text-anchor", !isHorizontal ? "middle" : "start").attr(
|
|
4847
4847
|
"x",
|
|
4848
4848
|
(d) => !isHorizontal ? (xBand(d.x) ?? 0) + xBand.bandwidth() / 2 : xLin(d.y) + 6
|
|
4849
4849
|
).attr(
|
|
@@ -4922,7 +4922,7 @@ var PieChart = ({
|
|
|
4922
4922
|
description && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: "caption-1", children: description }),
|
|
4923
4923
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex", children: [
|
|
4924
4924
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("svg", { ref: svgRef }),
|
|
4925
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "flex flex-col gap-2 body-3 pl-[200px]", children: dataSide.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "grid grid-cols-3 gap-2 items-center", children: [
|
|
4925
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "flex flex-col gap-2 body-3 pl-[200px]", children: dataSide.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "grid grid-cols-3 gap-2 items-center body-2", children: [
|
|
4926
4926
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "w-[20px] h-[20px]", style: { backgroundColor: d.color } }),
|
|
4927
4927
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { children: d.label }),
|
|
4928
4928
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { children: d.value })
|
package/dist/index.mjs
CHANGED
|
@@ -4717,7 +4717,7 @@ var BarChart = ({
|
|
|
4717
4717
|
} else {
|
|
4718
4718
|
xTickTexts.attr("transform", "rotate(0)").style("text-anchor", "middle");
|
|
4719
4719
|
}
|
|
4720
|
-
const maxLabelWidth = isHorizontal ?
|
|
4720
|
+
const maxLabelWidth = isHorizontal ? 50 : Math.max(40, (xBand.bandwidth?.() ?? 0) - 30);
|
|
4721
4721
|
ellipsizeTickText(xTickTexts, maxLabelWidth);
|
|
4722
4722
|
const grid = !isHorizontal ? d3.axisLeft(yLin).ticks(5).tickSize(-innerW).tickFormat(() => "") : d3.axisBottom(xLin).ticks(5).tickSize(-innerH).tickFormat(() => "");
|
|
4723
4723
|
const gridG = svg.selectAll("g.grid").data([null]).join("g").attr("class", "grid").attr(
|
|
@@ -4777,7 +4777,7 @@ var BarChart = ({
|
|
|
4777
4777
|
);
|
|
4778
4778
|
const labels = g.selectAll("text.bar-label").data(data, (d) => d.x);
|
|
4779
4779
|
labels.join(
|
|
4780
|
-
(enter) => enter.append("text").attr("class", "bar-label").style("font-weight", "bold").style("font-family", "Kanit, sans-serif").style("font-size", "
|
|
4780
|
+
(enter) => enter.append("text").attr("class", "bar-label").style("font-weight", "bold").style("font-family", "Kanit, sans-serif").style("font-size", "50px").style("fill", (d, i) => colorPalette[i % colorPalette.length]).attr("text-anchor", !isHorizontal ? "middle" : "start").attr(
|
|
4781
4781
|
"x",
|
|
4782
4782
|
(d) => !isHorizontal ? (xBand(d.x) ?? 0) + xBand.bandwidth() / 2 : xLin(d.y) + 6
|
|
4783
4783
|
).attr(
|
|
@@ -4856,7 +4856,7 @@ var PieChart = ({
|
|
|
4856
4856
|
description && /* @__PURE__ */ jsx47("p", { className: "caption-1", children: description }),
|
|
4857
4857
|
/* @__PURE__ */ jsxs38("div", { className: "flex", children: [
|
|
4858
4858
|
/* @__PURE__ */ jsx47("svg", { ref: svgRef }),
|
|
4859
|
-
/* @__PURE__ */ jsx47("div", { className: "flex flex-col gap-2 body-3 pl-[200px]", children: dataSide.map((d, i) => /* @__PURE__ */ jsxs38("div", { className: "grid grid-cols-3 gap-2 items-center", children: [
|
|
4859
|
+
/* @__PURE__ */ jsx47("div", { className: "flex flex-col gap-2 body-3 pl-[200px]", children: dataSide.map((d, i) => /* @__PURE__ */ jsxs38("div", { className: "grid grid-cols-3 gap-2 items-center body-2", children: [
|
|
4860
4860
|
/* @__PURE__ */ jsx47("div", { className: "w-[20px] h-[20px]", style: { backgroundColor: d.color } }),
|
|
4861
4861
|
/* @__PURE__ */ jsx47("div", { children: d.label }),
|
|
4862
4862
|
/* @__PURE__ */ jsx47("div", { children: d.value })
|