pyegeria 5.3.3.13.dev3__py3-none-any.whl → 5.3.3.13.dev4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyegeria/mermaid_utilities.py +24 -17
- {pyegeria-5.3.3.13.dev3.dist-info → pyegeria-5.3.3.13.dev4.dist-info}/METADATA +1 -1
- {pyegeria-5.3.3.13.dev3.dist-info → pyegeria-5.3.3.13.dev4.dist-info}/RECORD +6 -6
- {pyegeria-5.3.3.13.dev3.dist-info → pyegeria-5.3.3.13.dev4.dist-info}/LICENSE +0 -0
- {pyegeria-5.3.3.13.dev3.dist-info → pyegeria-5.3.3.13.dev4.dist-info}/WHEEL +0 -0
- {pyegeria-5.3.3.13.dev3.dist-info → pyegeria-5.3.3.13.dev4.dist-info}/entry_points.txt +0 -0
pyegeria/mermaid_utilities.py
CHANGED
@@ -59,20 +59,22 @@ def load_mermaid():
|
|
59
59
|
display(HTML(mermaid_js))
|
60
60
|
|
61
61
|
|
62
|
+
# def render_mermaid(mermaid_code):
|
63
|
+
# """Function to display a Mermaid diagram in a Jupyter notebook"""
|
64
|
+
# mermaid_html = f"""
|
65
|
+
# <div class="mermaid">
|
66
|
+
# {mermaid_code}
|
67
|
+
# </div>
|
68
|
+
# <script type="text/javascript">
|
69
|
+
# if (window.mermaid) {{
|
70
|
+
# mermaid.initialize({{startOnLoad: true}});
|
71
|
+
# mermaid.contentLoaded();
|
72
|
+
# }}
|
73
|
+
# </script>
|
74
|
+
# """
|
75
|
+
# display(HTML(mermaid_html))
|
62
76
|
def render_mermaid(mermaid_code):
|
63
|
-
|
64
|
-
mermaid_html = f"""
|
65
|
-
<div class="mermaid">
|
66
|
-
{mermaid_code}
|
67
|
-
</div>
|
68
|
-
<script type="text/javascript">
|
69
|
-
if (window.mermaid) {{
|
70
|
-
mermaid.initialize({{startOnLoad: true}});
|
71
|
-
mermaid.contentLoaded();
|
72
|
-
}}
|
73
|
-
</script>
|
74
|
-
"""
|
75
|
-
display(HTML(mermaid_html))
|
77
|
+
return display(HTML(construct_mermaid_html(mermaid_code)))
|
76
78
|
|
77
79
|
|
78
80
|
def parse_mermaid_code(mermaid_code):
|
@@ -88,7 +90,7 @@ def construct_mermaid_html(mermaid_str: str) -> str:
|
|
88
90
|
"""Function to display a HTML code in a Jupyter notebook"""
|
89
91
|
title, mermaid_code = parse_mermaid_code(mermaid_str)
|
90
92
|
|
91
|
-
|
93
|
+
html_section1 = """
|
92
94
|
<html>
|
93
95
|
<head>
|
94
96
|
<style type="text/css">
|
@@ -106,8 +108,13 @@ def construct_mermaid_html(mermaid_str: str) -> str:
|
|
106
108
|
|
107
109
|
</style>
|
108
110
|
</head>
|
109
|
-
|
111
|
+
"""
|
112
|
+
html_section2 = """"
|
113
|
+
<title>{title}</title>
|
114
|
+
"""
|
115
|
+
html_section3 = """
|
110
116
|
<body>
|
117
|
+
|
111
118
|
<div id="graphDiv"></div>
|
112
119
|
<script src="https://bumbu.me/svg-pan-zoom/dist/svg-pan-zoom.min.js"></script>
|
113
120
|
<script type="module">
|
@@ -140,7 +147,7 @@ def construct_mermaid_html(mermaid_str: str) -> str:
|
|
140
147
|
const graphDefinition = `
|
141
148
|
"""
|
142
149
|
|
143
|
-
|
150
|
+
html_section4 = """`;
|
144
151
|
const {svg} = await mermaid.render('mySvgId', graphDefinition);
|
145
152
|
element.innerHTML = svg.replace(/( )*max-width:( 0-9\.)*px;/i, '');
|
146
153
|
|
@@ -197,7 +204,7 @@ def construct_mermaid_html(mermaid_str: str) -> str:
|
|
197
204
|
</body>
|
198
205
|
"""
|
199
206
|
|
200
|
-
return
|
207
|
+
return html_section1 + html_section2 + html_section3 + mermaid_code + html_section4
|
201
208
|
|
202
209
|
def save_mermaid_html(title: str, mermaid_str: str, folder:str = EGERIA_MERMAID_FOLDER):
|
203
210
|
"""Save a Mermaid diagram to a file"""
|
@@ -229,7 +229,7 @@ pyegeria/feedback_manager_omvs.py,sha256=B66e3ZCaC_dirb0mcb2Nz3PYh2ZKsoMAYNOb3eu
|
|
229
229
|
pyegeria/full_omag_server_config.py,sha256=k3fUfopAFAE3OKkFR7zZPiki_FYj6j2xQ4oD2SVaefQ,47350
|
230
230
|
pyegeria/glossary_browser_omvs.py,sha256=NcitYaZJqwVODBO5zBtWpXPNUJJ3DKzEbRaOFSAyUlg,93554
|
231
231
|
pyegeria/glossary_manager_omvs.py,sha256=tBjoHrrHJLasXoeQSpW-KpF3vEQdN_GR3jfcceTjt_c,132444
|
232
|
-
pyegeria/mermaid_utilities.py,sha256=
|
232
|
+
pyegeria/mermaid_utilities.py,sha256=dJgkRl_uG3qT0wID6QadKrcFjIxscFcZ-PspYTX3Pf8,17788
|
233
233
|
pyegeria/metadata_explorer_omvs.py,sha256=XBg6q-JXOA8UYsT85nlpBVe4EQ6jxwj70MvE7tkVvH0,86905
|
234
234
|
pyegeria/my_profile_omvs.py,sha256=DyECbUFEcgokrIbzdMMNljC3bqfqKGXAF2wZEpzvRYs,34666
|
235
235
|
pyegeria/platform_services.py,sha256=CJIOYIFEbcIGwdWlApAQcXxZTsdrhFtpJcm4O3p7dG0,41646
|
@@ -242,8 +242,8 @@ pyegeria/template_manager_omvs.py,sha256=Sw5xsQAhy7a48xFCg59mg9_nqyhawoS9v4WyF-P
|
|
242
242
|
pyegeria/utils.py,sha256=1h6bwveadd6GpbnGLTmqPBmBk68QvxdjGTI9RfbrgKY,5415
|
243
243
|
pyegeria/valid_metadata_omvs.py,sha256=cCt5CCLv6BdzCu90n68r_PkG_PEQJjrtwCxio7K6yko,65034
|
244
244
|
pyegeria/x_action_author_omvs.py,sha256=xu1IQ0YbhIKi17C5a7Aq9u1Az2czwahNPpX9czmyVxE,6454
|
245
|
-
pyegeria-5.3.3.13.
|
246
|
-
pyegeria-5.3.3.13.
|
247
|
-
pyegeria-5.3.3.13.
|
248
|
-
pyegeria-5.3.3.13.
|
249
|
-
pyegeria-5.3.3.13.
|
245
|
+
pyegeria-5.3.3.13.dev4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
246
|
+
pyegeria-5.3.3.13.dev4.dist-info/METADATA,sha256=W9zH0QLLrGpsrxHbB7HZVp3xMnfjrP1CwSk7BBS8eK8,2741
|
247
|
+
pyegeria-5.3.3.13.dev4.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
248
|
+
pyegeria-5.3.3.13.dev4.dist-info/entry_points.txt,sha256=cLnCR81Pm2c35hDDg7BOlQ9Mtvx5wofuvwXHnL1bGis,5956
|
249
|
+
pyegeria-5.3.3.13.dev4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|