Skip to content

Repository files navigation

Intersection Signal Lab

English | 简体中文

Node.js 24 pnpm 10.33.2 React 19.2.8 Vite 8.2.1 TypeScript 6.0.3 Sass 1.102.0 Test Coverage License Sponsor

An interactive 2D lab for exploring protected traffic-signal phases at three-, four-, and five-way intersections. Compare countdown policies, tune phase durations, and watch deterministic vehicle queues respond to independent left, through, and right signals.

Live application: shenzhepei.github.io/intersection-signal-lab

Intersection Signal Lab showing simultaneous protected left turns from opposing entrances

Features

  • Switch between explicit 3-way, 4-way, and 5-way route models.
  • Inspect independent red, yellow, and green states for left, through, and right movements.
  • Compare always-visible, last-10-seconds, and hidden countdown modes.
  • Adjust through/right green, protected-left green, yellow, and all-red intervals.
  • Pause, step, reset, and run the deterministic simulation at 0.5x, 1x, or 2x speed.
  • Use the complete English and Simplified Chinese interface on desktop or mobile.
  • Restore validated settings from local browser storage without a backend.

Development

Requires Node.js 24 and pnpm 10.33.2.

pnpm install
pnpm dev

Quality checks:

pnpm typecheck
pnpm test:coverage
pnpm build

Simulation Model

The simulator uses right-hand traffic and practical protected teaching phases. Opposing approaches at a four-way intersection run together for through/right traffic and protected left turns. The main road at a three-way intersection is paired where movements are compatible; five-way approaches remain individually protected because the symmetric layout has no true opposing pair. Yellow and all-red clearance intervals separate every phase. A signal's red countdown represents time until its next green interval.

This application is an educational visualization. It is not certified traffic-engineering software and must not be used for field signal timing, regulatory compliance, or safety decisions.

License

MIT © 2026 shenzhepei

About

Interactive 2D lab for exploring traffic signal phases across three-, four-, and five-way intersections.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages