-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
76 lines (64 loc) · 1.67 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Usage:
# streamlit run app.py
import streamlit as st
from utils import (
get_final_df,
show_correlation_tab,
show_description_tab,
show_predictive_tab,
show_relationship_tab,
)
# Make page content wider
st.set_page_config(
page_title="ESG x Market Performance",
page_icon=":earth_americas:",
layout="wide",
)
# Allow long selection columns to scroll
st.markdown(
"""
<style>
[data-testid="column"] > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div {
overflow: auto;
max-height: 90vh;
}
</style>
""",
unsafe_allow_html=True,
)
# Hide the streamlit backend features in serve
st.markdown(
"""
<style>
#MainMenu {visibility: hidden;}
header {visibility: hidden;}
footer {visibility: hidden;}
</style>
""",
unsafe_allow_html=True,
)
# Set the title
st.title("ESG x Market Performance :earth_americas:")
st.markdown("""Nathan Alakija, Nicole ElChaar, Mason Otley, Xiaozhe Zhang""")
# Use three main tabs: Description, Relationship Model, and Predictive Model
tab_list = [
"Description",
"ESG Metric Details",
"Relationship Model",
"Predictive Model",
]
description_tab, correlation_tab, relationship_tab, predictive_tab = st.tabs(tab_list)
# Store the final df for manipulation across all tabs
final_df = get_final_df()
# Description page
with description_tab:
show_description_tab()
# Show ESG score details
with correlation_tab:
show_correlation_tab(final_df)
# Relationship Model page
with relationship_tab:
show_relationship_tab(final_df)
# Predictive Model page
with predictive_tab:
show_predictive_tab(final_df)