Spaces:
Sleeping
Sleeping
Commit
·
c8290d2
1
Parent(s):
433fed0
feat: updated app script
Browse files
app.py
CHANGED
|
@@ -193,7 +193,6 @@ if page == "Summary":
|
|
| 193 |
inbound_values = [23, 77] # Adjust the values
|
| 194 |
labels = ['Outbound', 'Inbound']
|
| 195 |
color_scheme = ['#155F7A', '#29b5e8']
|
| 196 |
-
title = 'States Migration'
|
| 197 |
|
| 198 |
donut_fig = create_donut_chart(inbound_values, labels, color_scheme, title)
|
| 199 |
st.plotly_chart(donut_fig, use_container_width=True)
|
|
@@ -212,6 +211,11 @@ if page == "Summary":
|
|
| 212 |
'z': np.random.randn(100)
|
| 213 |
})
|
| 214 |
fig_cluster = px.scatter_3d(df_cluster, x='x', y='y', z='z', color='Cluster')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 215 |
st.plotly_chart(fig_cluster, use_container_width=True)
|
| 216 |
|
| 217 |
st.markdown('#### Sales by Cluster')
|
|
@@ -220,7 +224,7 @@ if page == "Summary":
|
|
| 220 |
sales_data = {'Cluster': ['Cluster 1', 'Cluster 2', 'Cluster 3', 'Cluster 4'],
|
| 221 |
'Sales': [400000, 600000, 500000, 300000]}
|
| 222 |
df_sales = pd.DataFrame(sales_data)
|
| 223 |
-
fig_sales = px.bar(df_sales, x='Cluster', y='Sales'
|
| 224 |
st.plotly_chart(fig_sales, use_container_width=True)
|
| 225 |
|
| 226 |
# Right Column (Blue): Key Metrics Overview and Data Preparation Summary
|
|
|
|
| 193 |
inbound_values = [23, 77] # Adjust the values
|
| 194 |
labels = ['Outbound', 'Inbound']
|
| 195 |
color_scheme = ['#155F7A', '#29b5e8']
|
|
|
|
| 196 |
|
| 197 |
donut_fig = create_donut_chart(inbound_values, labels, color_scheme, title)
|
| 198 |
st.plotly_chart(donut_fig, use_container_width=True)
|
|
|
|
| 211 |
'z': np.random.randn(100)
|
| 212 |
})
|
| 213 |
fig_cluster = px.scatter_3d(df_cluster, x='x', y='y', z='z', color='Cluster')
|
| 214 |
+
fig_cluster.update_layout(
|
| 215 |
+
scene=dict(aspectratio=dict(x=1, y=1, z=0.7)), # Control the aspect ratio
|
| 216 |
+
margin=dict(t=0, b=0, l=0, r=0), # Tighten margins
|
| 217 |
+
height=400, # Shrink the height to fit page better
|
| 218 |
+
)
|
| 219 |
st.plotly_chart(fig_cluster, use_container_width=True)
|
| 220 |
|
| 221 |
st.markdown('#### Sales by Cluster')
|
|
|
|
| 224 |
sales_data = {'Cluster': ['Cluster 1', 'Cluster 2', 'Cluster 3', 'Cluster 4'],
|
| 225 |
'Sales': [400000, 600000, 500000, 300000]}
|
| 226 |
df_sales = pd.DataFrame(sales_data)
|
| 227 |
+
fig_sales = px.bar(df_sales, x='Cluster', y='Sales')
|
| 228 |
st.plotly_chart(fig_sales, use_container_width=True)
|
| 229 |
|
| 230 |
# Right Column (Blue): Key Metrics Overview and Data Preparation Summary
|