pyegeria 5.3.4.6__py3-none-any.whl → 5.3.4.7__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,107 +235,239 @@ def construct_mermaid_html(mermaid_str: str) -> str:
235
235
  escaped_header = html.escape(title_label) if title_label else "" # Sanitize the header safely
236
236
  escaped_mermaid_code = html.escape(mermaid_code)
237
237
 
238
- 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 ""
239
+ # Header HTML (display only if header exists)
240
+ header_html = f"""
241
+ <h2 style="text-align: center; color: #007acc; margin-bottom: 16px;">
242
+ {escaped_header}
243
+ </h2>
244
+ """ if title_label else ""
239
245
 
240
246
  # Construct the HTML content with Mermaid.js initialization and zoom/pan support
247
+
248
+
241
249
  mermaid_html = f"""
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;">
250
+ <div id="{graph_id}-container" class="diagram-container"
251
+ style="width: 90%; max-width: 800px; margin: auto; padding: 20px;
252
+ background: white; border: 1px solid #ddd;
253
+ border-radius: 12px; position: relative;">
243
254
  {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;">
255
+ <div class="pan-zoom-container"
256
+ style="width: 100%; height: 500px; overflow: hidden;
257
+ position: relative; background: #f9f9f9;
258
+ border: 1px solid #ccc; cursor: grab;">
259
+ <div id="{graph_id}" class="mermaid pan-zoom-content"
260
+ style="position: absolute; transform-origin: 0 0;">
246
261
  {escaped_mermaid_code}
247
262
  </div>
248
263
  </div>
249
264
  </div>
250
- <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
265
+
251
266
  <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);
267
+ (function() {{
268
+ // Check if Mermaid.js is already loaded; load if not
269
+ if (typeof mermaid === "undefined") {{
270
+ const script = document.createElement('script');
271
+ script.src = "https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js";
272
+ script.onload = () => initializeMermaid();
273
+ document.head.appendChild(script);
295
274
  }} else {{
296
- scale = Math.max(scale - zoomSpeed, 0.5);
275
+ initializeMermaid();
297
276
  }}
298
277
 
299
- const zoomRatio = scale / previousScale;
300
- panX -= (event.clientX - container.getBoundingClientRect().left) * (zoomRatio - 1);
301
- panY -= (event.clientY - container.getBoundingClientRect().top) * (zoomRatio - 1);
302
-
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
- }});
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);
278
+ function initializeMermaid() {{
279
+ // Re-render the Mermaid chart
280
+ mermaid.initialize({{ startOnLoad: true }});
281
+ mermaid.init(undefined, document.querySelector("#{graph_id}"));
282
+
283
+ // Add interactivity for pan and zoom
284
+ const container = document.querySelector('.pan-zoom-container');
285
+ const content = document.querySelector('.pan-zoom-content');
286
+
287
+ let scale = 1; // Current zoom level
288
+ let panX = 0; // X-axis pan
289
+ let panY = 0; // Y-axis pan
290
+ let isDragging = false;
291
+ let startX, startY;
292
+
293
+ // Apply Transformations
294
+ const applyTransform = () => {{
295
+ content.style.transform = `translate(${{panX}}px, ${{panY}}px) scale(${{scale}})`;
296
+ }};
297
+
298
+ // Center Diagram on Load
299
+ const centerAndFitDiagram = () => {{
300
+ const containerRect = container.getBoundingClientRect();
301
+ const rect = content.getBoundingClientRect();
302
+
303
+ scale = Math.min(
304
+ containerRect.width / rect.width,
305
+ containerRect.height / rect.height
306
+ );
307
+
308
+ panX = (containerRect.width - rect.width * scale) / 2;
309
+ panY = (containerRect.height - rect.height * scale) / 2;
310
+
311
+ applyTransform();
312
+ }};
313
+
314
+ setTimeout(centerAndFitDiagram, 200); // Allow rendering time
315
+
316
+ // Enable Mouse-Wheel Zoom
317
+ container.addEventListener('wheel', (event) => {{
318
+ event.preventDefault();
319
+ const zoomSpeed = 0.1;
320
+ const previousScale = scale;
321
+
322
+ if (event.deltaY < 0) {{
323
+ scale = Math.min(scale + zoomSpeed, 4);
324
+ }} else {{
325
+ scale = Math.max(scale - zoomSpeed, 0.5);
326
+ }}
327
+
328
+ const zoomRatio = scale / previousScale;
329
+ const clientRect = container.getBoundingClientRect();
330
+
331
+ panX -= (event.clientX - clientRect.left) * (zoomRatio - 1);
332
+ panY -= (event.clientY - clientRect.top) * (zoomRatio - 1);
333
+
334
+ applyTransform();
335
+ }});
336
+
337
+ // Enable Drag-to-Pan
338
+ container.addEventListener('mousedown', (event) => {{
339
+ isDragging = true;
340
+ startX = event.clientX - panX;
341
+ startY = event.clientY - panY;
342
+ container.style.cursor = "grabbing";
343
+ }});
344
+
345
+ container.addEventListener('mousemove', (event) => {{
346
+ if (!isDragging) return;
347
+
348
+ panX = event.clientX - startX;
349
+ panY = event.clientY - startY;
350
+
351
+ applyTransform();
352
+ }});
353
+
354
+ container.addEventListener('mouseup', () => {{
355
+ isDragging = false;
356
+ container.style.cursor = "grab";
357
+ }});
358
+
359
+ container.addEventListener('mouseleave', () => {{
360
+ isDragging = false;
361
+ container.style.cursor = "grab";
362
+ }});
363
+ }}
364
+ }})();
335
365
  </script>
336
- """
337
366
 
367
+ """
338
368
  return mermaid_html
369
+ # mermaid_html = f"""
370
+ # <h2 style="text-align: center; color: #007acc; margin-bottom: 16px;">
371
+ # {escaped_header}
372
+ # </h2>
373
+ # """ if header else ""
374
+ # # <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;">
375
+ # # {header_html}
376
+ # # <div class="pan-zoom-container" style="width: 100%; height: 500px; overflow: hidden; position: relative; background: #f9f9f9; border: 1px solid #ccc; cursor: grab;">
377
+ # # <div id="{graph_id}" class="mermaid pan-zoom-content" style="position: absolute; transform-origin: 0 0; cursor: grab;">
378
+ # # {escaped_mermaid_code}
379
+ # # </div>
380
+ # # </div>
381
+ # # </div>
382
+ # # <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
383
+ # # <script>
384
+ # # // Initialize Mermaid.js and set up pan/zoom
385
+ # # mermaid.initialize({{ startOnLoad: true }});
386
+ # #
387
+ # # const container = document.querySelector('.pan-zoom-container');
388
+ # # const content = document.querySelector('.pan-zoom-content');
389
+ # # const rect = content.getBoundingClientRect();
390
+ # #
391
+ # # let scale = 1; // Current zoom level
392
+ # # let panX = 0; // X-axis pan offset
393
+ # # let panY = 0; // Y-axis pan offset
394
+ # # let isDragging = false;
395
+ # # let startX, startY;
396
+ # #
397
+ # # // Helper: Apply transformations
398
+ # # const applyTransform = () => {{
399
+ # # content.style.transform = `translate(${{panX}}px, ${{panY}}px) scale(${{scale}})`;
400
+ # # }};
401
+ # #
402
+ # # // Helper: Center the diagram and fit it to the container
403
+ # # const centerAndFitDiagram = () => {{
404
+ # # const containerRect = container.getBoundingClientRect();
405
+ # # const rect = content.getBoundingClientRect();
406
+ # #
407
+ # # scale = Math.min(
408
+ # # containerRect.width / rect.width,
409
+ # # containerRect.height / rect.height
410
+ # # );
411
+ # #
412
+ # # panX = (containerRect.width - rect.width * scale) / 2;
413
+ # # panY = (containerRect.height - rect.height * scale) / 2;
414
+ # #
415
+ # # applyTransform();
416
+ # # console.log("Diagram centered and fitted.");
417
+ # # }};
418
+ # #
419
+ # # // Add zoom functionality
420
+ # # container.addEventListener('wheel', function(event) {{
421
+ # # event.preventDefault();
422
+ # # const zoomSpeed = 0.1;
423
+ # # const previousScale = scale;
424
+ # #
425
+ # # if (event.deltaY < 0) {{
426
+ # # scale = Math.min(scale + zoomSpeed, 4);
427
+ # # }} else {{
428
+ # # scale = Math.max(scale - zoomSpeed, 0.5);
429
+ # # }}
430
+ # #
431
+ # # const zoomRatio = scale / previousScale;
432
+ # # panX -= (event.clientX - container.getBoundingClientRect().left) * (zoomRatio - 1);
433
+ # # panY -= (event.clientY - container.getBoundingClientRect().top) * (zoomRatio - 1);
434
+ # #
435
+ # # applyTransform();
436
+ # # }});
437
+ # #
438
+ # # // Add drag functionality for panning
439
+ # # container.addEventListener('mousedown', function(event) {{
440
+ # # isDragging = true;
441
+ # # startX = event.clientX - panX;
442
+ # # startY = event.clientY - panY;
443
+ # # container.style.cursor = "grabbing";
444
+ # # }});
445
+ # #
446
+ # # container.addEventListener('mousemove', function(event) {{
447
+ # # if (!isDragging) return;
448
+ # #
449
+ # # panX = event.clientX - startX;
450
+ # # panY = event.clientY - startY;
451
+ # #
452
+ # # applyTransform();
453
+ # # }});
454
+ # #
455
+ # # container.addEventListener('mouseup', function() {{
456
+ # # isDragging = false;
457
+ # # container.style.cursor = "grab";
458
+ # # }});
459
+ # #
460
+ # # container.addEventListener('mouseleave', function() {{
461
+ # # isDragging = false;
462
+ # # container.style.cursor = "grab";
463
+ # # }});
464
+ # #
465
+ # # // Center diagram after rendering by Mermaid
466
+ # # setTimeout(centerAndFitDiagram, 200);
467
+ # # </script>
468
+ # # """
469
+ #
470
+ # return mermaid_html
339
471
 
