Skip to content

SortVision is a web-based sorting algorithm visualizer 🖥️ that lets users explore and compare algorithms like Bubble, Quick, Merge, and more 🔄. Easily adjust speed ⚡ and array size 📊 to watch the sorting process in real-time. Perfect for students and enthusiasts looking to understand sorting mechanics!

License

Notifications You must be signed in to change notification settings

alienx5499/SortVision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌟 SortVision 🌟

Interactive Sorting Algorithm Visualizer

Build Passing Node.js Contributions Welcome License: MIT Platform Views ⭐ GitHub stars 🍴 GitHub forks Commits 🐛 GitHub issues 📂 GitHub pull requests 💾 GitHub code size


🎯 What is SortVision?

SortVision is an interactive web application that brings sorting algorithms to life through real-time visualization. Built with modern web technologies, it provides an engaging platform for learning and understanding various sorting algorithms.

🌟 Key Features

  • Interactive Visualizations: Watch sorting algorithms in action with real-time animations
  • Multiple Algorithms: Explore 8 different sorting algorithms
  • Customizable Parameters: Adjust speed, array size, and more
  • Performance Metrics: Track comparisons, swaps, and time complexity
  • Educational Insights: Learn about algorithm behavior and efficiency
  • Responsive Design: Works seamlessly on desktop and mobile devices

"Visualize your data, understand sorting better!"

🚀 Help Us Build Something Amazing Together!

Made algorithms click for you? You're exactly who we built this for!
Help other developers discover what you just experienced 💝

Star this repo Tweet about SortVision Try SortVision Live View Contributors

💭 "Every star motivates us to add more algorithms and features!" - The SortVision Team


📚 Table of Contents

  1. ✨ Features
  2. 🦾 Tech Stack
  3. 📂 Project Structure
  4. 📸 Screenshots
  5. 🚀 Quick Start
  6. 👨‍🔧 Detailed Setup
  7. 🛠️ Developer Tools
  8. 🎯 Target Audience
  9. 🤝 Contributing
  10. 🌟 Awesome Contributors
  11. 📜 License
  12. 📬 Feedback & Suggestions

Features

🎮 Interactive Visualization

  • Real-time visual representation of sorting steps
  • Adjustable animation speed
  • Pause and resume functionality
  • Array size customization
  • Random array generation

📊 Supported Algorithms

  • Bubble Sort: Simple comparison-based algorithm
  • Selection Sort: In-place comparison sorting
  • Insertion Sort: Adaptive sorting algorithm
  • Merge Sort: Divide-and-conquer algorithm
  • Quick Sort: Efficient, in-place sorting
  • Heap Sort: Comparison-based sorting using binary heap data structure
  • Radix Sort: Non-comparative integer sorting
  • Bucket Sort: Distribution sort that groups elements into buckets

📈 Performance Tracking

  • Real-time comparison count
  • Swap operation tracking
  • Time complexity visualization
  • Algorithm efficiency metrics

🎨 User Interface

  • Modern, responsive design
  • Dark mode support
  • Mobile-friendly interface
  • Intuitive controls

🦾 Tech Stack

🌐 Frontend Technologies

  • Framework: React.js with Vite
  • UI Components: ShadCN
  • Styling: TailwindCSS
  • Icons: Lucide
  • Animations: Framer Motion
  • State Management: React Hooks

🛠️ Development Tools

  • Build Tool: Vite
  • Package Manager: npm/pnpm
  • Code Quality: ESLint
  • Version Control: Git
  • Deployment: Vercel

🔧 Future Enhancements

  • Backend integration with Node.js
  • User preferences storage
  • Algorithm performance history
  • Custom algorithm support

📂 Project Structure

