From 2de10fac26db3bf7a342926dfb38aae190d2e610 Mon Sep 17 00:00:00 2001 From: ciphervaishnavi Date: Sun, 26 Oct 2025 18:31:09 +0530 Subject: [PATCH] Dp page corrected --- frontend/src/pages/GraphVisualizer.jsx | 351 ++++++++++++++++--------- 1 file changed, 227 insertions(+), 124 deletions(-) diff --git a/frontend/src/pages/GraphVisualizer.jsx b/frontend/src/pages/GraphVisualizer.jsx index 3718e0d..da7676b 100644 --- a/frontend/src/pages/GraphVisualizer.jsx +++ b/frontend/src/pages/GraphVisualizer.jsx @@ -527,97 +527,109 @@ const GraphVisualizer = () => { return ( -
- {/* Conditional Particle Background */} +
+ {/* Enhanced Particle Background with Glow Effect */} {showParticles && !timeoutDetected && ( - + <> + +
+
+
+
+
+ )} - {/* Timeout Warning */} + {/* Timeout Warning with Animation */} {timeoutDetected && ( -
+
⚠️ Performance issue detected. Visual effects disabled.
)} -
- {/* Enhanced Header */} -
+ {/* Enhanced Header with Gradient Animation */} +
-
-
+
+ {/* Animated Background Pattern */} +
+
+
+ +
-

- Graph Algorithm Visualizer +

+ 🔗 Graph Algorithm Visualizer

-

- Interactive graph algorithm visualization platform +

+ Interactive graph algorithm visualization platform with real-time analysis

-
+
{/* Search + Theme Toggle */} -
-
- +
+
+ setSearchTerm(e.target.value)} - className={`pl-10 pr-4 py-2 w-full rounded-lg backdrop-blur-md border transition-all ${ + className={`pl-10 pr-4 py-2 w-full rounded-lg backdrop-blur-md border transition-all focus:ring-2 focus:ring-blue-400 focus:scale-105 ${ darkMode - ? "bg-gray-800/50 border-gray-600 text-white" - : "bg-white/50 border-white/30 text-gray-800" + ? "bg-gray-800/50 border-gray-600 text-white placeholder-gray-400" + : "bg-white/50 border-white/30 text-gray-800 placeholder-gray-500" }`} />
- {/* Theme Toggle */} + {/* Theme Toggle with Rotation Animation */}
{/* Algorithm Selector + User Menu */} -
- {/* Algorithm Selector */} +
+ {/* Algorithm Selector with Enhanced Hover */} - {/* User Menu */} + {/* User Menu with Ripple Effect */}
{showUserMenu && ( @@ -637,7 +649,7 @@ const GraphVisualizer = () => { : "hover:bg-gray-100 text-gray-800" }`} > - + {showParticles ? "Hide" : "Show"} Particles
@@ -650,25 +662,26 @@ const GraphVisualizer = () => {
- {/* Algorithm Selector */} + {/* Algorithm Selector with Staggered Animation */} {isAlgorithmSelectorOpen && ( -
-
- {filteredAlgorithms.map((algo) => ( +
+ {filteredAlgorithms.map((algo, index) => (
{ setAlgorithm(algo.id); @@ -688,23 +701,23 @@ const GraphVisualizer = () => { onMouseLeave={() => setHoveredAlgorithm(null)} >
-
+
{algo.name}
{algo.description}
-
+
{algo.complexity}
{hoveredAlgorithm === algo.id && ( -
+
{algo.preview}
)} @@ -716,17 +729,18 @@ const GraphVisualizer = () => { )}
-
+
{/* Left Panel - Graph Configuration & Controls */} -
-
+
-
-

- +
+
+

+ Graph Configuration & Controls

@@ -735,7 +749,7 @@ const GraphVisualizer = () => { {/* Graph Configuration */}

- + Graph Setup

@@ -756,7 +770,7 @@ const GraphVisualizer = () => { {/* Controls */}

- + Playback Controls

{
{/* Right Panel - Graph Visualization */} -
-
+
-
-
+
+
+

{selectedAlgorithm?.name} Visualization

-
+
Step {currentStep + 1} of {steps.length || 1}
- + Nodes: {nodes.length}
{
- {/* Step Explanation */} -
-
-
+
+
+

- + Step Explanation

-
-
+
-

+

+ Current Operation:

@@ -864,10 +881,11 @@ const GraphVisualizer = () => {

-
-

+

+

+ What's Happening:

@@ -877,10 +895,11 @@ const GraphVisualizer = () => {

{selectedAlgorithm && ( -
-

+

+

+ Algorithm Info:

@@ -893,15 +912,17 @@ const GraphVisualizer = () => {

- {/* Bottom Panel - Analysis & Metrics */} -
-
+
-
-

+
+
+

+ Complexity Analysis

@@ -916,52 +937,54 @@ const GraphVisualizer = () => {

-
-
-

+ ? 'bg-gray-800/20 border-gray-700/50 hover:border-cyan-500/50' + : 'bg-white/20 border-white/50 hover:border-cyan-300/50' + }`} style={{ animationDelay: '0.2s' }}> +
+
+

+ Graph Metrics

-
-
+
{nodes.length}
Vertices
-
-
+
+
{edges.length}
Edges
-
-
+
+
{steps.length}
Total Steps
-
-
+
+
{steps.length > 0 ? Math.round((currentStep / (steps.length - 1)) * 100) : 0}%
@@ -974,18 +997,98 @@ const GraphVisualizer = () => {
- {/* Custom CSS for animations */} + {/* Enhanced Custom CSS for animations */}