Niharmahesh commited on
Commit
e883314
·
verified ·
1 Parent(s): d1628be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -0
app.py CHANGED
@@ -148,6 +148,41 @@ def create_time_series(df, time_unit='day'):
148
  )
149
 
150
  return fig
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  def display_about_page():
152
  st.markdown("""
153
  ## What is this application?
 
148
  )
149
 
150
  return fig
151
+ def display_dashboard(df):
152
+ top_companies, top_locations, top_job_titles, df_by_date = prepare_dashboard_data(df)
153
+
154
+ today = datetime.now().date()
155
+ jobs_today = df[df['date_posted'].dt.date == today].shape[0]
156
+
157
+ col1, col2 = st.columns(2)
158
+
159
+ with col1:
160
+ st.subheader("Job Postings Overview")
161
+ st.metric("Total Job Postings", len(df))
162
+ st.metric("Unique Companies", df['company'].nunique())
163
+ st.metric("Job Postings Today", jobs_today)
164
+
165
+ min_date = df['date_posted'].min().date()
166
+ max_date = df['date_posted'].max().date()
167
+ st.write(f"Job postings from {min_date} to {max_date}")
168
+
169
+ with col2:
170
+ fig = create_chart(top_companies, top_companies.index, top_companies.values, "Top 10 Companies", ['#4e79a7'])
171
+ st.plotly_chart(fig, use_container_width=True)
172
+
173
+ # Job Postings Over Time Chart
174
+ fig_time_series = create_time_series(df)
175
+ st.plotly_chart(fig_time_series, use_container_width=True)
176
+
177
+ col3, col4 = st.columns(2)
178
+
179
+ with col3:
180
+ fig = create_chart(top_locations, top_locations.index, top_locations.values, "Top 10 Locations", ['#f28e2b'])
181
+ st.plotly_chart(fig, use_container_width=True)
182
+
183
+ with col4:
184
+ fig = create_chart(top_job_titles, top_job_titles.index, top_job_titles.values, "Top 20 Job Titles", ['#59a14f'])
185
+ st.plotly_chart(fig, use_container_width=True)
186
  def display_about_page():
187
  st.markdown("""
188
  ## What is this application?