pyegeria 5.3.4.4.dev4__py3-none-any.whl → 5.3.4.4.dev5__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.
@@ -235,24 +235,92 @@ def construct_mermaid_html(mermaid_str: str) -> str:
235
235
  # Construct the HTML content with Mermaid.js initialization and zoom/pan support
236
236
  mermaid_html = f"""
237
237
  <!DOCTYPE html>
238
- <html>
238
+ <html lang="en">
239
239
  <head>
240
- <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
240
+ <meta charset="UTF-8">
241
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
242
+ <title>Interactive Mermaid Graph</title>
243
+ <script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
241
244
  <script>
242
245
  // Initialize Mermaid.js
243
- window.mermaid.initialize({{
244
- startOnLoad: true,
245
- securityLevel: "loose",
246
- theme: "default",
247
- flowchart: {{
248
- useMaxWidth: false,
249
- htmlLabels: true,
250
- wrap: true
251
- }}
246
+ document.addEventListener("DOMContentLoaded", function() {{
247
+ const graphContainer = document.getElementById("{graph_id}");
248
+
249
+ // Inject Mermaid code into the container
250
+ graphContainer.innerHTML = `{mermaid_code}`;
251
+
252
+ // Manually render the Mermaid graph
253
+ window.mermaid?.run({{ querySelector: "#{graph_id}" }});
254
+ }});
255
+
256
+ // Enable panning and zooming
257
+ document.addEventListener("DOMContentLoaded", function() {{
258
+ const container = document.querySelector('.pan-zoom-container');
259
+ const content = document.querySelector('.pan-zoom-content');
260
+
261
+ let scale = 1;
262
+ let panX = 0;
263
+ let panY = 0;
264
+ let isDragging = false;
265
+ let startX, startY;
266
+
267
+ // Mouse wheel zoom with cursor as focal point
268
+ container.addEventListener('wheel', function(event) {{
269
+ event.preventDefault();
270
+ const zoomSpeed = 0.1;
271
+ const zoomDelta = event.deltaY > 0 ? -zoomSpeed : zoomSpeed;
272
+ const previousScale = scale;
273
+
274
+ // Clamp zoom level between 50% and 400%
275
+ scale = Math.min(Math.max(0.5, scale + zoomDelta), 4);
276
+
277
+ // Calculate the focal point for zoom using mouse position
278
+ const rect = content.getBoundingClientRect();
279
+ const offsetX = event.clientX - rect.left;
280
+ const offsetY = event.clientY - rect.top;
281
+
282
+ // Adjust pan values to focus zoom on cursor
283
+ panX -= (offsetX / previousScale - offsetX / scale);
284
+ panY -= (offsetY / previousScale - offsetY / scale);
285
+
286
+ // Apply transformations
287
+ content.style.transform = `translate(${panX}px, ${panY}px) scale(${scale})`;
288
+ }});
289
+
290
+ // Handle panning with mouse drag
291
+ container.addEventListener('mousedown', function(event) {{
292
+ isDragging = true;
293
+ startX = event.clientX - panX;
294
+ startY = event.clientY - panY;
295
+ container.style.cursor = "grabbing";
296
+ }});
297
+
298
+ container.addEventListener('mousemove', function(event) {{
299
+ if (!isDragging) return;
300
+ panX = event.clientX - startX;
301
+ panY = event.clientY - startY;
302
+
303
+ // Apply transformations
304
+ content.style.transform = `translate(${panX}px, ${panY}px) scale(${scale})`;
305
+ }});
306
+
307
+ container.addEventListener('mouseup', function() {{
308
+ isDragging = false;
309
+ container.style.cursor = "grab";
310
+ }});
311
+
312
+ container.addEventListener('mouseleave', function() {{
313
+ isDragging = false;
314
+ container.style.cursor = "grab";
315
+ }});
252
316
  }});
253
317
  </script>
254
318
  <style>
255
- /* Pan and zoom container styles */
319
+ body {{
320
+ margin: 0;
321
+ padding: 0;
322
+ font-family: Arial, sans-serif;
323
+ }}
256
324
  .pan-zoom-container {{
257
325
  overflow: hidden;
258
326
  position: relative;
@@ -261,6 +329,7 @@ def construct_mermaid_html(mermaid_str: str) -> str:
261
329
  background-color: #f4f4f4;
262
330
  }}
263
331
  .pan-zoom-content {{
332
+ display: inline-block;
264
333
  transform-origin: 0 0;
265
334
  cursor: grab;
266
335
  }}
@@ -270,81 +339,18 @@ def construct_mermaid_html(mermaid_str: str) -> str:
270
339
  </style>
271
340
  </head>
272
341
  <body>
342
+ <title>{title_label}</title>
343
+ <h3>{title_label}</h3>
344
+ GUID : {guid}
273
345
  <div class="pan-zoom-container">
274
- <div id="{graph_id}" class="mermaid pan-zoom-content">
275
- {mermaid_code}
346
+ <div id="{graph_id}" class="pan-zoom-content mermaid">
347
+ <!-- Placeholder for Mermaid.js -->
276
348
  </div>
277
349
  </div>
278
- <script>
279
- // Enable pan and zoom
280
- const container = document.querySelector('.pan-zoom-container');
281
- const content = document.querySelector('.pan-zoom-content');
282
-
283
- let scale = 1; // Current zoom level
284
- let panX = 0; // Current x-axis pan position
285
- let panY = 0; // Current y-axis pan position
286
- let isDragging = false; // Mouse dragging state
287
- let startX, startY; // Mouse starting point for dragging
288
-
289
- // Mouse wheel zoom with cursor as focal point
290
- container.addEventListener('wheel', function(event) {{
291
- event.preventDefault();
292
- const zoomSpeed = 0.1; // Speed of zoom
293
- const zoomDelta = event.deltaY > 0 ? -zoomSpeed : zoomSpeed;
294
- const previousScale = scale;
295
-
296
- // Clamp zoom level between 50% and 400%
297
- scale = Math.min(Math.max(0.5, scale + zoomDelta), 4);
298
-
299
- // Calculate the focal point for zoom using mouse position
300
- const rect = content.getBoundingClientRect();
301
- const offsetX = event.clientX - rect.left; // Mouse X relative to content
302
- const offsetY = event.clientY - rect.top; // Mouse Y relative to content
303
-
304
- // Adjust pan values to focus zoom on cursor
305
- panX -= (offsetX / previousScale - offsetX / scale);
306
- panY -= (offsetY / previousScale - offsetY / scale);
307
-
308
- // Apply transformations
309
- content.style.transform = `translate(${{
310
- panX
311
- }}px, ${{panY}}px) scale(${{scale}})`;
312
- }});
313
-
314
- // Handle panning with mouse drag
315
- container.addEventListener('mousedown', function(event) {{
316
- isDragging = true;
317
- startX = event.clientX - panX;
318
- startY = event.clientY - panY;
319
- container.style.cursor = "grabbing";
320
- }});
321
-
322
- container.addEventListener('mousemove', function(event) {{
323
- if (!isDragging) return;
324
- panX = event.clientX - startX;
325
- panY = event.clientY - startY;
326
-
327
- // Apply transformations
328
- content.style.transform = `translate(${{
329
- panX
330
- }}px, ${{panY}}px) scale(${{scale}})`;
331
- }});
332
-
333
- // Stop dragging on mouseup
334
- container.addEventListener('mouseup', function() {{
335
- isDragging = false;
336
- container.style.cursor = "grab";
337
- }});
338
-
339
- // Stop dragging if mouse leaves the container
340
- container.addEventListener('mouseleave', function() {{
341
- isDragging = false;
342
- container.style.cursor = "grab";
343
- }});
344
- </script>
345
350
  </body>
346
351
  </html>
347
352
  """