SortVision/                  # Main project repository
├── .github/                 # GitHub specific configurations
│   ├── ISSUE_TEMPLATE/      # Templates for GitHub issues
│   │   ├── bug_report.md    # Bug report template
│   │   ├── config.yml       # Issue template configuration
│   │   ├── documentation.md # Documentation request template
│   │   ├── feature_request.md # Feature request template
│   │   └── performance.md   # Performance issue template
│   ├── dependabot.yml       # Dependabot configuration
│   └── pull_request_template.md # PR template
├── .gitignore               # Git ignore configuration
├── .vite/                   # Vite build tool cache
│   └── deps/                # Dependency optimization cache
│       ├── _metadata.json   # Dependency metadata
│       └── package.json     # Dependency package information
├── CODE_OF_CONDUCT.md       # Community code of conduct
├── CONTRIBUTING.md          # Contribution guidelines
├── LICENSE                  # MIT license file
├── README.md                # Project documentation (this file)
├── SECURITY.md              # Security policy and reporting
└── SortVision/              # Main application directory
    ├── .env.example         # Environment variables template
    ├── .gitignore           # Application-specific git ignore
    ├── components.json      # Component configuration
    ├── eslint.config.js     # ESLint configuration
    ├── index.html           # Main HTML entry point
    ├── jsconfig.json        # JavaScript configuration
    ├── package-lock.json    # NPM package lock
    ├── package.json         # NPM package definition
    ├── pnpm-lock.yaml       # PNPM package lock
    ├── prerender.js         # Prerendering logic for SEO
    ├── public/              # Public static assets
    │   ├── devTools/        # Developer tools directory
    │   │   ├── core.js      # Core utilities and initialization
    │   │   ├── device-info.js # Device detection and information
    │   │   ├── index.js     # Main entry point for debug tools
    │   │   ├── monitoring.js # Performance monitoring utilities
    │   │   ├── performance.js # Performance metrics tracking
    │   │   └── ui.js        # Debug UI components and panel
    │   ├── favicon.svg      # Site favicon
    │   ├── google12e2679e2ea95334.html # Google site verification
    │   ├── manifest.json    # PWA manifest
    │   ├── mobile.css       # Mobile-specific styles
    │   ├── og-image.png     # Open Graph image for sharing
    │   ├── robots.txt       # Search engine crawling instructions
    │   ├── sitemap.xml      # Site map for search engines
    │   ├── splash.svg       # App splash screen
    │   └── sw.js            # Service worker for offline support
    ├── scripts/             # Build and utility scripts
    │   ├── build-with-seo.js # Build script with SEO optimization
    │   └── generate-sitemap.js # Sitemap generator
    ├── src/                 # Source code directory
    │   ├── App.css          # App-level styles
    │   ├── App.jsx          # Main App component
    │   ├── algorithms/      # Sorting algorithm implementations
    │   │   ├── bubbleSort.jsx # Bubble sort implementation
    │   │   ├── bucketSort.jsx # Bucket sort implementation
    │   │   ├── heapSort.jsx # Heap sort implementation
    │   │   ├── index.js     # Algorithm exports
    │   │   ├── insertionSort.jsx # Insertion sort implementation
    │   │   ├── mergeSort.jsx # Merge sort implementation
    │   │   ├── quickSort.jsx # Quick sort implementation
    │   │   ├── radixSort.jsx # Radix sort implementation
    │   │   └── selectionSort.jsx # Selection sort implementation
    │   ├── components/      # UI components
    │   │   ├── MobileOverlay.jsx # Mobile device support
    │   │   ├── SEOContent.jsx # SEO content component
    │   │   ├── SortingVisualizer.jsx # Main visualization component
    │   │   ├── panels/      # UI panels directory
    │   │   │   ├── ConfigPanel.jsx # Configuration panel
    │   │   │   ├── ContributionPanel.jsx # Contribution information panel
    │   │   │   ├── DetailsPanel.jsx # Algorithm details panel
    │   │   │   ├── MetricsPanel.jsx # Performance metrics panel
    │   │   │   ├── config/  # Configuration components
    │   │   │   │   ├── AlgorithmSelector.jsx # Algorithm selection
    │   │   │   │   ├── ArraySizeControl.jsx # Array size controls
    │   │   │   │   ├── ComplexityInfo.jsx # Complexity information
    │   │   │   │   ├── ControlButtons.jsx # Control buttons
    │   │   │   │   ├── SpeedControl.jsx # Animation speed control
    │   │   │   │   └── index.js # Config component exports
    │   │   │   ├── contributions/ # Contribution-related components
    │   │   │   │   ├── ContributionHeader.jsx # Contribution header
    │   │   │   │   ├── guide/   # Contribution guides
    │   │   │   │   │   ├── BestPractices.jsx # Best practices guide
    │   │   │   │   │   ├── ContributeGuide.jsx # How to contribute guide
    │   │   │   │   │   ├── QuickReferences.jsx # Quick reference guide
    │   │   │   │   │   └── index.js # Guide component exports
    │   │   │   │   ├── index.js # Contribution component exports
    │   │   │   │   └── overview/ # Contribution overview
    │   │   │   │       ├── ContributorList.jsx # List of contributors
    │   │   │   │       ├── ContributorStats.jsx # Contributor statistics
    │   │   │   │       ├── RepositoryHealth.jsx # Repository health metrics
    │   │   │   │       └── index.js # Overview component exports
    │   │   │   ├── details/ # Detail components
    │   │   │   │   ├── AlgorithmDetails.jsx # Algorithm detail display
    │   │   │   │   ├── AlgorithmInfo.jsx # Algorithm information
    │   │   │   │   ├── AlgorithmSelector.jsx # Algorithm selection
    │   │   │   │   ├── DataPanel.jsx # Data display panel
    │   │   │   │   ├── FunFact.jsx # Fun facts about algorithms
    │   │   │   │   ├── InteractiveTip.jsx # Interactive tips
    │   │   │   │   └── index.js # Detail component exports
    │   │   │   ├── index.js # Panel component exports
    │   │   │   └── metrics/ # Metric components
    │   │   │       ├── AlgorithmComparison.jsx # Algorithm comparisons
    │   │   │       ├── CurrentRunMetrics.jsx # Current run metrics
    │   │   │       ├── RankingCard.jsx # Algorithm ranking display
    │   │   │       ├── TestControls.jsx # Testing controls
    │   │   │       ├── WinnerSummary.jsx # Algorithm comparison results
    │   │   │       └── index.js # Metric component exports
    │   │   ├── sortingVisualizer/ # Visualization components
    │   │   │   ├── PerformanceMetrics.jsx # Performance display
    │   │   │   ├── SortingControls.jsx # Sorting control buttons
    │   │   │   ├── SortingHeader.jsx # Visualization header
    │   │   │   ├── SortingVisualizer.jsx # Main visualizer
    │   │   │   └── index.js # Visualizer component exports
    │   │   ├── ui/          # UI component library
    │   │   │   ├── badge.jsx # Badge component
    │   │   │   ├── button.jsx # Button component
    │   │   │   ├── card.jsx # Card component
    │   │   │   ├── input.jsx # Input component
    │   │   │   ├── select.jsx # Select dropdown component
    │   │   │   ├── slider.jsx # Slider component
    │   │   │   └── tabs.jsx # Tabs component
    │   │   └── visualizations/ # Visualization components
    │   │       ├── ArrayVisualization.jsx # Array visual representation
    │   │       └── index.js # Visualization component exports
    │   ├── index.css        # Global styles
    │   ├── lib/             # Library utilities
    │   │   └── utils.js     # Shared utility functions
    │   ├── main.jsx         # Application entry point
    │   └── utils/           # Utility modules
    │       └── seo.js       # SEO optimization utilities
    ├── vercel.json          # Vercel deployment configuration
    └── vite.config.js       # Vite configuration

