LakshmiHarika commited on
Commit
0a4221a
·
verified ·
1 Parent(s): c3de9d8

Update pages/3Life Cycle of Machine Learning Project.py

Browse files
pages/3Life Cycle of Machine Learning Project.py CHANGED
@@ -43,65 +43,54 @@ st.markdown(
43
  st.markdown("""
44
  <div style="text-align: center; margin-top: 20px;">
45
  <h1 style="color: #BB3385;">Life Cycle of End to End ML Project</h1></div>""", unsafe_allow_html=True)
46
-
47
  import streamlit as st
48
- import math
49
 
50
- # CSS for Circular Buttons and Layout
51
- custom_css = """
52
- <style>
53
- .circle-container {
54
- display: flex;
55
- justify-content: center;
56
- align-items: center;
57
- position: relative;
58
- width: 600px;
59
- height: 600px;
60
- margin: 0 auto;
61
- }
62
- .circle-button {
63
- position: absolute;
64
- width: 80px;
65
- height: 80px;
66
- background: #4CAF50;
67
- color: white;
68
  border-radius: 50%;
69
- display: flex;
70
- justify-content: center;
71
- align-items: center;
72
- font-size: 12px;
73
- font-weight: bold;
74
  text-align: center;
75
- cursor: pointer;
76
- transition: transform 0.2s, background-color 0.2s;
77
- }
78
- .circle-button:hover {
79
- transform: scale(1.1);
80
- background-color: #3e8e41;
81
- }
82
- </style>
83
- """
 
 
84
 
85
- # Generate HTML for Buttons in Circular Layout
86
- radius = 250 # Radius of the circle
87
- center_x, center_y = 300, 300 # Center of the container
88
- buttons_html = ""
89
 
90
- for i in range(10):
91
- angle = 2 * math.pi * i / 10 # Angle in radians for each button
92
- x = center_x + radius * math.cos(angle) - 40 # Adjust for button center
93
- y = center_y + radius * math.sin(angle) - 40 # Adjust for button center
94
- buttons_html += f"""
95
- <div class="circle-button" style="top: {y}px; left: {x}px;">Step {i + 1}</div>
96
- """
97
 
98
- html_content = f"""
99
- <div class="circle-container">
100
- {buttons_html}
101
- </div>
102
- """
 
 
 
103
 
104
- # Apply CSS and Render HTML
105
- st.markdown(custom_css, unsafe_allow_html=True)
106
- st.markdown(html_content, unsafe_allow_html=True)
107
 
 
 
 
 
 
 
 
 
 
43
  st.markdown("""
44
  <div style="text-align: center; margin-top: 20px;">
45
  <h1 style="color: #BB3385;">Life Cycle of End to End ML Project</h1></div>""", unsafe_allow_html=True)
 
46
  import streamlit as st
47
+ from streamlit.components.v1 import html
48
 
49
+ # Function to create a circular button
50
+ def circular_button(label, link):
51
+ button_html = f"""
52
+ <style>
53
+ .button {{
54
+ display: inline-block;
 
 
 
 
 
 
 
 
 
 
 
 
55
  border-radius: 50%;
56
+ background-color: #4CAF50;
57
+ color: white;
 
 
 
58
  text-align: center;
59
+ padding: 20px;
60
+ width: 100px;
61
+ height: 100px;
62
+ text-decoration: none;
63
+ font-size: 16px;
64
+ margin: 10px;
65
+ }}
66
+ </style>
67
+ <a href="{link}" class="button">{label}</a>
68
+ """
69
+ html(button_html)
70
 
71
+ # Title
72
+ st.title("Machine Learning Life Cycle")
73
+ st.subheader("Click a step to view details")
 
74
 
75
+ # Circular layout for 10 steps
76
+ col1, col2, col3 = st.columns([1, 3, 1]) # Adjust column widths
 
 
 
 
 
77
 
78
+ # Top half of the circle
79
+ with col2:
80
+ st.write("")
81
+ circular_button("Step 1", "?page=1")
82
+ circular_button("Step 2", "?page=2")
83
+ circular_button("Step 3", "?page=3")
84
+ circular_button("Step 4", "?page=4")
85
+ circular_button("Step 5", "?page=5")
86
 
87
+ st.write("") # Add some spacing
 
 
88
 
89
+ # Bottom half of the circle
90
+ col1, col2, col3 = st.columns([1, 3, 1]) # Adjust column widths
91
+ with col2:
92
+ circular_button("Step 6", "?page=6")
93
+ circular_button("Step 7", "?page=7")
94
+ circular_button("Step 8", "?page=8")
95
+ circular_button("Step 9", "?page=9")
96
+ circular_button("Step 10", "?page=10")