@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.js
CHANGED
|
@@ -8264,7 +8264,12 @@ function ITLineBarChart({
|
|
|
8264
8264
|
const linePoints = data.map((d, i) => `${x(i)},${y(d.line)}`).join(" ");
|
|
8265
8265
|
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` : "";
|
|
8266
8266
|
const active = hover !== null ? data[hover] : null;
|
|
8267
|
-
|
|
8267
|
+
const tooltipLeft = (() => {
|
|
8268
|
+
if (hover === null) return 0;
|
|
8269
|
+
const center = x(hover) / width * 100;
|
|
8270
|
+
return Math.min(Math.max(center, 12), 88);
|
|
8271
|
+
})();
|
|
8272
|
+
return /* @__PURE__ */ jsxs46("div", { className: `relative flex flex-col gap-3 ${className}`.trim(), children: [
|
|
8268
8273
|
/* @__PURE__ */ jsxs46(
|
|
8269
8274
|
"svg",
|
|
8270
8275
|
{
|
|
@@ -8333,20 +8338,27 @@ function ITLineBarChart({
|
|
|
8333
8338
|
data.map((d, i) => /* @__PURE__ */ jsxs46("g", { onMouseEnter: () => setHover(i), children: [
|
|
8334
8339
|
/* @__PURE__ */ jsx60("rect", { x: padding.left + step * i, y: padding.top, width: step, height: plotHeight, fill: "transparent" }),
|
|
8335
8340
|
/* @__PURE__ */ jsx60("text", { x: x(i), y: height - 8, textAnchor: "middle", fontSize: 10, fill: "#64748b", children: d.label })
|
|
8336
|
-
] }, `hit-${d.label}`))
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
|
|
8347
|
-
|
|
8348
|
-
|
|
8349
|
-
|
|
8341
|
+
] }, `hit-${d.label}`))
|
|
8342
|
+
]
|
|
8343
|
+
}
|
|
8344
|
+
),
|
|
8345
|
+
active && /* @__PURE__ */ jsxs46(
|
|
8346
|
+
"div",
|
|
8347
|
+
{
|
|
8348
|
+
className: "pointer-events-none absolute z-10 -translate-x-1/2 rounded-lg px-2.5 py-1.5 shadow-lg",
|
|
8349
|
+
style: { left: `${tooltipLeft}%`, top: 4, background: "#0f172a", opacity: 0.94, minWidth: 132 },
|
|
8350
|
+
role: "status",
|
|
8351
|
+
children: [
|
|
8352
|
+
/* @__PURE__ */ jsx60("p", { className: "text-[10px] font-semibold", style: { color: "#e2e8f0" }, children: active.label }),
|
|
8353
|
+
/* @__PURE__ */ jsxs46("p", { className: "text-[11px] tabular-nums", style: { color: lineColor }, children: [
|
|
8354
|
+
lineLabel,
|
|
8355
|
+
": ",
|
|
8356
|
+
formatValue(active.line)
|
|
8357
|
+
] }),
|
|
8358
|
+
/* @__PURE__ */ jsxs46("p", { className: "text-[11px] tabular-nums", style: { color: "#93c5fd" }, children: [
|
|
8359
|
+
barLabel,
|
|
8360
|
+
": ",
|
|
8361
|
+
formatValue(active.bar)
|
|
8350
8362
|
] })
|
|
8351
8363
|
]
|
|
8352
8364
|
}
|