-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapp.py
More file actions
225 lines (180 loc) · 10.2 KB
/
app.py
File metadata and controls
225 lines (180 loc) · 10.2 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
import streamlit as st # type: ignore
import pandas as pd # type: ignore
from modules.lottie_animation import load_lottie_url
from streamlit_lottie import st_lottie
from modules.data_loader import load_data
from modules.filters import filter_data
from modules.modrendesign_kpi import modern_metrics
from modules.visualizations import (plot_3d_heatmaps_in_funding_rounds,
plot_bubble_funding_growth_per_years, plot_countries_by_funding, plot_funding_by_market,
plot_funding_distribution_by_status, plot_startup_by_state_of_usa,
plot_startup_distribution_by_countries, plot_total_global_funding_by_country,
plot_yearly_funding_trends)
from modules.data_usa_load import load_usa_data
# call the animation function
lottie_animation=load_lottie_url("assets/footer_animation.json")
# set the page for the dashboard
st.set_page_config(page_title="Startup Dashboard",layout="wide",page_icon=":chart_with_upwards_trend:")
# load the data
df=load_data()
# title of the dashboard
# custom style for title
# Inject CSS to Style st.title()
st.markdown("""
<style>
/* Custom Style for st.title() */
div[data-testid="stAppViewContainer"] h1 {
color: #00c8ff !important; /* Bright Cyan */
font-size: 42px !important;
font-weight: bold !important;
text-align: center;
text-shadow: 2px 2px 5px rgba(0, 200, 255, 0.5);
}
</style>
""", unsafe_allow_html=True)
# Use st.title()
st.title("📊 Startup Investment Analytics Dashboard")
# Sidebar Title with Custom Styling
st.sidebar.markdown("""
<style>
.sidebar-title {
color: #FFFFFF; /* Vibrant Orange */
text-align: center;
font-size: 26px;
font-weight: bold;
padding: 10px 5px;
border-radius: 8px;
background: linear-gradient(90deg, rgba(255, 133, 19, 0.9), rgba(255, 87, 51, 0.9));
box-shadow: 2px 2px 5px rgba(255, 133, 24, 0.5);
border: 2px solid #ffffff;
margin-bottom: 20px; /* Adds space below the title */
}
</style>
<h2 class="sidebar-title">🏆 Quantum Queries</h2>
""", unsafe_allow_html=True)
# on side bar add the logo of the project
st.sidebar.markdown("""
<style>
.sidebar-logo {
display: block;
margin: 5px auto; /* Adds space above and centers the logo */
padding: 10px;
}
</style>
""", unsafe_allow_html=True)
st.sidebar.markdown('<div class="sidebar-logo">', unsafe_allow_html=True)
st.sidebar.image("assets/logo.webp", width=160)
st.sidebar.markdown('</div>', unsafe_allow_html=True)
# filter option for the dashboard
st.sidebar.title("Filters")
selected_country = filter_data("Select Country", df["region"].dropna().unique()) if "region" in df else []
selected_market = filter_data("Select Market or Category", df["market"].dropna().unique()) if "market" in df else []
selected_country_codes = filter_data("Select Country Code", df["country_code"].dropna().unique()) if "country_code" in df else []
selected_state_codes = filter_data("Select State Data", df["state_code"].dropna().unique()) if "state_code" in df else []
filtered_data=df[(df['market'].isin(selected_market)) & (df['region'].isin(selected_country)) & (df['state_code'].isin(selected_state_codes)) & (df['country_code'].isin(selected_country_codes))]
#key metrics for the dashboard
modern_metrics(filtered_data)
st.markdown("---")
# data visualizations
col1,col2=st.columns(2)
with col1:
# Section for Charts
st.markdown("<h2 class='medium-font'>📊 Total Funding By Market</h2>", unsafe_allow_html=True)
st.plotly_chart(plot_funding_by_market(filtered_data),use_container_width=True)
st.markdown("📊 Summary : The Total Funding by Market analysis highlights the distribution of funding across different industries, helping investors identify high-growth sectors and market trends.")
with col2:
# Country by Funding
st.markdown("<h2 class='medium-font'>📊 Country by Funding</h2>", unsafe_allow_html=True)
st.plotly_chart(plot_countries_by_funding(filtered_data),use_container_width=True)
st.markdown("📊 Summary: The Funding by Country Code analysis provides insights into how investment is distributed across different countries, helping investors identify key markets and emerging opportunities.")
st.markdown("---")
col3,col4=st.columns(2)
with col3:
# Funding Distribution by Status
st.markdown("<h2 class='medium-font'>📊 Funding Distribution by Status</h2>", unsafe_allow_html=True)
st.plotly_chart(plot_funding_distribution_by_status(filtered_data),use_container_width=True)
st.markdown("📊 Summary:The Funding Distribution by Startup Status analysis categorizes funding based on a startup's current status—Operating, Closed, or Acquired. This helps investors understand how capital flows across active, failed, and merged startups, providing insights into market stability and investment risks.")
with col4:
st.markdown("<h2 class='medium-font'>📊 Top 10 Countries that Large Number of Startup</h2>", unsafe_allow_html=True)
st.plotly_chart(plot_startup_distribution_by_countries(filtered_data),use_container_width=True)
st.markdown("📊 Summary:The Number of Startups by Country Code analysis showcases the distribution of startups across different countries, helping investors and analysts identify regions with high entrepreneurial activity and emerging startup ecosystems.")
st.markdown("---")
# Advanced Visualizations
# Number of Startups by State in the USA
state_count=load_usa_data(df)
st.markdown("<h2 class='medium-font'>📊 Number of Startups by State in the USA</h2>", unsafe_allow_html=True)
st.plotly_chart(plot_startup_by_state_of_usa(state_count),use_container_width=True)
st.markdown("📊 Summary:The Number of Startups by U.S. State analysis highlights the distribution of startups across different states in the U.S., helping investors and policymakers identify key startup hubs and emerging innovation centers")
st.markdown("---")
# 3D Correelation Heatmap by Funding Rounds
st.markdown("<h2 class='medium-font'>📊 3D Correlation Heatmap by Funding Rounds</h2>", unsafe_allow_html=True)
st.plotly_chart(plot_3d_heatmaps_in_funding_rounds(filtered_data),use_container_width=True)
st.markdown(" Summary : 📊 3D Funding Correlation Heatmap – A 3D heatmap revealing relationships between different startup funding rounds, helping investors understand funding trends.")
st.markdown("---")
# Total Funding by Country
st.markdown("<h2 class='medium-font'>📊 Total Funding by Country</h2>", unsafe_allow_html=True)
st.plotly_chart(plot_total_global_funding_by_country(filtered_data),use_container_width=True)
st.markdown("📊 Summary:The Total Funding by Country analysis provides insights into the overall investment received by startups in different countries, helping investors identify leading markets and assess global funding trends.")
st.markdown("---")
# Yearly Funding Trends
st.markdown("<h2 class='medium-font'>📊 Yearly Funding Trends</h2>", unsafe_allow_html=True)
start_year, end_year = st.slider("Select Year Range for line",
min_value=df["first_funding_year"].min(),
max_value=df["first_funding_year"].max(),
value=(df["first_funding_year"].min(), df["first_funding_year"].max()))
year_filtered_data_line_chart = df[(df["first_funding_year"] >= start_year) & (df["first_funding_year"] <= end_year)]
st.plotly_chart(plot_yearly_funding_trends(year_filtered_data_line_chart),use_container_width=True)
st.markdown("📊 Summary:This analysis tracks funding patterns over the years, helping investors identify growth trends, market fluctuations, and emerging investment opportunities.")
st.markdown("---")
# funding growth per year
st.markdown("<h2 class='medium-font'>📊 Funding Growth by Years</h2>", unsafe_allow_html=True)
start_year, end_year = st.slider("Select Year Range for Growth",
min_value=df["first_funding_year"].min(),
max_value=df["first_funding_year"].max(),
value=(df["first_funding_year"].min(), df["first_funding_year"].max()))
year_filtered_data = df[(df["first_funding_year"] >= start_year) & (df["first_funding_year"] <= end_year)]
st.plotly_chart(plot_bubble_funding_growth_per_years(year_filtered_data),use_container_width=True)
st.markdown("📊 Summary:This analysis highlights the yearly funding growth, showcasing trends in investment increases, market expansion, and sector-wise funding shifts over time.")
# footer section of my Dashboard
st.markdown("---")
col5,col6=st.columns([1.5,2])
with col5:
st.markdown("<h3 class='medium-font'>About the Project</h3>",unsafe_allow_html=True)
st.markdown("""
This **Startup Investments Analysis Dashboard** provides insights into startup funding trends,
market distribution, and more. The project aims to help investors and entrepreneurs make
data-driven decisions.
""")
st.markdown("<h3 class='medium-font'>Team Members</h3>",unsafe_allow_html=True)
st.markdown("""
"I sincerely appreciate everyone's dedication, teamwork, and hard work in making this project a success. It was a pleasure leading such a motivated team and seeing our collective efforts come to life. Looking forward to more collaborations and achievements together!" 🚀👏
- **Ankit**
- **Sadnya Kolhe**
- **Vishal Kapoor**
- **Sarika**
""")
# second columns we have the animated image
with col6:
if lottie_animation:
st_lottie(lottie_animation,height=600,width=600,key="footer_animation")
else:
st.error("Failed to load the Lottie animation. Check the file path.")
# custom css for the footer section
st.markdown("""
<style>
.footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: #262730;
color: white;
text-align: center;
padding: 10px;
font-size: 14px;
}
</style>
<div class="footer">
<p>© 2025 Startup Investments Dashboard | <b>Team : Quantum Queries </b></p>
</div>
""", unsafe_allow_html=True)