ogegadavis254
commited on
Commit
•
df288fd
1
Parent(s):
103ff43
Update app.py
Browse files
app.py
CHANGED
@@ -192,6 +192,26 @@ def create_excel_report(data):
|
|
192 |
output.seek(0)
|
193 |
return output
|
194 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
# Streamlit app layout
|
196 |
st.markdown('<div class="header">Digital Skills and Employment Analytics Platform (DSEAP)</div>', unsafe_allow_html=True)
|
197 |
st.markdown('<div class="subheader">Empowering Youth Through Data-Driven Insights</div>', unsafe_allow_html=True)
|
@@ -201,6 +221,7 @@ st.sidebar.title("Navigation")
|
|
201 |
page = st.sidebar.radio("Go to", ["Home", "Skills Analysis", "Program Evaluation", "Barrier Identification", "Recommendations", "Reports"])
|
202 |
|
203 |
if page == "Home":
|
|
|
204 |
col1, col2 = st.columns([2, 1])
|
205 |
with col1:
|
206 |
st.markdown('<div class="section">', unsafe_allow_html=True)
|
@@ -234,6 +255,7 @@ if page == "Home":
|
|
234 |
st.markdown('</div>', unsafe_allow_html=True)
|
235 |
|
236 |
elif page == "Skills Analysis":
|
|
|
237 |
st.markdown('<div class="section">', unsafe_allow_html=True)
|
238 |
st.subheader("Digital Skills Demand Analysis")
|
239 |
|
@@ -283,6 +305,7 @@ elif page == "Skills Analysis":
|
|
283 |
st.markdown('</div>', unsafe_allow_html=True)
|
284 |
|
285 |
elif page == "Program Evaluation":
|
|
|
286 |
st.markdown('<div class="section">', unsafe_allow_html=True)
|
287 |
st.subheader("Digital Empowerment Program Evaluation")
|
288 |
|
@@ -297,8 +320,8 @@ elif page == "Program Evaluation":
|
|
297 |
evaluation_data = generate_simulated_data(programs)
|
298 |
|
299 |
# Plotting
|
300 |
-
|
301 |
-
|
302 |
fig.update_layout(legend_title_text='Programs')
|
303 |
st.plotly_chart(fig)
|
304 |
|
@@ -310,7 +333,7 @@ elif page == "Program Evaluation":
|
|
310 |
|
311 |
# Impact Visualization
|
312 |
impact_data = {prog: random.uniform(0, 1) for prog in programs}
|
313 |
-
fig = px.pie(values=impact_data.values(), names=impact_data.keys(), title="Program Impact Distribution")
|
314 |
st.plotly_chart(fig)
|
315 |
|
316 |
# Comparative Analysis
|
@@ -322,6 +345,7 @@ elif page == "Program Evaluation":
|
|
322 |
st.markdown('</div>', unsafe_allow_html=True)
|
323 |
|
324 |
elif page == "Barrier Identification":
|
|
|
325 |
st.markdown('<div class="section">', unsafe_allow_html=True)
|
326 |
st.subheader("Digital Skills Acquisition Barriers")
|
327 |
|
@@ -334,11 +358,17 @@ elif page == "Barrier Identification":
|
|
334 |
barrier_data = generate_simulated_data(selected_barriers)
|
335 |
|
336 |
# Plotting
|
337 |
-
fig = go.Figure(data=[go.
|
338 |
r=[max(barrier_data[cat]) for cat in selected_barriers],
|
339 |
theta=selected_barriers,
|
340 |
fill='toself'
|
341 |
)])
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
fig.update_layout(title="Barrier Intensity Analysis")
|
343 |
st.plotly_chart(fig)
|
344 |
|
@@ -376,6 +406,7 @@ elif page == "Barrier Identification":
|
|
376 |
st.markdown('</div>', unsafe_allow_html=True)
|
377 |
|
378 |
elif page == "Recommendations":
|
|
|
379 |
st.markdown('<div class="section">', unsafe_allow_html=True)
|
380 |
st.subheader("Personalized Recommendations")
|
381 |
|
@@ -436,6 +467,7 @@ elif page == "Recommendations":
|
|
436 |
st.markdown('</div>', unsafe_allow_html=True)
|
437 |
|
438 |
elif page == "Reports":
|
|
|
439 |
st.markdown('<div class="section">', unsafe_allow_html=True)
|
440 |
st.subheader("Generate Custom Reports")
|
441 |
|
|
|
192 |
output.seek(0)
|
193 |
return output
|
194 |
|
195 |
+
# Function for animated progress bar
|
196 |
+
def animated_progress_bar():
|
197 |
+
progress_bar = st.progress(0)
|
198 |
+
status_text = st.empty()
|
199 |
+
phrases = [
|
200 |
+
"Empowering youth with digital skills...",
|
201 |
+
"Unlocking your potential...",
|
202 |
+
"Building a brighter future...",
|
203 |
+
"Connecting skills to opportunities...",
|
204 |
+
"Transforming lives through technology..."
|
205 |
+
]
|
206 |
+
for i in range(100):
|
207 |
+
progress_bar.progress(i + 1)
|
208 |
+
status_text.text(random.choice(phrases))
|
209 |
+
time.sleep(0.05)
|
210 |
+
status_text.text("Ready to empower!")
|
211 |
+
time.sleep(0.5)
|
212 |
+
status_text.empty()
|
213 |
+
progress_bar.empty()
|
214 |
+
|
215 |
# Streamlit app layout
|
216 |
st.markdown('<div class="header">Digital Skills and Employment Analytics Platform (DSEAP)</div>', unsafe_allow_html=True)
|
217 |
st.markdown('<div class="subheader">Empowering Youth Through Data-Driven Insights</div>', unsafe_allow_html=True)
|
|
|
221 |
page = st.sidebar.radio("Go to", ["Home", "Skills Analysis", "Program Evaluation", "Barrier Identification", "Recommendations", "Reports"])
|
222 |
|
223 |
if page == "Home":
|
224 |
+
animated_progress_bar()
|
225 |
col1, col2 = st.columns([2, 1])
|
226 |
with col1:
|
227 |
st.markdown('<div class="section">', unsafe_allow_html=True)
|
|
|
255 |
st.markdown('</div>', unsafe_allow_html=True)
|
256 |
|
257 |
elif page == "Skills Analysis":
|
258 |
+
animated_progress_bar()
|
259 |
st.markdown('<div class="section">', unsafe_allow_html=True)
|
260 |
st.subheader("Digital Skills Demand Analysis")
|
261 |
|
|
|
305 |
st.markdown('</div>', unsafe_allow_html=True)
|
306 |
|
307 |
elif page == "Program Evaluation":
|
308 |
+
animated_progress_bar()
|
309 |
st.markdown('<div class="section">', unsafe_allow_html=True)
|
310 |
st.subheader("Digital Empowerment Program Evaluation")
|
311 |
|
|
|
320 |
evaluation_data = generate_simulated_data(programs)
|
321 |
|
322 |
# Plotting
|
323 |
+
df = pd.DataFrame(evaluation_data)
|
324 |
+
fig = px.line(df, x=df.index, y=df.columns, labels={'index': 'Time (months)', 'value': 'Performance'}, title="Program Performance Over Time")
|
325 |
fig.update_layout(legend_title_text='Programs')
|
326 |
st.plotly_chart(fig)
|
327 |
|
|
|
333 |
|
334 |
# Impact Visualization
|
335 |
impact_data = {prog: random.uniform(0, 1) for prog in programs}
|
336 |
+
fig = px.pie(values=list(impact_data.values()), names=list(impact_data.keys()), title="Program Impact Distribution")
|
337 |
st.plotly_chart(fig)
|
338 |
|
339 |
# Comparative Analysis
|
|
|
345 |
st.markdown('</div>', unsafe_allow_html=True)
|
346 |
|
347 |
elif page == "Barrier Identification":
|
348 |
+
animated_progress_bar()
|
349 |
st.markdown('<div class="section">', unsafe_allow_html=True)
|
350 |
st.subheader("Digital Skills Acquisition Barriers")
|
351 |
|
|
|
358 |
barrier_data = generate_simulated_data(selected_barriers)
|
359 |
|
360 |
# Plotting
|
361 |
+
fig = go.Figure(data=[go.Scatterpolar(
|
362 |
r=[max(barrier_data[cat]) for cat in selected_barriers],
|
363 |
theta=selected_barriers,
|
364 |
fill='toself'
|
365 |
)])
|
366 |
+
fig.update_layout(
|
367 |
+
polar=dict(
|
368 |
+
radialaxis=dict(visible=True),
|
369 |
+
),
|
370 |
+
showlegend=False
|
371 |
+
)
|
372 |
fig.update_layout(title="Barrier Intensity Analysis")
|
373 |
st.plotly_chart(fig)
|
374 |
|
|
|
406 |
st.markdown('</div>', unsafe_allow_html=True)
|
407 |
|
408 |
elif page == "Recommendations":
|
409 |
+
animated_progress_bar()
|
410 |
st.markdown('<div class="section">', unsafe_allow_html=True)
|
411 |
st.subheader("Personalized Recommendations")
|
412 |
|
|
|
467 |
st.markdown('</div>', unsafe_allow_html=True)
|
468 |
|
469 |
elif page == "Reports":
|
470 |
+
animated_progress_bar()
|
471 |
st.markdown('<div class="section">', unsafe_allow_html=True)
|
472 |
st.subheader("Generate Custom Reports")
|
473 |
|