@parto-system-design/ui 1.0.1 → 1.0.2
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 +38 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +3 -0
- package/dist/index.js +38 -36
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
package/dist/index.js
CHANGED
|
@@ -9035,6 +9035,7 @@ function PartoHeatMap({
|
|
|
9035
9035
|
|
|
9036
9036
|
// src/components/charts/PartoWordCloud.tsx
|
|
9037
9037
|
import * as React32 from "react";
|
|
9038
|
+
import { createPortal as createPortal3 } from "react-dom";
|
|
9038
9039
|
import { Wordcloud } from "@visx/wordcloud";
|
|
9039
9040
|
import { scaleLog } from "@visx/scale";
|
|
9040
9041
|
import { Text } from "@visx/text";
|
|
@@ -9091,28 +9092,25 @@ function PartoWordCloud({
|
|
|
9091
9092
|
return fontScale(datum.value);
|
|
9092
9093
|
};
|
|
9093
9094
|
const handleMouseMove = (event, text, value) => {
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
color: primaryColor
|
|
9104
|
-
});
|
|
9105
|
-
}
|
|
9095
|
+
const x = event.clientX;
|
|
9096
|
+
const y = event.clientY;
|
|
9097
|
+
setHovered({
|
|
9098
|
+
text,
|
|
9099
|
+
value,
|
|
9100
|
+
x,
|
|
9101
|
+
y,
|
|
9102
|
+
color: primaryColor
|
|
9103
|
+
});
|
|
9106
9104
|
};
|
|
9107
|
-
return /* @__PURE__ */
|
|
9105
|
+
return /* @__PURE__ */ jsxs39(
|
|
9108
9106
|
"div",
|
|
9109
9107
|
{
|
|
9110
9108
|
ref: containerRef,
|
|
9111
9109
|
className,
|
|
9112
9110
|
style: { position: "relative", width: "100%", height: "100%", display: "flex", alignItems: "center", justifyContent: "center" },
|
|
9113
9111
|
dir: "rtl",
|
|
9114
|
-
children:
|
|
9115
|
-
/* @__PURE__ */ jsx71(
|
|
9112
|
+
children: [
|
|
9113
|
+
/* @__PURE__ */ jsx71("div", { style: { position: "relative", width, height, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ jsx71(
|
|
9116
9114
|
Wordcloud,
|
|
9117
9115
|
{
|
|
9118
9116
|
words: formattedWords,
|
|
@@ -9150,29 +9148,33 @@ function PartoWordCloud({
|
|
|
9150
9148
|
) }, w.text);
|
|
9151
9149
|
})
|
|
9152
9150
|
}
|
|
9153
|
-
),
|
|
9154
|
-
hovered &&
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
|
|
9161
|
-
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
/* @__PURE__ */
|
|
9167
|
-
|
|
9168
|
-
|
|
9169
|
-
|
|
9170
|
-
/* @__PURE__ */
|
|
9151
|
+
) }),
|
|
9152
|
+
hovered && typeof document !== "undefined" && createPortal3(
|
|
9153
|
+
/* @__PURE__ */ jsx71(
|
|
9154
|
+
"div",
|
|
9155
|
+
{
|
|
9156
|
+
className: "pointer-events-none fixed z-[9999]",
|
|
9157
|
+
dir: "ltr",
|
|
9158
|
+
style: {
|
|
9159
|
+
left: `${hovered.x}px`,
|
|
9160
|
+
top: `${hovered.y - 10}px`,
|
|
9161
|
+
transform: "translate(-50%, -100%)"
|
|
9162
|
+
},
|
|
9163
|
+
children: /* @__PURE__ */ jsxs39("div", { className: "grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", dir: "rtl", children: [
|
|
9164
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-2", children: [
|
|
9165
|
+
/* @__PURE__ */ jsx71("div", { className: "h-2.5 w-2.5 rounded-[2px]", style: { backgroundColor: hovered.color } }),
|
|
9166
|
+
/* @__PURE__ */ jsx71("span", { className: "font-medium", children: hovered.text })
|
|
9167
|
+
] }),
|
|
9168
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex items-center justify-between", children: [
|
|
9169
|
+
/* @__PURE__ */ jsx71("span", { className: "text-muted-foreground", children: "\u062A\u0639\u062F\u0627\u062F" }),
|
|
9170
|
+
/* @__PURE__ */ jsx71("span", { className: "font-mono font-medium tabular-nums", children: hovered.value.toLocaleString("fa-IR") })
|
|
9171
|
+
] })
|
|
9171
9172
|
] })
|
|
9172
|
-
|
|
9173
|
-
|
|
9173
|
+
}
|
|
9174
|
+
),
|
|
9175
|
+
document.body
|
|
9174
9176
|
)
|
|
9175
|
-
]
|
|
9177
|
+
]
|
|
9176
9178
|
}
|
|
9177
9179
|
);
|
|
9178
9180
|
}
|