Skip to content

Commit 42b4f87

Browse files
committed
Auto-set slider to optimal threshold while maintaining user control
1 parent 29648b6 commit 42b4f87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function App() {
4747
// Update minVisitsPercentage when maxMinEdgeCount changes
4848
useEffect(() => {
4949
if (maxMinEdgeCount > 0) {
50-
const percentage = ((maxMinEdgeCount - 1) / maxEdgeCount) * 100;
50+
const percentage = (maxMinEdgeCount / maxEdgeCount) * 100;
5151
setMinVisitsPercentage(Math.max(0, Math.min(100, percentage)));
5252
}
5353
}, [maxMinEdgeCount, maxEdgeCount]);
@@ -256,7 +256,7 @@ function App() {
256256
</div>
257257
<p className="text-xs text-gray-500">
258258
Maximum threshold before any node becomes
259-
disconnected: {maxMinEdgeCount - 1} students
259+
disconnected: {maxMinEdgeCount} students
260260
</p>
261261
</div>
262262
</div>

0 commit comments

Comments
 (0)