pyegeria 5.3.4.14__py3-none-any.whl → 5.3.4.15__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.
@@ -236,18 +236,16 @@ def construct_mermaid_html(mermaid_str: str) -> str:
236
236
  """ if title_label else ""
237
237
 
238
238
  html_content = f"""
239
- <style>
240
- /* Style the diagram container */
239
+ <style>
241
240
  .diagram-container {{
242
241
  position: relative;
243
242
  width: 90%; /* Adjust container width */
244
243
  height: 500px; /* Fixed height */
245
- margin: 0 auto;
244
+ margin: 20px auto;
246
245
  border: 1px solid #ccc;
247
246
  overflow: hidden; /* Prevents content overflow */
248
247
  }}
249
248
 
250
- /* Style custom zoom controls */
251
249
  .svg-pan-zoom-controls {{
252
250
  position: absolute;
253
251
  top: 10px;
@@ -255,7 +253,7 @@ def construct_mermaid_html(mermaid_str: str) -> str:
255
253
  display: flex;
256
254
  flex-direction: column;
257
255
  gap: 5px;
258
- z-index: 10; /* Ensures controls are above other elements */
256
+ z-index: 10;
259
257
  }}
260
258
 
261
259
  .svg-pan-zoom-controls button {{
@@ -273,23 +271,16 @@ def construct_mermaid_html(mermaid_str: str) -> str:
273
271
  </style>
274
272
 
275
273
  <div id="{graph_id}-container" class="diagram-container">
276
- <!-- Title/Heading (optional; include as needed) -->
277
- {header_html}
278
- <!-- Mermaid rendering area -->
279
274
  <div id="{graph_id}" class="mermaid">
280
275
  {mermaid_code}
281
276
  </div>
282
277
  </div>
283
278
 
284
- <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
285
- <script src="https://cdn.jsdelivr.net/npm/svg-pan-zoom@3.6.1/dist/svg-pan-zoom.min.js"></script>
286
-
287
279
  <script>
288
280
  (function() {{
289
281
  const graph_id = "{graph_id}";
290
- let panZoomInstance; // Store reference to the panZoom instance
282
+ let panZoomInstance; // Reference for svg-pan-zoom instance
291
283
 
292
- // Function to initialize Mermaid
293
284
  function initializeMermaid(graph_id) {{
294
285
  const container = document.getElementById(`${{graph_id}}-container`);
295
286
  const diagram = document.getElementById(`${{graph_id}}`);
@@ -303,15 +294,16 @@ def construct_mermaid_html(mermaid_str: str) -> str:
303
294
  mermaid.initialize({{ startOnLoad: false }});
304
295
  mermaid.init(undefined, diagram);
305
296
 
306
- // Set a small delay to allow Mermaid rendering to complete before initializing Pan-Zoom
297
+ // Set a small delay to allow Mermaid rendering to complete
307
298
  setTimeout(() => {{
308
299
  const svg = container.querySelector("svg");
300
+
309
301
  if (!svg) {{
310
302
  console.error(`SVG not found for graph ID "${{graph_id}}"`);
311
303
  return;
312
304
  }}
313
305
 
314
- // Force the SVG to fit the container by setting width, height, and viewBox
306
+ // Force SVG to fit the container
315
307
  svg.setAttribute("width", "100%");
316
308
  svg.setAttribute("height", "100%");
317
309
  svg.setAttribute("preserveAspectRatio", "xMidYMid meet");
@@ -322,10 +314,10 @@ def construct_mermaid_html(mermaid_str: str) -> str:
322
314
  svg.setAttribute("viewBox", `0 0 ${{bbox.width}} ${{bbox.height}}`);
323
315
  }}
324
316
 
325
- // Initialize Pan-Zoom functionality
317
+ // Initialize Pan-Zoom
326
318
  panZoomInstance = svgPanZoom(svg, {{
327
319
  zoomEnabled: true,
328
- controlIconsEnabled: false, // Use custom controls
320
+ controlIconsEnabled: false, // Custom controls
329
321
  fit: true,
330
322
  center: true,
331
323
  contain: true,
@@ -333,7 +325,7 @@ def construct_mermaid_html(mermaid_str: str) -> str:
333
325
  maxZoom: 10
334
326
  }});
335
327
 
336
- // Add custom controls
328
+ // Add controls
337
329
  const controlsContainer = document.createElement("div");
338
330
  controlsContainer.className = "svg-pan-zoom-controls";
339
331
  controlsContainer.innerHTML = `
@@ -343,7 +335,7 @@ def construct_mermaid_html(mermaid_str: str) -> str:
343
335
  `;
344
336
  container.appendChild(controlsContainer);
345
337
 
346
- // Add event listeners for the controls
338
+ // Attach control event listeners
347
339
  document.getElementById(`${{graph_id}}-zoom-in`).addEventListener("click", () => {{
348
340
  if (panZoomInstance) panZoomInstance.zoomIn();
349
341
  }});
@@ -356,21 +348,46 @@ def construct_mermaid_html(mermaid_str: str) -> str:
356
348
  panZoomInstance.center();
357
349
  }}
358
350
  }});
359
- }}, 500); // Delay of 500ms for Mermaid and SVG rendering
351
+ }}, 500); // Delay for Mermaid and SVG rendering
360
352
  }}
361
353
 
