davidsun1234/sichuan-digital-twin-dashboard
About
A lightweight Sichuan digital twin operation dashboard with Canvas map rendering, realtime simulation and bilingual documentation.
Design & MediaMeasured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.en.md
OriginalSichuan Digital Twin Dashboard
A lightweight, zero-runtime-dependency digital twin dashboard template for Sichuan province, designed for smart city operations, energy dispatching, traffic monitoring, hydrology alerts and emergency command scenarios.
中文文档 · Contributing · Security
Overview
Sichuan Digital Twin Dashboard is a browser-native data visualization project built with HTML, CSS and JavaScript. It renders prefecture-level Sichuan GeoJSON on Canvas and provides animated map layers, full city labels, route pulses, event orchestration, energy metrics, regional load ranking and a rolling coordination timeline.
The project does not depend on React, Vue, ECharts or Three.js at runtime. It is suitable as a clean starter template for:
- Smart city command centers
- Provincial energy operation dashboards
- Traffic and emergency response screens
- Hydrology, meteorology, industrial park or tourism monitoring demos
- Academic projects, visualization competitions and open-source showcases
Live Demo
After GitHub Pages is enabled, the dashboard is deployed to:
https://davidsun1234.github.io/sichuan-digital-twin-dashboard/
Run locally:
npm install
npm run dev
Open:
http://127.0.0.1:4173/
The repository also works with any static file server.
Preview

Features
Prefecture-level Sichuan map rendering
Draws 21 prefecture-level administrative regions fromassets/sichuan.geojson, including full labels, hover highlighting and tooltips.High-DPI friendly Canvas hit testing
Uses cached hit paths and unscaled Canvas coordinates to avoid pointer offset issues caused by device pixel ratio, browser zoom or CSS scaling.Animated energy module
Clean energy ratio, wind/solar output and storage response time update continuously.Dynamic regional load ranking
TOP 5 city loads update and reorder over time, with visual states for normal, warning and high-load conditions.Event orchestration feed
Rotating event cards include city name, event description, processing status and closure rate.Rolling coordination timeline
Timeline items advance automatically and highlight the active task.Zero runtime dependency
The dashboard runs with browser-native APIs only. It can be deployed to GitHub Pages, object storage, Nginx or any internal static server.Open-source ready repository structure
Includes bilingual documentation, MIT license, contributing guide, code of conduct, issue templates, pull request template, security policy and GitHub Pages workflow.
Tech Stack
| Area | Choice |
|---|---|
| Markup | HTML5 |
| Styling | CSS3, responsive Grid, Canvas overlays |
| Map rendering | Canvas 2D + GeoJSON |
| Dynamic data | Native JavaScript timers |
| Deployment | GitHub Pages / any static server |
| Runtime dependencies | None |
Project Structure
.
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ ├── workflows/
│ │ └── pages.yml
│ └── PULL_REQUEST_TEMPLATE.md
├── assets/
│ └── sichuan.geojson
├── docs/
│ └── preview.png
├── scripts/
│ └── check-project.mjs
├── app.js
├── index.html
├── styles.css
├── package.json
├── README.md
├── README.en.md
├── CONTRIBUTING.md
├── CODE_OF_CONDUCT.md
├── SECURITY.md
└── LICENSE
Quick Start
1. Clone
git clone https://github.com/davidsun1234/sichuan-digital-twin-dashboard.git
cd sichuan-digital-twin-dashboard
2. Install development dependency
npm install
3. Run locally
npm run dev
4. Validate project
npm run check
The check verifies required files, GeoJSON parseability, HTML references and obvious legacy markers.
Data Model
The current project uses simulated operational data:
cities: highlighted city points, base load and dynamic state.eventPool: event orchestration records with city, description, level and status.timelinePool: coordination timeline tasks.assets/sichuan.geojson: Sichuan prefecture-level administrative boundaries.
To connect real data, replace these functions:
updateLoadData()for regional load.updateEventList()for event orchestration.updateTimeline()for coordination timeline.updateEnergyData()for energy metrics.
Possible data sources:
- REST API
- WebSocket
- Server-Sent Events
- Local JSON files
- Edge gateway telemetry
Map Interaction Design
The map is rendered in four conceptual layers:
- Radar rings and background grid.
- Prefecture-level administrative polygons.
- Full prefecture/city labels.
- Route pulses, key points and event heat indicators.
On hover, the dashboard updates:
- Region highlight.
- Tooltip.
- Current focus area.
Deployment
GitHub Pages
The repository includes .github/workflows/pages.yml.
- Open repository
Settings. - Go to
Pages. - Set source to
GitHub Actions. - Push to
main. - GitHub Actions will deploy the static dashboard.
Nginx
server {
listen 80;
server_name dashboard.example.com;
root /var/www/sichuan-digital-twin-dashboard;
index index.html;
}
Object Storage / CDN
Upload the static files in the repository root. Ensure:
index.htmlis at the site root.assets/sichuan.geojsonis accessible.- No third-party font is bundled. The dashboard uses a system font stack by default.
Browser Support
- Chrome 100+
- Edge 100+
- Firefox 100+
- Safari 15+
The dashboard relies on Canvas 2D, CSS Grid, Fetch API and modern JavaScript.
License
Released under the MIT License.
Note: map data and third-party assets may have their own licenses. This project no longer bundles fonts with unclear redistribution terms and uses a system font stack by default. Before publishing publicly, verify that the GeoJSON data source is allowed to be redistributed in an open-source repository.
Explore related projects
Loading…