@tomaszjarosz/react-visualizers 0.4.10 → 0.4.12

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 CHANGED
@@ -4440,7 +4440,7 @@ const DPVisualizerComponent = ({
4440
4440
  ] })
4441
4441
  ] })
4442
4442
  ] }),
4443
- currentI > 0 && currentW > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-4 p-3 bg-white rounded-lg border-2 border-purple-300", children: [
4443
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4 p-3 bg-white rounded-lg border-2 border-purple-300 min-h-[76px]", children: currentI > 0 && currentW > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4444
4444
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm font-semibold text-purple-800 mb-2", children: [
4445
4445
  "Current: dp[",
4446
4446
  currentI,
@@ -4462,7 +4462,7 @@ const DPVisualizerComponent = ({
4462
4462
  ] }),
4463
4463
  decision && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `px-3 py-1 rounded-full font-bold ${decision === "take" ? "bg-green-100 text-green-700" : "bg-yellow-100 text-yellow-700"}`, children: decision === "take" ? "✓ TAKE" : "✗ SKIP" })
4464
4464
  ] })
4465
- ] })
4465
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-purple-400 italic text-center py-2", children: "Current cell calculation will appear here..." }) })
4466
4466
  ] }),
4467
4467
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-6", children: [
4468
4468
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-40", children: [
@@ -18027,7 +18027,7 @@ const BloomFilterVisualizerComponent = ({
18027
18027
  "]"
18028
18028
  ] }, idx)) })
18029
18029
  ] }),
18030
- stepData.element && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-4 p-3 bg-gray-50 rounded-lg border border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm", children: [
18030
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-4 p-3 bg-gray-50 rounded-lg border border-gray-200 min-h-[44px]", children: stepData.element ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm", children: [
18031
18031
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500", children: "Element: " }),
18032
18032
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-mono font-bold text-purple-600", children: [
18033
18033
  '"',
@@ -18042,8 +18042,8 @@ const BloomFilterVisualizerComponent = ({
18042
18042
  ] }),
18043
18043
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono font-bold text-pink-600", children: stepData.hashIndex })
18044
18044
  ] })
18045
- ] }) }),
18046
- stepData.operation === "init" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4 p-3 bg-indigo-50 rounded-lg border border-indigo-200", children: [
18045
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-400 italic", children: "Current operation will appear here..." }) }),
18046
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4 p-3 bg-indigo-50 rounded-lg border border-indigo-200 min-h-[76px]", children: [
18047
18047
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs font-medium text-indigo-800 mb-2", children: [
18048
18048
  "Hash Functions (k=",
18049
18049
  NUM_HASH_FUNCTIONS,
@@ -18499,11 +18499,11 @@ const BTreeVisualizerComponent = ({
18499
18499
  ] })
18500
18500
  ] }),
18501
18501
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-4 p-4 bg-gray-50 rounded-lg border border-gray-200 min-h-[150px] flex items-center justify-center", children: nodes.size > 0 ? renderNode(rootId) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400", children: "Empty tree" }) }),
18502
- targetKey !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-4 p-3 bg-gray-50 rounded-lg border border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm", children: [
18502
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-4 p-3 bg-gray-50 rounded-lg border border-gray-200 min-h-[44px]", children: targetKey !== void 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm", children: [
18503
18503
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500", children: "Target key: " }),
18504
18504
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono font-bold text-emerald-600", children: targetKey })
18505
- ] }) }),
18506
- splitInfo && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4 p-3 bg-purple-50 rounded-lg border border-purple-200", children: [
18505
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-400 italic", children: "Target key will appear here..." }) }),
18506
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-4 p-3 bg-purple-50 rounded-lg border border-purple-200 min-h-[76px]", children: splitInfo ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
18507
18507
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-medium text-purple-800 mb-1", children: "Node Split" }),
18508
18508
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs text-purple-700 font-mono", children: [
18509
18509
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -18522,7 +18522,7 @@ const BTreeVisualizerComponent = ({
18522
18522
  "]"
18523
18523
  ] })
18524
18524
  ] })
18525
- ] }),
18525
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-purple-400 italic text-center py-2", children: "Split info will appear here when node overflows..." }) }),
18526
18526
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4 p-2 bg-blue-50 rounded-lg border border-blue-200", children: [
18527
18527
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-medium text-blue-800 mb-1", children: "Operations" }),
18528
18528
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-blue-700 font-mono", children: OPERATIONS$4.map((op, i) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "mr-2", children: [
@@ -20777,13 +20777,13 @@ const ConsistentHashingVisualizerComponent = ({
20777
20777
  },
20778
20778
  server
20779
20779
  )) }),
20780
- dataKeys.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-4 overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full text-xs", children: [
20780
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-4 overflow-x-auto min-h-[100px]", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full text-xs", children: [
20781
20781
  /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "bg-gray-100", children: [
20782
20782
  /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-2 py-1 text-left", children: "Key" }),
20783
20783
  /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-2 py-1 text-left", children: "Hash (°)" }),
20784
20784
  /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-2 py-1 text-left", children: "Server" })
20785
20785
  ] }) }),
20786
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: dataKeys.map((key) => /* @__PURE__ */ jsxRuntime.jsxs(
20786
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: dataKeys.length > 0 ? dataKeys.map((key) => /* @__PURE__ */ jsxRuntime.jsxs(
20787
20787
  "tr",
20788
20788
  {
20789
20789
  className: `
@@ -20809,7 +20809,7 @@ const ConsistentHashingVisualizerComponent = ({
20809
20809
  ]
20810
20810
  },
20811
20811
  key.key
20812
- )) })
20812
+ )) : /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 3, className: "px-2 py-4 text-center text-gray-400 italic", children: "No keys added yet..." }) }) })
20813
20813
  ] }) })
20814
20814
  ] });
20815
20815
  return /* @__PURE__ */ jsxRuntime.jsx(