WardhaMetroFlow icon indicating copy to clipboard operation
WardhaMetroFlow copied to clipboard

Enhance WardhaMetroFlow with Historical Analytics & Export Features

Open shupandee opened this issue 1 year ago • 1 comments

📋 Issue Description WardhaMetroFlow is an interactive Streamlit dashboard that visualizes real-time congestion levels across Wardha Metro stations. Currently, the application provides a basic heatmap view with simulated congestion data and a simple refresh mechanism. We're looking to enhance this prototype with historical data tracking, trend analytics, and data export capabilities to make it more useful for both passengers and metro administrators. 🎯 Objective Add three key features to transform WardhaMetroFlow from a simple real-time viewer into a comprehensive congestion analysis tool:

Historical Data Logging - Track congestion levels over time Trend Visualization - Display congestion patterns with line charts CSV Export Functionality - Enable data download for external analysis

🔧 Proposed Changes Feature 1: Historical Data Storage

Implement a data structure (using st.session_state) to store congestion readings with timestamps Each refresh should append new data points to the historical log Include a "Clear History" button to reset accumulated data Store data format: {timestamp, station_name, congestion_percentage}

Feature 2: Analytics Dashboard Tab

Add a new page option "Analytics" to the sidebar navigation Create line charts showing congestion trends over time for each station Use Plotly or Matplotlib for interactive visualizations Display statistics: average congestion, peak times, min/max values per station Add filters to view data by:

Time range (last 10 refreshes, last hour, etc.) Individual stations or all stations combined Congestion level thresholds (e.g., only show red-level incidents)

Feature 3: Export Functionality

Add a "Download Data" button that exports historical data as CSV Include both summary statistics and raw timestamped readings Format the CSV with proper headers and human-readable timestamps Bonus: Add option to export the current map view as a PNG image

💡 Implementation Suggestions python# Example structure for historical data if "history" not in st.session_state: st.session_state["history"] = []

On each refresh, append to history

timestamp = datetime.now() for station, level in congestion_levels.items(): st.session_state["history"].append({ "timestamp": timestamp, "station": station, "congestion": level }) ✅ Acceptance Criteria

Historical data persists across refreshes within the same session Analytics page displays at least one line chart showing congestion trends CSV export downloads successfully with proper formatting Code follows existing style and structure conventions No breaking changes to existing "About" and "This App" pages Documentation updated in the About section to describe new features

🚀 Getting Started

Fork the repository and create a new branch: feature/historical-analytics Set up the development environment:

bash pip install streamlit pandas numpy folium streamlit-folium plotly

Test your changes locally: streamlit run app.py Submit a pull request with a clear description of your implementation

🏷️ Labels hacktoberfest good-first-issue enhancement python streamlit data-visualization 📚 Resources

Streamlit Session State Documentation Plotly Python Graphing Library Pandas DataFrame to CSV

🤝 Contributing We welcome contributions from developers of all skill levels! This is a great opportunity to work with real-world data visualization tools and contribute to an open-source project. Feel free to ask questions in the comments if you need clarification on any aspect of the implementation. Estimated Difficulty: Intermediate Time Commitment: 4-6 hours Skills Required: Python, Streamlit, Pandas, Data Visualization Happy coding! 🎃👻

@Manjushwarofficial please assign this to me

shupandee avatar Oct 27 '25 12:10 shupandee

Thank you for raising this issue!

We'll review it as soon as possible. We truly appreciate your contributions! ✨

Meanwhile make sure you've visited the README.md, CONTRIBUTING.md, CODE_OF_CONDUCT.md and our discord before creating a PR for this. Also, please do NOT create a PR until this issue has been assigned to you 😊.

github-actions[bot] avatar Oct 27 '25 12:10 github-actions[bot]