340
472
 
341
473
 
pyegeria/test_m.html CHANGED
@@ -1,9 +1,19 @@
1
1
 
2
- <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;">
3
- <h2 class='diagram-header'>Component for Solution Blueprint - Clinical Trial Management Solution Blueprint </h2>
4
- GUID: c4f8d707-7c85-4125-b5fd-c3257a2ef2ef
5
- <div class="pan-zoom-container" style="width: 100%; height: 500px; overflow: hidden; position: relative; background: #f9f9f9; border: 1px solid #ccc; cursor: grab;">
6
- <div id="Component_for_Solution_Blueprint_-_Clinical_Trial_Management_Solution_Blueprint_" class="mermaid pan-zoom-content" style="position: absolute; transform-origin: 0 0; cursor: grab;">
2
+ <div id="Component_for_Solution_Blueprint_-_Clinical_Trial_Management_Solution_Blueprint_-container" class="diagram-container"
3
+ style="width: 90%; max-width: 800px; margin: auto; padding: 20px;
4
+ background: white; border: 1px solid #ddd;
5
+ border-radius: 12px; position: relative;">
6
+
7
+ <h2 style="text-align: center; color: #007acc; margin-bottom: 16px;">
8
+ Component for Solution Blueprint - Clinical Trial Management Solution Blueprint
9
+ </h2>
10
+
11
+ <div class="pan-zoom-container"
12
+ style="width: 100%; height: 500px; overflow: hidden;
13
+ position: relative; background: #f9f9f9;
14
+ border: 1px solid #ccc; cursor: grab;">
15
+ <div id="Component_for_Solution_Blueprint_-_Clinical_Trial_Management_Solution_Blueprint_" class="mermaid pan-zoom-content"
16
+ style="position: absolute; transform-origin: 0 0;">
7
17
  flowchart TD
8
18
  %%{init: {&quot;flowchart&quot;: {&quot;htmlLabels&quot;: false}} }%%
9
19
 
@@ -108,89 +118,106 @@ style fb32bef2-e79f-4893-b500-2e547f24d482 color:#FFFFFF, fill:#838cc7, stroke:#
108
118
  </div>
109
119
  </div>
110
120
  </div>
111
- <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
121
+
112
122
  <script>