📁 Key Directories and Files:

  • src/algorithms/: Contains implementations of various sorting algorithms with step-by-step visualization logic
  • src/components/: React components organized by functionality (panels, visualizations, UI elements)
  • src/components/panels/contributions/: Complete contribution system with guides, statistics, and contributor information
  • public/devTools/: Development and debugging tools for performance monitoring and device information
  • .github/ISSUE_TEMPLATE/: Comprehensive issue templates for bugs, features, documentation, and performance
  • scripts/: Build automation and SEO optimization scripts
  • SECURITY.md: Security policy and vulnerability reporting guidelines

📸 Screenshots

Visualizer & Metric Selection Screens

Visualizer Screen Metric Screen Metric Screen
Visualizer Screen Metric Screen Details Screen
DevTools Panel DevTools Performance Monitoring DevTools Device Information
DevTools Panel Performance Monitoring Device Information

🚀 Quick Start

  1. Visit the Website Try the WebSite

  2. Choose an Algorithm

    • Select from the available sorting algorithms
    • Adjust visualization parameters
  3. Start Visualizing

    • Click "Start" to begin the visualization
    • Use controls to adjust speed and pause/resume

🛠️ Developer Tools

SortVision includes a comprehensive suite of developer tools designed to enhance the development experience, debug performance issues, and monitor application behavior in real-time. These tools are intelligently restricted to development environments only and are automatically blocked in production deployments for security and performance optimization.

🔐 Security & Access Control

The DevTools implement a sophisticated access control system:

  • Development-Only Access: Tools are completely inaccessible in production environments
  • URL-Based Authentication: Requires specific query parameters for activation
  • Domain Restrictions: Automatically detects and blocks access on production domains
  • Performance Protection: Prevents performance degradation in live environments

⚡ Accessing DevTools

Prerequisites

  • Node.js development environment
  • Local development server running
  • Modern browser with JavaScript enabled

Access Methods

  1. Standard Development Access:

    npm run dev
    # or
    pnpm dev
  2. DevTools Activation:

    http://localhost:3000/?cr7=goat
    
  3. Alternative Local URLs:

    http://127.0.0.1:3000/?cr7=goat
    http://localhost:5173/?cr7=goat  # Vite default port
    

