A React-based interactive matrix visualization tool designed for competitive programming practice and algorithm visualization.
- Interactive grid-based matrix visualization
- Customizable matrix dimensions (up to 40x40)
- Cell highlighting with click interactions
- Mouseless Navigation: Navigate the grid using vim keys:
- h, j, k, l: Move left, down, up, and right across the matrix.
- f: Toggle the color of the currently selected cell.
- i: Toggle between 0-based and 1-based indexing.
- r, c: Jump to the rows or columns input fields (which clear on focus, updating on navigation if left empty).
- e: Reset/erase the current cell coloring.
- Clean, responsive UI built with Tailwind CSS
- Node.js (v14 or later)
- npm or yarn
-
Clone the repository:
git clone https://github.com/ashishpawar517/matrix-visualizer-for-cp.git
-
Navigate to the project directory:
cd matrix-visualizer-for-cp
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser and visit
http://localhost:5173
- Adjust Matrix Size: Use the row and column inputs to resize the matrix (1-40 dimensions). The inputs automatically clear when focused via keyboard navigation and revert if no new value is entered.
- Highlight Cells: Click on any cell to highlight or unhighlight it.
- Mouseless Navigation: Use:
- h, j, k, l to move the selection cursor around the matrix.
- f to toggle the cell color.
- i to switch indexing between 0-based and 1-based.
- r, c to quickly jump to the rows or columns input fields.
- e to reset/clear all highlighted cells.
- Reset: Click the reset button or press e to clear all highlighted cells.
- Cell Coordinates: Each cell displays its (row, column) coordinates.
- React with TypeScript
- Tailwind CSS for styling
- Vite for fast development and building
- Lucide React for icons
src/
├── components/
│ ├── Cell.tsx # Individual cell component
│ ├── ControlBar.tsx # Controls for matrix dimensions and reset
│ └── Matrix.tsx # Main matrix grid component
├── types/
│ └── index.ts # TypeScript interfaces
├── utils/
│ └── matrixUtils.ts # Utility functions for matrix operations
└── App.tsx # Main application component
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the GNU v3 License - see the LICENSE file for details.
- Inspired by the needs of competitive programmers to visualize matrix-based algorithms.
- Built with React and Tailwind CSS.