362
- // Load Mermaid.js if not already loaded
363
- if (typeof mermaid === "undefined") {{
364
- const script = document.createElement("script");
365
- script.src = "https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js";
366
- script.onload = () => initializeMermaid(graph_id);
367
- document.head.appendChild(script);
354
+ // Check if Mermaid and SVG-Pan-Zoom are loaded
355
+ const loadMermaid = typeof mermaid === "undefined";
356
+ const loadSvgPanZoom = typeof svgPanZoom === "undefined";
357
+
358
+ if (loadMermaid || loadSvgPanZoom) {{
359
+ const promises = [];
360
+
361
+ // Load Mermaid.js if not already loaded
362
+ if (loadMermaid) {{
363
+ promises.push(new Promise((resolve) => {{
364
+ const script = document.createElement("script");
365
+ script.src = "https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js";
366
+ script.onload = resolve;
367
+ document.head.appendChild(script);
368
+ }}));
369
+ }}
370
+
371
+ // Load SVG-Pan-Zoom if not already loaded
372
+ if (loadSvgPanZoom) {{
373
+ promises.push(new Promise((resolve) => {{
374
+ const script = document.createElement("script");
375
+ script.src = "https://cdn.jsdelivr.net/npm/svg-pan-zoom@3.6.1/dist/svg-pan-zoom.min.js";
376
+ script.onload = resolve;
377
+ document.head.appendChild(script);
378
+ }}));
379
+ }}
380
+
381
+ Promise.all(promises).then(() => initializeMermaid(graph_id));
368
382
  }} else {{
369
383
  initializeMermaid(graph_id);
370
384
  }}
371
385
  }})();
372
386
  </script>
373
- """
387
+
388
+ """
389
+
390
+
374
391
 
375
392
 
376
393
  return html_content
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyegeria
3
- Version: 5.3.4.14
3
+ Version: 5.3.4.15
4
4
  Summary: A python client for Egeria
5
5
  License: Apache 2.0
6
6
  Keywords: egeria,metadata,governance
@@ -245,7 +245,7 @@ pyegeria/full_omag_server_config.py,sha256=CQqLCy_3DZFvJZEOcGf50HWdFaWpiAIs6z-kK
245
245
  pyegeria/glossary_browser_omvs.py,sha256=ci57LXFjIAXWw6XXFu8pIbeR_3y4hl_x4F2-HHdy7VM,93585
246
246
  pyegeria/glossary_manager_omvs.py,sha256=GJQo5E3bxv8JL84wTGqJKMrMo7QqNAPtyJJgvGpI_lU,132558
247
247
  pyegeria/m_test.py,sha256=BDKRLsHsAWnwCbzHkkvfsc8ZIJ0k-jmwPPNuTSgW6Qo,7659
248
- pyegeria/mermaid_utilities.py,sha256=hDLpCOmLDsh9gkqmx2jTEXRjUGYgN3wkkWzpmiN-HoA,40281
248
+ pyegeria/mermaid_utilities.py,sha256=eIQ21z8KuoeKWkDLChvU_f3O-33sFah67Vaks0Oaj0g,40651
249
249
  pyegeria/metadata_explorer_omvs.py,sha256=xHnZTQKbd6XwOhYia-RiIisrvZcqHi0SL1l6OCf04Gk,86911
250
250
  pyegeria/my_profile_omvs.py,sha256=d0oJYCJG7pS9BINPuGciVa00ac0jwPHNANXDCLginEc,34720
251
251
  pyegeria/platform_services.py,sha256=xlF5p5HPKDGTFFDsuxm2RLhr8vjZPv4T7e2qCkDgKXE,41654
@@ -261,8 +261,8 @@ pyegeria/test_mer.ipynb,sha256=G7hpHn07IXnt_VKvnTDvljwwHB7RfC0etOMyZKt1icQ,30809
261
261
  pyegeria/utils.py,sha256=GCt1C0bp0Xng1ahzbZhzV9qQwH7Dj93IaCt2dvWb-sg,5417
262
262
  pyegeria/valid_metadata_omvs.py,sha256=kL3bEkoBtNCaQKjziFwRAqQyleu-i2ua_REIogfulFw,65031
263
263
  pyegeria/x_action_author_omvs.py,sha256=6b725SPsC52AI7ols7Qq8MsBlZuAXr_BgJ_-ychVRCw,6386
264
- pyegeria-5.3.4.14.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
265
- pyegeria-5.3.4.14.dist-info/METADATA,sha256=FftxyngR6Meq7NLfYJODC0jOAA3LLqja0sulciEPzcs,2736
266
- pyegeria-5.3.4.14.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
267
- pyegeria-5.3.4.14.dist-info/entry_points.txt,sha256=LS9g5JPSBL0whnyAcGhLZCAyUp6PkPU6fjHP9Aso1V4,6176
268
- pyegeria-5.3.4.14.dist-info/RECORD,,
264
+ pyegeria-5.3.4.15.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
265
+ pyegeria-5.3.4.15.dist-info/METADATA,sha256=MCI6Baa0OgGreARNDJm282wBYOBxfgw1WoQx-HZgK_E,2736
266
+ pyegeria-5.3.4.15.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
267
+ pyegeria-5.3.4.15.dist-info/entry_points.txt,sha256=LS9g5JPSBL0whnyAcGhLZCAyUp6PkPU6fjHP9Aso1V4,6176
268
+ pyegeria-5.3.4.15.dist-info/RECORD,,