LovnishVerma commited on
Commit
f49bfe4
·
verified ·
1 Parent(s): 1cc319d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -8
app.py CHANGED
@@ -80,23 +80,25 @@ st.markdown("""
80
  color: #0f172a !important;
81
  }
82
 
83
- /* Link Button Fix - CRITICAL OVERRIDE */
84
  [data-testid="stSidebar"] a {
85
- color: #3b82f6 !important; /* Brighter blue */
 
86
  font-weight: 700 !important;
87
  text-decoration: none;
88
- background-color: #ffffff !important; /* Force white background for button look */
89
- border: 1px solid #e2e8f0 !important;
90
  border-radius: 8px !important;
91
- padding: 8px 16px !important;
92
  display: inline-block !important;
93
  text-align: center !important;
94
  width: 100% !important;
 
95
  }
96
  [data-testid="stSidebar"] a:hover {
97
- background-color: #f1f5f9 !important;
98
- color: #2563eb !important;
99
- border-color: #cbd5e1 !important;
 
100
  }
101
 
102
  /* Link Button Container Background */
@@ -157,6 +159,7 @@ def fetch_coordinates_batch(unique_locations):
157
  pass # File corrupted, start fresh
158
 
159
  # 2. Add Hardcoded Pre-fills (High Priority Redundancy)
 
160
  prefills = {
161
  ('Gautam Buddha Nagar', 'Uttar Pradesh'): (28.39, 77.65),
162
  ('West Jaintia Hills', 'Meghalaya'): (25.55, 92.38),
@@ -251,6 +254,18 @@ def load_data():
251
  df['district'] = df['district'].astype(str).str.strip()
252
  df['state'] = df['state'].astype(str).str.strip()
253
 
 
 
 
 
 
 
 
 
 
 
 
 
254
  # Get Unique Locations
255
  unique_locs = list(
256
  df[['district', 'state']].drop_duplicates().itertuples(index=False, name=None))
 
80
  color: #0f172a !important;
81
  }
82
 
83
+ /* Link Button Fix - CRITICAL OVERRIDE FOR DARK TEXT */
84
  [data-testid="stSidebar"] a {
85
+ background-color: #3b82f6 !important; /* Brighter blue background */
86
+ color: #ffffff !important; /* White text for contrast */
87
  font-weight: 700 !important;
88
  text-decoration: none;
89
+ border: 1px solid #2563eb !important;
 
90
  border-radius: 8px !important;
91
+ padding: 10px 16px !important;
92
  display: inline-block !important;
93
  text-align: center !important;
94
  width: 100% !important;
95
+ box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
96
  }
97
  [data-testid="stSidebar"] a:hover {
98
+ background-color: #2563eb !important;
99
+ color: #ffffff !important;
100
+ border-color: #1d4ed8 !important;
101
+ transform: translateY(-1px);
102
  }
103
 
104
  /* Link Button Container Background */
 
159
  pass # File corrupted, start fresh
160
 
161
  # 2. Add Hardcoded Pre-fills (High Priority Redundancy)
162
+ # These override if missing, but usually JSON is preferred source if present
163
  prefills = {
164
  ('Gautam Buddha Nagar', 'Uttar Pradesh'): (28.39, 77.65),
165
  ('West Jaintia Hills', 'Meghalaya'): (25.55, 92.38),
 
254
  df['district'] = df['district'].astype(str).str.strip()
255
  df['state'] = df['state'].astype(str).str.strip()
256
 
257
+ # --- FIX DUPLICATE STATES ---
258
+ # Standardize State Names to remove variations (e.g., J&K)
259
+ state_mapping = {
260
+ 'Jammu & Kashmir': 'Jammu and Kashmir',
261
+ 'J&K': 'Jammu and Kashmir',
262
+ 'Orissa': 'Odisha',
263
+ 'Chattisgarh': 'Chhattisgarh',
264
+ 'Telengana': 'Telangana',
265
+ 'Pondicherry': 'Puducherry'
266
+ }
267
+ df['state'] = df['state'].replace(state_mapping)
268
+
269
  # Get Unique Locations
270
  unique_locs = list(
271
  df[['district', 'state']].drop_duplicates().itertuples(index=False, name=None))