-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathUser_Interface_CLI_.html
More file actions
427 lines (384 loc) · 17.2 KB
/
User_Interface_CLI_.html
File metadata and controls
427 lines (384 loc) · 17.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CodeBoarding Analysis - django</title>
<!-- Load dagre first, then cytoscape, then cytoscape-dagre -->
<script src="https://unpkg.com/dagre@0.8.5/dist/dagre.min.js"></script>
<script src="https://unpkg.com/cytoscape@3.23.0/dist/cytoscape.min.js"></script>
<script src="https://unpkg.com/cytoscape-dagre@2.4.0/cytoscape-dagre.js"></script>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
margin: 0 auto;
padding: 20px;
background-color: #f8f9fa;
}
.component {
border-left: 3px solid #6c757d;
padding-left: 15px;
margin-bottom: 20px;
background: white;
padding: 15px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.component h3 {
color: #495057;
margin-top: 0;
}
code {
background-color: #e9ecef;
padding: 2px 4px;
border-radius: 3px;
font-family: monospace;
}
#cy {
width: 100%;
height: 600px;
border: 1px solid #dee2e6;
margin: 20px 0;
border-radius: 8px;
background-color: #ffffff;
}
.badges {
margin: 20px 0;
}
.badge {
display: inline-block;
margin-right: 10px;
}
.badge img {
vertical-align: middle;
}
.references {
list-style: none;
padding-left: 0;
margin: 10px 0;
}
.references li {
margin: 4px 0;
}
.diagram-controls {
margin: 10px 0;
text-align: center;
}
.diagram-controls button {
margin: 0 5px;
padding: 8px 16px;
background: #6c757d;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
.diagram-controls button:hover {
background: #495057;
}
</style>
</head>
<body>
<h1>CodeBoarding Analysis - django</h1>
<div class="badges">
<a href="https://github.com/CodeBoarding/GeneratedOnBoardings" class="badge">
<img src="https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square" alt="Generated by CodeBoarding">
</a>
<a href="https://www.codeboarding.org/demo" class="badge">
<img src="https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square" alt="Try our Demo">
</a>
<a href="mailto:contact@codeboarding.org" class="badge">
<img src="https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square" alt="Contact us">
</a>
</div>
<div class="diagram-controls">
<button onclick="resetLayout()">Reset Layout</button>
<button onclick="fitToView()">Fit to View</button>
<button onclick="exportImage()">Export PNG</button>
</div>
<div id="cy"></div>
<h2>Details</h2>
<p>The CLI Interface is fundamental because it is the user's gateway to the entire ProteinFlow system. Without it, users would not be able to initiate or control any of the data pipeline operations. It abstracts away the underlying complexity of the data processing components, providing a simplified and unified command-line experience. Its role as an orchestrator and dispatcher is critical for coordinating the execution of various data-related tasks (downloading, generating, splitting) in a structured manner. The integration with Logging and Reporting is also vital, as it provides the necessary feedback loop for users to understand the status and outcomes of their initiated processes, making the system robust and user-friendly.</p>
<div class="component">
<h3 id="CLI_Interface">CLI Interface</h3>
<p>The CLI Interface serves as the primary command-line entry point for users to interact with the ProteinFlow data pipeline. Its fundamental role is to orchestrate the entire data processing workflow by translating user commands into specific actions. It acts as a dispatcher, invoking the appropriate backend functions from other core components such as the Data Downloader, Data Generator, and Data Splitter. Furthermore, it integrates with the Logging and Reporting component to provide operational feedback, status updates, and error summaries to the user, ensuring transparency and aiding in debugging. This component is crucial because it provides the user-facing control mechanism, making the complex data pipeline accessible and manageable.</p>
<h4>Related Classes/Methods:</h4><ul class="references"><li><code>`proteinflow.cli` (18:20)</code></li></ul>
</div>
<div class="component">
<h3 id="Data_Downloader">Data Downloader</h3>
<p>Handles the acquisition of data.</p>
<h4>Related Classes/Methods:</h4><p><em>None</em></p>
</div>
<div class="component">
<h3 id="Data_Generator">Data Generator</h3>
<p>Manages the synthesis or transformation of data.</p>
<h4>Related Classes/Methods:</h4><p><em>None</em></p>
</div>
<div class="component">
<h3 id="Data_Splitter">Data Splitter</h3>
<p>Manages dataset partitioning and re-consolidation.</p>
<h4>Related Classes/Methods:</h4><p><em>None</em></p>
</div>
<div class="component">
<h3 id="Logging_and_Reporting">Logging and Reporting</h3>
<p>Provides operational feedback, status updates, and error summaries.</p>
<h4>Related Classes/Methods:</h4><p><em>None</em></p>
</div>
<h3><a href="https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq">FAQ</a></h3>
<script>
// Wait for all scripts to load before initializing
document.addEventListener('DOMContentLoaded', function() {
// Check if all required libraries are loaded
if (typeof cytoscape === 'undefined') {
console.error('Cytoscape is not loaded');
document.getElementById('cy').innerHTML = '<div style="padding: 20px; text-align: center; color: #666;">Error loading diagram. Please refresh the page.</div>';
return;
}
if (typeof dagre === 'undefined') {
console.error('Dagre is not loaded');
document.getElementById('cy').innerHTML = '<div style="padding: 20px; text-align: center; color: #666;">Error loading diagram. Please refresh the page.</div>';
return;
}
if (typeof cytoscapeDagre === 'undefined') {
console.error('Cytoscape-dagre extension is not loaded');
document.getElementById('cy').innerHTML = '<div style="padding: 20px; text-align: center; color: #666;">Error loading diagram. Please refresh the page.</div>';
return;
}
// Register the dagre extension
try {
cytoscape.use(cytoscapeDagre);
console.log('Dagre extension registered successfully');
} catch (e) {
console.error('Failed to register dagre extension:', e);
document.getElementById('cy').innerHTML = '<div style="padding: 20px; text-align: center; color: #666;">Error loading diagram. Please refresh the page.</div>';
return;
}
const cytoscapeData = {
"elements": [
{
"data": {
"id": "CLI_Interface",
"label": "CLI Interface",
"description": "The CLI Interface serves as the primary command-line entry point for users to interact with the ProteinFlow data pipeline. Its fundamental role is to orchestrate the entire data processing workflow by translating user commands into specific actions. It acts as a dispatcher, invoking the appropriate backend functions from other core components such as the Data Downloader, Data Generator, and Data Splitter. Furthermore, it integrates with the Logging and Reporting component to provide operational feedback, status updates, and error summaries to the user, ensuring transparency and aiding in debugging. This component is crucial because it provides the user-facing control mechanism, making the complex data pipeline accessible and manageable.",
"hasLink": false
}
},
{
"data": {
"id": "Data_Downloader",
"label": "Data Downloader",
"description": "Handles the acquisition of data.",
"hasLink": false
}
},
{
"data": {
"id": "Data_Generator",
"label": "Data Generator",
"description": "Manages the synthesis or transformation of data.",
"hasLink": false
}
},
{
"data": {
"id": "Data_Splitter",
"label": "Data Splitter",
"description": "Manages dataset partitioning and re-consolidation.",
"hasLink": false
}
},
{
"data": {
"id": "Logging_and_Reporting",
"label": "Logging and Reporting",
"description": "Provides operational feedback, status updates, and error summaries.",
"hasLink": false
}
},
{
"data": {
"id": "edge_0",
"source": "CLI_Interface",
"target": "Data_Downloader",
"label": "calls"
}
},
{
"data": {
"id": "edge_1",
"source": "CLI_Interface",
"target": "Data_Generator",
"label": "calls"
}
},
{
"data": {
"id": "edge_2",
"source": "CLI_Interface",
"target": "Data_Splitter",
"label": "calls"
}
},
{
"data": {
"id": "edge_3",
"source": "CLI_Interface",
"target": "Logging_and_Reporting",
"label": "uses"
}
}
]
};
try {
const cy = cytoscape({
container: document.getElementById('cy'),
elements: cytoscapeData.elements,
style: [
{
selector: 'node',
style: {
'background-color': '#f8f9fa',
'label': 'data(label)',
'text-valign': 'center',
'text-halign': 'center',
'color': '#495057',
'text-wrap': 'wrap',
'font-size': '11px',
'font-weight': '500',
'width': 'label',
'height': 'label',
'padding': '15px',
'shape': 'roundrectangle',
'border-width': 2,
'border-color': '#dee2e6'
}
},
{
selector: 'node[hasLink = true]',
style: {
'background-color': '#e9ecef',
'border-color': '#6c757d',
'cursor': 'pointer',
'border-width': 3
}
},
{
selector: 'node:hover',
style: {
'background-color': '#dee2e6',
'border-color': '#495057',
'border-width': 3
}
},
{
selector: 'edge',
style: {
'width': 2,
'line-color': '#adb5bd',
'target-arrow-color': '#adb5bd',
'target-arrow-shape': 'triangle',
'curve-style': 'bezier',
'label': 'data(label)',
'font-size': '10px',
'color': '#6c757d',
'text-rotation': 'autorotate',
'text-margin-y': -10,
'text-background-color': '#ffffff',
'text-background-opacity': 0.8,
'text-background-padding': '2px',
'text-background-shape': 'roundrectangle'
}
}
],
layout: {
name: 'dagre',
directed: true,
padding: 30,
rankDir: 'LR',
nodeSep: 80,
edgeSep: 20,
rankSep: 150
}
});
// Apply dagre layout after cytoscape is initialized
cy.layout({
name: 'dagre',
directed: true,
padding: 30,
rankDir: 'LR',
nodeSep: 80,
edgeSep: 20,
rankSep: 150
}).run();
// Add click handler for nodes with links
cy.on('tap', 'node[hasLink = true]', function(evt) {
const node = evt.target;
const linkUrl = node.data('linkUrl');
if (linkUrl) {
window.open(linkUrl, '_blank');
}
});
// Add simple tooltip on hover
cy.on('mouseover', 'node', function(evt) {
const node = evt.target;
const description = node.data('description');
if (description) {
// Simple tooltip implementation
const tooltip = document.createElement('div');
tooltip.innerHTML = description;
tooltip.style.cssText = `
position: fixed;
background: #333;
color: white;
padding: 8px;
border-radius: 4px;
font-size: 12px;
max-width: 300px;
z-index: 1000;
pointer-events: none;
`;
document.body.appendChild(tooltip);
const updateTooltip = (e) => {
tooltip.style.left = (e.clientX + 10) + 'px';
tooltip.style.top = (e.clientY + 10) + 'px';
};
document.addEventListener('mousemove', updateTooltip);
node.on('mouseout', () => {
document.removeEventListener('mousemove', updateTooltip);
if (tooltip.parentNode) {
tooltip.parentNode.removeChild(tooltip);
}
});
}
});
// Make control functions globally available
window.resetLayout = function() {
cy.layout({
name: 'dagre',
directed: true,
padding: 30,
rankDir: 'LR',
nodeSep: 80,
edgeSep: 20,
rankSep: 150
}).run();
};
window.fitToView = function() {
cy.fit();
};
window.exportImage = function() {
const png64 = cy.png({ scale: 2, full: true });
const link = document.createElement('a');
link.download = 'diagram.png';
link.href = png64;
link.click();
};
} catch (error) {
console.error('Error initializing Cytoscape:', error);
document.getElementById('cy').innerHTML = '<div style="padding: 20px; text-align: center; color: #666;">Error loading diagram. Please refresh the page.</div>';
}
});
</script>
</body>
</html>