Sanjayraju30 commited on
Commit
ac922de
Β·
verified Β·
1 Parent(s): eeff389

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -0
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)