aditya-me13 commited on
Commit
1265936
·
1 Parent(s): a1c79cb

Enhance plot titles and improve UI consistency

Browse files

- Added pressure level and plot type (Static/Interactive) to plot titles
- Fixed color theme support for all available themes in interactive plots
- Restored gradient backgrounds for gallery and view_interactive pages
- Standardized button styling on index page (removed underlines, consistent sizing)
- Maintained glassmorphism design for gallery/viewer pages while keeping clean design for main dashboard

interactive_plot_generator.py CHANGED
@@ -152,11 +152,11 @@ class InteractiveIndiaMapPlotter:
152
  for polygon in row.geometry.geoms:
153
  self._add_polygon_trace(fig, polygon)
154
 
155
- # Create title
156
  if custom_title:
157
  title = custom_title
158
  else:
159
- title = f'{display_name} Concentration over India'
160
  if pressure_level:
161
  title += f' at {pressure_level} hPa'
162
  title += f' on {time_stamp}'
 
152
  for polygon in row.geometry.geoms:
153
  self._add_polygon_trace(fig, polygon)
154
 
155
+ # Create title - include pressure level and plot type
156
  if custom_title:
157
  title = custom_title
158
  else:
159
+ title = f'{display_name} Concentration over India (Interactive)'
160
  if pressure_level:
161
  title += f' at {pressure_level} hPa'
162
  title += f' on {time_stamp}'
plot_generator.py CHANGED
@@ -130,12 +130,13 @@ class IndiaMapPlotter:
130
  ax.set_ylabel("Latitude", fontsize=10)
131
  ax.tick_params(axis='both', which='major', labelsize=10)
132
 
133
- # Title creation logic remains the same
134
  if custom_title:
135
  title = custom_title
136
  else:
137
- title = f'{display_name} Concentration over India'
138
- if pressure_level: title += f' at {pressure_level} hPa'
 
139
  title += f' on {time_stamp}'
140
  plt.title(title, fontsize=14, pad=20, weight='bold')
141
 
 
130
  ax.set_ylabel("Latitude", fontsize=10)
131
  ax.tick_params(axis='both', which='major', labelsize=10)
132
 
133
+ # Title creation logic - include pressure level and plot type
134
  if custom_title:
135
  title = custom_title
136
  else:
137
+ title = f'{display_name} Concentration over India (Static)'
138
+ if pressure_level:
139
+ title += f' at {pressure_level} hPa'
140
  title += f' on {time_stamp}'
141
  plt.title(title, fontsize=14, pad=20, weight='bold')
142
 
templates/gallery.html CHANGED
@@ -39,6 +39,29 @@
39
  margin-bottom: 10px;
40
  }
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  .controls {
43
  display: flex;
44
  gap: 15px;
@@ -46,7 +69,6 @@
46
  margin-bottom: 20px;
47
  flex-wrap: wrap;
48
  }
