pyegeria 5.3.4.4.dev8__py3-none-any.whl → 5.3.4.6__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.
Files changed (95) hide show
  1. pyegeria/.DS_Store +0 -0
  2. pyegeria/commands/.DS_Store +0 -0
  3. pyegeria/commands/__pycache__/__init__.cpython-312.pyc +0 -0
  4. pyegeria/commands/__pycache__/server_status_widget.cpython-312-pytest-7.4.4.pyc +0 -0
  5. pyegeria/commands/cat/__pycache__/__init__.cpython-312.pyc +0 -0
  6. pyegeria/commands/cat/__pycache__/get_asset_graph.cpython-312.pyc +0 -0
  7. pyegeria/commands/cat/__pycache__/get_collection.cpython-312.pyc +0 -0
  8. pyegeria/commands/cat/__pycache__/get_project_dependencies.cpython-312.pyc +0 -0
  9. pyegeria/commands/cat/__pycache__/get_project_structure.cpython-312.pyc +0 -0
  10. pyegeria/commands/cat/__pycache__/get_tech_type_elements.cpython-312.pyc +0 -0
  11. pyegeria/commands/cat/__pycache__/glossary_actions.cpython-312.pyc +0 -0
  12. pyegeria/commands/cat/__pycache__/list_assets.cpython-312.pyc +0 -0
  13. pyegeria/commands/cat/__pycache__/list_cert_types.cpython-312.pyc +0 -0
  14. pyegeria/commands/cat/__pycache__/list_collections.cpython-312.pyc +0 -0
  15. pyegeria/commands/cat/__pycache__/list_deployed_catalogs.cpython-312.pyc +0 -0
  16. pyegeria/commands/cat/__pycache__/list_deployed_database_schemas.cpython-312.pyc +0 -0
  17. pyegeria/commands/cat/__pycache__/list_deployed_databases.cpython-312.pyc +0 -0
  18. pyegeria/commands/cat/__pycache__/list_glossaries.cpython-312.pyc +0 -0
  19. pyegeria/commands/cat/__pycache__/list_projects.cpython-312.pyc +0 -0
  20. pyegeria/commands/cat/__pycache__/list_servers_deployed_imp.cpython-312.pyc +0 -0
  21. pyegeria/commands/cat/__pycache__/list_tech_type_elements.cpython-312.pyc +0 -0
  22. pyegeria/commands/cat/__pycache__/list_tech_types.cpython-312.pyc +0 -0
  23. pyegeria/commands/cat/__pycache__/list_terms.cpython-312.pyc +0 -0
  24. pyegeria/commands/cat/__pycache__/list_todos.cpython-312.pyc +0 -0
  25. pyegeria/commands/cat/__pycache__/list_user_ids.cpython-312.pyc +0 -0
  26. pyegeria/commands/cli/__pycache__/__init__.cpython-312.pyc +0 -0
  27. pyegeria/commands/cli/__pycache__/egeria_login_tui.cpython-312.pyc +0 -0
  28. pyegeria/commands/cli/__pycache__/egeria_ops.cpython-312.pyc +0 -0
  29. pyegeria/commands/cli/__pycache__/ops_config.cpython-312.pyc +0 -0
  30. pyegeria/commands/doc/.DS_Store +0 -0
  31. pyegeria/commands/doc/Visual Command Reference/.DS_Store +0 -0
  32. pyegeria/commands/doc/Visual Command Reference/cat/.DS_Store +0 -0
  33. pyegeria/commands/doc/Visual Command Reference/cat/show/.DS_Store +0 -0
  34. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/.DS_Store +0 -0
  35. pyegeria/commands/doc/glossary/.DS_Store +0 -0
  36. pyegeria/commands/doc/glossary/images/.DS_Store +0 -0
  37. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/.DS_Store +0 -0
  38. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/.DS_Store +0 -0
  39. pyegeria/commands/my/__pycache__/__init__.cpython-312.pyc +0 -0
  40. pyegeria/commands/my/__pycache__/list_my_profile.cpython-312.pyc +0 -0
  41. pyegeria/commands/my/__pycache__/list_my_roles.cpython-312.pyc +0 -0
  42. pyegeria/commands/my/__pycache__/monitor_my_todos.cpython-312.pyc +0 -0
  43. pyegeria/commands/my/__pycache__/monitor_open_todos.cpython-312.pyc +0 -0
  44. pyegeria/commands/my/__pycache__/todo_actions.cpython-312.pyc +0 -0
  45. pyegeria/commands/ops/__pycache__/__init__.cpython-312.pyc +0 -0
  46. pyegeria/commands/ops/__pycache__/gov_server_actions.cpython-312.pyc +0 -0
  47. pyegeria/commands/ops/__pycache__/list_archives.cpython-312.pyc +0 -0
  48. pyegeria/commands/ops/__pycache__/list_catalog_targets.cpython-312.pyc +0 -0
  49. pyegeria/commands/ops/__pycache__/load_archive.cpython-312.pyc +0 -0
  50. pyegeria/commands/ops/__pycache__/monitor_engine_activity.cpython-312.pyc +0 -0
  51. pyegeria/commands/ops/__pycache__/monitor_engine_activity_c.cpython-312.pyc +0 -0
  52. pyegeria/commands/ops/__pycache__/monitor_gov_eng_status.cpython-312.pyc +0 -0
  53. pyegeria/commands/ops/__pycache__/monitor_integ_daemon_status.cpython-312.pyc +0 -0
  54. pyegeria/commands/ops/__pycache__/monitor_platform_status.cpython-312.pyc +0 -0
  55. pyegeria/commands/ops/__pycache__/monitor_server_startup.cpython-312.pyc +0 -0
  56. pyegeria/commands/ops/__pycache__/monitor_server_status.cpython-312.pyc +0 -0
  57. pyegeria/commands/ops/__pycache__/refresh_integration_daemon.cpython-312.pyc +0 -0
  58. pyegeria/commands/ops/__pycache__/restart_integration_daemon.cpython-312.pyc +0 -0
  59. pyegeria/commands/ops/__pycache__/table_integ_daemon_status.cpython-312.pyc +0 -0
  60. pyegeria/commands/tech/.DS_Store +0 -0
  61. pyegeria/commands/tech/__pycache__/__init__.cpython-312.pyc +0 -0
  62. pyegeria/commands/tech/__pycache__/get_element_info.cpython-312.pyc +0 -0
  63. pyegeria/commands/tech/__pycache__/get_guid_info.cpython-312.pyc +0 -0
  64. pyegeria/commands/tech/__pycache__/get_tech_details.cpython-312.pyc +0 -0
  65. pyegeria/commands/tech/__pycache__/get_tech_type_template.cpython-312.pyc +0 -0
  66. pyegeria/commands/tech/__pycache__/list_all_om_type_elements.cpython-312.pyc +0 -0
  67. pyegeria/commands/tech/__pycache__/list_all_om_type_elements_x.cpython-312.pyc +0 -0
  68. pyegeria/commands/tech/__pycache__/list_all_related_elements.cpython-312.pyc +0 -0
  69. pyegeria/commands/tech/__pycache__/list_anchored_elements.cpython-312.pyc +0 -0
  70. pyegeria/commands/tech/__pycache__/list_asset_types.cpython-312.pyc +0 -0
  71. pyegeria/commands/tech/__pycache__/list_elements_by_classification_by_property_value.cpython-312.pyc +0 -0
  72. pyegeria/commands/tech/__pycache__/list_elements_by_property_value.cpython-312.pyc +0 -0
  73. pyegeria/commands/tech/__pycache__/list_elements_by_property_value_x.cpython-312.pyc +0 -0
  74. pyegeria/commands/tech/__pycache__/list_elements_for_classification.cpython-312.pyc +0 -0
  75. pyegeria/commands/tech/__pycache__/list_gov_action_processes.cpython-312.pyc +0 -0
  76. pyegeria/commands/tech/__pycache__/list_information_supply_chains.cpython-312.pyc +0 -0
  77. pyegeria/commands/tech/__pycache__/list_registered_services.cpython-312.pyc +0 -0
  78. pyegeria/commands/tech/__pycache__/list_related_elements_with_prop_value.cpython-312.pyc +0 -0
  79. pyegeria/commands/tech/__pycache__/list_related_specification.cpython-312.pyc +0 -0
  80. pyegeria/commands/tech/__pycache__/list_relationship_types.cpython-312.pyc +0 -0
  81. pyegeria/commands/tech/__pycache__/list_relationships.cpython-312.pyc +0 -0
  82. pyegeria/commands/tech/__pycache__/list_solution_blueprints.cpython-312.pyc +0 -0
  83. pyegeria/commands/tech/__pycache__/list_solution_components.cpython-312.pyc +0 -0
  84. pyegeria/commands/tech/__pycache__/list_solution_roles.cpython-312.pyc +0 -0
  85. pyegeria/commands/tech/__pycache__/list_tech_templates.cpython-312.pyc +0 -0
  86. pyegeria/commands/tech/__pycache__/list_valid_metadata_values.cpython-312.pyc +0 -0
  87. pyegeria/mermaid_utilities.py +92 -154
  88. pyegeria/test_m.html +196 -0
  89. pyegeria/test_m.py +113 -0
  90. pyegeria/test_m1.html +273 -0
  91. {pyegeria-5.3.4.4.dev8.dist-info → pyegeria-5.3.4.6.dist-info}/METADATA +1 -1
  92. {pyegeria-5.3.4.4.dev8.dist-info → pyegeria-5.3.4.6.dist-info}/RECORD +95 -6
  93. {pyegeria-5.3.4.4.dev8.dist-info → pyegeria-5.3.4.6.dist-info}/LICENSE +0 -0
  94. {pyegeria-5.3.4.4.dev8.dist-info → pyegeria-5.3.4.6.dist-info}/WHEEL +0 -0
  95. {pyegeria-5.3.4.4.dev8.dist-info → pyegeria-5.3.4.6.dist-info}/entry_points.txt +0 -0
