ZainMalik0925 commited on
Commit
3b7ba3d
·
verified ·
1 Parent(s): a68b099

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -8
app.py CHANGED
@@ -1,10 +1,11 @@
1
  import streamlit as st
2
  import pandas as pd
3
  import plotly.express as px
 
4
 
5
  # Add custom CSS for the background
6
  def add_background():
7
- background_url = "https://huggingface.co/spaces/ZainMalik0925/GreenLensAI_LCA/resolve/main/BCK1.jpg"
8
  css = f"""
9
  <style>
10
  .stApp {{
@@ -118,9 +119,11 @@ def style_figure(fig):
118
  plot_bgcolor="rgba(0,0,0,0.8)", # 20% transparency
119
  paper_bgcolor="rgba(0,0,0,0.8)", # 20% transparency
120
  font=dict(color="white"), # Font color set to white
121
- legend=dict(font=dict(color="white")) # Set legend text to white
 
 
122
  )
123
- fig.update_traces(marker_color="white") # Change bar color to white
124
  return fig
125
 
126
  # Main application logic
@@ -143,8 +146,8 @@ if fiber_impact_data and transport_impact_data and washing_impact_data:
143
 
144
  # Display numerical comparison
145
  st.subheader("Numerical Comparison")
146
- st.write(f"**Assessment 1**: Water: {water1:.2f} kL, Energy: {energy1:.2f} MJ, Carbon: {carbon1:.2f} kg CO2e")
147
- st.write(f"**Assessment 2**: Water: {water2:.2f} kL, Energy: {energy2:.2f} MJ, Carbon: {carbon2:.2f} kg CO2e")
148
 
149
  # Bar chart comparison
150
  comparison_data = pd.DataFrame({
@@ -168,9 +171,9 @@ if fiber_impact_data and transport_impact_data and washing_impact_data:
168
 
169
  # Display results
170
  st.subheader("Single Assessment Results")
171
- st.markdown(f"- **Water Footprint**: {water:.2f} kL")
172
- st.markdown(f"- **Energy Footprint**: {energy:.2f} MJ")
173
- st.markdown(f"- **Carbon Footprint**: {carbon:.2f} kg CO2e")
174
 
175
  # Bar chart for single assessment
176
  result_data = pd.DataFrame({
 
1
  import streamlit as st
2
  import pandas as pd
3
  import plotly.express as px
4
+ import plotly.graph_objects as go
5
 
6
  # Add custom CSS for the background
7
  def add_background():
8
+ background_url = "https://huggingface.co/spaces/ZainMalik0925/GreenLensAI_LCA/resolve/main/BCK2.jpg"
9
  css = f"""
10
  <style>
11
  .stApp {{
 
119
  plot_bgcolor="rgba(0,0,0,0.8)", # 20% transparency
120
  paper_bgcolor="rgba(0,0,0,0.8)", # 20% transparency
121
  font=dict(color="white"), # Font color set to white
122
+ title_font=dict(size=18, color="white"), # Title font white
123
+ xaxis=dict(title_font=dict(color="white"), tickfont=dict(color="white")),
124
+ yaxis=dict(title_font=dict(color="white"), tickfont=dict(color="white"))
125
  )
126
+ fig.update_traces(marker=dict(color="white", line=dict(color="gray", width=1))) # Simulate 3D effect with border
127
  return fig
128
 
129
  # Main application logic
 
146
 
147
  # Display numerical comparison
148
  st.subheader("Numerical Comparison")
149
+ st.markdown(f"<p style='color: white;'>**Assessment 1**: Water: {water1:.2f} kL, Energy: {energy1:.2f} MJ, Carbon: {carbon1:.2f} kg CO2e</p>", unsafe_allow_html=True)
150
+ st.markdown(f"<p style='color: white;'>**Assessment 2**: Water: {water2:.2f} kL, Energy: {energy2:.2f} MJ, Carbon: {carbon2:.2f} kg CO2e</p>", unsafe_allow_html=True)
151
 
152
  # Bar chart comparison
153
  comparison_data = pd.DataFrame({
 
171
 
172
  # Display results
173
  st.subheader("Single Assessment Results")
174
+ st.markdown(f"<p style='color: white;'>- **Water Footprint**: {water:.2f} kL</p>", unsafe_allow_html=True)
175
+ st.markdown(f"<p style='color: white;'>- **Energy Footprint**: {energy:.2f} MJ</p>", unsafe_allow_html=True)
176
+ st.markdown(f"<p style='color: white;'>- **Carbon Footprint**: {carbon:.2f} kg CO2e</p>", unsafe_allow_html=True)
177
 
178
  # Bar chart for single assessment
179
  result_data = pd.DataFrame({