113
- // Initialize Mermaid.js and set up pan/zoom
114
- mermaid.initialize({ startOnLoad: true });
115
-
116
- const container = document.querySelector('.pan-zoom-container');
117
- const content = document.querySelector('.pan-zoom-content');
118
- const rect = content.getBoundingClientRect();
119
-
120
- let scale = 1; // Current zoom level
121
- let panX = 0; // X-axis pan offset
122
- let panY = 0; // Y-axis pan offset
123
- let isDragging = false;
124
- let startX, startY;
125
-
126
- // Helper: Apply transformations
127
- const applyTransform = () => {
128
- content.style.transform = `translate(${panX}px, ${panY}px) scale(${scale})`;
129
- };
130
-
131
- // Helper: Center the diagram and fit it to the container
132
- const centerAndFitDiagram = () => {
133
- const containerRect = container.getBoundingClientRect();
134
- const rect = content.getBoundingClientRect();
135
-
136
- scale = Math.min(
137
- containerRect.width / rect.width,
138
- containerRect.height / rect.height
139
- );
140
-
141
- panX = (containerRect.width - rect.width * scale) / 2;
142
- panY = (containerRect.height - rect.height * scale) / 2;
143
-
144
- applyTransform();
145
- console.log("Diagram centered and fitted.");
146
- };
147
-
148
- // Add zoom functionality
149
- container.addEventListener('wheel', function(event) {
150
- event.preventDefault();
151
- const zoomSpeed = 0.1;
152
- const previousScale = scale;
153
-
154
- if (event.deltaY < 0) {
155
- scale = Math.min(scale + zoomSpeed, 4);
123
+ (function() {
124
+ // Check if Mermaid.js is already loaded; load if not
125
+ if (typeof mermaid === "undefined") {
126
+ const script = document.createElement('script');
127
+ script.src = "https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js";
128
+ script.onload = () => initializeMermaid();
129
+ document.head.appendChild(script);
156
130
  } else {
157
- scale = Math.max(scale - zoomSpeed, 0.5);
131
+ initializeMermaid();
158
132
  }
159
133
 
160
- const zoomRatio = scale / previousScale;
161
- panX -= (event.clientX - container.getBoundingClientRect().left) * (zoomRatio - 1);
162
- panY -= (event.clientY - container.getBoundingClientRect().top) * (zoomRatio - 1);
163
-
164
- applyTransform();
165
- });
166
-
167
- // Add drag functionality for panning
168
- container.addEventListener('mousedown', function(event) {
169
- isDragging = true;
170
- startX = event.clientX - panX;
171
- startY = event.clientY - panY;
172
- container.style.cursor = "grabbing";
173
- });
174
-
175
- container.addEventListener('mousemove', function(event) {
176
- if (!isDragging) return;
177
-
178
- panX = event.clientX - startX;
179
- panY = event.clientY - startY;
180
-
181
- applyTransform();
182
- });
183
-
184
- container.addEventListener('mouseup', function() {
185
- isDragging = false;
186
- container.style.cursor = "grab";
187
- });
188
-
189
- container.addEventListener('mouseleave', function() {
190
- isDragging = false;
191
- container.style.cursor = "grab";
192
- });
193
-
194
- // Center diagram after rendering by Mermaid
195
- setTimeout(centerAndFitDiagram, 200);
134
+ function initializeMermaid() {
135
+ // Re-render the Mermaid chart
136
+ mermaid.initialize({ startOnLoad: true });
137
+ mermaid.init(undefined, document.querySelector("#Component_for_Solution_Blueprint_-_Clinical_Trial_Management_Solution_Blueprint_"));
138
+
139
+ // Add interactivity for pan and zoom
140
+ const container = document.querySelector('.pan-zoom-container');
141
+ const content = document.querySelector('.pan-zoom-content');
142
+
143
+ let scale = 1; // Current zoom level
144
+ let panX = 0; // X-axis pan
145
+ let panY = 0; // Y-axis pan
146
+ let isDragging = false;
147
+ let startX, startY;
148
+
149
+ // Apply Transformations
150
+ const applyTransform = () => {
151
+ content.style.transform = `translate(${panX}px, ${panY}px) scale(${scale})`;
152
+ };
153
+
154
+ // Center Diagram on Load
155
+ const centerAndFitDiagram = () => {
156
+ const containerRect = container.getBoundingClientRect();
157
+ const rect = content.getBoundingClientRect();
158
+
159
+ scale = Math.min(
160
+ containerRect.width / rect.width,
161
+ containerRect.height / rect.height
162
+ );
163
+
164
+ panX = (containerRect.width - rect.width * scale) / 2;
165
+ panY = (containerRect.height - rect.height * scale) / 2;
166
+
167
+ applyTransform();
168
+ };
169
+
170
+ setTimeout(centerAndFitDiagram, 200); // Allow rendering time
171
+
172
+ // Enable Mouse-Wheel Zoom
173
+ container.addEventListener('wheel', (event) => {
174
+ event.preventDefault();
175
+ const zoomSpeed = 0.1;
176
+ const previousScale = scale;
177
+
178
+ if (event.deltaY < 0) {
179
+ scale = Math.min(scale + zoomSpeed, 4);
180
+ } else {
181
+ scale = Math.max(scale - zoomSpeed, 0.5);
182
+ }
183
+
184
+ const zoomRatio = scale / previousScale;
185
+ const clientRect = container.getBoundingClientRect();
186
+
187
+ panX -= (event.clientX - clientRect.left) * (zoomRatio - 1);
188
+ panY -= (event.clientY - clientRect.top) * (zoomRatio - 1);
189
+
190
+ applyTransform();
191
+ });
192
+
193
+ // Enable Drag-to-Pan
194
+ container.addEventListener('mousedown', (event) => {
195
+ isDragging = true;
196
+ startX = event.clientX - panX;
197
+ startY = event.clientY - panY;
198
+ container.style.cursor = "grabbing";
199
+ });
200
+
201
+ container.addEventListener('mousemove', (event) => {
202
+ if (!isDragging) return;
203
+
204
+ panX = event.clientX - startX;
205
+ panY = event.clientY - startY;
206
+
207
+ applyTransform();
208
+ });
209
+
210
+ container.addEventListener('mouseup', () => {
211
+ isDragging = false;
212
+ container.style.cursor = "grab";
213
+ });
214
+
215
+ container.addEventListener('mouseleave', () => {
216
+ isDragging = false;
217
+ container.style.cursor = "grab";
218
+ });
219
+ }
220
+ })();
196
221
  </script>
222
+
223
+
@@ -0,0 +1,596 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "id": "initial_id",
6
+ "metadata": {
7
+ "collapsed": true
8
+ },
9
+ "source": [
10
+ ""
11
+ ],
12
+ "outputs": [],
13
+ "execution_count": null
14
+ },
15
+ {
16
+ "metadata": {},
17
+ "cell_type": "code",
18
+ "source": [
19
+ "from pyegeria import save_mermaid_graph, render_mermaid, load_mermaid, construct_mermaid_html\n",
20
+ "from IPython.display import display, HTML"
21
+ ],
22
+ "id": "ce93f58829adc918",
23
+ "outputs": [],
24
+ "execution_count": null
25
+ },
26
+ {
27
+ "metadata": {},
28
+ "cell_type": "code",
29
+ "source": [
30
+ "s = \"\"\"\n",
31
+ "\n",
32
+ " <div class=\"diagram-container\" style=\"width: 100%; max-width: 800px; margin: auto; padding: 20px; background: white; border: 1px solid #ddd; border-radius: 12px; position: relative;\">\n",
33
+ " <h2 class='diagram-header'>Component for Solution Blueprint - Clinical Trial Management Solution Blueprint </h2>\n",
34
+ "GUID: c4f8d707-7c85-4125-b5fd-c3257a2ef2ef\n",
35
+ " <div class=\"pan-zoom-container\" style=\"width: 100%; height: 500px; overflow: hidden; position: relative; background: #f9f9f9; border: 1px solid #ccc; cursor: grab;\">\n",
36
+ " <div id=\"Component_for_Solution_Blueprint_-_Clinical_Trial_Management_Solution_Blueprint_\" class=\"mermaid pan-zoom-content\" style=\"position: absolute; transform-origin: 0 0;\">\n",
37
+ " flowchart TD\n",
38
+ "%%{init: {&quot;flowchart&quot;: {&quot;htmlLabels&quot;: false}} }%%\n",
39
+ "\n",
40
+ "subgraph c4f8d707-7c85-4125-b5fd-c3257a2ef2ef [Components and Actors]\n",
41
+ "fc2de77f-7320-48ea-8750-d434c6e870db@{ shape: text, label: &quot;*Description*\n",
42
+ "**A description of how a clinical trial is managed in Coco Pharmaceuticals.**&quot;}\n",
43
+ "37b8560d-84d4-434b-9b0d-105420fcc924@{ shape: subproc, label: &quot;*Solution Component*\n",
44
+ "**Certify Hospital**&quot;}\n",
45
+ "f37f3735-28a1-4e03-9ff5-3fe2f137f661@{ shape: trap-t, label: &quot;*Solution Actor Role*\n",
46
+ "**Clinical Trial Manager**&quot;}\n",
47
+ "f37f3735-28a1-4e03-9ff5-3fe2f137f661--&gt;|&quot;Certifier&quot;|37b8560d-84d4-434b-9b0d-105420fcc924\n",
48
+ "72a86eec-9734-4bc0-babb-4fec0aa7c9ff@{ shape: docs, label: &quot;*Solution Component*\n",
49
+ "**Assemble Treatment Assessment Report**&quot;}\n",
50
+ "48bc201e-3d4e-4beb-bdb2-0fd9d134f6d5@{ shape: rect, label: &quot;*Solution Component*\n",
51
+ "**Treatment Efficacy Evidence**&quot;}\n",
52
+ "48bc201e-3d4e-4beb-bdb2-0fd9d134f6d5--&gt;|&quot;Solution Linking Wire&quot;|72a86eec-9734-4bc0-babb-4fec0aa7c9ff\n",
53
+ "f37f3735-28a1-4e03-9ff5-3fe2f137f661--&gt;|&quot;Author&quot;|72a86eec-9734-4bc0-babb-4fec0aa7c9ff\n",
54
+ "b5c8da4c-f925-4cf1-8294-e43cd2c1a584@{ shape: rect, label: &quot;*Solution Component*\n",
55
+ "**Analyse Patient Data**&quot;}\n",
56
+ "b5c8da4c-f925-4cf1-8294-e43cd2c1a584--&gt;|&quot;Solution Linking Wire&quot;|48bc201e-3d4e-4beb-bdb2-0fd9d134f6d5\n",
57
+ "7f5dca65-50b4-4103-9ac7-3a406a09047a@{ shape: subproc, label: &quot;*Solution Component*\n",
58
+ "**Weekly Measurements Onboarding Pipeline**&quot;}\n",
59
+ "07705e15-efff-4f80-8992-f04ac85e0ef1@{ shape: rect, label: &quot;*Solution Component*\n",
60
+ "**Landing Folder Cataloguer**&quot;}\n",
61
+ "07705e15-efff-4f80-8992-f04ac85e0ef1--&gt;|&quot;Solution Linking Wire&quot;|7f5dca65-50b4-4103-9ac7-3a406a09047a\n",
62
+ "f37f3735-28a1-4e03-9ff5-3fe2f137f661--&gt;|&quot;Steward&quot;|7f5dca65-50b4-4103-9ac7-3a406a09047a\n",
63
+ "b0290339-c96c-4b05-904f-12fc98e54e14@{ shape: trap-t, label: &quot;*Solution Actor Role*\n",
64
+ "**Certified Data Engineer**&quot;}\n",
65
+ "b0290339-c96c-4b05-904f-12fc98e54e14--&gt;|&quot;Steward&quot;|7f5dca65-50b4-4103-9ac7-3a406a09047a\n",
66
+ "d48f579f-76d3-4c49-b1b4-575f5645a9d0@{ shape: lin-cyl, label: &quot;*Solution Component*\n",
67
+ "**Treatment Validation Sandbox**&quot;}\n",
68
+ "26c07ca4-3b8e-484b-812b-36c1ace4b275@{ shape: rect, label: &quot;*Solution Component*\n",
69
+ "**Populate Sandbox**&quot;}\n",
70
+ "26c07ca4-3b8e-484b-812b-36c1ace4b275--&gt;|&quot;Solution Linking Wire&quot;|d48f579f-76d3-4c49-b1b4-575f5645a9d0\n",
71
+ "ee2bb773-e630-4cf9-bdf1-7c2dd64fe4ec@{ shape: processes, label: &quot;*Solution Component*\n",
72
+ "**Hospital Processes**&quot;}\n",
73
+ "a8bd84ca-0aae-4534-b0e8-87e8659467a6@{ shape: trap-t, label: &quot;*Solution Actor Role*\n",
74
+ "**Clinical Trial Participating Hospital Coordinator**&quot;}\n",
75
+ "a8bd84ca-0aae-4534-b0e8-87e8659467a6--&gt;|&quot;Coordinator on behalf of hospital&quot;|ee2bb773-e630-4cf9-bdf1-7c2dd64fe4ec\n",
76
+ "30adaab5-8870-47a8-8ae9-facbf84cb05a@{ shape: trap-t, label: &quot;*Solution Actor Role*\n",
77
+ "**Clinical Trial Participating Hospital**&quot;}\n",
78
+ "30adaab5-8870-47a8-8ae9-facbf84cb05a--&gt;|&quot;Owner&quot;|ee2bb773-e630-4cf9-bdf1-7c2dd64fe4ec\n",
79
+ "d48f579f-76d3-4c49-b1b4-575f5645a9d0--&gt;|&quot;Solution Linking Wire&quot;|b5c8da4c-f925-4cf1-8294-e43cd2c1a584\n",
80
+ "ece17806-836c-4756-b3a2-2d12dde215f6@{ shape: trap-t, label: &quot;*Solution Actor Role*\n",
81
+ "**New Treatment Data Scientist**&quot;}\n",
82
+ "ece17806-836c-4756-b3a2-2d12dde215f6--&gt;|&quot;Data Analyser&quot;|b5c8da4c-f925-4cf1-8294-e43cd2c1a584\n",
83
+ "0c757e35-8a42-4d5f-b01b-c72a6cea65cc@{ shape: trap-t, label: &quot;*Solution Actor Role*\n",
84
+ "**New Treatment Researcher.**&quot;}\n",
85
+ "0c757e35-8a42-4d5f-b01b-c72a6cea65cc--&gt;|&quot;Results Interpreter&quot;|b5c8da4c-f925-4cf1-8294-e43cd2c1a584\n",
86
+ "e9c2f911-ffcb-40c6-aeee-8c4d43811576@{ shape: subproc, label: &quot;*Solution Component*\n",
87
+ "**Onboard Hospital**&quot;}\n",
88
+ "b0290339-c96c-4b05-904f-12fc98e54e14--&gt;|&quot;Initiator&quot;|e9c2f911-ffcb-40c6-aeee-8c4d43811576\n",
89
+ "849b0b42-f465-452b-813c-477d6398e082@{ shape: subproc, label: &quot;*Solution Component*\n",
90
+ "**Set up clinical trial**&quot;}\n",
91
+ "f37f3735-28a1-4e03-9ff5-3fe2f137f661--&gt;|&quot;Initiator&quot;|849b0b42-f465-452b-813c-477d6398e082\n",
92
+ "a5d4d638-6836-47e5-99d0-fdcde637e13f@{ shape: lin-cyl, label: &quot;*Solution Component*\n",
93
+ "**Weekly Measurements Data Lake Folder**&quot;}\n",
94
+ "7f5dca65-50b4-4103-9ac7-3a406a09047a--&gt;|&quot;Solution Linking Wire&quot;|a5d4d638-6836-47e5-99d0-fdcde637e13f\n",
95
+ "0bf2547c-937c-41b6-814f-6284849271a1@{ shape: odd, label: &quot;*Solution Component*\n",
96
+ "**Treatment Assessment Report Validation and Delivery**&quot;}\n",
97
+ "72a86eec-9734-4bc0-babb-4fec0aa7c9ff--&gt;|&quot;Solution Linking Wire&quot;|0bf2547c-937c-41b6-814f-6284849271a1\n",
98
+ "f6bc847b-868d-43cc-b767-41f5fe3e47d1@{ shape: trap-t, label: &quot;*Solution Actor Role*\n",
99
+ "**Clinical Trial Sponsor**&quot;}\n",
100
+ "f6bc847b-868d-43cc-b767-41f5fe3e47d1--&gt;|&quot;Reviewer&quot;|0bf2547c-937c-41b6-814f-6284849271a1\n",
101
+ "a5d4d638-6836-47e5-99d0-fdcde637e13f--&gt;|&quot;Solution Linking Wire&quot;|26c07ca4-3b8e-484b-812b-36c1ace4b275\n",
102
+ "fb32bef2-e79f-4893-b500-2e547f24d482@{ shape: subproc, label: &quot;*Solution Component*\n",
103
+ "**Set up Data Lake Folder**&quot;}\n",
104
+ "b0290339-c96c-4b05-904f-12fc98e54e14--&gt;|&quot;Initiator&quot;|fb32bef2-e79f-4893-b500-2e547f24d482\n",
105
+ "1c150d6e-30cf-481c-9afb-3b06c9c9e78f@{ shape: lin-cyl, label: &quot;*Solution Component*\n",
106
+ "**Hospital Landing Area Folder**&quot;}\n",
107
+ "ee2bb773-e630-4cf9-bdf1-7c2dd64fe4ec--&gt;|&quot;Solution Linking Wire&quot;|1c150d6e-30cf-481c-9afb-3b06c9c9e78f\n",
108
+ "1c150d6e-30cf-481c-9afb-3b06c9c9e78f--&gt;|&quot;Solution Linking Wire&quot;|07705e15-efff-4f80-8992-f04ac85e0ef1\n",
109
+ "11c7c850-c67c-41cc-9423-d74db47cbf3a@{ shape: subproc, label: &quot;*Solution Component*\n",
110
+ "**Nominate Hospital**&quot;}\n",
111
+ "f37f3735-28a1-4e03-9ff5-3fe2f137f661--&gt;|&quot;Initiator&quot;|11c7c850-c67c-41cc-9423-d74db47cbf3a\n",
112
+ "end\n",
113
+ "style 48bc201e-3d4e-4beb-bdb2-0fd9d134f6d5 color:#FFFFFF, fill:#838cc7, stroke:#3079ab\n",
114
+ "style ece17806-836c-4756-b3a2-2d12dde215f6 color:#FFFFFF, fill:#AA00FF, stroke:#E1D5E7\n",
115
+ "style e9c2f911-ffcb-40c6-aeee-8c4d43811576 color:#FFFFFF, fill:#838cc7, stroke:#3079ab\n",
116
+ "style a5d4d638-6836-47e5-99d0-fdcde637e13f color:#FFFFFF, fill:#838cc7, stroke:#3079ab\n",
117
+ "style 0bf2547c-937c-41b6-814f-6284849271a1 color:#FFFFFF, fill:#838cc7, stroke:#3079ab\n",
118
+ "style 30adaab5-8870-47a8-8ae9-facbf84cb05a color:#FFFFFF, fill:#AA00FF, stroke:#E1D5E7\n",
119
+ "style b0290339-c96c-4b05-904f-12fc98e54e14 color:#FFFFFF, fill:#AA00FF, stroke:#E1D5E7\n",
120
+ "style 26c07ca4-3b8e-484b-812b-36c1ace4b275 color:#FFFFFF, fill:#838cc7, stroke:#3079ab\n",
121
+ "style 1c150d6e-30cf-481c-9afb-3b06c9c9e78f color:#FFFFFF, fill:#838cc7, stroke:#3079ab\n",
122
+ "style 07705e15-efff-4f80-8992-f04ac85e0ef1 color:#FFFFFF, fill:#838cc7, stroke:#3079ab\n",
123
+ "style a8bd84ca-0aae-4534-b0e8-87e8659467a6 color:#FFFFFF, fill:#AA00FF, stroke:#E1D5E7\n",
124
+ "style 0c757e35-8a42-4d5f-b01b-c72a6cea65cc color:#FFFFFF, fill:#AA00FF, stroke:#E1D5E7\n",
125
+ "style c4f8d707-7c85-4125-b5fd-c3257a2ef2ef color:#3079ab, fill:#b7c0c7, stroke:#3079ab\n",
126
+ "style 37b8560d-84d4-434b-9b0d-105420fcc924 color:#FFFFFF, fill:#838cc7, stroke:#3079ab\n",
127
+ "style 11c7c850-c67c-41cc-9423-d74db47cbf3a color:#FFFFFF, fill:#838cc7, stroke:#3079ab\n",
128
+ "style fc2de77f-7320-48ea-8750-d434c6e870db color:#000000, fill:#F9F7ED, stroke:#b7c0c7\n",
129
+ "style 849b0b42-f465-452b-813c-477d6398e082 color:#FFFFFF, fill:#838cc7, stroke:#3079ab\n",
130
+ "style 7f5dca65-50b4-4103-9ac7-3a406a09047a color:#FFFFFF, fill:#838cc7, stroke:#3079ab\n",
131
+ "style ee2bb773-e630-4cf9-bdf1-7c2dd64fe4ec color:#FFFFFF, fill:#838cc7, stroke:#3079ab\n",
132
+ "style 72a86eec-9734-4bc0-babb-4fec0aa7c9ff color:#FFFFFF, fill:#838cc7, stroke:#3079ab\n",
133
+ "style b5c8da4c-f925-4cf1-8294-e43cd2c1a584 color:#FFFFFF, fill:#838cc7, stroke:#3079ab\n",
134
+ "style f6bc847b-868d-43cc-b767-41f5fe3e47d1 color:#FFFFFF, fill:#AA00FF, stroke:#E1D5E7\n",
135
+ "style d48f579f-76d3-4c49-b1b4-575f5645a9d0 color:#FFFFFF, fill:#838cc7, stroke:#3079ab\n",
136
+ "style f37f3735-28a1-4e03-9ff5-3fe2f137f661 color:#FFFFFF, fill:#AA00FF, stroke:#E1D5E7\n",
137
+ "style fb32bef2-e79f-4893-b500-2e547f24d482 color:#FFFFFF, fill:#838cc7, stroke:#3079ab\n",
138
+ " </div>\n",
139
+ " </div>\n",
140
+ " </div>\n",
141
+ "\n",
142
+ " <script>\n",
143
+ " // Load Mermaid if it's not already loaded\n",
144
+ " if (typeof mermaid === \"undefined\") {\n",
145
+ " const script = document.createElement('script');\n",
146
+ " script.src = \"https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js\";\n",
147
+ " script.onload = () => renderMermaidGraph();\n",
148
+ " document.head.appendChild(script);\n",
149
+ " } else {\n",
150
+ " // Mermaid already loaded, render the graph immediately\n",
151
+ " renderMermaidGraph();\n",
152
+ " }\n",
153
+ "\n",
154
+ " function renderMermaidGraph() {\n",
155
+ " mermaid.initialize({ startOnLoad: true });\n",
156
+ "\n",
157
+ " const container = document.querySelector('.pan-zoom-container');\n",
158
+ " const content = document.querySelector('.pan-zoom-content');\n",
159
+ "\n",
160
+ " let scale = 1; // Current zoom level\n",
161
+ " let panX = 0; // X-axis pan\n",
162
+ " let panY = 0; // Y-axis pan\n",
163
+ " let isDragging = false;\n",
164
+ " let startX, startY;\n",
165
+ "\n",
166
+ " // Apply transformations\n",
167
+ " const applyTransform = () => {\n",
168
+ " content.style.transform = `translate(${panX}px, ${panY}px) scale(${scale})`;\n",
169
+ " };\n",
170
+ "\n",
171
+ " // Fit diagram to container\n",
172
+ " const centerAndFitDiagram = () => {\n",
173
+ " const containerRect = container.getBoundingClientRect();\n",
174
+ " const rect = content.getBoundingClientRect();\n",
175
+ "\n",
176
+ " scale = Math.min(\n",
177
+ " containerRect.width / rect.width,\n",
178
+ " containerRect.height / rect.height\n",
179
+ " );\n",
180
+ "\n",
181
+ " panX = (containerRect.width - rect.width * scale) / 2;\n",
182
+ " panY = (containerRect.height - rect.height * scale) / 2;\n",
183
+ "\n",
184
+ " applyTransform();\n",
185
+ " };\n",
186
+ "\n",
187
+ " // Zoom functionality\n",
188
+ " container.addEventListener('wheel', function(event) {\n",
189
+ " event.preventDefault();\n",
190
+ " const zoomSpeed = 0.1;\n",
191
+ " const previousScale = scale;\n",
192
+ "\n",
193
+ " if (event.deltaY < 0) {\n",
194
+ " scale = Math.min(scale + zoomSpeed, 4);\n",
195
+ " } else {\n",
196
+ " scale = Math.max(scale - zoomSpeed, 0.5);\n",
197
+ " }\n",
198
+ "\n",
199
+ " const zoomRatio = scale / previousScale;\n",
200
+ " const clientRect = container.getBoundingClientRect();\n",
201
+ "\n",
202
+ " panX -= (event.clientX - clientRect.left) * (zoomRatio - 1);\n",
203
+ " panY -= (event.clientY - clientRect.top) * (zoomRatio - 1);\n",
204
+ "\n",
205
+ " applyTransform();\n",
206
+ " });\n",
207
+ "\n",
208
+ " // Drag functionality\n",
209
+ " container.addEventListener('mousedown', function(event) {\n",
210
+ " isDragging = true;\n",
211
+ " startX = event.clientX - panX;\n",
212
+ " startY = event.clientY - panY;\n",
213
+ " container.style.cursor = \"grabbing\";\n",
214
+ " });\n",
215
+ "\n",
216
+ " container.addEventListener('mousemove', function(event) {\n",
217
+ " if (!isDragging) return;\n",
218
+ "\n",
219
+ " panX = event.clientX - startX;\n",
220
+ " panY = event.clientY - startY;\n",
221
+ "\n",
222
+ " applyTransform();\n",
223
+ " });\n",
224
+ "\n",
225
+ " container.addEventListener('mouseup', function() {\n",
226
+ " isDragging = false;\n",
227
+ " container.style.cursor = \"grab\";\n",
228
+ " });\n",
229
+ "\n",
230
+ " container.addEventListener('mouseleave', function() {\n",
231
+ " isDragging = false;\n",
232
+ " container.style.cursor = \"grab\";\n",
233
+ " });\n",
234
+ "\n",
235
+ " setTimeout(centerAndFitDiagram, 200);\n",
236
+ " }\n",
237
+ " </script>\n",
238
+ " \"\"\""
239
+ ],
240
+ "id": "6f8c28251d1dfa9f",
241
+ "outputs": [],
242
+ "execution_count": null
243
+ },
244
+ {
245
+ "metadata": {
246
+ "ExecuteTime": {
247
+ "end_time": "2025-02-07T01:29:56.716699Z",
248
+ "start_time": "2025-02-07T01:29:56.414355Z"
249
+ }
250
+ },
251
+ "cell_type": "code",
252
+ "source": [
253
+ "from pyegeria.egeria_tech_client import EgeriaTech\n",
254
+ "from pyegeria.mermaid_utilities import render_mermaid, construct_mermaid_html, load_mermaid\n",
255
+ "from IPython.display import display, HTML\n",
256
+ "\n",
257
+ "c = EgeriaTech('qs-view-server','https://localhost:9443','erinoverview','secret')\n",
258
+ "c.create_egeria_bearer_token()"
259
+ ],
260
+ "id": "2adde043f97ae76a",
261
+ "outputs": [
262
+ {
263
+ "data": {
264
+ "text/plain": [
265
+ "'eyJraWQiOiI1NTNhNTIzOC1iNDFjLTQyZTItOTM2YS1iMGE3NjQ5YWFlOWQiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJzZWxmIiwic3ViIjoiZXJpbm92ZXJ2aWV3IiwiZXhwIjoxNzM4ODk1Mzk2LCJpYXQiOjE3Mzg4OTE3OTYsImRpc3BsYXlOYW1lIjoiRXJpbiBPdmVydmlldyJ9.roGnq2SiZYJ2u60waVkpd2zKdK2PeEpVf0D7L4-UTQyHmlQKjpzRdqgBUXy7B2kcgN2iEKloNaYXimdM23mQdqZrCIWGu8g_-Wt5fdSIX1ZU8QTIKa6oXJt-fKZCGGpHrRArfuQNrGm1q_k64pQa98ABc1OZkr6Z9Uorboxr7q73rOzfS-RRuKnsxyM9xKUBBMLXfrKiz8NZVX82ao46ihi2_c7EJ4PofGM4aAY1A5mgB2zOvEms2JTb6LU3I_3aexgg9JRBBUsCqf-RcRfsSnG-MZN93ry7rZAVeVx2oXCtA9xvk8oZ5k3FCk0Zxi7Yv2qku-9Igdqto1tVXVmeCw'"
266
+ ]
267
+ },
268
+ "execution_count": 1,
269
+ "metadata": {},
270
+ "output_type": "execute_result"
271
+ }
272
+ ],
273
+ "execution_count": 1
274
+ },
275
+ {
276
+ "metadata": {
277
+ "ExecuteTime": {
278
+ "end_time": "2025-02-07T01:30:00.016156Z",
279
+ "start_time": "2025-02-07T01:29:57.976937Z"
280
+ }
281
+ },
282
+ "cell_type": "code",
283
+ "source": [
284
+ "bp = c.find_solution_blueprints('Clinical')\n",
285
+ "sc = c.find_information_supply_chains('Clinical')\n",
286
+ "g1 = bp[0]['mermaidGraph']\n",
287
+ "s1 = sc[0]['mermaidGraph']"
288
+ ],
289
+ "id": "1f48750fa8f194c9",
290
+ "outputs": [],
291
+ "execution_count": 2
292
+ },
293
+ {
294
+ "metadata": {
295
+ "ExecuteTime": {
296
+ "end_time": "2025-02-07T01:30:01.757080Z",
297
+ "start_time": "2025-02-07T01:30:01.754630Z"
298
+ }
299
+ },
300
+ "cell_type": "code",
301
+ "source": "print(s1)",
302
+ "id": "ebc1d9451ffb8698",
303
+ "outputs": [
304
+ {
305
+ "name": "stdout",
306
+ "output_type": "stream",
307
+ "text": [
308
+ "---\n",
309
+ "title: Information Supply Chain - Clinical Trial Subject Onboarding [39a035f0-3b2b-45fe-adb8-ee8a19581f6a]\n",
310
+ "---\n",
311
+ "flowchart TD\n",
312
+ "%%{init: {\"flowchart\": {\"htmlLabels\": false}} }%%\n",
313
+ "\n",
314
+ "39a035f0-3b2b-45fe-adb8-ee8a19581f6a@{ shape: flip-tri, label: \"*Information Supply Chain*\n",
315
+ "**Clinical Trial Subject Onboarding**\"}\n",
316
+ "384f2dce-60be-4ad1-8993-1f3b6070e8ee@{ shape: text, label: \"*Description*\n",
317
+ "**Delivering the data necessary to add a person as a subject in a clinical trial.**\"}\n",
318
+ "39a035f0-3b2b-45fe-adb8-ee8a19581f6a~~~384f2dce-60be-4ad1-8993-1f3b6070e8ee\n",
319
+ "1195927b-9aca-4716-8cd4-2e2f30a13bf2@{ shape: text, label: \"*Purpose*\n",
320
+ "**Ensure patient subject is aware of the process and potential risks in participation.**\"}\n",
321
+ "384f2dce-60be-4ad1-8993-1f3b6070e8ee~~~1195927b-9aca-4716-8cd4-2e2f30a13bf2\n",
322
+ "df4be8f9-f3cc-4af3-89cf-df27b3575460@{ shape: text, label: \"*Purpose*\n",
323
+ "**Ensure patient subject has given permission for Coco Pharmaceuticals to acquire, store and process their personal data needed for the clinical trial.**\"}\n",
324
+ "1195927b-9aca-4716-8cd4-2e2f30a13bf2~~~df4be8f9-f3cc-4af3-89cf-df27b3575460\n",
325
+ "5d8b5071-d707-437a-be43-6e4487e8b04d@{ shape: text, label: \"*Purpose*\n",
326
+ "**Ensure incoming data is validated and catalogued.**\"}\n",
327
+ "df4be8f9-f3cc-4af3-89cf-df27b3575460~~~5d8b5071-d707-437a-be43-6e4487e8b04d\n",
328
+ "1da03445-e4d6-4769-9cf6-b8810822c943@{ shape: text, label: \"*Purpose*\n",
329
+ "**Ensure data and process owners are informed of key milestones and issues requiring attention.**\"}\n",
330
+ "5d8b5071-d707-437a-be43-6e4487e8b04d~~~1da03445-e4d6-4769-9cf6-b8810822c943\n",
331
+ "614ca1a4-bc66-44ff-b9e5-34c1ba4edecc@{ shape: text, label: \"*Purpose*\n",
332
+ "**Ensure the process of data capture and validation is transparent and auditable.**\"}\n",
333
+ "1da03445-e4d6-4769-9cf6-b8810822c943~~~614ca1a4-bc66-44ff-b9e5-34c1ba4edecc\n",
334
+ "style 39a035f0-3b2b-45fe-adb8-ee8a19581f6a color:#FFFFFF, fill:#004563, stroke:#b7c0c7\n",
335
+ "style 1da03445-e4d6-4769-9cf6-b8810822c943 color:#000000, fill:#F9F7ED, stroke:#b7c0c7\n",
336
+ "style 5d8b5071-d707-437a-be43-6e4487e8b04d color:#000000, fill:#F9F7ED, stroke:#b7c0c7\n",
337
+ "style 384f2dce-60be-4ad1-8993-1f3b6070e8ee color:#000000, fill:#F9F7ED, stroke:#b7c0c7\n",
338
+ "style 614ca1a4-bc66-44ff-b9e5-34c1ba4edecc color:#000000, fill:#F9F7ED, stroke:#b7c0c7\n",
339
+ "style 1195927b-9aca-4716-8cd4-2e2f30a13bf2 color:#000000, fill:#F9F7ED, stroke:#b7c0c7\n",
340
+ "style df4be8f9-f3cc-4af3-89cf-df27b3575460 color:#000000, fill:#F9F7ED, stroke:#b7c0c7\n",
341
+ "\n"
342
+ ]
343
+ }
344
+ ],
345
+ "execution_count": 3
346
+ },
347
+ {
348
+ "metadata": {
349
+ "ExecuteTime": {
350
+ "end_time": "2025-02-07T01:30:03.540438Z",
351
+ "start_time": "2025-02-07T01:30:03.537172Z"
352
+ }
353
+ },
354
+ "cell_type": "code",
355
+ "source": "load_mermaid()",
356
+ "id": "b83a08cff7bc5c8f",
357
+ "outputs": [
358
+ {
359
+ "data": {
360
+ "text/plain": [
361
+ "<IPython.core.display.HTML object>"
362
+ ],
363
+ "text/html": [
364
+ "\n",
365
+ " <script src=\"https://unpkg.com/mermaid@11.4.1/dist/mermaid.min.js\"></script>\n",
366
+ " <script>\n",
367
+ " document.addEventListener('DOMContentLoaded', function() {\n",
368
+ " mermaid.initialize({startOnLoad: true});\n",
369
+ " });\n",
370
+ " </script>\n",
371
+ "\n",
372
+ " "
373
+ ]
374
+ },
375
+ "metadata": {},
376
+ "output_type": "display_data"
377
+ }
378
+ ],
379
+ "execution_count": 4
380
+ },
381
+ {
382
+ "metadata": {
383
+ "ExecuteTime": {
384
+ "end_time": "2025-02-07T01:30:04.918794Z",
385
+ "start_time": "2025-02-07T01:30:04.915949Z"
386
+ }
387
+ },
388
+ "cell_type": "code",
389
+ "source": "render_mermaid(s1)",
390
+ "id": "245bb4b173d65a6a",
391
+ "outputs": [
392
+ {
393
+ "data": {
394
+ "text/plain": [
395
+ "<IPython.core.display.HTML object>"
396
+ ],
397
+ "text/html": [
398
+ "\n",
399
+ " <div id=\"Information_Supply_Chain_-_Clinical_Trial_Subject_Onboarding_-container\" class=\"diagram-container\" \n",
400
+ " style=\"width: 90%; max-width: 800px; margin: auto; padding: 20px; \n",
401
+ " background: white; border: 1px solid #ddd; \n",
402
+ " border-radius: 12px; position: relative;\">\n",
403
+ " \n",
404
+ " <h2 style=\"text-align: center; color: #007acc; margin-bottom: 16px;\">\n",
405
+ " Information Supply Chain - Clinical Trial Subject Onboarding \n",
406
+ " </h2>\n",
407
+ " \n",
408
+ " <div class=\"pan-zoom-container\" \n",
409
+ " style=\"width: 100%; height: 500px; overflow: hidden; \n",
410
+ " position: relative; background: #f9f9f9; \n",
411
+ " border: 1px solid #ccc; cursor: grab;\">\n",
412
+ " <div id=\"Information_Supply_Chain_-_Clinical_Trial_Subject_Onboarding_\" class=\"mermaid pan-zoom-content\" \n",
413
+ " style=\"position: absolute; transform-origin: 0 0;\">\n",
414
+ " flowchart TD\n",
415
+ "%%{init: {&quot;flowchart&quot;: {&quot;htmlLabels&quot;: false}} }%%\n",
416
+ "\n",
417
+ "39a035f0-3b2b-45fe-adb8-ee8a19581f6a@{ shape: flip-tri, label: &quot;*Information Supply Chain*\n",
418
+ "**Clinical Trial Subject Onboarding**&quot;}\n",
419
+ "384f2dce-60be-4ad1-8993-1f3b6070e8ee@{ shape: text, label: &quot;*Description*\n",
420
+ "**Delivering the data necessary to add a person as a subject in a clinical trial.**&quot;}\n",
421
+ "39a035f0-3b2b-45fe-adb8-ee8a19581f6a~~~384f2dce-60be-4ad1-8993-1f3b6070e8ee\n",
422
+ "1195927b-9aca-4716-8cd4-2e2f30a13bf2@{ shape: text, label: &quot;*Purpose*\n",
423
+ "**Ensure patient subject is aware of the process and potential risks in participation.**&quot;}\n",
424
+ "384f2dce-60be-4ad1-8993-1f3b6070e8ee~~~1195927b-9aca-4716-8cd4-2e2f30a13bf2\n",
425
+ "df4be8f9-f3cc-4af3-89cf-df27b3575460@{ shape: text, label: &quot;*Purpose*\n",
426
+ "**Ensure patient subject has given permission for Coco Pharmaceuticals to acquire, store and process their personal data needed for the clinical trial.**&quot;}\n",
427
+ "1195927b-9aca-4716-8cd4-2e2f30a13bf2~~~df4be8f9-f3cc-4af3-89cf-df27b3575460\n",
428
+ "5d8b5071-d707-437a-be43-6e4487e8b04d@{ shape: text, label: &quot;*Purpose*\n",
429
+ "**Ensure incoming data is validated and catalogued.**&quot;}\n",
430
+ "df4be8f9-f3cc-4af3-89cf-df27b3575460~~~5d8b5071-d707-437a-be43-6e4487e8b04d\n",
431
+ "1da03445-e4d6-4769-9cf6-b8810822c943@{ shape: text, label: &quot;*Purpose*\n",
432
+ "**Ensure data and process owners are informed of key milestones and issues requiring attention.**&quot;}\n",
433
+ "5d8b5071-d707-437a-be43-6e4487e8b04d~~~1da03445-e4d6-4769-9cf6-b8810822c943\n",
434
+ "614ca1a4-bc66-44ff-b9e5-34c1ba4edecc@{ shape: text, label: &quot;*Purpose*\n",
435
+ "**Ensure the process of data capture and validation is transparent and auditable.**&quot;}\n",
436
+ "1da03445-e4d6-4769-9cf6-b8810822c943~~~614ca1a4-bc66-44ff-b9e5-34c1ba4edecc\n",
437
+ "style 39a035f0-3b2b-45fe-adb8-ee8a19581f6a color:#FFFFFF, fill:#004563, stroke:#b7c0c7\n",
438
+ "style 1da03445-e4d6-4769-9cf6-b8810822c943 color:#000000, fill:#F9F7ED, stroke:#b7c0c7\n",
439
+ "style 5d8b5071-d707-437a-be43-6e4487e8b04d color:#000000, fill:#F9F7ED, stroke:#b7c0c7\n",
440
+ "style 384f2dce-60be-4ad1-8993-1f3b6070e8ee color:#000000, fill:#F9F7ED, stroke:#b7c0c7\n",
441
+ "style 614ca1a4-bc66-44ff-b9e5-34c1ba4edecc color:#000000, fill:#F9F7ED, stroke:#b7c0c7\n",
442
+ "style 1195927b-9aca-4716-8cd4-2e2f30a13bf2 color:#000000, fill:#F9F7ED, stroke:#b7c0c7\n",
443
+ "style df4be8f9-f3cc-4af3-89cf-df27b3575460 color:#000000, fill:#F9F7ED, stroke:#b7c0c7\n",
444
+ " </div>\n",
445
+ " </div>\n",
446
+ " </div>\n",
447
+ "\n",
448
+ " <script>\n",
449
+ " (function() {\n",
450
+ " // Check if Mermaid.js is already loaded; load if not\n",
451
+ " if (typeof mermaid === \"undefined\") {\n",
452
+ " const script = document.createElement('script');\n",
453
+ " script.src = \"https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js\";\n",
454
+ " script.onload = () => initializeMermaid();\n",
455
+ " document.head.appendChild(script);\n",
456
+ " } else {\n",
457
+ " initializeMermaid();\n",
458
+ " }\n",
459
+ "\n",
460
+ " function initializeMermaid() {\n",
461
+ " // Re-render the Mermaid chart\n",
462
+ " mermaid.initialize({ startOnLoad: true });\n",
463
+ " mermaid.init(undefined, document.querySelector(\"#Information_Supply_Chain_-_Clinical_Trial_Subject_Onboarding_\"));\n",
464
+ "\n",
465
+ " // Add interactivity for pan and zoom\n",
466
+ " const container = document.querySelector('.pan-zoom-container');\n",
467
+ " const content = document.querySelector('.pan-zoom-content');\n",
468
+ "\n",
469
+ " let scale = 1; // Current zoom level\n",
470
+ " let panX = 0; // X-axis pan\n",
471
+ " let panY = 0; // Y-axis pan\n",
472
+ " let isDragging = false;\n",
473
+ " let startX, startY;\n",
474
+ "\n",
475
+ " // Apply Transformations\n",
476
+ " const applyTransform = () => {\n",
477
+ " content.style.transform = `translate(${panX}px, ${panY}px) scale(${scale})`;\n",
478
+ " };\n",
479
+ "\n",
480
+ " // Center Diagram on Load\n",
481
+ " const centerAndFitDiagram = () => {\n",
482
+ " const containerRect = container.getBoundingClientRect();\n",
483
+ " const rect = content.getBoundingClientRect();\n",
484
+ "\n",
485
+ " scale = Math.min(\n",
486
+ " containerRect.width / rect.width,\n",
487
+ " containerRect.height / rect.height\n",
488
+ " );\n",
489
+ "\n",
490
+ " panX = (containerRect.width - rect.width * scale) / 2;\n",
491
+ " panY = (containerRect.height - rect.height * scale) / 2;\n",
492
+ "\n",
493
+ " applyTransform();\n",
494
+ " };\n",
495
+ "\n",
496
+ " setTimeout(centerAndFitDiagram, 200); // Allow rendering time\n",
497
+ "\n",
498
+ " // Enable Mouse-Wheel Zoom\n",
499
+ " container.addEventListener('wheel', (event) => {\n",
500
+ " event.preventDefault();\n",
501
+ " const zoomSpeed = 0.1;\n",
502
+ " const previousScale = scale;\n",
503
+ "\n",
504
+ " if (event.deltaY < 0) {\n",
505
+ " scale = Math.min(scale + zoomSpeed, 4);\n",
506
+ " } else {\n",
507
+ " scale = Math.max(scale - zoomSpeed, 0.5);\n",
508
+ " }\n",
509
+ "\n",
510
+ " const zoomRatio = scale / previousScale;\n",
511
+ " const clientRect = container.getBoundingClientRect();\n",
512
+ "\n",
513
+ " panX -= (event.clientX - clientRect.left) * (zoomRatio - 1);\n",
514
+ " panY -= (event.clientY - clientRect.top) * (zoomRatio - 1);\n",
515
+ "\n",
516
+ " applyTransform();\n",
517
+ " });\n",
518
+ "\n",
519
+ " // Enable Drag-to-Pan\n",
520
+ " container.addEventListener('mousedown', (event) => {\n",
521
+ " isDragging = true;\n",
522
+ " startX = event.clientX - panX;\n",
523
+ " startY = event.clientY - panY;\n",
524
+ " container.style.cursor = \"grabbing\";\n",
525
+ " });\n",
526
+ "\n",
527
+ " container.addEventListener('mousemove', (event) => {\n",
528
+ " if (!isDragging) return;\n",
529
+ "\n",
530
+ " panX = event.clientX - startX;\n",
531
+ " panY = event.clientY - startY;\n",
532
+ "\n",
533
+ " applyTransform();\n",
534
+ " });\n",
535
+ "\n",
536
+ " container.addEventListener('mouseup', () => {\n",
537
+ " isDragging = false;\n",
538
+ " container.style.cursor = \"grab\";\n",
539
+ " });\n",
540
+ "\n",
541
+ " container.addEventListener('mouseleave', () => {\n",
542
+ " isDragging = false;\n",
543
+ " container.style.cursor = \"grab\";\n",
544
+ " });\n",
545
+ " }\n",
546
+ " })();\n",
547
+ " </script>\n",
548
+ "\n",
549
+ " "
550
+ ]
551
+ },
552
+ "metadata": {},
553
+ "output_type": "display_data"
554
+ }
555
+ ],
556
+ "execution_count": 5
557
+ },
558
+ {
559
+ "metadata": {},
560
+ "cell_type": "code",
561
+ "source": "print(construct_mermaid_html(s1))",
562
+ "id": "81dfb284e894fa3",
563
+ "outputs": [],
564
+ "execution_count": null
565
+ },
566
+ {
567
+ "metadata": {},
568
+ "cell_type": "code",
569
+ "source": "",
570
+ "id": "dec9454145d5dc79",
571
+ "outputs": [],
572
+ "execution_count": null
573
+ }
574
+ ],
575
+ "metadata": {
576
+ "kernelspec": {
577
+ "display_name": "Python 3",
578
+ "language": "python",
579
+ "name": "python3"
580
+ },
581
+ "language_info": {
582
+ "codemirror_mode": {
583
+ "name": "ipython",
584
+ "version": 2
585
+ },
586
+ "file_extension": ".py",
587
+ "mimetype": "text/x-python",
588
+ "name": "python",
589
+ "nbconvert_exporter": "python",
590
+ "pygments_lexer": "ipython2",
591
+ "version": "2.7.6"
592
+ }
593
+ },
594
+ "nbformat": 4,
595
+ "nbformat_minor": 5
596
+ }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyegeria
3
- Version: 5.3.4.6
3
+ Version: 5.3.4.7
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=0p2pE9OUAejL-tNzZRSnNrWDfvDTdcU6WaUJPlwRxRE,22754
505
+ pyegeria/mermaid_utilities.py,sha256=uTb3mTOtzecE7yyQfDWHzGt_jgvpmOaX0G_Mc7WGKtg,28225
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
@@ -512,14 +512,15 @@ pyegeria/runtime_manager_omvs.py,sha256=NrY2yJriu20eJfpKBSLq81cMMARZIllhukm9VNmL
512
512
  pyegeria/server_operations.py,sha256=vmiUDU_Xa0U8pa0Fdb-QKkoeSqs7WfMwIpG_XU3xgeI,16784
