Skip to content

Commit

Permalink
Merge pull request #430 from agoenergy/416-display-for-hybrid-when-no…
Browse files Browse the repository at this point in the history
…-wind-capacity-is-being-used

for stacked areas, only add trace if not all are zero
  • Loading branch information
markushal authored Jun 10, 2024
2 parents 355fb81 + a602987 commit cde0fbf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions app/plot_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,20 +523,23 @@ def add_trace_to_figure(
df_plot = df[(df["Component"] == component)]
df_plot = df_plot[(df_plot["Parameter"] == parameter)]
if fill:
fig.add_trace(
go.Line(
x=df_plot["time"],
y=df_plot["MW (MWh for SOC)"],
name=component,
line_color=color,
stackgroup="one",
if df_plot["MW (MWh for SOC)"].sum() > 0:
fig.add_trace(
go.Scatter(
x=df_plot["time"],
y=df_plot["MW (MWh for SOC)"],
mode="lines",
name=component,
line_color=color,
stackgroup="one",
)
)
)
else:
fig.add_trace(
go.Line(
go.Scatter(
x=df_plot["time"],
y=df_plot["MW (MWh for SOC)"],
mode="lines",
name=component,
line_color=color,
)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pandas==2.2.1
numpy==1.26.4
streamlit==1.35.0
openpyxl==3.1.2
plotly==5.19.0
plotly==5.22.0
streamlit-antd-components
XlsxWriter==3.2.0
pypsa==0.27
Expand Down

0 comments on commit cde0fbf

Please sign in to comment.