pyegeria/.DS_Store ADDED
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -233,169 +233,107 @@ def construct_mermaid_html(mermaid_str: str) -> str:
233
233
 
234
234
  graph_id = title_label.replace(" ", "_")
235
235
  escaped_header = html.escape(title_label) if title_label else "" # Sanitize the header safely
236
+ escaped_mermaid_code = html.escape(mermaid_code)
236
237
 
237
- header_html = f"<h2 class='diagram-header'>{escaped_header}</h2>\nGUID: {guid}" if title_label else ""
238
+ header_html = f"<h2 class='diagram-header'>{escaped_header}</h2>\nGUID: {guid}" if {title_label} else ""
238
239
 
239
240
  # Construct the HTML content with Mermaid.js initialization and zoom/pan support
240
241
  mermaid_html = f"""
241
- <!DOCTYPE html>
242
- <html lang="en">
243
- <head>
244
- <meta charset="UTF-8">
245
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
246
- <title>Mermaid Diagram with Centered Pan and Zoom</title>
247
- <!-- Load Mermaid.js -->
248
- <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
249
- <style>
250
- body {{
251
- font-family: Arial, sans-serif;
252
- background-color: #f4f4f4;
253
- margin: 0;
254
- padding: 0;
255
- display: flex;
256
- justify-content: center;
257
- align-items: center;
258
- height: 100vh;
259
- }}
260
- .diagram-container {{
261
- width: 90%;
262
- max-width: 800px;
263
- padding: 20px;
264
- border: 1px solid #ddd;
265
- border-radius: 12px;
266
- background-color: white;
267
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
268
- text-align: center;
269
- position: relative;
270
- }}
271
- .diagram-header {{
272
- margin-bottom: 20px;
273
- font-size: 1.8rem;
274
- font-weight: bold;
275
- color: #007acc;
276
- }}
277
- .pan-zoom-container {{
278
- position: relative;
279
- width: 100%;
280
- height: 500px;
281
- overflow: hidden;
282
- border: 1px solid #ccc;
283
- background-color: #f9f9f9;
284
- cursor: grab;
285
- }}
286
- .pan-zoom-content {{
287
- position: absolute;
288
- transform-origin: center;
289
- cursor: grab;
290
- }}
291
- .pan-zoom-content:active {{
292
- cursor: grabbing;
293
- }}
294
- </style>
295
- </head>
296
- <body>
297
- <div class="diagram-container">
298
- {header_html}
299
- <div class="pan-zoom-container">
300
- <div id="{graph_id}" class="mermaid pan-zoom-content">
301
- {mermaid_code}
302
- </div>
242
+ <div class="diagram-container" style="width: 90%; max-width: 800px; margin: auto; padding: 20px; background: white; border: 1px solid #ddd; border-radius: 12px; position: relative;">
243
+ {header_html}
244
+ <div class="pan-zoom-container" style="width: 100%; height: 500px; overflow: hidden; position: relative; background: #f9f9f9; border: 1px solid #ccc; cursor: grab;">
245
+ <div id="{graph_id}" class="mermaid pan-zoom-content" style="position: absolute; transform-origin: 0 0; cursor: grab;">
246
+ {escaped_mermaid_code}
303
247
  </div>
304
248
  </div>
249
+ </div>
250
+ <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
251
+ <script>
252
+ // Initialize Mermaid.js and set up pan/zoom
253
+ mermaid.initialize({{ startOnLoad: true }});
254
+
255
+ const container = document.querySelector('.pan-zoom-container');
256
+ const content = document.querySelector('.pan-zoom-content');
257
+ const rect = content.getBoundingClientRect();
258
+
259
+ let scale = 1; // Current zoom level
260
+ let panX = 0; // X-axis pan offset
261
+ let panY = 0; // Y-axis pan offset
262
+ let isDragging = false;
263
+ let startX, startY;
264
+
265
+ // Helper: Apply transformations
266
+ const applyTransform = () => {{
267
+ content.style.transform = `translate(${{panX}}px, ${{panY}}px) scale(${{scale}})`;
268
+ }};
269
+
270
+ // Helper: Center the diagram and fit it to the container
271
+ const centerAndFitDiagram = () => {{
272
+ const containerRect = container.getBoundingClientRect();
273
+ const rect = content.getBoundingClientRect();
274
+
275
+ scale = Math.min(
276
+ containerRect.width / rect.width,
277
+ containerRect.height / rect.height
278
+ );
279
+
280
+ panX = (containerRect.width - rect.width * scale) / 2;
281
+ panY = (containerRect.height - rect.height * scale) / 2;
282
+
283
+ applyTransform();
284
+ console.log("Diagram centered and fitted.");
285
+ }};
286
+
287
+ // Add zoom functionality
288
+ container.addEventListener('wheel', function(event) {{
289
+ event.preventDefault();
290
+ const zoomSpeed = 0.1;
291
+ const previousScale = scale;
292
+
293
+ if (event.deltaY < 0) {{
294
+ scale = Math.min(scale + zoomSpeed, 4);
295
+ }} else {{
296
+ scale = Math.max(scale - zoomSpeed, 0.5);
297
+ }}
305
298
 
306
- <script>
307
- // Initialize Mermaid.js and make the graph pan/zoom enabled
308
- document.addEventListener("DOMContentLoaded", function() {{
309
- // Initialize Mermaid.js
310
- console.log("Initializing Mermaid...");
311
- mermaid.initialize({{ startOnLoad: true }});
312
-
313
- // After Mermaid.js renders the diagram, initialize pan/zoom functionality
314
- const container = document.querySelector('.pan-zoom-container');
315
- const content = document.querySelector('.pan-zoom-content');
316
-
317
- let scale = 1; // Zoom level
318
- let panX = 0; // X-axis pan
319
- let panY = 0; // Y-axis pan
320
- let isDragging = false;
321
- let startX, startY;
322
-
323
- // Centering logic for zoom behavior
324
- const zoomToCenter = (event, deltaZoom) => {{
325
- const rect = content.getBoundingClientRect();
326
-
327
- // Get the center point of the container
328
- const containerCenterX = container.clientWidth / 2;
329
- const containerCenterY = container.clientHeight / 2;
330
-
331
- // Calculate offset of the content relative to the container center
332
- const offsetX = containerCenterX - (rect.left + rect.width / 2);
333
- const offsetY = containerCenterY - (rect.top + rect.height / 2);
334
-
335
- // Adjust pan values based on the zoom delta
336
- panX += offsetX * deltaZoom;
337
- panY += offsetY * deltaZoom;
338
- }};
339
-
340
- // Mouse wheel zoom functionality
341
- container.addEventListener('wheel', function(event) {{
342
- event.preventDefault();
343
- const zoomSpeed = 0.1;
344
- const previousScale = scale;
345
-
346
- // Increase or decrease scale depending on the scroll direction
347
- if (event.deltaY < 0) {{
348
- scale = Math.min(scale + zoomSpeed, 4); // Limit zoom-in
349
- }} else {{
350
- scale = Math.max(scale - zoomSpeed, 0.5); // Limit zoom-out
351
- }}
352
-
353
- // Compute the zoom delta
354
- const deltaZoom = scale / previousScale - 1;
355
-
356
- // Center the zoom on the diagram
357
- zoomToCenter(event, deltaZoom);
358
-
359
- // Apply transformations
360
- content.style.transform = `translate(${{panX}}px, ${{panY}}px) scale(${{scale}})`;
361
- }});
362
-
363
- // Drag-to-pan functionality
364
- container.addEventListener('mousedown', function(event) {{
365
- isDragging = true;
366
- startX = event.clientX - panX;
367
- startY = event.clientY - panY;
368
- container.style.cursor = "grabbing";
369
- }});
370
-
371
- container.addEventListener('mousemove', function(event) {{
372
- if (!isDragging) return;
373
- panX = event.clientX - startX;
374
- panY = event.clientY - startY;
375
-
376
- // Apply transformations
377
- content.style.transform = `translate(${{panX}}px, ${{panY}}px) scale(${{scale}})`;
378
- }});
379
-
380
- container.addEventListener('mouseup', function() {{
381
- isDragging = false;
382
- container.style.cursor = "grab";
383
- }});
384
-
385
- container.addEventListener('mouseleave', function() {{
386
- isDragging = false;
387
- container.style.cursor = "grab";
388
- }});
389
-
390
- console.log("Pan and zoom enabled");
391
- }});
392
- </script>
393
- </body>
394
- </html>
299
+ const zoomRatio = scale / previousScale;
300
+ panX -= (event.clientX - container.getBoundingClientRect().left) * (zoomRatio - 1);
301
+ panY -= (event.clientY - container.getBoundingClientRect().top) * (zoomRatio - 1);
395
302
 
396
-
397
- """
303
+ applyTransform();
304
+ }});
305
+
306
+ // Add drag functionality for panning
307
+ container.addEventListener('mousedown', function(event) {{
308
+ isDragging = true;
309
+ startX = event.clientX - panX;
310
+ startY = event.clientY - panY;
311
+ container.style.cursor = "grabbing";
312
+ }});
313
+
314
+ container.addEventListener('mousemove', function(event) {{
315
+ if (!isDragging) return;
316
+
317
+ panX = event.clientX - startX;
318
+ panY = event.clientY - startY;
319
+
320
+ applyTransform();
321
+ }});
398
322
 
323
+ container.addEventListener('mouseup', function() {{
324
+ isDragging = false;
325
+ container.style.cursor = "grab";
326
+ }});
327
+
328
+ container.addEventListener('mouseleave', function() {{
329
+ isDragging = false;
330
+ container.style.cursor = "grab";
331
+ }});
332
+
333
+ // Center diagram after rendering by Mermaid
334
+ setTimeout(centerAndFitDiagram, 200);
335
+ </script>
336
+ """
399
337
 
400
338
  return mermaid_html
401
339