Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,21 @@ dependencies = [
[project.optional-dependencies]
charts = ["plotext>=5.2.0"]
dashboard = [
"streamlit>=1.30.0",
# 1.60 is the floor because the dashboard passes width="stretch", the
# replacement for use_container_width, which older releases do not accept.
# Capped below 2.0 so a major release cannot silently change widget APIs.
"streamlit>=1.60.0,<2.0.0",
"plotly>=5.18.0",
]
dev = [
"pytest>=8.0.0",
"pyflakes>=3.2.0",
"respx>=0.22.0",
# The dashboard journey tests drive the real app through streamlit's AppTest.
"streamlit>=1.30.0",
# 1.60 is the floor because the dashboard passes width="stretch", the
# replacement for use_container_width, which older releases do not accept.
# Capped below 2.0 so a major release cannot silently change widget APIs.
"streamlit>=1.60.0,<2.0.0",
"plotly>=5.18.0",
# Terminal charts are an optional feature, but one test covers what happens
# when drawing them fails, so the test install needs them present.
Expand Down
8 changes: 4 additions & 4 deletions src/perfect_choice/dashboard/views/detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def render() -> None:
yaxis=dict(autorange="reversed"),
height=max(250, len(decision.criteria) * 45),
)
st.plotly_chart(fig_weights, use_container_width=True)
st.plotly_chart(fig_weights, width="stretch")
else:
st.info("No criteria defined.")

Expand All @@ -99,7 +99,7 @@ def render() -> None:
yaxis_title="Score",
height=350,
)
st.plotly_chart(fig_rank, use_container_width=True)
st.plotly_chart(fig_rank, width="stretch")
else:
st.info("No rankings computed.")

Expand All @@ -119,7 +119,7 @@ def render() -> None:
# Reorder columns by criteria order
col_order = [c.name for c in decision.criteria if c.name in df.columns]
df = df[col_order]
st.dataframe(df, use_container_width=True)
st.dataframe(df, width="stretch")
else:
st.info("No scores recorded.")

Expand Down Expand Up @@ -217,4 +217,4 @@ def _render_sensitivity_chart(decision) -> None:
yaxis=dict(autorange="reversed"),
height=max(250, len(names) * 45),
)
st.plotly_chart(fig, use_container_width=True)
st.plotly_chart(fig, width="stretch")
6 changes: 3 additions & 3 deletions src/perfect_choice/dashboard/views/new_decision.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ def _render_ranking_chart(rankings: dict[str, list[RankingResult]]) -> None:
yaxis_title="Score",
xaxis_title="Alternative",
)
st.plotly_chart(fig, use_container_width=True)
st.plotly_chart(fig, width="stretch")


def _render_weight_donut(criteria: list[Criterion]) -> None:
Expand Down Expand Up @@ -624,7 +624,7 @@ def _render_weight_donut(criteria: list[Criterion]) -> None:
**PLOTLY_LAYOUT,
title="Criteria Weights",
)
st.plotly_chart(fig, use_container_width=True)
st.plotly_chart(fig, width="stretch")


def _render_sensitivity_chart(sensitivity: list) -> None:
Expand Down Expand Up @@ -666,7 +666,7 @@ def _render_sensitivity_chart(sensitivity: list) -> None:
xaxis_title="Weight Perturbation (%)",
yaxis=dict(autorange="reversed"),
)
st.plotly_chart(fig, use_container_width=True)
st.plotly_chart(fig, width="stretch")


# ---------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/perfect_choice/dashboard/views/replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def _run_comparison(decision, new_criteria):
yaxis_title="Weight (%)",
height=350,
)
st.plotly_chart(fig, use_container_width=True)
st.plotly_chart(fig, width="stretch")


def _render_ranking_chart(rankings, label):
Expand Down Expand Up @@ -223,4 +223,4 @@ def _render_ranking_chart(rankings, label):
yaxis_title="Score",
height=300,
)
st.plotly_chart(fig, use_container_width=True)
st.plotly_chart(fig, width="stretch")
Loading