awacke1 commited on
Commit
905b935
·
verified ·
1 Parent(s): 183166f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -60
app.py CHANGED
@@ -1,6 +1,5 @@
1
  import streamlit as st
2
  import streamlit.components.v1 as components
3
- import urllib.parse
4
 
5
  # --------------------------
6
  # Mermaid Renderer Function
@@ -30,24 +29,6 @@ def render_mermaid(mermaid_code, height=300):
30
  """
31
  components.html(html_code, height=height)
32
 
33
- # --------------------------
34
- # Function to Add Clickable Links to Mermaid Diagrams
35
- # --------------------------
36
- def add_mermaid_links(mermaid_code, area_code, base_url):
37
- """Add clickable links to Mermaid diagram nodes."""
38
- lines = mermaid_code.split('\n')
39
- new_lines = []
40
- for line in lines:
41
- new_lines.append(line)
42
- # Check if the line defines a node (e.g., LeCo["..."])
43
- if '[' in line and ']' in line:
44
- node_id = line.split('[')[0].strip()
45
- if node_id:
46
- # Self-referential link with query parameter
47
- safe_url = f"{base_url}/?area={area_code}#{node_id}"
48
- new_lines.append(f' click {node_id} "{safe_url}" "View {node_id}"')
49
- return '\n'.join(new_lines)
50
-
51
  # --------------------------
52
  # Markdown Outlines for Each Area
53
  # --------------------------
@@ -153,15 +134,10 @@ graph LR
153
  '''
154
  }
155
 
156
- # Update mermaid_areas with clickable links
157
- base_url = "http://localhost:8501" # Replace with your app's base URL when deployed
158
- for key in mermaid_areas:
159
- area_code = key.split(' ')[-1] # Extract area code (e.g., LeCo)
160
- mermaid_areas[key] = add_mermaid_links(mermaid_areas[key], area_code, base_url)
161
-
162
  # --------------------------
163
  # Markdown Sections
164
  # --------------------------
 
165
  md_combined_outline = r'''
166
  # 📚 Hands On ML App. Dev. with Mixture of Experts and Multiagent Skills and State of Art ML Architecture
167
  1. 🗼LeCo👥 Leadership and Collaboration : Strategic leadership and team management.
@@ -191,7 +167,7 @@ md_submodels_outline = r'''
191
  2. **📊 Analytics, Forecasting and Visualization - BI, dashboards and forecasting**
192
  3. **📝 Data Governance and Quality - Modeling, warehousing and stakeholder comms**
193
 
194
- ## 4. � **📢 Community OpenSource Communication CoOS
195
  1. **📚 Technical Documentation and Demos - Code examples, demos and notebooks**
196
  2. **💬 Community Engagement and Collaboration - Public speaking, social media and collabs**
197
 
@@ -341,16 +317,6 @@ graph TD
341
  CoOS ---|🤝 collaborates with| LeCo
342
  CoOS ---|🗣️ informs| DaEn
343
  SpDo ---|🔄 shares with| CoOS
344
-
345
- click LeCo "/?area=LeCo" "View Leadership and Collaboration"
346
- click SeCo "/?area=SeCo" "View Security and Compliance"
347
- click DaEn "/?area=DaEn" "View Data Engineering"
348
- click CoOS "/?area=CoOS" "View Community Open Source"
349
- click FuMo "/?area=FuMo" "View FullStack UI Mobile"
350
- click SoCM "/?area=SoCM" "View Software Cloud MLOps"
351
- click AIML "/?area=AIML" "View AI Machine Learning"
352
- click SyIn "/?area=SyIn" "View Systems Infrastructure"
353
- click SpDo "/?area=SpDo" "View Specialized Domains"
354
  '''
355
 
356
  # --------------------------
@@ -359,32 +325,17 @@ graph TD
359
  def main():
360
  st.set_page_config(page_title="Densified Skill Tree", layout="wide")
361
 
362
- # Get query parameters
363
- selected_area = st.query_params.get("area", None) # Get the 'area' parameter, default to None
364
-
365
- # Display combined outline
366
  st.markdown(md_combined_outline, unsafe_allow_html=True)
 
367
 
368
- # If an area is selected, show only that area's content
369
- if selected_area:
370
- for key in sorted(markdown_areas.keys(), key=lambda k: int(k.split('.')[0])):
371
- area_code = key.split(' ')[-1] # Extract area code (e.g., LeCo, SeCo)
372
- if area_code == selected_area:
373
- st.markdown(markdown_areas[key], unsafe_allow_html=True)
374
- if key in mermaid_areas:
375
- render_mermaid(mermaid_areas[key], height=350)
376
- # Add a "Back to Overview" button
377
- if st.button("Back to Overview"):
378
- st.query_params.clear() # Clear query parameters to show all areas
379
- break
380
- else:
381
- # Show all areas if no specific area is selected
382
- for key in sorted(markdown_areas.keys(), key=lambda k: int(k.split('.')[0])):
383
- st.markdown(markdown_areas[key], unsafe_allow_html=True)
384
- if key in mermaid_areas:
385
- render_mermaid(mermaid_areas[key], height=350)
386
 
387
- # Render the combined mermaid diagram
388
  render_mermaid(combined_mermaid, height=850)
389
 
390
  # Display additional markdown sections
@@ -395,4 +346,4 @@ def main():
395
  st.markdown(md_tweet, unsafe_allow_html=True)
396
 
397
  if __name__ == "__main__":
398
- main()
 
1
  import streamlit as st
2
  import streamlit.components.v1 as components
 
3
 
4
  # --------------------------
5
  # Mermaid Renderer Function
 
29
  """
