pyegeria 5.3.4.16__py3-none-any.whl → 5.3.4.18__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,163 +236,324 @@ def construct_mermaid_html(mermaid_str: str) -> str:
236
236
  """ if title_label else ""
237
237
 
238
238
  html_content = f"""
239
- <style>
240
- .diagram-container {{
241
- position: relative;
242
- width: 90%; /* Adjust container width */
243
- height: 500px; /* Fixed height */
244
- margin: 20px auto;
245
- border: 1px solid #ccc;
246
- overflow: hidden; /* Prevents content overflow */
247
- }}
248
-
249
- .svg-pan-zoom-controls {{
250
- position: absolute;
251
- top: 10px;
252
- right: 10px;
253
- display: flex;
254
- flex-direction: column;
255
- gap: 5px;
256
- z-index: 10;
257
- }}
258
-
259
- .svg-pan-zoom-controls button {{
260
- background-color: #007bff;
261
- color: white;
262
- border: none;
263
- padding: 5px 10px;
264
- border-radius: 3px;
265
- cursor: pointer;
266
- font-size: 14px;
267
- }}
268
- .svg-pan-zoom-controls button:hover {{
269
- background-color: #0056b3;
270
- }}
271
- </style>
272
-
273
- <div id="{graph_id}-container" class="diagram-container">
274
- {header_html}
275
- <div id="{graph_id}" class="mermaid">
276
- {escaped_mermaid_code}
277
- </div>
239
+ <style>
240
+ /* Style for the diagram container */
241
+ .diagram-container {{
242
+ position: relative;
243
+ width: 100%; /* Adjust the diagram container width */
244
+ height: 500px; /* Set a fixed height for the container */
245
+ margin: 0 auto;
246
+ border: 1px solid #ccc; /* Optional border for visualization */
247
+ overflow: hidden; /* Prevent content overflow outside the container */
248
+ }}
249
+
250
+ /* Style for zoom controls */
251
+ .svg-pan-zoom_controls {{
252
+ position: absolute;
253
+ top: 10px;
254
+ right: 10px;
255
+ display: flex;
256
+ flex-direction: column;
257
+ gap: 5px;
258
+ }}
259
+ .svg-pan-zoom_controls button {{
260
+ background-color: #007bff;
261
+ color: white;
262
+ border: none;
263
+ padding: 5px 10px;
264
+ border-radius: 3px;
265
+ cursor: pointer;
266
+ font-size: 14px;
267
+ }}
268
+ .svg-pan-zoom_controls button:hover {{
269
+ background-color: #0056b3;
270
+ }}
271
+ </style>
272
+
273
+ <div id="{graph_id}-container" class="diagram-container">
274
+ <!-- Mermaid diagram will be dynamically rendered here -->
275
+ {header_html}
276
+ <div id="{graph_id}" class="mermaid">
277
+ {escaped_mermaid_code}
278
278
  </div>
279
+ </div>
279
280
 
281
+ <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
282
+ <script src="https://cdn.jsdelivr.net/npm/svg-pan-zoom@3.6.1/dist/svg-pan-zoom.min.js"></script>
280
283
  <script>