513
513
  pyegeria/solution_architect_omvs.py,sha256=AsyjQzfgSUriDymeP9W45iJqYux423xXDaqfHLEtWN4,22085
514
514
  pyegeria/template_manager_omvs.py,sha256=o_qCIFTRLK8b9C3N99taLji8VkDygo1Ss0fua35yfhA,42389
515
- pyegeria/test_m.html,sha256=EysP_GDFTiLtJZKXuNEvz-vdBwkIu1oOXwc_OLtdT18,11725
515
+ pyegeria/test_m.html,sha256=jGK_3tEIzADVhvNym0NRSwB4dTN0PgGmiFc3VHZlM88,12915
516
516
  pyegeria/test_m.py,sha256=BDKRLsHsAWnwCbzHkkvfsc8ZIJ0k-jmwPPNuTSgW6Qo,7659
517
517
  pyegeria/test_m1.html,sha256=XS_1IAtfG4ZlZk45QTkrFWWpjQMVlO21ScDMX2Frl3g,14086
518
+ pyegeria/test_mer.ipynb,sha256=G7hpHn07IXnt_VKvnTDvljwwHB7RfC0etOMyZKt1icQ,30809
518
519
  pyegeria/utils.py,sha256=GCt1C0bp0Xng1ahzbZhzV9qQwH7Dj93IaCt2dvWb-sg,5417