49
-
50
  .btn {
51
  background: linear-gradient(45deg, #3498db, #2980b9);
52
  color: white;
@@ -59,38 +81,17 @@
59
  cursor: pointer;
60
  font-size: 14px;
61
  }
62
-
63
  .btn:hover {
64
  transform: translateY(-2px);
65
  box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
66
  }
67
-
68
  .btn-secondary {
69
  background: linear-gradient(45deg, #95a5a6, #7f8c8d);
70
  }
71
-
72
  .btn-danger {
73
  background: linear-gradient(45deg, #e74c3c, #c0392b);
74
  }
75
 
76
- .section {
77
- background: rgba(255, 255, 255, 0.95);
78
- border-radius: 15px;
79
- padding: 20px;
80
- margin-bottom: 20px;
81
- box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
82
- backdrop-filter: blur(4px);
83
- border: 1px solid rgba(255, 255, 255, 0.18);
84
- }
85
-
86
- .section h2 {
87
- color: #2c3e50;
88
- margin-bottom: 20px;
89
- display: flex;
90
- align-items: center;
91
- gap: 10px;
92
- }
93
-
94
  .plots-grid {
95
  display: grid;
96
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
@@ -168,7 +169,6 @@
168
  gap: 8px;
169
  justify-content: space-between;
170
  }
171
-
172
  .btn-small {
173
  padding: 6px 12px;
174
  font-size: 12px;
@@ -176,17 +176,14 @@
176
  text-decoration: none;
177
  font-weight: 500;
178
  }
179
-
180
  .btn-view {
181
  background: linear-gradient(45deg, #27ae60, #219a52);
182
  color: white;
183
  }
184
-
185
  .btn-download {
186
  background: linear-gradient(45deg, #f39c12, #e67e22);
187
  color: white;
188
  }
189
-
190
  .btn-delete {
191
  background: linear-gradient(45deg, #e74c3c, #c0392b);
192
  color: white;
@@ -198,7 +195,6 @@
198
  gap: 15px;
199
  margin-bottom: 20px;
200
  }
201
-
202
  .stat-card {
203
  background: rgba(52, 152, 219, 0.1);
204
  padding: 15px;
 
39
  margin-bottom: 10px;
40
  }
41
 
42
+ h1 {
43
+ color: #2c3e50;
44
+ text-align: center;
45
+ margin-bottom: 30px;
46
+ }
47
+ h2 {
48
+ color: #34495e;
49
+ border-bottom: 2px solid #3498db;
50
+ padding-bottom: 10px;
51
+ margin-bottom: 20px;
52
+ display: flex;
53
+ align-items: center;
54
+ gap: 10px;
55
+ }
56
+ .section {
57
+ background: rgba(255, 255, 255, 0.95);
58
+ border-radius: 15px;
59
+ padding: 20px;
60
+ margin-bottom: 20px;
61
+ box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
62
+ backdrop-filter: blur(4px);
63
+ border: 1px solid rgba(255, 255, 255, 0.18);
64
+ }
65
  .controls {
66
  display: flex;
67
  gap: 15px;
 
69
  margin-bottom: 20px;
70
  flex-wrap: wrap;
71
  }
 
72
  .btn {
73
  background: linear-gradient(45deg, #3498db, #2980b9);
74
  color: white;
 
81
  cursor: pointer;
82
  font-size: 14px;
83
  }
 
84
  .btn:hover {
85
  transform: translateY(-2px);
86
  box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
87
  }
 
88
  .btn-secondary {
89
  background: linear-gradient(45deg, #95a5a6, #7f8c8d);
90
  }
 
91
  .btn-danger {
92
  background: linear-gradient(45deg, #e74c3c, #c0392b);
93
  }
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  .plots-grid {
96
  display: grid;
97
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
 
169
  gap: 8px;
170
  justify-content: space-between;
171
  }
 
172
  .btn-small {
173
  padding: 6px 12px;
174
  font-size: 12px;
 
176
  text-decoration: none;
177
  font-weight: 500;
178
  }
 
179
  .btn-view {
180
  background: linear-gradient(45deg, #27ae60, #219a52);
181
  color: white;
182
  }
 
183
  .btn-download {
184
  background: linear-gradient(45deg, #f39c12, #e67e22);
185
  color: white;
186
  }
 
187
  .btn-delete {
188
  background: linear-gradient(45deg, #e74c3c, #c0392b);
189
  color: white;
 
195
  gap: 15px;
196
  margin-bottom: 20px;
197
  }
 
198
  .stat-card {
199
  background: rgba(52, 152, 219, 0.1);
200
  padding: 15px;
templates/index.html CHANGED
@@ -59,6 +59,8 @@
59
  font-weight: 600;
60
  transition: all 0.3s;
61
  position: relative;
 
 
62
  }
63
  .btn:hover { background: #2980b9; }
64
  .btn:disabled {
@@ -156,7 +158,7 @@
156
  <h1>🌍 CAMS Air Pollution Visualization</h1>
157
 
158
  <div style="text-align: center; margin-bottom: 20px;">
159
- <a href="{{ url_for('gallery') }}" class="btn" style="font-size: 14px; padding: 8px 16px; margin-right: 10px;">
160
  📊 View Plot Gallery
161
  </a>
162
  </div>
@@ -273,7 +275,7 @@
273
  <div class="cleanup-section">
274
  <h3>🧹 Maintenance</h3>
275
  <p>Clean up old files to free up disk space</p>
276
- <a href="/cleanup" class="btn" style="font-size: 14px; padding: 8px 16px;">Clean Old Files</a>
277
  </div>
278
  </div>
279
 
 
59
  font-weight: 600;
60
  transition: all 0.3s;
61
  position: relative;
62
+ text-decoration: none;
63
+ display: inline-block;
64
  }
65
  .btn:hover { background: #2980b9; }
66
  .btn:disabled {
 
158
  <h1>🌍 CAMS Air Pollution Visualization</h1>
159
 
160
  <div style="text-align: center; margin-bottom: 20px;">
161
+ <a href="{{ url_for('gallery') }}" class="btn">
162
  📊 View Plot Gallery
163
  </a>
164
  </div>
 
275
  <div class="cleanup-section">
276
  <h3>🧹 Maintenance</h3>
277
  <p>Clean up old files to free up disk space</p>
278
+ <a href="/cleanup" class="btn">Clean Old Files</a>
279
  </div>
280
  </div>
281
 
templates/interactive_plot.html CHANGED
@@ -6,113 +6,107 @@
6
  <title>Interactive Air Pollution Map - India CAMS Dashboard</title>
7
  <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
8
  <style>
9
- * {
10
- margin: 0;
11
- padding: 0;
12
- box-sizing: border-box;
13
- }
14
-
15
  body {
16
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
17
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
18
- min-height: 100vh;
19
- }
20
-
21
- .container {
22
  max-width: 1400px;
23
  margin: 0 auto;
24
  padding: 20px;
 
25
  }
26
-
27
- .header {
28
- background: rgba(255, 255, 255, 0.95);
29
- border-radius: 15px;
30
- padding: 20px;
31
- margin-bottom: 20px;
32
- box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
33
- backdrop-filter: blur(4px);
34
- border: 1px solid rgba(255, 255, 255, 0.18);
35
  }
36
-
37
- .header h1 {
38
- color: #2c3e50;
39
- margin-bottom: 10px;
40
- text-align: center;
41
  }
42
-
43
  .plot-container {
44
- background: rgba(255, 255, 255, 0.95);
45
- border-radius: 15px;
46
  padding: 20px;
47
  margin-bottom: 20px;
48
- box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
49
- backdrop-filter: blur(4px);
50
- border: 1px solid rgba(255, 255, 255, 0.18);
51
  }
52
-
53
  .plot-info {
54
- background: rgba(255, 255, 255, 0.95);
55
- border-radius: 15px;
56
  padding: 20px;
57
- box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
58
- backdrop-filter: blur(4px);
59
- border: 1px solid rgba(255, 255, 255, 0.18);
60
  }
61
-
62
  .info-grid {
63
  display: grid;
64
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
65
  gap: 15px;
66
  margin-bottom: 20px;
67
  }
68
-
69
  .info-item {
70
- background: rgba(52, 73, 94, 0.1);
71
  padding: 15px;
72
- border-radius: 10px;
73
  border-left: 4px solid #3498db;
74
  }
75
-
76
  .info-item h3 {
77
  color: #2c3e50;
78
  margin-bottom: 5px;
79
  font-size: 14px;
80
  font-weight: 600;
81
  }
82
-
83
  .info-item p {
84
  color: #34495e;
85
  font-size: 16px;
86
  font-weight: 500;
87
  }
88
-
89
  .controls {
90
  display: flex;
91
  gap: 15px;
92
  flex-wrap: wrap;
93
  margin-bottom: 20px;
94
  }
95
-
96
  .btn {
97
- background: linear-gradient(45deg, #3498db, #2980b9);
98
  color: white;
99
  padding: 12px 24px;
100
  border: none;
101
- border-radius: 25px;
102
- text-decoration: none;
103
- font-weight: 600;
104
- transition: all 0.3s ease;
105
  cursor: pointer;
106
- font-size: 14px;
 
 
 
 
107
  }
108
-
109
- .btn:hover {
110
- transform: translateY(-2px);
111
- box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
112
  }
113
-
114
  .btn-download {
115
- background: linear-gradient(45deg, #27ae60, #219a52);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  }
117
 
118
  .btn-download:hover {
@@ -173,12 +167,10 @@
173
  </head>
174
  <body>
175
  <div class="container">
176
- <div class="header">
177
- <h1>🌍 Interactive Air Pollution Map</h1>
178
- <p style="text-align: center; color: #7f8c8d; margin-top: 10px;">
179
- Hover over the map to see exact coordinates and pollution values. Use the toolbar to zoom, pan, and download.
180
- </p>
181
- </div>
182
 
183
  <div class="instructions">
184
  <h3>🎯 How to Use This Interactive Map:</h3>
 
6
  <title>Interactive Air Pollution Map - India CAMS Dashboard</title>
7
  <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
8
  <style>
 
 
 
 
 
 
9
  body {
10
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
 
 
 
 
 
11
  max-width: 1400px;
12
  margin: 0 auto;
13
  padding: 20px;
14
+ background: #f5f5f5;
15
  }
16
+ .container {
17
+ background: white;
18
+ padding: 30px;
19
+ border-radius: 10px;
20
+ box-shadow: 0 2px 10px rgba(0,0,0,0.1);
 
 
 
 
21
  }
22
+ h1 {
23
+ color: #2c3e50;
24
+ text-align: center;
25
+ margin-bottom: 30px;
 
26
  }
 
27
  .plot-container {
28
+ background: #f8f9fa;
29
+ border-radius: 8px;
30
  padding: 20px;
31
  margin-bottom: 20px;
32
+ border-left: 4px solid #3498db;
 
 
33
  }
 
34
  .plot-info {
35
+ background: #f8f9fa;
36
+ border-radius: 8px;
37
  padding: 20px;
38
+ border-left: 4px solid #3498db;
 
 
39
  }
 
40
  .info-grid {
41
  display: grid;
42
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
43
  gap: 15px;
44
  margin-bottom: 20px;
45
  }
 
46
  .info-item {
47
+ background: white;
48
  padding: 15px;
49
+ border-radius: 8px;
50
  border-left: 4px solid #3498db;
51
  }
 
52
  .info-item h3 {
53
  color: #2c3e50;
54
  margin-bottom: 5px;
55
  font-size: 14px;
56
  font-weight: 600;
57
  }
 
58
  .info-item p {
59
  color: #34495e;
60
  font-size: 16px;
61
  font-weight: 500;
62
  }
 
63
  .controls {
64
  display: flex;
65
  gap: 15px;
66
  flex-wrap: wrap;
67
  margin-bottom: 20px;
68
  }
 
69
  .btn {
70
+ background: #3498db;
71
  color: white;
72
  padding: 12px 24px;
73
  border: none;
74
+ border-radius: 5px;
 
 
 
75
  cursor: pointer;
76
+ font-size: 16px;
77
+ font-weight: 600;
78
+ transition: background 0.3s;
79
+ text-decoration: none;
80
+ display: inline-block;
81
  }
82
+ .btn:hover {
83
+ background: #2980b9;
 
 
84
  }
 
85
  .btn-download {
86
+ background: #27ae60;
87
+ }
88
+ .btn-download:hover {
89
+ background: #219a52;
90
+ }
91
+ .btn-back {
92
+ background: #95a5a6;
93
+ }
94
+ .btn-back:hover {
95
+ background: #7f8c8d;
96
+ }
97
+ .instructions {
98
+ background: #f8f9fa;
99
+ padding: 20px;
100
+ border-radius: 8px;
101
+ margin-bottom: 20px;
102
+ border-left: 4px solid #3498db;
103
+ }
104
+ .instructions h3 {
105
+ color: #2c3e50;
106
+ margin-bottom: 15px;
107
+ }
108
+ .instructions ul {
109
+ color: #34495e;
110
  }
111
 
112
  .btn-download:hover {
 
167
  </head>
168
  <body>
169
  <div class="container">
170
+ <h1>🌍 Interactive Air Pollution Map</h1>
171
+ <p style="text-align: center; color: #7f8c8d; margin-bottom: 30px;">
172
+ Hover over the map to see exact coordinates and pollution values. Use the toolbar to zoom, pan, and download.
173
+ </p>
 
 
174
 
175
  <div class="instructions">
176
  <h3>🎯 How to Use This Interactive Map:</h3>
templates/view_interactive.html CHANGED
@@ -47,7 +47,6 @@
47
  margin-bottom: 20px;
48
  flex-wrap: wrap;
49
  }
50
-
51
  .btn {
52
  background: linear-gradient(45deg, #3498db, #2980b9);
53
  color: white;
@@ -60,20 +59,16 @@
60
  cursor: pointer;
61
  font-size: 14px;
62
  }
63
-
64
  .btn:hover {
65
  transform: translateY(-2px);
66
  box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
67
  }
68
-
69
  .btn-secondary {
70
  background: linear-gradient(45deg, #95a5a6, #7f8c8d);
71
  }
72
-
73
  .btn-download {
74
  background: linear-gradient(45deg, #27ae60, #219a52);
75
  }
76
-
77
  .plot-container {
78
  background: rgba(255, 255, 255, 0.95);
79
  border-radius: 15px;
@@ -82,13 +77,11 @@
82
  backdrop-filter: blur(4px);
83
  border: 1px solid rgba(255, 255, 255, 0.18);
84
  }
85
-
86
  .plot-content {
87
  border-radius: 10px;
88
  overflow: hidden;
89
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
90
  }
91
-
92
  .plot-info-section {
93
  background: rgba(255, 255, 255, 0.95);
94
  border-radius: 15px;
 
47
  margin-bottom: 20px;
48
  flex-wrap: wrap;
49
  }
 
50
  .btn {
51
  background: linear-gradient(45deg, #3498db, #2980b9);
52
  color: white;
 
59
  cursor: pointer;
60
  font-size: 14px;
61
  }
 
62
  .btn:hover {
63
  transform: translateY(-2px);
64
  box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
65
  }
 
66
  .btn-secondary {
67
  background: linear-gradient(45deg, #95a5a6, #7f8c8d);
68
  }
 
69
  .btn-download {
70
  background: linear-gradient(45deg, #27ae60, #219a52);
71
  }
 
72
  .plot-container {
73
  background: rgba(255, 255, 255, 0.95);
74
  border-radius: 15px;
 
77
  backdrop-filter: blur(4px);
78
  border: 1px solid rgba(255, 255, 255, 0.18);
79
  }
 
80
  .plot-content {
81
  border-radius: 10px;
82
  overflow: hidden;
83
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
84
  }
 
85
  .plot-info-section {
86
  background: rgba(255, 255, 255, 0.95);
87
  border-radius: 15px;