@tomaszjarosz/react-visualizers 0.1.1 → 0.1.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 +23 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +23 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4831,48 +4831,39 @@ const HashTableVisualizerComponent = ({
|
|
|
4831
4831
|
buckets.length,
|
|
4832
4832
|
" buckets):"
|
|
4833
4833
|
] }),
|
|
4834
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4834
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-4 gap-2", children: buckets.map((bucket, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4835
4835
|
"div",
|
|
4836
4836
|
{
|
|
4837
|
-
className:
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
},
|
|
4857
|
-
keyIdx
|
|
4858
|
-
)) })
|
|
4859
|
-
]
|
|
4860
|
-
},
|
|
4861
|
-
idx
|
|
4862
|
-
))
|
|
4863
|
-
}
|
|
4864
|
-
)
|
|
4837
|
+
className: `p-2 rounded border-2 min-h-[60px] transition-colors ${getBucketStyle(idx)}`,
|
|
4838
|
+
children: [
|
|
4839
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs font-mono text-gray-500 mb-1", children: [
|
|
4840
|
+
"[",
|
|
4841
|
+
idx,
|
|
4842
|
+
"]"
|
|
4843
|
+
] }),
|
|
4844
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1", children: bucket.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-gray-400 italic", children: "empty" }) : bucket.map((bucketKey, keyIdx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4845
|
+
"span",
|
|
4846
|
+
{
|
|
4847
|
+
className: `px-1.5 py-0.5 text-xs rounded border ${getKeyStyle(bucketKey)}`,
|
|
4848
|
+
children: bucketKey
|
|
4849
|
+
},
|
|
4850
|
+
keyIdx
|
|
4851
|
+
)) })
|
|
4852
|
+
]
|
|
4853
|
+
},
|
|
4854
|
+
idx
|
|
4855
|
+
)) })
|
|
4865
4856
|
] }),
|
|
4866
|
-
|
|
4857
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4 p-3 bg-gray-100 rounded-lg min-h-[52px]", children: [
|
|
4867
4858
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-medium text-gray-700 mb-1", children: "Hash Calculation:" }),
|
|
4868
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4859
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-mono text-sm", children: operation === "insert" && key ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4869
4860
|
'hash("',
|
|
4870
4861
|
key,
|
|
4871
4862
|
'") mod ',
|
|
4872
4863
|
buckets.length,
|
|
4873
4864
|
" = ",
|
|
4874
4865
|
bucketIndex
|
|
4875
|
-
] })
|
|
4866
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400", children: "—" }) })
|
|
4876
4867
|
] }),
|
|
4877
4868
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4878
4869
|
StatusPanel,
|