Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,9 +3,10 @@ import pandas as pd
|
|
| 3 |
import plotly.express as px
|
| 4 |
from io import BytesIO
|
| 5 |
|
| 6 |
-
# Page
|
| 7 |
st.set_page_config(page_title="Research Gantt Chart", layout="wide")
|
| 8 |
|
|
|
|
| 9 |
st.title("📊 Research Proposal Gantt Chart")
|
| 10 |
st.markdown("""
|
| 11 |
This Gantt chart outlines the 10-month timeline for your research project:
|
|
@@ -15,39 +16,39 @@ Each phase is color-coded and aligned with your methodology for formal presentat
|
|
| 15 |
|
| 16 |
# Define task data
|
| 17 |
tasks = [
|
| 18 |
-
{"Phase": "Literature Review", "Start":
|
| 19 |
-
{"Phase": "UG-37 Calculations", "Start":
|
| 20 |
-
{"Phase": "Finite Element Analysis (FEA)", "Start":
|
| 21 |
-
{"Phase": "Comparative Study", "Start":
|
| 22 |
-
{"Phase": "Recommendations", "Start":
|
| 23 |
-
{"Phase": "Thesis & Journal Prep", "Start":
|
| 24 |
-
{"Phase": "Buffer Month", "Start":
|
| 25 |
]
|
| 26 |
|
| 27 |
df = pd.DataFrame(tasks)
|
| 28 |
-
df["Duration"] = df["End"] - df["Start"]
|
| 29 |
|
| 30 |
# Create Gantt chart
|
| 31 |
fig = px.timeline(
|
| 32 |
df,
|
| 33 |
x_start="Start",
|
| 34 |
-
x_end="
|
| 35 |
y="Phase",
|
| 36 |
color="Phase",
|
| 37 |
color_discrete_map={row["Phase"]: row["Color"] for row in tasks},
|
| 38 |
title="Gantt Chart: ASME Nozzle Reinforcement Study",
|
| 39 |
)
|
| 40 |
|
|
|
|
| 41 |
fig.update_layout(
|
| 42 |
-
xaxis_title="
|
| 43 |
yaxis_title="Research Phase",
|
| 44 |
title_font=dict(size=22, family="Segoe UI"),
|
| 45 |
font=dict(size=14),
|
| 46 |
showlegend=False,
|
| 47 |
margin=dict(l=40, r=40, t=80, b=40),
|
| 48 |
height=650,
|
| 49 |
-
xaxis=dict(tickmode="linear", tick0=1, dtick=1, range=[0.5, 11]),
|
| 50 |
)
|
|
|
|
| 51 |
|
| 52 |
# Display chart
|
| 53 |
st.plotly_chart(fig, use_container_width=True)
|
|
|
|
| 3 |
import plotly.express as px
|
| 4 |
from io import BytesIO
|
| 5 |
|
| 6 |
+
# Page config
|
| 7 |
st.set_page_config(page_title="Research Gantt Chart", layout="wide")
|
| 8 |
|
| 9 |
+
# Title and description
|
| 10 |
st.title("📊 Research Proposal Gantt Chart")
|
| 11 |
st.markdown("""
|
| 12 |
This Gantt chart outlines the 10-month timeline for your research project:
|
|
|
|
| 16 |
|
| 17 |
# Define task data
|
| 18 |
tasks = [
|
| 19 |
+
{"Phase": "Literature Review", "Start": "2025-09-01", "Finish": "2025-10-31", "Color": "SteelBlue"},
|
| 20 |
+
{"Phase": "UG-37 Calculations", "Start": "2025-11-01", "Finish": "2025-11-30", "Color": "SlateGray"},
|
| 21 |
+
{"Phase": "Finite Element Analysis (FEA)", "Start": "2025-12-01", "Finish": "2026-02-28", "Color": "DarkOrange"},
|
| 22 |
+
{"Phase": "Comparative Study", "Start": "2026-03-01", "Finish": "2026-03-31", "Color": "Teal"},
|
| 23 |
+
{"Phase": "Recommendations", "Start": "2026-04-01", "Finish": "2026-04-30", "Color": "Olive"},
|
| 24 |
+
{"Phase": "Thesis & Journal Prep", "Start": "2026-05-01", "Finish": "2026-05-31", "Color": "Navy"},
|
| 25 |
+
{"Phase": "Buffer Month", "Start": "2026-06-01", "Finish": "2026-06-30", "Color": "LightGray"},
|
| 26 |
]
|
| 27 |
|
| 28 |
df = pd.DataFrame(tasks)
|
|
|
|
| 29 |
|
| 30 |
# Create Gantt chart
|
| 31 |
fig = px.timeline(
|
| 32 |
df,
|
| 33 |
x_start="Start",
|
| 34 |
+
x_end="Finish",
|
| 35 |
y="Phase",
|
| 36 |
color="Phase",
|
| 37 |
color_discrete_map={row["Phase"]: row["Color"] for row in tasks},
|
| 38 |
title="Gantt Chart: ASME Nozzle Reinforcement Study",
|
| 39 |
)
|
| 40 |
|
| 41 |
+
# Format chart
|
| 42 |
fig.update_layout(
|
| 43 |
+
xaxis_title="Timeline",
|
| 44 |
yaxis_title="Research Phase",
|
| 45 |
title_font=dict(size=22, family="Segoe UI"),
|
| 46 |
font=dict(size=14),
|
| 47 |
showlegend=False,
|
| 48 |
margin=dict(l=40, r=40, t=80, b=40),
|
| 49 |
height=650,
|
|
|
|
| 50 |
)
|
| 51 |
+
fig.update_yaxes(autorange="reversed") # Gantt-style top-down
|
| 52 |
|
| 53 |
# Display chart
|
| 54 |
st.plotly_chart(fig, use_container_width=True)
|