Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pages/DsaVisualization.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ const GraphVisualizer = ({ algorithmName, isPlaying, setIsPlaying, speed, onFini
const isVisited = visualState.visited.has(node.id);
const isPath = visualState.path.has(node.id);
const dist = visualState.dists[node.id];
return (<g key={node.id} transform={`translate(${node.x},${node.y})`} className="pointer-events-auto cursor-pointer transition-transform duration-200 hover:scale-110" onMouseDown={(e) => handleMouseDown(e, node.id)} onClick={() => editMode === 'move' && setEndNode(node.id)} onContextMenu={(e) => handleNodeContext(e, node.id)}><circle r={18} fill={isStart ? '#10b981' : isEnd ? '#ef4444' : isPath ? '#8b5cf6' : isVisited ? '#3b82f6' : (darkMode ? '#1e293b' : '#ffffff')} stroke={isStart || isEnd || isPath || isVisited ? 'white' : (darkMode ? '#475569' : '#94a3b8')} strokeWidth={2} className="transition-colors duration-300" /><text dy=".3em" textAnchor="middle" fill={isStart || isEnd || isPath || isVisited ? 'white' : (darkMode ? '#e2e8f0' : '#1e293b')} fontSize="12" fontWeight="bold" className="pointer-events-none">{node.id}</text>{(algorithmName === 'Dijkstra' || algorithmName === 'AStar') && dist !== undefined && (<text dy="-1.8em" textAnchor="middle" fill={darkMode ? '#cbd5e1' : '#475569'} fontSize="10" className="font-mono">{dist === Infinity ? '∞' : dist}</text>)}</g>);
return (<g key={node.id} transform={`translate(${node.x},${node.y})`} className="pointer-events-auto cursor-pointer " onMouseDown={(e) => handleMouseDown(e, node.id)} onClick={() => editMode === 'move' && setEndNode(node.id)} onContextMenu={(e) => handleNodeContext(e, node.id)}><circle r={18} fill={isStart ? '#10b981' : isEnd ? '#ef4444' : isPath ? '#8b5cf6' : isVisited ? '#3b82f6' : (darkMode ? '#1e293b' : '#ffffff')} stroke={isStart || isEnd || isPath || isVisited ? 'white' : (darkMode ? '#475569' : '#94a3b8')} strokeWidth={2} className="transition-colors duration-300" /><text dy=".3em" textAnchor="middle" fill={isStart || isEnd || isPath || isVisited ? 'white' : (darkMode ? '#e2e8f0' : '#1e293b')} fontSize="12" fontWeight="bold" className="pointer-events-none">{node.id}</text>{(algorithmName === 'Dijkstra' || algorithmName === 'AStar') && dist !== undefined && (<text dy="-1.8em" textAnchor="middle" fill={darkMode ? '#cbd5e1' : '#475569'} fontSize="10" className="font-mono">{dist === Infinity ? '∞' : dist}</text>)}</g>);
})}
</svg>
</div>
Expand Down