pyegeria 5.3.4.4.dev3__py3-none-any.whl → 5.3.4.4.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.
- pyegeria/mermaid_utilities.py +95 -17
- {pyegeria-5.3.4.4.dev3.dist-info → pyegeria-5.3.4.4.dev4.dist-info}/METADATA +1 -1
- {pyegeria-5.3.4.4.dev3.dist-info → pyegeria-5.3.4.4.dev4.dist-info}/RECORD +6 -6
- {pyegeria-5.3.4.4.dev3.dist-info → pyegeria-5.3.4.4.dev4.dist-info}/LICENSE +0 -0
- {pyegeria-5.3.4.4.dev3.dist-info → pyegeria-5.3.4.4.dev4.dist-info}/WHEEL +0 -0
- {pyegeria-5.3.4.4.dev3.dist-info → pyegeria-5.3.4.4.dev4.dist-info}/entry_points.txt +0 -0
pyegeria/mermaid_utilities.py
CHANGED
@@ -239,38 +239,116 @@ def construct_mermaid_html(mermaid_str: str) -> str:
|
|
239
239
|
<head>
|
240
240
|
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
241
241
|
<script>
|
242
|
-
// Initialize
|
242
|
+
// Initialize Mermaid.js
|
243
243
|
window.mermaid.initialize({{
|
244
244
|
startOnLoad: true,
|
245
|
-
securityLevel: "loose",
|
246
|
-
theme: "default",
|
245
|
+
securityLevel: "loose",
|
246
|
+
theme: "default",
|
247
247
|
flowchart: {{
|
248
|
-
useMaxWidth: false,
|
249
|
-
htmlLabels: true,
|
250
|
-
wrap: true
|
251
|
-
}},
|
252
|
-
// Enable zoom and pan for the graph
|
253
|
-
zoom: {{
|
254
|
-
enabled: true,
|
255
|
-
scaleExtent: [0.5, 4], // Minimum 50% zoom, maximum 400% zoom
|
256
|
-
pan: true, // Enable panning
|
257
|
-
zoomOnScroll: true // Zoom with scrollwheel/mousepad
|
248
|
+
useMaxWidth: false,
|
249
|
+
htmlLabels: true,
|
250
|
+
wrap: true
|
258
251
|
}}
|
259
252
|
}});
|
260
253
|
</script>
|
254
|
+
<style>
|
255
|
+
/* Pan and zoom container styles */
|
256
|
+
.pan-zoom-container {{
|
257
|
+
overflow: hidden;
|
258
|
+
position: relative;
|
259
|
+
width: 100%;
|
260
|
+
height: 100vh;
|
261
|
+
background-color: #f4f4f4;
|
262
|
+
}}
|
263
|
+
.pan-zoom-content {{
|
264
|
+
transform-origin: 0 0;
|
265
|
+
cursor: grab;
|
266
|
+
}}
|
267
|
+
.pan-zoom-content:active {{
|
268
|
+
cursor: grabbing;
|
269
|
+
}}
|
270
|
+
</style>
|
261
271
|
</head>
|
262
272
|
<body>
|
263
|
-
<div
|
273
|
+
<div class="pan-zoom-container">
|
274
|
+
<div id="{graph_id}" class="mermaid pan-zoom-content">
|
275
|
+
{mermaid_code}
|
276
|
+
</div>
|
277
|
+
</div>
|
264
278
|
<script>
|
265
|
-
//
|
266
|
-
|
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
|
+
}});
|
267
344
|
</script>
|
268
345
|
</body>
|
269
346
|
</html>
|
270
347
|
"""
|
271
|
-
|
272
348
|
return mermaid_html
|
273
349
|
|
350
|
+
|
351
|
+
|
274
352
|
def save_mermaid_html(
|
275
353
|
title: str, mermaid_str: str, folder: str = EGERIA_MERMAID_FOLDER
|
276
354
|
):
|
@@ -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=
|
505
|
+
pyegeria/mermaid_utilities.py,sha256=qSF3Ye5QhH3YHTTLfsxwRozrjstWNVHzT8mQ3nMJyRQ,22957
|
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.
|
519
|
-
pyegeria-5.3.4.4.
|
520
|
-
pyegeria-5.3.4.4.
|
521
|
-
pyegeria-5.3.4.4.
|
522
|
-
pyegeria-5.3.4.4.
|
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,,
|
File without changes
|
File without changes
|
File without changes
|