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.
@@ -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
- """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))
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
- html_prefix = """
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
- html_postfix = """`;
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 html_prefix + mermaid_code + html_postfix
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"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyegeria
3
- Version: 5.3.3.13.dev3
3
+ Version: 5.3.3.13.dev4
4
4
  Summary: A python client for Egeria
5
5
  License: Apache 2.0
6
6
  Keywords: egeria,metadata,governance
@@ -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=n12wLznJ9yQdyfKyRHaQORF8nX1SQt3hZR4WNU0h7dM,17525
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.dev3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
246
- pyegeria-5.3.3.13.dev3.dist-info/METADATA,sha256=347eZXBRgtTN5q54HUSeg2D9bDoAigGlOuj-oePlYik,2741
247
- pyegeria-5.3.3.13.dev3.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
248
- pyegeria-5.3.3.13.dev3.dist-info/entry_points.txt,sha256=cLnCR81Pm2c35hDDg7BOlQ9Mtvx5wofuvwXHnL1bGis,5956
249
- pyegeria-5.3.3.13.dev3.dist-info/RECORD,,
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,,