281
- (function() {{
284
+ document.addEventListener("DOMContentLoaded", () => {{
285
+ // Initialize Mermaid and Pan-Zoom functionality
282
286
  const graph_id = "{graph_id}";
283
- let panZoomInstance; // Reference for svg-pan-zoom instance
284
287
 
285
288
  function initializeMermaid(graph_id) {{
286
- const container = document.getElementById(`${{graph_id}}-container`);
287
- const diagram = document.getElementById(`${{graph_id}}`);
289
+ const containerElement = document.getElementById(`${{graph_id}}-container`);
288
290
 
289
- if (!container || !diagram) {{
290
- console.error(`Container or diagram not found for ID "${{graph_id}}"`);
291
+ if (!containerElement) {{
292
+ console.error(`Container with ID "${{graph_id}}-container" not found.`);
291
293
  return;
292
294
  }}
293
295
 
294
- // Initialize Mermaid
295
- mermaid.initialize({{ startOnLoad: false }});
296
- mermaid.init(undefined, diagram);
296
+ // Configure Mermaid
297
+ mermaid.initialize({{ startOnLoad: false, logLevel: "debug" }});
298
+ mermaid.init(undefined, `#${{graph_id}}`);
297
299
 
298
- // Set a small delay to allow Mermaid rendering to complete
299
300
  setTimeout(() => {{
300
- const svg = container.querySelector("svg");
301
-
301
+ const svg = containerElement.querySelector("svg");
302
302
  if (!svg) {{
303
- console.error(`SVG not found for graph ID "${{graph_id}}"`);
303
+ console.error(`SVG not rendered for ID "${{graph_id}}".`);
304
304
  return;
305
305
  }}
306
306
 
307
- // Force SVG to fit the container
307
+ // Set initial size
308
308
  svg.setAttribute("width", "100%");
309
309
  svg.setAttribute("height", "100%");
310
- svg.setAttribute("preserveAspectRatio", "xMidYMid meet");
311
- svg.style.display = "block";
312
-
313
- if (!svg.hasAttribute("viewBox")) {{
314
- const bbox = svg.getBBox();
315
- svg.setAttribute("viewBox", `0 0 ${{bbox.width}} ${{bbox.height}}`);
316
- }}
317
310
 
318
311
  // Initialize Pan-Zoom
319
- panZoomInstance = svgPanZoom(svg, {{
312
+ const panZoom = svgPanZoom(svg, {{
320
313
  zoomEnabled: true,
321
- controlIconsEnabled: false, // Custom controls
314
+ controlIconsEnabled: false,
322
315
  fit: true,
323
316
  center: true,
324
- contain: true,
325
317
  minZoom: 0.5,
326
- maxZoom: 10
318
+ maxZoom: 10,
319
+ contain: true
327
320
  }});
328
321
 
329
- // Add controls
322
+ // Add custom controls
330
323
  const controlsContainer = document.createElement("div");
331
- controlsContainer.className = "svg-pan-zoom-controls";
324
+ controlsContainer.className = "svg-pan-zoom_controls";
332
325
  controlsContainer.innerHTML = `
333
- <button type="button" id="${{graph_id}}-zoom-in">+</button>
334
- <button type="button" id="${{graph_id}}-zoom-out">-</button>
335
- <button type="button" id="${{graph_id}}-reset">Reset</button>
326
+ <button id="${{graph_id}}-zoom-in">+</button>
327
+ <button id="${{graph_id}}-zoom-out">-</button>
328
+ <button id="${{graph_id}}-reset">Reset</button>
336
329
  `;
337
- container.appendChild(controlsContainer);
330
+ containerElement.appendChild(controlsContainer);
338
331
 
339
- // Attach control event listeners
340
- document.getElementById(`${{graph_id}}-zoom-in`).addEventListener("click", () => {{
341
- if (panZoomInstance) panZoomInstance.zoomIn();
342
- }});
343
- document.getElementById(`${{graph_id}}-zoom-out`).addEventListener("click", () => {{
344
- if (panZoomInstance) panZoomInstance.zoomOut();
345
- }});
332
+ // Handle controls
333
+ document.getElementById(`${{graph_id}}-zoom-in`).addEventListener("click", () => panZoom.zoomIn());
334
+ document.getElementById(`${{graph_id}}-zoom-out`).addEventListener("click", () => panZoom.zoomOut());
346
335
  document.getElementById(`${{graph_id}}-reset`).addEventListener("click", () => {{
347
- if (panZoomInstance) {{
348
- panZoomInstance.resetZoom();
349
- panZoomInstance.center();
350
- }}
336
+ panZoom.resetZoom();
337
+ panZoom.center();
351
338
  }});
352
- }}, 500); // Delay for Mermaid and SVG rendering
339
+ }}, 500);
353
340
  }}
354
341
 
355
- // Check if Mermaid and SVG-Pan-Zoom are loaded
356
- const loadMermaid = typeof mermaid === "undefined";
357
- const loadSvgPanZoom = typeof svgPanZoom === "undefined";
358
-
359
- if (loadMermaid || loadSvgPanZoom) {{
360
- const promises = [];
361
-
362
- // Load Mermaid.js if not already loaded
363
- if (loadMermaid) {{
364
- promises.push(new Promise((resolve) => {{
365
- const script = document.createElement("script");
366
- script.src = "https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js";
367
- script.onload = resolve;
368
- document.head.appendChild(script);
369
- }}));
370
- }}
371
-
372
- // Load SVG-Pan-Zoom if not already loaded
373
- if (loadSvgPanZoom) {{
374
- promises.push(new Promise((resolve) => {{
375
- const script = document.createElement("script");
376
- script.src = "https://cdn.jsdelivr.net/npm/svg-pan-zoom@3.6.1/dist/svg-pan-zoom.min.js";
377
- script.onload = resolve;
378
- document.head.appendChild(script);
379
- }}));
380
- }}
381
-
382
- Promise.all(promises).then(() => initializeMermaid(graph_id));
342
+ if (typeof mermaid === "undefined") {{
343
+ const script = document.createElement('script');
344
+ script.src = "https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js";
345
+ script.onload = () => initializeMermaid(graph_id);
346
+ document.head.appendChild(script);
383
347
  }} else {{
384
348
  initializeMermaid(graph_id);
385
349
  }}
386
- }})();
350
+ }});
387
351
  </script>
388
352
 
389
- """
353
+ """
354
+ #
355
+ # return html_content
356
+ # This one almost works - no controls and diagram too small
357
+ # html_content = f"""
358
+ # <!DOCTYPE html>
359
+ # <html>
360
+ # <head>
361
+ # <style>
362
+ # /* Set consistent sizing and prevent shrinking for the container and parents */
363
+ # html, body, #{graph_id}-wrapper {{
364
+ # margin: 0;
365
+ # padding: 0;
366
+ # height: 100%; /* Ensure the entire root hierarchy respects 100% height */
367
+ # width: 100%;
368
+ # }}
369
+ #
370
+ # /* Ensure diagram container maintains full height and prevents overflow */
371
+ # #{graph_id}-container {{
372
+ # position: relative;
373
+ # width: 100%;
374
+ # height: 100%;
375
+ # overflow: hidden; /* Prevent content from breaking layout */
376
+ # display: flex;
377
+ # align-items: center; /* Centers the diagram vertically */
378
+ # justify-content: center; /* Centers the diagram horizontally */
379
+ # }}
380
+ #
381
+ # /* Ensure SVG always stretches to match container */
382
+ # #{graph_id} svg {{
383
+ # width: 100%;
384
+ # height: 100%;
385
+ # display: block; /* Avoid unwanted inline space issues */
386
+ # }}
387
+ #
388
+ # /* Optional custom pan/zoom controls (if dynamically added) */
389
+ # .svg-pan-zoom_controls {{
390
+ # position: absolute;
391
+ # bottom: 10px; /* Adjust based on desired placement */
392
+ # right: 10px;
393
+ # z-index: 10;
394
+ # display: flex;
395
+ # gap: 5px;
396
+ # }}
397
+ #
398
+ # .svg-pan-zoom_controls button {{
399
+ # border: 1px solid #ccc;
400
+ # background-color: #fff;
401
+ # color: #000;
402
+ # padding: 5px 10px;
403
+ # cursor: pointer;
404
+ # font-size: 16px;
405
+ # }}
406
+ #
407
+ # .svg-pan-zoom_controls button:hover {{
408
+ # background-color: #f0f0f0;
409
+ # }}
410
+ # </style>
411
+ # </head>
412
+ # <body>
413
+ # <div id="{graph_id}-wrapper">
414
+ # <!-- Title/Heading (optional; include as needed) -->
415
+ # {escaped_header if escaped_header else ""}
416
+ #
417
+ # <!-- Mermaid Diagram Container -->
418
+ # <div id="{graph_id}-container">
419
+ # <div id="{graph_id}" class="mermaid">
420
+ # {escaped_mermaid_code}
421
+ # </div>
422
+ # </div>
423
+ # </div>
424
+ #
425
+ # <script src="https://cdn.jsdelivr.net/npm/svg-pan-zoom@3.6.1/dist/svg-pan-zoom.min.js"></script>
426
+ # <script>
427
+ # document.addEventListener("DOMContentLoaded", () => {{
428
+ # // Define the graph ID dynamically passed via Python
429
+ # const graph_id = "{graph_id}";
430
+ #
431
+ # // Function to load external scripts dynamically
432
+ # function loadScript(url, callback) {{
433
+ # const script = document.createElement('script');
434
+ # script.src = url;
435
+ # script.async = true;
436
+ # script.onload = callback;
437
+ # script.onerror = () => console.error("Error loading script:", url);
438
+ # document.head.appendChild(script);
439
+ # }}
440
+ #
441
+ # // Function to initialize Mermaid
442
+ # function initializeMermaid(graph_id) {{
443
+ # // Look for the container ID generated dynamically by the template
444
+ # const containerElement = document.getElementById(`${{graph_id}}-container`);
445
+ # if (!containerElement) {{
446
+ # console.error(`Container element with id "${{graph_id}}-container" not found.`);
447
+ # return;
448
+ # }}
449
+ #
450
+ # // Initialize Mermaid.js with default configuration
451
+ # mermaid.initialize({{ startOnLoad: false, logLevel: "debug" }});
452
+ # mermaid.init(undefined, `#${{graph_id}}`); // Initialize element with id matching `graph_id`
453
+ #
454
+ # // Add a timeout to ensure the SVG is rendered
455
+ # setTimeout(() => {{
456
+ # const svg = containerElement.querySelector("svg");
457
+ #
458
+ # // Handle errors if SVG rendering fails
459
+ # if (!svg) {{
460
+ # console.error(`SVG not rendered for ID "${{graph_id}}". Check Mermaid syntax or rendering issues.`);
461
+ # console.log("Container content:", containerElement.innerHTML); // Log the container's content
462
+ # return;
463
+ # }}
464
+ #
465
+ # // Set SVG attributes for full container fit
466
+ # svg.setAttribute("width", "100%");
467
+ # svg.setAttribute("height", "100%");
468
+ #
469
+ # // Initialize SVG Pan-Zoom functionality
470
+ # const panZoom = svgPanZoom(svg, {{
471
+ # zoomEnabled: true,
472
+ # controlIconsEnabled: true, // Display default controls if enabled
473
+ # fit: true, // Fit diagram within the container
474
+ # center: true, // Center the diagram
475
+ # minZoom: 0.5, // Prevent too much zooming out
476
+ # maxZoom: 10, // Prevent extreme zooming in
477
+ # contain: true // Keep the diagram fully within bounds
478
+ # }});
479
+ #
480
+ # // Optional: Add custom pan/zoom controls dynamically
481
+ # const controlsContainer = document.createElement("div");
482
+ # controlsContainer.classList.add("svg-pan-zoom_controls");
483
+ # controlsContainer.innerHTML = `
484
+ # <button id="${{graph_id}}-zoom-in">+</button>
485
+ # <button id="${{graph_id}}-zoom-out">-</button>
486
+ # <button id="${{graph_id}}-reset">Reset</button>
487
+ # `;
488
+ # containerElement.appendChild(controlsContainer);
489
+ #
490
+ # // Add event listeners for the custom controls
491
+ # document.getElementById(`${{graph_id}}-zoom-in`).addEventListener("click", () => panZoom.zoomIn());
492
+ # document.getElementById(`${{graph_id}}-zoom-out`).addEventListener("click", () => panZoom.zoomOut());
493
+ # document.getElementById(`${{graph_id}}-reset`).addEventListener("click", () => {{
494
+ # panZoom.resetZoom();
495
+ # panZoom.center();
496
+ # }});
497
+ # }}, 500); // Short delay to ensure SVG rendering is complete
498
+ # }}
499
+ #
500
+ # // Load Mermaid.js if not already loaded
501
+ # if (typeof mermaid === "undefined") {{
502
+ # loadScript("https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js", () => {{
503
+ # console.log("Mermaid.js loaded successfully");
504
+ # initializeMermaid(graph_id); // Call initialization after Mermaid.js is loaded
505
+ # }});
506
+ # }} else {{
507
+ # initializeMermaid(graph_id); // If Mermaid.js is already loaded, proceed immediately
508
+ # }}
509
+ # }});
510
+ # </script>
511
+ #
512
+ #
513
+ # </body>
514
+ # </html>
515
+ # """
516
+
390
517
 
391
518
 
392
519
 
393
520
 
394
521
  return html_content
395
522
 
523
+ # // Check if Mermaid and SVG-Pan-Zoom are loaded
524
+ # const loadMermaid = typeof mermaid === "undefined";
525
+ # const loadSvgPanZoom = typeof svgPanZoom === "undefined";
526
+ #
527
+ # if (loadMermaid || loadSvgPanZoom) {{
528
+ # const promises = [];
529
+ #
530
+ # // Load Mermaid.js if not already loaded
531
+ # if (loadMermaid) {{
532
+ # promises.push(new Promise((resolve) => {{
533
+ # const script = document.createElement("script");
534
+ # script.src = "https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js";
535
+ # script.onload = resolve;
536
+ # document.head.appendChild(script);
537
+ # }}));
538
+ # }}
539
+ #
540
+ # // Load SVG-Pan-Zoom if not already loaded
541
+ # if (loadSvgPanZoom) {{
542
+ # promises.push(new Promise((resolve) => {{
543
+ # const script = document.createElement("script");
544
+ # script.src = "https://cdn.jsdelivr.net/npm/svg-pan-zoom@3.6.1/dist/svg-pan-zoom.min.js";
545
+ # script.onload = resolve;
546
+ # document.head.appendChild(script);
547
+ # }}));
548
+ # }}
549
+ #
550
+ # Promise.all(promises).then(() => initializeMermaid(graph_id));
551
+ # }} else {{
552
+ # initializeMermaid(graph_id);
553
+ # }}
554
+ # }})();
555
+
556
+
396
557
  # html_content = f"""
397
558
  # <style>
398
559
  # /* Style for the diagram container */
pyegeria/test_m.html CHANGED
@@ -1,49 +1,50 @@
1
1
 
2
- <style>
3
- .diagram-container {
4
- position: relative;
5
- width: 90%; /* Adjust container width */
6
- height: 500px; /* Fixed height */
7
- margin: 20px auto;
8
- border: 1px solid #ccc;
9
- overflow: hidden; /* Prevents content overflow */
10
- }
11
-
12
- .svg-pan-zoom-controls {
13
- position: absolute;
14
- top: 10px;
15
- right: 10px;
16
- display: flex;
17
- flex-direction: column;
18
- gap: 5px;
19
- z-index: 10;
20
- }
21
-
22
- .svg-pan-zoom-controls button {
23
- background-color: #007bff;
24
- color: white;
25
- border: none;
26
- padding: 5px 10px;
27
- border-radius: 3px;
28
- cursor: pointer;
29
- font-size: 14px;
30
- }
31
- .svg-pan-zoom-controls button:hover {
32
- background-color: #0056b3;
33
- }
34
- </style>
35
-
36
- <div id="mermaid-graph-c4f8d707-7c85-4125-b5fd-c3257a2ef2ef-1569-container" class="diagram-container">
37
-
38
- <h3 id="mermaid-graph-c4f8d707-7c85-4125-b5fd-c3257a2ef2ef-1569-heading" style="margin: 20px 0; font-size: 1.5em; text-align: center;">
2
+ <style>
3
+ /* Style for the diagram container */
4
+ .diagram-container {
5
+ position: relative;
6
+ width: 100%; /* Adjust the diagram container width */
7
+ height: 500px; /* Set a fixed height for the container */
8
+ margin: 0 auto;
9
+ border: 1px solid #ccc; /* Optional border for visualization */
10
+ overflow: hidden; /* Prevent content overflow outside the container */
11
+ }
12
+
13
+ /* Style for zoom controls */
14
+ .svg-pan-zoom_controls {
15
+ position: absolute;
16
+ top: 10px;
17
+ right: 10px;
18
+ display: flex;
19
+ flex-direction: column;
20
+ gap: 5px;
21
+ }
22
+ .svg-pan-zoom_controls button {
23
+ background-color: #007bff;
24
+ color: white;
25
+ border: none;
26
+ padding: 5px 10px;
27
+ border-radius: 3px;
28
+ cursor: pointer;
29
+ font-size: 14px;
30
+ }
31
+ .svg-pan-zoom_controls button:hover {
32
+ background-color: #0056b3;
33
+ }
34
+ </style>
35
+
36
+ <div id="mermaid-graph-c4f8d707-7c85-4125-b5fd-c3257a2ef2ef-2bd0-container" class="diagram-container">
37
+ <!-- Mermaid diagram will be dynamically rendered here -->
38
+
39
+ <h3 id="mermaid-graph-c4f8d707-7c85-4125-b5fd-c3257a2ef2ef-2bd0-heading" style="margin: 20px 0; font-size: 1.5em; text-align: center;">
39
40
  Component for Solution Blueprint - Clinical Trial Management Solution Blueprint
40
41
  </h3>
41
- <p id="mermaid-graph-c4f8d707-7c85-4125-b5fd-c3257a2ef2ef-1569-subheading" style="margin: 0; padding: 5px; font-size: 1em; text-align: center; color: gray; flex: 0 0 auto;">
42
+ <p id="mermaid-graph-c4f8d707-7c85-4125-b5fd-c3257a2ef2ef-2bd0-subheading" style="margin: 0; padding: 5px; font-size: 1em; text-align: center; color: gray; flex: 0 0 auto;">
42
43
  GUID: c4f8d707-7c85-4125-b5fd-c3257a2ef2ef
43
44
  </p>
44
45
 
45
- <div id="mermaid-graph-c4f8d707-7c85-4125-b5fd-c3257a2ef2ef-1569" class="mermaid">
46
- flowchart TD
46
+ <div id="mermaid-graph-c4f8d707-7c85-4125-b5fd-c3257a2ef2ef-2bd0" class="mermaid">
47
+ flowchart TD
47
48
  %%{init: {&quot;flowchart&quot;: {&quot;htmlLabels&quot;: false}} }%%
48
49
 
49
50
  subgraph c4f8d707-7c85-4125-b5fd-c3257a2ef2ef [Components and Actors]
@@ -144,116 +145,78 @@ style f6bc847b-868d-43cc-b767-41f5fe3e47d1 color:#FFFFFF, fill:#AA00FF, stroke:#
144
145
  style d48f579f-76d3-4c49-b1b4-575f5645a9d0 color:#FFFFFF, fill:#838cc7, stroke:#3079ab
145
146
  style f37f3735-28a1-4e03-9ff5-3fe2f137f661 color:#FFFFFF, fill:#AA00FF, stroke:#E1D5E7
146
147
  style fb32bef2-e79f-4893-b500-2e547f24d482 color:#FFFFFF, fill:#838cc7, stroke:#3079ab
147
- </div>
148
148
  </div>
149
+ </div>
149
150
 
151
+ <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
152
+ <script src="https://cdn.jsdelivr.net/npm/svg-pan-zoom@3.6.1/dist/svg-pan-zoom.min.js"></script>
150
153
  <script>
151
- (function() {
152
- const graph_id = "mermaid-graph-c4f8d707-7c85-4125-b5fd-c3257a2ef2ef-1569";
153
- let panZoomInstance; // Reference for svg-pan-zoom instance
154
+ document.addEventListener("DOMContentLoaded", () => {
155
+ // Initialize Mermaid and Pan-Zoom functionality
156
+ const graph_id = "mermaid-graph-c4f8d707-7c85-4125-b5fd-c3257a2ef2ef-2bd0";
154
157
 
155
158
  function initializeMermaid(graph_id) {
156
- const container = document.getElementById(`${graph_id}-container`);
157
- const diagram = document.getElementById(`${graph_id}`);
159
+ const containerElement = document.getElementById(`${graph_id}-container`);
158
160
 
159
- if (!container || !diagram) {
160
- console.error(`Container or diagram not found for ID "${graph_id}"`);
161
+ if (!containerElement) {
162
+ console.error(`Container with ID "${graph_id}-container" not found.`);
161
163
  return;
162
164
  }
163
165
 
164
- // Initialize Mermaid
165
- mermaid.initialize({ startOnLoad: false });
166
- mermaid.init(undefined, diagram);
166
+ // Configure Mermaid
167
+ mermaid.initialize({ startOnLoad: false, logLevel: "debug" });
168
+ mermaid.init(undefined, `#${graph_id}`);
167
169
 
168
- // Set a small delay to allow Mermaid rendering to complete
169
170
  setTimeout(() => {
170
- const svg = container.querySelector("svg");
171
-
171
+ const svg = containerElement.querySelector("svg");
172
172
  if (!svg) {
173
- console.error(`SVG not found for graph ID "${graph_id}"`);
173
+ console.error(`SVG not rendered for ID "${graph_id}".`);
174
174
  return;
175
175
  }
176
176
 
177
- // Force SVG to fit the container
177
+ // Set initial size
178
178
  svg.setAttribute("width", "100%");
179
179
  svg.setAttribute("height", "100%");
180
- svg.setAttribute("preserveAspectRatio", "xMidYMid meet");
181
- svg.style.display = "block";
182
-
183
- if (!svg.hasAttribute("viewBox")) {
184
- const bbox = svg.getBBox();
185
- svg.setAttribute("viewBox", `0 0 ${bbox.width} ${bbox.height}`);
186
- }
187
180
 
188
181
  // Initialize Pan-Zoom
189
- panZoomInstance = svgPanZoom(svg, {
182
+ const panZoom = svgPanZoom(svg, {
190
183
  zoomEnabled: true,
191
- controlIconsEnabled: false, // Custom controls
184
+ controlIconsEnabled: false,
192
185
  fit: true,
193
186
  center: true,
194
- contain: true,
195
187
  minZoom: 0.5,
196
- maxZoom: 10
188
+ maxZoom: 10,
189
+ contain: true
197
190
  });
198
191
 
199
- // Add controls
192
+ // Add custom controls
200
193
  const controlsContainer = document.createElement("div");
201
- controlsContainer.className = "svg-pan-zoom-controls";
194
+ controlsContainer.className = "svg-pan-zoom_controls";
202
195
  controlsContainer.innerHTML = `
203
- <button type="button" id="${graph_id}-zoom-in">+</button>
204
- <button type="button" id="${graph_id}-zoom-out">-</button>
205
- <button type="button" id="${graph_id}-reset">Reset</button>
196
+ <button id="${graph_id}-zoom-in">+</button>
197
+ <button id="${graph_id}-zoom-out">-</button>
198
+ <button id="${graph_id}-reset">Reset</button>
206
199
  `;
207
- container.appendChild(controlsContainer);
200
+ containerElement.appendChild(controlsContainer);
208
201
 
209
- // Attach control event listeners
210
- document.getElementById(`${graph_id}-zoom-in`).addEventListener("click", () => {
211
- if (panZoomInstance) panZoomInstance.zoomIn();
212
- });
213
- document.getElementById(`${graph_id}-zoom-out`).addEventListener("click", () => {
214
- if (panZoomInstance) panZoomInstance.zoomOut();
215
- });
202
+ // Handle controls
203
+ document.getElementById(`${graph_id}-zoom-in`).addEventListener("click", () => panZoom.zoomIn());
204
+ document.getElementById(`${graph_id}-zoom-out`).addEventListener("click", () => panZoom.zoomOut());
216
205
  document.getElementById(`${graph_id}-reset`).addEventListener("click", () => {
217
- if (panZoomInstance) {
218
- panZoomInstance.resetZoom();
219
- panZoomInstance.center();
220
- }
206
+ panZoom.resetZoom();
207
+ panZoom.center();
221
208
  });
222
- }, 500); // Delay for Mermaid and SVG rendering
209
+ }, 500);
223
210
  }
224
211
 
225
- // Check if Mermaid and SVG-Pan-Zoom are loaded
226
- const loadMermaid = typeof mermaid === "undefined";
227
- const loadSvgPanZoom = typeof svgPanZoom === "undefined";
228
-
229
- if (loadMermaid || loadSvgPanZoom) {
230
- const promises = [];
231
-
232
- // Load Mermaid.js if not already loaded
233
- if (loadMermaid) {
234
- promises.push(new Promise((resolve) => {
235
- const script = document.createElement("script");
236
- script.src = "https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js";
237
- script.onload = resolve;
238
- document.head.appendChild(script);
239
- }));
240
- }
241
-
242
- // Load SVG-Pan-Zoom if not already loaded
243
- if (loadSvgPanZoom) {
244
- promises.push(new Promise((resolve) => {
245
- const script = document.createElement("script");
246
- script.src = "https://cdn.jsdelivr.net/npm/svg-pan-zoom@3.6.1/dist/svg-pan-zoom.min.js";
247
- script.onload = resolve;
248
- document.head.appendChild(script);
249
- }));
250
- }
251
-
252
- Promise.all(promises).then(() => initializeMermaid(graph_id));
212
+ if (typeof mermaid === "undefined") {
213
+ const script = document.createElement('script');
214
+ script.src = "https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js";
215
+ script.onload = () => initializeMermaid(graph_id);
216
+ document.head.appendChild(script);
253
217
  } else {
254
218
  initializeMermaid(graph_id);
255
219
  }
256
- })();
220
+ });
257
221
  </script>
258
222
 
259
-
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyegeria
3
- Version: 5.3.4.16
3
+ Version: 5.3.4.18
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=ePS5eO2BWkfj_FkvnUrYyMFS8YxSCL31vgXouc9cx_o,40705
248
+ pyegeria/mermaid_utilities.py,sha256=kupTYnHk_9uhmKPleEQo7eXTXNy5c6c73EQ1a0wfBwk,47108
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
@@ -255,14 +255,14 @@ pyegeria/runtime_manager_omvs.py,sha256=Z5wY9ignNjil8O6yjihZftxkGoh9A4PQDcXhoIsO
255
255
  pyegeria/server_operations.py,sha256=vmiUDU_Xa0U8pa0Fdb-QKkoeSqs7WfMwIpG_XU3xgeI,16784
256
256
  pyegeria/solution_architect_omvs.py,sha256=x6CfPTyn1l2DFYVEFP0t_rT9uVjoFr596hBBeuVaMRg,22093
257
257
  pyegeria/template_manager_omvs.py,sha256=PfJ9dOfmBvf59DgRdZ9Dl1Kl_UYqjF-JncXVnbCqLZU,42408
258
- pyegeria/test_m.html,sha256=KIhpa43T1bL3621oNfJ9iEl9nkc3lPMUEjDdNieYYzo,14497
258
+ pyegeria/test_m.html,sha256=6YF3zyAEiMj7sWSWws3VmhI3PMDpaTJcHYBiWdpaNxo,12927
259
259
  pyegeria/test_m1.html,sha256=XS_1IAtfG4ZlZk45QTkrFWWpjQMVlO21ScDMX2Frl3g,14086
260
260
  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.16.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
265
- pyegeria-5.3.4.16.dist-info/METADATA,sha256=eGmKFjzIJrGY9h2jVOib_5mrXCePwP-597ozj1coWbg,2736
266
- pyegeria-5.3.4.16.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
267
- pyegeria-5.3.4.16.dist-info/entry_points.txt,sha256=LS9g5JPSBL0whnyAcGhLZCAyUp6PkPU6fjHP9Aso1V4,6176
268
- pyegeria-5.3.4.16.dist-info/RECORD,,
264
+ pyegeria-5.3.4.18.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
265
+ pyegeria-5.3.4.18.dist-info/METADATA,sha256=u-PL8VDXIPoxos85dnnnCH_en06dGdyzbbxX8jn-lqQ,2736
266
+ pyegeria-5.3.4.18.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
267
+ pyegeria-5.3.4.18.dist-info/entry_points.txt,sha256=LS9g5JPSBL0whnyAcGhLZCAyUp6PkPU6fjHP9Aso1V4,6176
268
+ pyegeria-5.3.4.18.dist-info/RECORD,,