File size: 2,443 Bytes
87d2502
 
 
 
 
c53c249
87d2502
 
c53c249
87d2502
 
 
 
c973454
87d2502
 
c973454
87d2502
c973454
 
 
 
 
 
 
87d2502
 
 
 
 
 
 
 
c53c249
87d2502
 
 
 
 
 
c53c249
87d2502
c973454
87d2502
 
 
 
 
 
c973454
 
 
 
 
 
 
87d2502
c53c249
87d2502
 
 
 
e4fce96
 
 
 
87d2502
e4fce96
 
 
 
87d2502
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import streamlit as st
import pandas as pd
import plotly.express as px
from io import BytesIO

# Page config
st.set_page_config(page_title="Research Gantt Chart", layout="wide")

# Title and description
st.title("📊 Research Proposal Gantt Chart")
st.markdown("""
This Gantt chart outlines the 10-month timeline for your research project:  
**Critical Evaluation of ASME Section VIII Rules for Nozzle Reinforcement and Placement**  
Each phase is color-coded and aligned with your methodology. The timeline is shown in relative months (Month 1 to Month 10.5).
""")

# Define task data using relative months
tasks = [
    {"Phase": "Literature Review", "Start": 1.0, "Finish": 2.0, "Color": "SteelBlue"},
    {"Phase": "UG-37 Calculations", "Start": 2.0, "Finish": 3.0, "Color": "SlateGray"},
    {"Phase": "Finite Element Analysis (FEA)", "Start": 3.0, "Finish": 6.0, "Color": "DarkOrange"},
    {"Phase": "Comparative Study", "Start": 6.0, "Finish": 7.0, "Color": "Teal"},
    {"Phase": "Recommendations", "Start": 7.0, "Finish": 8.0, "Color": "Olive"},
    {"Phase": "Thesis & Journal Prep", "Start": 8.0, "Finish": 9.0, "Color": "Navy"},
    {"Phase": "Buffer Month", "Start": 10.0, "Finish": 10.5, "Color": "LightGray"},
]

df = pd.DataFrame(tasks)

# Create Gantt chart
fig = px.timeline(
    df,
    x_start="Start",
    x_end="Finish",
    y="Phase",
    color="Phase",
    color_discrete_map={row["Phase"]: row["Color"] for row in tasks},
    title="Gantt Chart: ASME Nozzle Reinforcement Study",
)

# Format chart
fig.update_layout(
    xaxis_title="Month",
    yaxis_title="Research Phase",
    title_font=dict(size=22, family="Segoe UI"),
    font=dict(size=14),
    showlegend=False,
    margin=dict(l=40, r=40, t=80, b=40),
    height=650,
    xaxis=dict(
        tickmode="linear",
        tick0=1,
        dtick=1,
        range=[0.5, 11],
        title_font=dict(size=16),
    ),
)
fig.update_yaxes(autorange="reversed")  # Gantt-style top-down

# Display chart
st.plotly_chart(fig, use_container_width=True)

# Export chart as HTML
st.markdown("### 📥 Download Chart as HTML")
html_buffer = BytesIO()
html_buffer.write(fig.to_html(include_plotlyjs='cdn').encode())
st.download_button(
    label="Download Interactive Chart (HTML)",
    data=html_buffer.getvalue(),
    file_name="ASME_Research_Gantt_Chart.html",
    mime="text/html"
)

st.markdown("---")
st.caption("Designed by Muhammad | Powered by Streamlit & Plotly")