353
+
348
354
  return mermaid_html
349
355
 
350
356
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyegeria
3
- Version: 5.3.4.4.dev4
3
+ Version: 5.3.4.4.dev5
4
4
  Summary: A python client for Egeria
5
5
  License: Apache 2.0
6
6
  Keywords: egeria,metadata,governance
@@ -502,7 +502,7 @@ pyegeria/feedback_manager_omvs.py,sha256=B66e3ZCaC_dirb0mcb2Nz3PYh2ZKsoMAYNOb3eu
502
502
  pyegeria/full_omag_server_config.py,sha256=CQqLCy_3DZFvJZEOcGf50HWdFaWpiAIs6z-kKyjvpDA,47464
503
503
  pyegeria/glossary_browser_omvs.py,sha256=RCvZ1l2xg6uZ1o4xGJUkIVJQO9NZG00F_jGSc4fAERU,93538
504
504
  pyegeria/glossary_manager_omvs.py,sha256=CN04lhnAFk_g4soE5V_jZ0GDrLPClhX5yX9iE0t6NDk,132440
505
- pyegeria/mermaid_utilities.py,sha256=qSF3Ye5QhH3YHTTLfsxwRozrjstWNVHzT8mQ3nMJyRQ,22957
505
+ pyegeria/mermaid_utilities.py,sha256=I3UwXbEl1wyZnKl7_-SSH7lp9FgmMuLWCxCtdezXtho,23327
506
506
  pyegeria/metadata_explorer_omvs.py,sha256=u66o4IOhSo-i75KYeHogGql-gECBzZPT-RYbvfYuzoI,86932
