awacke1 commited on
Commit
a508916
Β·
1 Parent(s): 226d732

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -2
app.py CHANGED
@@ -1,8 +1,22 @@
1
  import streamlit as st
2
- from streamlit_mermaid import mermaid
3
 
4
  st.set_page_config(page_title="8 Dimensions of Self Care", page_icon=":heart:")
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  st.title("8 Dimensions of Self Care")
7
 
8
  mermaid_chart = '''
@@ -17,4 +31,6 @@ graph TD
17
  I[πŸƒβ€β™‚οΈ Physical, Our bodies] --> B
18
  '''
19
 
20
- mermaid(mermaid_chart, width="100%")
 
 
 
1
  import streamlit as st
 
2
 
3
  st.set_page_config(page_title="8 Dimensions of Self Care", page_icon=":heart:")
4
 
5
+ def mermaid(code: str) -> None:
6
+ components.html(
7
+ f"""
8
+ <pre class="mermaid">
9
+ {code}
10
+ </pre>
11
+
12
+ <script type="module">
13
+ import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
14
+ mermaid.initialize({{ startOnLoad: true }});
15
+ </script>
16
+ """
17
+ )
18
+
19
+
20
  st.title("8 Dimensions of Self Care")
21
 
22
  mermaid_chart = '''
 
31
  I[πŸƒβ€β™‚οΈ Physical, Our bodies] --> B
32
  '''
33
 
34
+
35
+ mermaid(mermaid_chart)
36
+ #mermaid(mermaid_chart, width="100%")