Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# app.py
|
2 |
+
|
3 |
+
import streamlit as st
|
4 |
+
from salesforce_integration import fetch_poles
|
5 |
+
import plotly.express as px
|
6 |
+
from modules.visuals import display_dashboard, display_charts
|
7 |
+
|
8 |
+
|
9 |
+
|
10 |
+
st.title("π‘ VIEP Smart Poles Dashboard (Salesforce Data)")
|
11 |
+
|
12 |
+
# Fetch Data
|
13 |
+
df = fetch_poles()
|
14 |
+
|
15 |
+
# Display Table
|
16 |
+
st.subheader("π Pole Table")
|
17 |
+
st.dataframe(df)
|
18 |
+
|
19 |
+
# Charts
|
20 |
+
st.subheader("β Energy Generation (Solar vs Wind)")
|
21 |
+
st.plotly_chart(px.bar(df, x="Name", y=["Solar_Generation__c", "Wind_Generation__c"], barmode="group"))
|
22 |
+
|
23 |
+
st.subheader("π₯ Camera Status")
|
24 |
+
st.plotly_chart(px.pie(df, names="Camera_Status__c", hole=0.4))
|
25 |
+
display_dashboard(df)
|
26 |
+
display_charts(df)
|