Umar4321 commited on
Commit
c53c249
·
verified ·
1 Parent(s): 5f19fc4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -12
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 configuration
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": 1, "End": 2, "Color": "SteelBlue"},
19
- {"Phase": "UG-37 Calculations", "Start": 2, "End": 3, "Color": "SlateGray"},
20
- {"Phase": "Finite Element Analysis (FEA)", "Start": 3, "End": 6, "Color": "DarkOrange"},
21
- {"Phase": "Comparative Study", "Start": 6, "End": 7, "Color": "Teal"},
22
- {"Phase": "Recommendations", "Start": 7, "End": 8, "Color": "Olive"},
23
- {"Phase": "Thesis & Journal Prep", "Start": 8, "End": 9, "Color": "Navy"},
24
- {"Phase": "Buffer Month", "Start": 10, "End": 10.5, "Color": "LightGray"},
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="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="Month",
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)