🛡️ Security Note: The query parameter cr7=goat acts as a development key and is intentionally obscure to prevent accidental activation. This parameter is completely ignored in production environments.

🧰 DevTools Feature Suite

📊 Performance Monitoring

Real-time performance tracking with detailed metrics:

  • Frame Rate Analysis

    • Live FPS counter with historical data
    • Frame time distribution graphs
    • Performance bottleneck detection
    • Smooth/choppy animation identification
  • Memory Usage Tracking

    • Heap memory consumption monitoring
    • Memory leak detection
    • Garbage collection impact analysis
    • Memory usage trends and patterns
  • Rendering Performance

    • Component render time tracking
    • Re-render frequency analysis
    • DOM manipulation performance
    • CSS animation performance metrics
  • Algorithm Execution Metrics

    • Sorting algorithm performance comparison
    • Step-by-step execution timing
    • Memory allocation during sorting
    • Optimization opportunity identification

📱 Device Information Panel

Comprehensive device and browser analysis:

  • Hardware Specifications

    • CPU core count and architecture
    • Available RAM and usage
    • GPU information and capabilities
    • Screen resolution and pixel density
  • Browser Environment

    • User agent string analysis
    • Supported web APIs
    • JavaScript engine details
    • CSS feature support matrix
  • Network Information

    • Connection type and speed
    • Bandwidth estimation
    • Latency measurements
    • Network quality assessment
  • Viewport and Display

    • Screen dimensions and orientation
    • Color depth and HDR support
    • Touch capability detection
    • Device pixel ratio

💻 Console Integration

Enhanced debugging capabilities:

  • Formatted Logging

    • Color-coded log levels
    • Structured data visualization
    • Error stack trace enhancement
    • Performance timing logs
  • Interactive Debugging

    • Variable inspection tools
    • Breakpoint management
    • Call stack visualization
    • Memory snapshot analysis

📈 Advanced Monitoring Features

  • Algorithm Visualization Metrics

    • Animation frame consistency
    • Sorting step accuracy verification
    • Visual element positioning tracking
    • User interaction response times
  • Resource Loading Analysis

    • Asset loading performance
    • Bundle size impact assessment
    • Lazy loading effectiveness
    • Critical resource identification
  • Error Tracking & Reporting

    • Runtime error capture
    • Promise rejection handling
    • Component error boundaries
    • Performance regression detection

🔍 Using DevTools for Development

Basic Usage

  1. Panel Management

    // Toggle DevTools panel
    // Click "TOGGLE PANEL" button in the floating widget
    
    // Close DevTools completely
    // Click "CLOSE" button to hide all tools
  2. Performance Monitoring

    // Monitor specific algorithm performance
    // Select algorithm and watch real-time metrics
    // Compare performance across different array sizes
    // Identify performance bottlenecks during sorting

Advanced Development Workflows

  1. Performance Optimization

    • Use FPS monitoring to identify animation issues
    • Analyze memory usage during long sorting operations
    • Monitor rendering performance with different array sizes
    • Compare algorithm efficiency in real-time
  2. Cross-Device Testing

    • Verify responsive design across different screen sizes
    • Test touch interactions on mobile devices
    • Analyze performance on low-end devices
    • Ensure compatibility across browser engines
  3. Algorithm Development

    • Debug new sorting algorithm implementations
    • Verify correctness of sorting steps
    • Optimize animation performance
    • Test edge cases and error handling

Performance Optimization Tips

  • Memory Management

    // Monitor memory during array operations
    // Identify memory leaks in algorithm implementations
    // Optimize garbage collection patterns
  • Rendering Optimization

    // Track component re-renders
    // Identify unnecessary DOM updates
    // Optimize CSS animations for 60fps

⚙️ Technical Implementation

Architecture Overview

  • Modular Design: Each tool is implemented as an independent module
  • Event-Driven: Uses observer pattern for real-time updates
  • Non-Intrusive: Minimal impact on application performance
  • Conditional Loading: Only loads when explicitly requested

File Structure

public/devTools/
├── index.js          # Main entry point and tool orchestration
├── core.js           # Core utilities and initialization logic
├── performance.js    # Performance monitoring implementation
├── device-info.js    # Device detection and analysis
├── monitoring.js     # Real-time monitoring utilities
└── ui.js            # User interface components and styling

API Integration

