@axzydev/axzy_ui_system 1.4.5 → 1.4.7
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.cjs +27 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -15
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/components/molecules/line-bar-chart/line-bar-chart.tsx +24 -15
package/dist/index.cjs
CHANGED
|
@@ -8354,7 +8354,12 @@ function ITLineBarChart({
|
|
|
8354
8354
|
const linePoints = data.map((d, i) => `${x(i)},${y(d.line)}`).join(" ");
|
|
8355
8355
|
const areaPath = data.length > 0 ? `M ${x(0)} ${y(data[0].line)} ` + data.slice(1).map((d, i) => `L ${x(i + 1)} ${y(d.line)}`).join(" ") + ` L ${x(data.length - 1)} ${padding.top + plotHeight} L ${x(0)} ${padding.top + plotHeight} Z` : "";
|
|
8356
8356
|
const active = hover !== null ? data[hover] : null;
|
|
8357
|
-
|
|
8357
|
+
const tooltipLeft = (() => {
|
|
8358
|
+
if (hover === null) return 0;
|
|
8359
|
+
const center = x(hover) / width * 100;
|
|
8360
|
+
return Math.min(Math.max(center, 12), 88);
|
|
8361
|
+
})();
|
|
8362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: `relative flex flex-col gap-3 ${className}`.trim(), children: [
|
|
8358
8363
|
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
8359
8364
|
"svg",
|
|
8360
8365
|
{
|
|
@@ -8423,20 +8428,27 @@ function ITLineBarChart({
|
|
|
8423
8428
|
data.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("g", { onMouseEnter: () => setHover(i), children: [
|
|
8424
8429
|
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("rect", { x: padding.left + step * i, y: padding.top, width: step, height: plotHeight, fill: "transparent" }),
|
|
8425
8430
|
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("text", { x: x(i), y: height - 8, textAnchor: "middle", fontSize: 10, fill: "#64748b", children: d.label })
|
|
8426
|
-
] }, `hit-${d.label}`))
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8431
|
+
] }, `hit-${d.label}`))
|
|
8432
|
+
]
|
|
8433
|
+
}
|
|
8434
|
+
),
|
|
8435
|
+
active && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
8436
|
+
"div",
|
|
8437
|
+
{
|
|
8438
|
+
className: "pointer-events-none absolute z-10 -translate-x-1/2 rounded-lg px-2.5 py-1.5 shadow-lg",
|
|
8439
|
+
style: { left: `${tooltipLeft}%`, top: 4, background: "#0f172a", opacity: 0.94, minWidth: 132 },
|
|
8440
|
+
role: "status",
|
|
8441
|
+
children: [
|
|
8442
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "text-[10px] font-semibold", style: { color: "#e2e8f0" }, children: active.label }),
|
|
8443
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("p", { className: "text-[11px] tabular-nums", style: { color: lineColor }, children: [
|
|
8444
|
+
lineLabel,
|
|
8445
|
+
": ",
|
|
8446
|
+
formatValue(active.line)
|
|
8447
|
+
] }),
|
|
8448
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("p", { className: "text-[11px] tabular-nums", style: { color: "#93c5fd" }, children: [
|
|
8449
|
+
barLabel,
|
|
8450
|
+
": ",
|
|
8451
|
+
formatValue(active.bar)
|
|
8440
8452
|
] })
|
|
8441
8453
|
]
|
|
8442
8454
|
}
|