This project is a China province migration data visualization dashboard built using Streamlit, NetworkX, and Plotly. Users can view migration relationships and statistics between provinces by selecting different provinces and migration directions (Inbound/Outbound).
- Interactive Map: Display the locations of provinces, migration relationships, and migration flows across China.
- Data Filtering: Allows viewing an overall overview or detailed analysis by selecting a specific province.
- Detailed Summary: Shows statistical summaries of inbound, outbound, and intra-province migration data for quick insights.
- Stylish Hover Labels: Custom hover labels display detailed data with customizable background colors and font styles.
-
data/province_coordinates_china.csv
Contains latitude, longitude, abbreviation, and full name information for each province to plot node positions on the map. -
data/province_migration_china.csv
Contains migration data between provinces, including source province, destination province, and migration counts. -
data/province_migration_summary_china.csv
Summarizes inbound, outbound, and intra-province migration data for each province, used to generate data summaries.
- Streamlit: For building the web application and interactive interface.
- NetworkX: For constructing the migration graph based on the CSV data (nodes and edges).
- Plotly: For generating interactive maps and charts.
- Clone the repository:
git clone https://github.com/mluckydream/population-migration-model.git
- Clone the repository:
git clone https://github.com/mluckydream/population-migration-model.git
- Create a virtual environment (recommended):
python3.12 -m venv venv
- Activate the virtual environment:
source venv/bin/activate # Linux/Mac # or on Windows: venv\Scripts\activate
- Install the required dependencies:
pip install -r requirements.txt
- Run the Streamlit application:
streamlit run migration_app.py