519
520
  pyegeria/valid_metadata_omvs.py,sha256=UyIT4DfB1_QIG55Hmop7ozbsq8cNdrpYB7Tb6EOFiN8,65035
520
521
  pyegeria/x_action_author_omvs.py,sha256=6b725SPsC52AI7ols7Qq8MsBlZuAXr_BgJ_-ychVRCw,6386
521
- pyegeria-5.3.4.6.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
522
- pyegeria-5.3.4.6.dist-info/METADATA,sha256=W5OxgqZ-16hDB12c6aTrrfPbtOKmAluYsr_tMyu2QDk,2735
523
- pyegeria-5.3.4.6.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
524
- pyegeria-5.3.4.6.dist-info/entry_points.txt,sha256=E83aZ9RhrxffYGmHgBwhLdS5fvEeYhrIPp0FZRvaFOI,6180
525
- pyegeria-5.3.4.6.dist-info/RECORD,,
522
+ pyegeria-5.3.4.7.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
523
+ pyegeria-5.3.4.7.dist-info/METADATA,sha256=dz3Pp3h3fQQ6oyfVOaZnL4yXsNYldCWX1YOt6eh6M-w,2735
524
+ pyegeria-5.3.4.7.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
525
+ pyegeria-5.3.4.7.dist-info/entry_points.txt,sha256=E83aZ9RhrxffYGmHgBwhLdS5fvEeYhrIPp0FZRvaFOI,6180
526
+ pyegeria-5.3.4.7.dist-info/RECORD,,