// Example DevTools API usage
window.devTools = {
  performance: {
    startMonitoring(),
    getMetrics(),
    createReport()
  },
  device: {
    getInfo(),
    runDiagnostics(),
    exportData()
  }
};

🚨 Troubleshooting

Common Issues

  1. DevTools Not Loading

    # Verify development server is running
    npm run dev
    
    # Check URL parameters
    http://localhost:3000/?cr7=goat
    
    # Clear browser cache
    Ctrl+Shift+R (Windows/Linux)
    Cmd+Shift+R (Mac)
  2. Performance Issues

    // If DevTools impact performance:
    // 1. Close unnecessary monitoring panels
    // 2. Reduce monitoring frequency
    // 3. Disable heavy metrics collection
  3. Browser Compatibility

    // Supported browsers:
    // Chrome 80+, Firefox 75+, Safari 13+, Edge 80+
    // Some features may be limited in older browsers

Performance Considerations

  • Development Impact: DevTools add ~2-5% performance overhead
  • Memory Usage: Additional 10-20MB RAM usage when active
  • Network: Minimal network impact (local tools only)
  • Battery: May increase battery usage on mobile devices

🎪 Advanced Features

Custom Metrics

// Add custom performance markers
performance.mark('algorithm-start');
// ... sorting algorithm execution
performance.mark('algorithm-end');
performance.measure('algorithm-duration', 'algorithm-start', 'algorithm-end');

Export Capabilities

  • Performance reports in JSON format
  • Device information as downloadable data
  • Memory usage charts and graphs
  • Algorithm performance comparisons

Integration with Popular Tools

  • React DevTools: Enhanced component inspection
  • Chrome DevTools: Extended performance profiling
  • Lighthouse: Performance audit integration
  • WebPageTest: Network performance analysis

🎯 Best Practices

  1. Development Workflow

    • Always test with DevTools enabled during development
    • Use performance metrics to guide optimization decisions
    • Monitor memory usage during algorithm development
    • Regularly check device compatibility
  2. Performance Testing

    • Test on various device specifications
    • Monitor performance across different array sizes
    • Verify smooth animations at 60fps
    • Check memory usage patterns
  3. Debugging Strategy

    • Use console integration for systematic debugging
    • Leverage performance metrics for bottleneck identification
    • Monitor device information for compatibility issues
    • Track user interaction patterns

💡 Pro Tip: Use DevTools data to create performance budgets and ensure consistent user experience across all devices and browsers.


👨‍🔧 Detailed Setup

Prerequisites

  • Node.js (v16.10.0 or higher)
  • npm or pnpm package manager
  • Git for version control

Installation Steps

  1. Clone the Repository

    git clone https://github.com/alienx5499/SortVision.git
  2. Navigate to Project Directory

    cd SortVision
  3. Install Dependencies

    npm install
    # or
    pnpm install
  4. Start Development Server

    npm run dev
    # or
    pnpm dev
  5. Open in Browser

    • Visit http://localhost:3000
    • Start exploring sorting algorithms!

🎯 Target Audience

👨‍🎓 Students

  • Visual learning of sorting algorithms
  • Understanding time complexity
  • Algorithm comparison and analysis

👨‍🏫 Educators

  • Interactive teaching tool
  • Algorithm demonstration
  • Performance visualization

👨‍💻 Developers

  • Algorithm implementation reference
  • Performance optimization insights
  • Code structure examples

📊 Data Enthusiasts

  • Algorithm behavior analysis
  • Performance comparison
  • Data structure visualization

🤝 Contributing

We ❤️ open source! Your contributions make this project better.

How to Contribute

  1. Fork the Repository

    git clone https://github.com/your-username/SortVision.git
  2. Create Feature Branch

    git checkout -b feature/amazing-feature
  3. Commit Changes

    git commit -m "Add amazing feature"
  4. Push to Branch

    git push origin feature/amazing-feature
  5. Open Pull Request

Contribution Guidelines

  • Follow the existing code style
  • Add tests for new features
  • Update documentation
  • Keep commits clean and meaningful

Awesome Contributors

Thank you for contributing to our repository



📜 License

This project is licensed under the MIT License - see the LICENSE file for details.


📬 Feedback & Suggestions

We value your input! Share your thoughts through GitHub Issues.

💡 Let's work together to enhance the understanding of sorting algorithms!

About

SortVision is a web-based sorting algorithm visualizer 🖥️ that lets users explore and compare algorithms like Bubble, Quick, Merge, and more 🔄. Easily adjust speed ⚡ and array size 📊 to watch the sorting process in real-time. Perfect for students and enthusiasts looking to understand sorting mechanics!

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published