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