30
  components.html(html_code, height=height)
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  # --------------------------
33
  # Markdown Outlines for Each Area
34
  # --------------------------
 
134
  '''
135
  }
136
 
 
 
 
 
 
 
137
  # --------------------------
138
  # Markdown Sections
139
  # --------------------------
140
+
141
  md_combined_outline = r'''
142
  # 📚 Hands On ML App. Dev. with Mixture of Experts and Multiagent Skills and State of Art ML Architecture
143
  1. 🗼LeCo👥 Leadership and Collaboration : Strategic leadership and team management.
 
167
  2. **📊 Analytics, Forecasting and Visualization - BI, dashboards and forecasting**
168
  3. **📝 Data Governance and Quality - Modeling, warehousing and stakeholder comms**
169
 
170
+ ## 4. 📢 Community OpenSource Communication CoOS
171
  1. **📚 Technical Documentation and Demos - Code examples, demos and notebooks**
172
  2. **💬 Community Engagement and Collaboration - Public speaking, social media and collabs**
173
 
 
317
  CoOS ---|🤝 collaborates with| LeCo
318
  CoOS ---|🗣️ informs| DaEn
319
  SpDo ---|🔄 shares with| CoOS
 
 
 
 
 
 
 
 
 
 
320
  '''
321
 
322
  # --------------------------
 
325
  def main():
326
  st.set_page_config(page_title="Densified Skill Tree", layout="wide")
327
 
328
+ # Optionally render combined outlines and submodels if desired:
 
 
 
329
  st.markdown(md_combined_outline, unsafe_allow_html=True)
330
+ #st.markdown(md_submodels_outline, unsafe_allow_html=True)
331
 
332
+ # For each numbered area, display its markdown outline first, then its mermaid diagram.
333
+ for key in sorted(markdown_areas.keys(), key=lambda k: int(k.split('.')[0])):
334
+ st.markdown(markdown_areas[key], unsafe_allow_html=True)
335
+ if key in mermaid_areas:
336
+ render_mermaid(mermaid_areas[key], height=350)
 
 
 
 
 
 
 
 
 
 
 
 
 
337
 
338
+ # Render the combined mermaid diagram for an overview
339
  render_mermaid(combined_mermaid, height=850)
340
 
341
  # Display additional markdown sections
 
346
  st.markdown(md_tweet, unsafe_allow_html=True)
347
 
348
  if __name__ == "__main__":
349
+ main()