Add @st.cache_data to all builders, .gitignore, and live-demo badge#1
Draft
Copilot wants to merge 5 commits into
Draft
Add @st.cache_data to all builders, .gitignore, and live-demo badge#1Copilot wants to merge 5 commits into
@st.cache_data to all builders, .gitignore, and live-demo badge#1Copilot wants to merge 5 commits into
Conversation
…deployment config Co-authored-by: budugameghraj <178402503+budugameghraj@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Replace Dash-based dashboard with Streamlit version
Replace Dash dashboard with Streamlit + add Folium India route map tab
Mar 12, 2026
Owner
|
streamlit |
Co-authored-by: budugameghraj <178402503+budugameghraj@users.noreply.github.com>
Copilot
AI
changed the title
Replace Dash dashboard with Streamlit + add Folium India route map tab
Add Streamlit live demo badge and link to README
Mar 12, 2026
Co-authored-by: budugameghraj <178402503+budugameghraj@users.noreply.github.com>
Co-authored-by: budugameghraj <178402503+budugameghraj@users.noreply.github.com>
Copilot
AI
changed the title
Add Streamlit live demo badge and link to README
Add Mar 12, 2026
@st.cache_data to all builders, .gitignore, and live-demo badge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The app had no caching — every user visit and every widget interaction re-read the CSV and rebuilt all 8 charts from scratch. First-deploy load time was also a concern.
Changes
dashboard.py— added@st.cache_datato all 9 functions (load_data, every chart builder, andbuild_route_map). Results are computed once per cold start and served from cache on all subsequent interactions.README.md— added Streamlit badge and live-demo URL at the top so visitors can reach the deployed app directly..gitignore— added (was missing); excludes__pycache__/,*.pyc,.ipynb_checkpoints/, and common OS artifacts.Original prompt
Goal
Replace the existing Dash-based
dashboard.pywith a Streamlit-based dashboard that includes all 7 existing Plotly charts plus the Folium geographical map from the notebook. Add deployment config for Streamlit Community Cloud.Existing Files
SmartTourRoutePlan.ipynb— the original notebookSmartTourRoutePlanner.csv— the dataset (500 rows, 19 columns)dashboard.py— current Dash-based dashboard with 7 Plotly chartstravel_route_map.html— the Folium map output from the notebookWhat to do
1. Rewrite
dashboard.pyusing StreamlitConvert the existing Dash app to Streamlit. Keep ALL 7 existing chart functions exactly as they are (same Plotly code, same titles, same colors, same parameters):
build_traffic_time_line— Line plot: Impact of Traffic Density on Estimated Travel Timebuild_demand_heatmap— Density heatmap: Travel Demand (Day Type vs Season) with transport animationbuild_budget_satisfaction_scatter— Scatter: User Budget vs Satisfaction Rating by Transport Modebuild_cost_sankey— Sankey: Travel Cost Flow Distributionbuild_travel_preference_sunburst— Sunburst: Season → Transport Mode → Destination Typebuild_transport_radar— Radar chart comparing transport modes across travel factorsbuild_traffic_violin— Violin: Traffic density distribution by day_typeReplace Dash layout (
dcc.Tabs,dcc.Graph,html.Div) with Streamlit equivalents (st.tabs,st.plotly_chart,st.title, etc.).2. Add the Folium Map Tab — EXACT code from notebook
Add a new tab called "🗺️ Route Map" with the exact Folium map from the notebook. Use
streamlit-folium(st_folium) to embed it. Here is the exact map code to use:Then render with:
st_folium(m, width=900, height=600)3. Add
requirements.txt4. Add
.streamlit/config.toml5. Update
README.mdAdd sections for:
pip install -r requirements.txtthenstreamlit run dashboard.py)Important
travel_route_map.htmlcan remain as-is (it's a static export)st.plotly_chart(fig, use_container_width=True)for all Plotly chartsThe following is the prior conversation context from the user's chat exploration (may be truncated):
Assistant: Both projects are live! 🎉 I've analyzed everything. Here's what I found:
🧠 Project 1: SwipeTCHA
This pull request was created from Copilot chat.
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.