Skip to content

A comprehensive, interactive web application for visualizing and understanding DOM events, event phases, and event propagation in real-time. Built with React, TypeScript, and modern web technologies.

License

Notifications You must be signed in to change notification settings

yurtsever/ui-event-visualizer

Repository files navigation

UI Event Visualizer

A comprehensive, interactive web application for visualizing and understanding DOM events, event phases, and event propagation in real-time. Built with React, TypeScript, and modern web technologies.

🌟 Features

Event Monitoring

  • Real-time Event Capture: Monitor mouse, pointer, keyboard, focus, touch, clipboard, and drag & drop events
  • Event Phase Visualization: See events in capturing, target, and bubbling phases
  • Live Event Stream: Watch events as they happen with millisecond precision
  • Comprehensive Event Details: View event properties, coordinates, keys, and more

Interactive Playground

  • Interactive Elements: Buttons, inputs, textareas, and draggable elements for testing
  • Event Filtering: Filter events by type, phase, or content
  • Configurable Event Groups: Enable/disable specific event categories
  • Smoke Test: Run predefined event sequences for testing

Advanced Features

  • Event Timeline: Visual timeline showing recent event sequences
  • Detailed Log Table: Comprehensive event log with all properties
  • Responsive Design: Works on desktop and mobile devices
  • Modern UI: Built with Shadcn/UI components and Tailwind CSS

🚀 Live Demo

Website

🛠️ Technology Stack

  • Frontend: React 18, TypeScript
  • Styling: Tailwind CSS, Shadcn/UI
  • Build Tool: Next.js 15
  • Event Handling: Native DOM Event Listeners
  • State Management: React Hooks
  • Architecture: Clean Architecture with component separation

📦 Installation

Prerequisites

  • Node.js 18+
  • npm

Setup

# Clone the repository
git clone https://github.com/your-username/ui-event-visualize.git
cd ui-event-visualize

# Install dependencies
npm install

# Run development server
npm run dev

# Build for production
npm run build

# Start production server
npm start

🔧 Usage

Basic Event Monitoring

  1. Open the application in your browser
  2. Interact with elements in the playground area
  3. Watch events appear in real-time in the log table
  4. Use the timeline to see event sequences

Event Configuration

  • Enable/Disable Events: Use checkboxes to control which events to monitor
  • Phase Control: Toggle capturing and bubbling phase listeners
  • Filtering: Use the search box to find specific events
  • Max Rows: Adjust the maximum number of events to display

Testing Features

  • Smoke Test: Click "Run smoke test" to generate a predictable event sequence
  • Pause/Resume: Stop and resume event monitoring
  • Clear Log: Reset the event log

🏗️ Architecture

The application follows Clean Architecture principles with clear separation of concerns:

components/visualizer/
├── types.ts              # Type definitions and constants
├── utils.ts              # Pure utility functions
├── use-event-manager.ts  # Custom hook for event management
├── visualizer.tsx        # Main orchestrator component
├── control-panel.tsx     # Control interface
├── playground.tsx        # Interactive testing area
├── timeline.tsx          # Event timeline visualization
├── event-log-table.tsx   # Event log display
└── phase-badge.tsx       # Event phase indicators

🎯 Use Cases

For Developers

  • Event Debugging: Understand complex event flows
  • Performance Analysis: Monitor event timing and frequency
  • Cross-browser Testing: Verify event behavior across browsers
  • Educational Purposes: Learn about DOM events and phases

For Educators

  • Web Development Classes: Demonstrate event concepts
  • Interactive Learning: Visual representation of event propagation
  • Code Examples: Real-world event handling examples

For QA Engineers

  • Event Testing: Verify event handling in applications
  • Regression Testing: Ensure events work after changes
  • Cross-platform Testing: Test on different devices and browsers

🔍 Event Types Supported

Category Events
Mouse mousedown, mouseup, click, dblclick, contextmenu, mouseenter, mouseleave, mousemove
Pointer pointerdown, pointerup, pointermove, pointerenter, pointerleave
Keyboard keydown, keypress, keyup, beforeinput, input, composition events
Focus focus, blur, focusin, focusout
Touch touchstart, touchend, touchmove, touchcancel
Clipboard copy, cut, paste
Drag & Drop dragstart, dragover, dragenter, dragleave, drop, dragend

🎨 Customization

Adding New Event Types

// In types.ts
export const ALL_EVENT_GROUPS: Record<string, string[]> = {
  custom: ["customevent1", "customevent2"],
  // ... existing groups
};

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Development Guidelines

  1. Follow the existing code structure and patterns
  2. Use TypeScript for all new code
  3. Maintain component separation and clean architecture
  4. Add tests for new features
  5. Update documentation as needed

📝 License

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

📞 Support

If you have any questions or need help:

About

A comprehensive, interactive web application for visualizing and understanding DOM events, event phases, and event propagation in real-time. Built with React, TypeScript, and modern web technologies.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published