507
507
  pyegeria/my_profile_omvs.py,sha256=i0e29KXRKZzZGgxuQI7c2_w7dyDuQWFIykky1Nqc0_8,34673
508
508
  pyegeria/platform_services.py,sha256=xlF5p5HPKDGTFFDsuxm2RLhr8vjZPv4T7e2qCkDgKXE,41654
@@ -515,8 +515,8 @@ pyegeria/template_manager_omvs.py,sha256=o_qCIFTRLK8b9C3N99taLji8VkDygo1Ss0fua35
515
515
  pyegeria/utils.py,sha256=GCt1C0bp0Xng1ahzbZhzV9qQwH7Dj93IaCt2dvWb-sg,5417
516
516
  pyegeria/valid_metadata_omvs.py,sha256=UyIT4DfB1_QIG55Hmop7ozbsq8cNdrpYB7Tb6EOFiN8,65035
517
517
  pyegeria/x_action_author_omvs.py,sha256=6b725SPsC52AI7ols7Qq8MsBlZuAXr_BgJ_-ychVRCw,6386
518
- pyegeria-5.3.4.4.dev4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
519
- pyegeria-5.3.4.4.dev4.dist-info/METADATA,sha256=cJiHDO5vOT9xLMaGhW0zX3_9pWPalLdj01XBKf7MvWc,2740
520
- pyegeria-5.3.4.4.dev4.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
521
- pyegeria-5.3.4.4.dev4.dist-info/entry_points.txt,sha256=E83aZ9RhrxffYGmHgBwhLdS5fvEeYhrIPp0FZRvaFOI,6180
522
- pyegeria-5.3.4.4.dev4.dist-info/RECORD,,
518
+ pyegeria-5.3.4.4.dev5.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
519
+ pyegeria-5.3.4.4.dev5.dist-info/METADATA,sha256=Oqn7dNo3wwYvSLuFHZRtT6RdziI6hQL2EXIBpNTGric,2740
520
+ pyegeria-5.3.4.4.dev5.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
521
+ pyegeria-5.3.4.4.dev5.dist-info/entry_points.txt,sha256=E83aZ9RhrxffYGmHgBwhLdS5fvEeYhrIPp0FZRvaFOI,6180
522
+ pyegeria-5.3.4.4.dev5.dist-info/RECORD,,