Skip to content

zhenyu666-debug/ditiediantu

Repository files navigation

Beijing Metro Real-time Passenger Flow PWA

Beijing Subway real-time passenger flow point-cloud monitoring - Progressive Web App.

Features

  • 22 Beijing metro lines (Lines 1/2/4-10/13-17/19 + Changping/Yizhuang/Fangshan/S1/Xijiao/Capital Airport/Daxing Airport)
  • Real-time updates every second
  • Point-cloud visualization (Canvas 2D)
  • Line switching and per-station filtering
  • PWA: installable on iOS / Android / desktop, works offline
  • Responsive mobile-first design, fullscreen mode, share API

Quick Start (30 seconds - just double-click!)

Option 0: Download the EXE (Windows, easiest - no Python required)

  1. Go to the Releases page
  2. Download the latest \ditiediantu.exe\ (~8 MB)
  3. Double-click \ditiediantu.exe4. Wait 3 seconds. Your browser opens automatically. Close the window to stop.

That is it. No Python, no Node, no setup, no install.

Option 1: Download and double-click (recommended)

  1. Go to the Releases page
  2. Download the latest zip (e.g. v1.0.1)
  3. Extract to any folder
  4. Windows: double-click start.bat macOS: double-click start.command Linux: run ./start.sh from terminal Cross-platform: double-click start.py
  5. Wait 3 seconds - your browser opens automatically. Close the launcher window to stop.

The launcher will:

  • Detect Python automatically (py -3 / python3 / python)
  • Find a free port in 8080-8089
  • Open your default browser after 3 seconds
  • Show the running status and URL

If Python is not installed: download from https://www.python.org/downloads/ (be sure to check Add Python to PATH during install).

Option 2: Clone and run

`�ash git clone https://github.com/zhenyu666-debug/ditiediantu.git cd ditiediantu python -m http.server 8080

Open http://localhost:8080 in your browser

`

Deploy Online

GitHub Pages (free)

  1. Repo Settings -> Pages
  2. Source: main branch -> Save
  3. Visit https://zhenyu666-debug.github.io/ditiediantu/

Vercel (free + auto HTTPS)

�ash npm i -g vercel cd ditiediantu vercel

Project Structure

ditiediantu/ +- ditiediantu.exe # Windows EXE (PyInstaller, ~8 MB) +- launcher.py # Python source for the EXE +- start.bat # Windows one-click launcher +- start.py # Cross-platform Python launcher +- start.sh # Linux one-click launcher +- start.command # macOS one-click launcher +- index.html # Main app +- manifest.json # PWA manifest +- sw.js # Service Worker (offline cache) +- offline.html # Offline fallback page +- icons/ # App icons (72/96/128/144/152/192/384/512 PNG) +- generate_icons.py # Pillow icon generator +- generate-icons.html # Browser-based icon generator (no Python needed) +- deploy_github.py # One-click GitHub Pages deploy

Generate Icons

Two ways:

Option A - Browser (no Python):

  1. Open generate-icons.html in your browser
  2. Click each Download button
  3. Save PNG files to the icons/ folder

Option B - Python: �ash pip install Pillow python generate_icons.py

PWA Install

Once served over HTTP(S), browsers will offer an install option:

  • iOS Safari: Share -> Add to Home Screen
  • Android Chrome: Menu -> Install App
  • Desktop Chrome/Edge: install icon in address bar

Build the EXE from Source

Requires PyInstaller 6.x and Python 3.6+ on the build machine.

Run PyInstaller with the same data args listed in ditiediantu.spec:

pip install pyinstaller
pyinstaller --noconfirm --onefile --console --name ditiediantu \
  --add-data "index.html;." \
  --add-data "manifest.json;." \
  --add-data "sw.js;." \
  --add-data "offline.html;." \
  --add-data "icons;icons" \
  launcher.py

Result: dist/ditiediantu.exe (~8 MB).

Tech Stack

  • Native HTML / CSS / JavaScript (no build tooling, no runtime deps)
  • Canvas 2D point-cloud rendering (60 points per frame, DPR-aware)
  • Web App Manifest + Service Worker (PWA standard)
  • Python http.server for dev (any static server works)

Data Note

This demo uses simulated data based on typical Beijing metro flow patterns (morning peak 7-9, evening peak 17-19, off-peak / night reductions). For real data, integrate Beijing Transportation Authority APIs or commercial providers (AutoNavi / Amap SDK, etc.).

Browser Support

Chrome 67+ / Safari 11.1+ / Firefox 44+ / Edge 79+ / iOS Safari 11.3+ / Android Chrome 67+

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors