Prasanna1622 commited on
Commit
d1512e5
·
verified ·
1 Parent(s): 9d4d82f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -15
app.py CHANGED
@@ -1,26 +1,22 @@
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)
 
1
  # app.py
 
2
  import streamlit as st
3
  from salesforce_integration import fetch_poles
 
4
  from modules.visuals import display_dashboard, display_charts
5
+ import pandas as pd
6
 
7
+ # Title
8
+ st.title("📡 VIEP Smart Poles Dashboard")
9
 
10
+ # Get data
 
 
 
11
  df = fetch_poles()
12
 
13
+ # 1. System Summary (Show first)
14
+ display_dashboard(df)
15
+
16
+ # 2. Pole Table
17
  st.subheader("📋 Pole Table")
18
+ st.dataframe(df, use_container_width=True)
19
 
20
+ # 3. Charts (Energy + Alert Breakdown)
21
+ display_charts(df)
 
22