garywelz commited on
Commit
1c5b9cd
·
verified ·
1 Parent(s): d13d854

Upload 8 files

Browse files
computer-science-database-table.html ADDED
@@ -0,0 +1,543 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Computer Science Processes Database</title>
7
+ <style>
8
+ body {
9
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
10
+ margin: 0;
11
+ padding: 20px;
12
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
13
+ min-height: 100vh;
14
+ }
15
+
16
+ .container {
17
+ max-width: 1400px;
18
+ margin: 0 auto;
19
+ background: white;
20
+ border-radius: 15px;
21
+ box-shadow: 0 20px 40px rgba(0,0,0,0.1);
22
+ overflow: hidden;
23
+ }
24
+
25
+ .header {
26
+ background: linear-gradient(135deg, #9b59b6 0%, #9b59b6 100%);
27
+ color: white;
28
+ padding: 30px;
29
+ text-align: center;
30
+ }
31
+
32
+ .header h1 {
33
+ margin: 0;
34
+ font-size: 2.5em;
35
+ font-weight: 300;
36
+ }
37
+
38
+ .header p {
39
+ margin: 10px 0 0 0;
40
+ opacity: 0.8;
41
+ font-size: 1.1em;
42
+ }
43
+
44
+ .stats-grid {
45
+ display: grid;
46
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
47
+ gap: 20px;
48
+ padding: 30px;
49
+ background: #f8f9fa;
50
+ }
51
+
52
+ .stat-card {
53
+ background: white;
54
+ padding: 20px;
55
+ border-radius: 10px;
56
+ text-align: center;
57
+ box-shadow: 0 5px 15px rgba(0,0,0,0.08);
58
+ border-left: 4px solid #9b59b6;
59
+ }
60
+
61
+ .stat-number {
62
+ font-size: 2.5em;
63
+ font-weight: bold;
64
+ color: #2c3e50;
65
+ margin: 0;
66
+ }
67
+
68
+ .stat-label {
69
+ color: #7f8c8d;
70
+ font-size: 0.9em;
71
+ margin: 5px 0 0 0;
72
+ }
73
+
74
+ .table-container {
75
+ padding: 30px;
76
+ overflow-x: auto;
77
+ }
78
+
79
+ .table-header {
80
+ background: #9b59b6;
81
+ color: white;
82
+ padding: 20px;
83
+ margin: -30px -30px 20px -30px;
84
+ }
85
+
86
+ .table-header h2 {
87
+ margin: 0;
88
+ font-size: 1.8em;
89
+ font-weight: 300;
90
+ }
91
+
92
+ table {
93
+ width: 100%;
94
+ border-collapse: collapse;
95
+ margin-top: 20px;
96
+ font-size: 0.9em;
97
+ }
98
+
99
+ th, td {
100
+ padding: 12px 8px;
101
+ text-align: left;
102
+ border-bottom: 1px solid #ddd;
103
+ }
104
+
105
+ th {
106
+ background: #ecf0f1;
107
+ font-weight: 600;
108
+ color: #2c3e50;
109
+ position: sticky;
110
+ top: 0;
111
+ cursor: pointer;
112
+ }
113
+
114
+ th:hover {
115
+ background: #d5dbdb;
116
+ }
117
+
118
+ tr:hover {
119
+ background: #f8f9fa;
120
+ }
121
+
122
+ .process-name {
123
+ font-weight: 600;
124
+ color: #2c3e50;
125
+ max-width: 300px;
126
+ }
127
+
128
+ .process-name a {
129
+ color: #9b59b6;
130
+ text-decoration: none;
131
+ }
132
+
133
+ .process-name a:hover {
134
+ text-decoration: underline;
135
+ }
136
+
137
+ .subcategory {
138
+ background: #fde8e8;
139
+ padding: 4px 8px;
140
+ border-radius: 4px;
141
+ font-size: 0.8em;
142
+ color: #9b59b6;
143
+ }
144
+
145
+ .complexity {
146
+ padding: 4px 8px;
147
+ border-radius: 4px;
148
+ font-size: 0.8em;
149
+ font-weight: 600;
150
+ }
151
+
152
+ .complexity.low {
153
+ background: #d5f4e6;
154
+ color: #27ae60;
155
+ }
156
+
157
+ .complexity.medium {
158
+ background: #fff3cd;
159
+ color: #856404;
160
+ }
161
+
162
+ .complexity.detailed, .complexity.high {
163
+ background: #fadbd8;
164
+ color: #9b59b6;
165
+ }
166
+
167
+ .number {
168
+ text-align: center;
169
+ font-weight: 600;
170
+ }
171
+
172
+ .loading {
173
+ text-align: center;
174
+ padding: 50px;
175
+ color: #7f8c8d;
176
+ }
177
+
178
+ .error {
179
+ text-align: center;
180
+ padding: 50px;
181
+ color: #9b59b6;
182
+ }
183
+
184
+ .refresh-btn {
185
+ background: #9b59b6;
186
+ color: white;
187
+ border: none;
188
+ padding: 10px 20px;
189
+ border-radius: 5px;
190
+ cursor: pointer;
191
+ font-size: 0.9em;
192
+ margin: 10px;
193
+ }
194
+
195
+ .refresh-btn:hover {
196
+ background: #9b59b6;
197
+ }
198
+
199
+ .breakdown {
200
+ padding: 30px;
201
+ background: #f8f9fa;
202
+ border-top: 1px solid #ecf0f1;
203
+ }
204
+
205
+ .breakdown h3 {
206
+ color: #2c3e50;
207
+ margin-bottom: 15px;
208
+ }
209
+
210
+ .breakdown-grid {
211
+ display: grid;
212
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
213
+ gap: 20px;
214
+ }
215
+
216
+ .breakdown-card {
217
+ background: white;
218
+ padding: 20px;
219
+ border-radius: 8px;
220
+ box-shadow: 0 2px 10px rgba(0,0,0,0.05);
221
+ }
222
+
223
+ .breakdown-item {
224
+ display: flex;
225
+ justify-content: space-between;
226
+ padding: 8px 0;
227
+ border-bottom: 1px solid #ecf0f1;
228
+ }
229
+
230
+ .breakdown-item:last-child {
231
+ border-bottom: none;
232
+ }
233
+
234
+ .breakdown-label {
235
+ color: #7f8c8d;
236
+ }
237
+
238
+ .breakdown-count {
239
+ font-weight: 600;
240
+ color: #2c3e50;
241
+ }
242
+
243
+ .color-legend {
244
+ padding: 20px;
245
+ background: #f8f9fa;
246
+ border-top: 1px solid #ecf0f1;
247
+ }
248
+
249
+ .color-legend h3 {
250
+ color: #2c3e50;
251
+ margin-bottom: 15px;
252
+ }
253
+
254
+ .color-grid {
255
+ display: grid;
256
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
257
+ gap: 15px;
258
+ }
259
+
260
+ .color-item {
261
+ display: flex;
262
+ align-items: center;
263
+ gap: 10px;
264
+ padding: 10px;
265
+ background: white;
266
+ border-radius: 5px;
267
+ }
268
+
269
+ .color-box {
270
+ width: 30px;
271
+ height: 30px;
272
+ border-radius: 4px;
273
+ border: 1px solid #ddd;
274
+ }
275
+ </style>
276
+ </head>
277
+ <body>
278
+ <div class="container">
279
+ <div class="header">
280
+ <h1>💻 Computer Science Processes Database</h1>
281
+ <p>Programming Framework - Interactive Database Analysis</p>
282
+ <button class="refresh-btn" onclick="loadData()">🔄 Refresh Data</button>
283
+ </div>
284
+
285
+ <div id="loading" class="loading">
286
+ <h3>Loading computer_science processes database...</h3>
287
+ <p>Fetching process data from metadata.json</p>
288
+ </div>
289
+
290
+ <div id="error" class="error" style="display: none;">
291
+ <h3>❌ Error Loading Data</h3>
292
+ <p>Could not fetch computer_science processes metadata. Please check your connection and try again.</p>
293
+ </div>
294
+
295
+ <div id="content" style="display: none;">
296
+ <div class="stats-grid" id="statsGrid">
297
+ <!-- Stats will be populated here -->
298
+ </div>
299
+
300
+ <div class="table-container">
301
+ <div class="table-header">
302
+ <h2>📊 Process Database Table</h2>
303
+ <p style="margin: 10px 0 0 0; opacity: 0.8; font-size: 0.9em;">
304
+ 💡 Click on any process name to view its interactive flowchart
305
+ </p>
306
+ </div>
307
+ <table id="processTable">
308
+ <thead>
309
+ <tr>
310
+ <th onclick="sortTable(0)">Process Name ↕</th>
311
+ <th onclick="sortTable(1)">Subcategory ↕</th>
312
+ <th onclick="sortTable(2)">Complexity ↕</th>
313
+ <th onclick="sortTable(3)">Nodes ↕</th>
314
+ <th onclick="sortTable(4)">Edges ↕</th>
315
+ <th onclick="sortTable(5)">AND Gates ↕</th>
316
+ <th onclick="sortTable(6)">OR Gates ↕</th>
317
+ </tr>
318
+ </thead>
319
+ <tbody id="tableBody">
320
+ <!-- Data will be populated here -->
321
+ </tbody>
322
+ </table>
323
+ </div>
324
+
325
+ <div class="breakdown">
326
+ <h3>📈 Database Analysis</h3>
327
+ <div class="breakdown-grid" id="breakdownGrid">
328
+ <!-- Breakdown will be populated here -->
329
+ </div>
330
+ </div>
331
+
332
+ <div class="color-legend">
333
+ <h3>🎨 Color Scheme (5-Color System)</h3>
334
+ <div class="color-grid">
335
+ <div class="color-item">
336
+ <div class="color-box" style="background: #ff6b6b;"></div>
337
+ <div>
338
+ <strong>Red</strong><br>
339
+ <small>Triggers & Inputs</small>
340
+ </div>
341
+ </div>
342
+ <div class="color-item">
343
+ <div class="color-box" style="background: #ffd43b;"></div>
344
+ <div>
345
+ <strong>Yellow</strong><br>
346
+ <small>Structures & Objects</small>
347
+ </div>
348
+ </div>
349
+ <div class="color-item">
350
+ <div class="color-box" style="background: #51cf66;"></div>
351
+ <div>
352
+ <strong>Green</strong><br>
353
+ <small>Processing & Operations</small>
354
+ </div>
355
+ </div>
356
+ <div class="color-item">
357
+ <div class="color-box" style="background: #74c0fc;"></div>
358
+ <div>
359
+ <strong>Blue</strong><br>
360
+ <small>Intermediates & States</small>
361
+ </div>
362
+ </div>
363
+ <div class="color-item">
364
+ <div class="color-box" style="background: #b197fc;"></div>
365
+ <div>
366
+ <strong>Violet</strong><br>
367
+ <small>Products & Outputs</small>
368
+ </div>
369
+ </div>
370
+ </div>
371
+ </div>
372
+ </div>
373
+ </div>
374
+
375
+ <script>
376
+ // Determine metadata URL based on where this file is hosted
377
+ const METADATA_URL = window.location.hostname.includes('storage.googleapis.com')
378
+ ? 'https://storage.googleapis.com/regal-scholar-453620-r7-podcast-storage/computer-science-processes-database/metadata.json'
379
+ : (window.location.hostname.includes('huggingface.co'))
380
+ ? './computer-science-processes-database/metadata.json'
381
+ : './metadata.json';
382
+ let currentSortColumn = -1;
383
+ let sortDirection = 1;
384
+ let processes = [];
385
+
386
+ async function loadData() {
387
+ console.log('🔄 Starting data load from:', METADATA_URL);
388
+ document.getElementById('loading').style.display = 'block';
389
+ document.getElementById('error').style.display = 'none';
390
+ document.getElementById('content').style.display = 'none';
391
+
392
+ try {
393
+ const response = await fetch(METADATA_URL);
394
+ if (!response.ok) {
395
+ throw new Error(`HTTP ${response.status}: ${response.statusText}`);
396
+ }
397
+
398
+ const data = await response.json();
399
+ console.log('✅ Data loaded successfully:', data.totalProcesses, 'processes');
400
+
401
+ processes = data.processes || [];
402
+ populateData(data);
403
+
404
+ document.getElementById('loading').style.display = 'none';
405
+ document.getElementById('content').style.display = 'block';
406
+
407
+ } catch (error) {
408
+ console.error('❌ Error loading data:', error);
409
+ document.getElementById('loading').style.display = 'none';
410
+ document.getElementById('error').style.display = 'block';
411
+ document.getElementById('error').innerHTML = `
412
+ <h3>❌ Error Loading Data</h3>
413
+ <p>Could not fetch computer_science processes metadata.</p>
414
+ <p style="font-size: 0.9em; color: #95a5a6; margin-top: 10px;">
415
+ Error: ${error.message}
416
+ </p>
417
+ `;
418
+ }
419
+ }
420
+
421
+ function populateData(data) {
422
+ // Populate statistics
423
+ const stats = data.statistics || {};
424
+ document.getElementById('statsGrid').innerHTML = `
425
+ <div class="stat-card">
426
+ <div class="stat-number">${data.totalProcesses || 0}</div>
427
+ <div class="stat-label">Total Processes</div>
428
+ </div>
429
+ <div class="stat-card">
430
+ <div class="stat-number">${stats.totalNodes || 0}</div>
431
+ <div class="stat-label">Total Nodes</div>
432
+ </div>
433
+ <div class="stat-card">
434
+ <div class="stat-number">${stats.totalEdges || 0}</div>
435
+ <div class="stat-label">Total Edges</div>
436
+ </div>
437
+ <div class="stat-card">
438
+ <div class="stat-number">${data.subcategories || 0}</div>
439
+ <div class="stat-label">Subcategories</div>
440
+ </div>
441
+ `;
442
+
443
+ // Populate table
444
+ const tableBody = document.getElementById('tableBody');
445
+ tableBody.innerHTML = '';
446
+
447
+ const processList = data.processes || [];
448
+ processList.forEach(process => {
449
+ const row = document.createElement('tr');
450
+ const isGCS = window.location.hostname.includes('storage.googleapis.com');
451
+ const isHF = window.location.hostname.includes('huggingface.co');
452
+ const viewerUrl = isGCS
453
+ ? `https://storage.googleapis.com/regal-scholar-453620-r7-podcast-storage/computer-science-processes-database/processes/${process.subcategory}/${process.id}.html`
454
+ : (isHF)
455
+ ? `./computer-science-processes-database/processes/${process.subcategory}/${process.id}.html`
456
+ : `./processes/${process.subcategory}/${process.id}.html`;
457
+ row.innerHTML = `
458
+ <td class="process-name">
459
+ <a href="${viewerUrl}" target="_blank">${process.name}</a>
460
+ </td>
461
+ <td><span class="subcategory">${process.subcategory_name || process.subcategory}</span></td>
462
+ <td><span class="complexity ${process.complexity}">${process.complexity}</span></td>
463
+ <td class="number">${process.nodes}</td>
464
+ <td class="number">${process.edges}</td>
465
+ <td class="number">${process.andGates || 0}</td>
466
+ <td class="number">${process.orGates || 0}</td>
467
+ `;
468
+ tableBody.appendChild(row);
469
+ });
470
+
471
+ // Populate breakdown
472
+ const breakdown = {};
473
+ processList.forEach(p => {
474
+ const subcat = p.subcategory_name || p.subcategory;
475
+ breakdown[subcat] = (breakdown[subcat] || 0) + 1;
476
+ });
477
+
478
+ let breakdownHTML = '<div class="breakdown-card"><h4>Processes by Subcategory</h4>';
479
+ Object.entries(breakdown).sort((a, b) => b[1] - a[1]).forEach(([subcat, count]) => {
480
+ breakdownHTML += `
481
+ <div class="breakdown-item">
482
+ <span class="breakdown-label">${subcat}</span>
483
+ <span class="breakdown-count">${count}</span>
484
+ </div>
485
+ `;
486
+ });
487
+ breakdownHTML += '</div>';
488
+
489
+ const complexityBreakdown = {};
490
+ processList.forEach(p => {
491
+ const comp = p.complexity || 'unknown';
492
+ complexityBreakdown[comp] = (complexityBreakdown[comp] || 0) + 1;
493
+ });
494
+
495
+ breakdownHTML += '<div class="breakdown-card"><h4>Processes by Complexity</h4>';
496
+ Object.entries(complexityBreakdown).sort((a, b) => b[1] - a[1]).forEach(([comp, count]) => {
497
+ breakdownHTML += `
498
+ <div class="breakdown-item">
499
+ <span class="breakdown-label">${comp}</span>
500
+ <span class="breakdown-count">${count}</span>
501
+ </div>
502
+ `;
503
+ });
504
+ breakdownHTML += '</div>';
505
+
506
+ document.getElementById('breakdownGrid').innerHTML = breakdownHTML;
507
+ }
508
+
509
+ function sortTable(column) {
510
+ const table = document.getElementById('processTable');
511
+ const tbody = table.querySelector('tbody');
512
+ const rows = Array.from(tbody.querySelectorAll('tr'));
513
+
514
+ if (currentSortColumn === column) {
515
+ sortDirection *= -1;
516
+ } else {
517
+ currentSortColumn = column;
518
+ sortDirection = 1;
519
+ }
520
+
521
+ rows.sort((a, b) => {
522
+ const aText = a.cells[column].textContent.trim();
523
+ const bText = b.cells[column].textContent.trim();
524
+
525
+ // Try to parse as number
526
+ const aNum = parseFloat(aText);
527
+ const bNum = parseFloat(bText);
528
+
529
+ if (!isNaN(aNum) && !isNaN(bNum)) {
530
+ return (aNum - bNum) * sortDirection;
531
+ }
532
+
533
+ return aText.localeCompare(bText) * sortDirection;
534
+ });
535
+
536
+ rows.forEach(row => tbody.appendChild(row));
537
+ }
538
+
539
+ // Load data on page load
540
+ loadData();
541
+ </script>
542
+ </body>
543
+ </html>
mathematics-database-table.html ADDED
@@ -0,0 +1,543 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Mathematics Processes Database</title>
7
+ <style>
8
+ body {
9
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
10
+ margin: 0;
11
+ padding: 20px;
12
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
13
+ min-height: 100vh;
14
+ }
15
+
16
+ .container {
17
+ max-width: 1400px;
18
+ margin: 0 auto;
19
+ background: white;
20
+ border-radius: 15px;
21
+ box-shadow: 0 20px 40px rgba(0,0,0,0.1);
22
+ overflow: hidden;
23
+ }
24
+
25
+ .header {
26
+ background: linear-gradient(135deg, #e67e22 0%, #e67e22 100%);
27
+ color: white;
28
+ padding: 30px;
29
+ text-align: center;
30
+ }
31
+
32
+ .header h1 {
33
+ margin: 0;
34
+ font-size: 2.5em;
35
+ font-weight: 300;
36
+ }
37
+
38
+ .header p {
39
+ margin: 10px 0 0 0;
40
+ opacity: 0.8;
41
+ font-size: 1.1em;
42
+ }
43
+
44
+ .stats-grid {
45
+ display: grid;
46
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
47
+ gap: 20px;
48
+ padding: 30px;
49
+ background: #f8f9fa;
50
+ }
51
+
52
+ .stat-card {
53
+ background: white;
54
+ padding: 20px;
55
+ border-radius: 10px;
56
+ text-align: center;
57
+ box-shadow: 0 5px 15px rgba(0,0,0,0.08);
58
+ border-left: 4px solid #e67e22;
59
+ }
60
+
61
+ .stat-number {
62
+ font-size: 2.5em;
63
+ font-weight: bold;
64
+ color: #2c3e50;
65
+ margin: 0;
66
+ }
67
+
68
+ .stat-label {
69
+ color: #7f8c8d;
70
+ font-size: 0.9em;
71
+ margin: 5px 0 0 0;
72
+ }
73
+
74
+ .table-container {
75
+ padding: 30px;
76
+ overflow-x: auto;
77
+ }
78
+
79
+ .table-header {
80
+ background: #e67e22;
81
+ color: white;
82
+ padding: 20px;
83
+ margin: -30px -30px 20px -30px;
84
+ }
85
+
86
+ .table-header h2 {
87
+ margin: 0;
88
+ font-size: 1.8em;
89
+ font-weight: 300;
90
+ }
91
+
92
+ table {
93
+ width: 100%;
94
+ border-collapse: collapse;
95
+ margin-top: 20px;
96
+ font-size: 0.9em;
97
+ }
98
+
99
+ th, td {
100
+ padding: 12px 8px;
101
+ text-align: left;
102
+ border-bottom: 1px solid #ddd;
103
+ }
104
+
105
+ th {
106
+ background: #ecf0f1;
107
+ font-weight: 600;
108
+ color: #2c3e50;
109
+ position: sticky;
110
+ top: 0;
111
+ cursor: pointer;
112
+ }
113
+
114
+ th:hover {
115
+ background: #d5dbdb;
116
+ }
117
+
118
+ tr:hover {
119
+ background: #f8f9fa;
120
+ }
121
+
122
+ .process-name {
123
+ font-weight: 600;
124
+ color: #2c3e50;
125
+ max-width: 300px;
126
+ }
127
+
128
+ .process-name a {
129
+ color: #e67e22;
130
+ text-decoration: none;
131
+ }
132
+
133
+ .process-name a:hover {
134
+ text-decoration: underline;
135
+ }
136
+
137
+ .subcategory {
138
+ background: #fde8e8;
139
+ padding: 4px 8px;
140
+ border-radius: 4px;
141
+ font-size: 0.8em;
142
+ color: #e67e22;
143
+ }
144
+
145
+ .complexity {
146
+ padding: 4px 8px;
147
+ border-radius: 4px;
148
+ font-size: 0.8em;
149
+ font-weight: 600;
150
+ }
151
+
152
+ .complexity.low {
153
+ background: #d5f4e6;
154
+ color: #27ae60;
155
+ }
156
+
157
+ .complexity.medium {
158
+ background: #fff3cd;
159
+ color: #856404;
160
+ }
161
+
162
+ .complexity.detailed, .complexity.high {
163
+ background: #fadbd8;
164
+ color: #e67e22;
165
+ }
166
+
167
+ .number {
168
+ text-align: center;
169
+ font-weight: 600;
170
+ }
171
+
172
+ .loading {
173
+ text-align: center;
174
+ padding: 50px;
175
+ color: #7f8c8d;
176
+ }
177
+
178
+ .error {
179
+ text-align: center;
180
+ padding: 50px;
181
+ color: #e67e22;
182
+ }
183
+
184
+ .refresh-btn {
185
+ background: #e67e22;
186
+ color: white;
187
+ border: none;
188
+ padding: 10px 20px;
189
+ border-radius: 5px;
190
+ cursor: pointer;
191
+ font-size: 0.9em;
192
+ margin: 10px;
193
+ }
194
+
195
+ .refresh-btn:hover {
196
+ background: #e67e22;
197
+ }
198
+
199
+ .breakdown {
200
+ padding: 30px;
201
+ background: #f8f9fa;
202
+ border-top: 1px solid #ecf0f1;
203
+ }
204
+
205
+ .breakdown h3 {
206
+ color: #2c3e50;
207
+ margin-bottom: 15px;
208
+ }
209
+
210
+ .breakdown-grid {
211
+ display: grid;
212
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
213
+ gap: 20px;
214
+ }
215
+
216
+ .breakdown-card {
217
+ background: white;
218
+ padding: 20px;
219
+ border-radius: 8px;
220
+ box-shadow: 0 2px 10px rgba(0,0,0,0.05);
221
+ }
222
+
223
+ .breakdown-item {
224
+ display: flex;
225
+ justify-content: space-between;
226
+ padding: 8px 0;
227
+ border-bottom: 1px solid #ecf0f1;
228
+ }
229
+
230
+ .breakdown-item:last-child {
231
+ border-bottom: none;
232
+ }
233
+
234
+ .breakdown-label {
235
+ color: #7f8c8d;
236
+ }
237
+
238
+ .breakdown-count {
239
+ font-weight: 600;
240
+ color: #2c3e50;
241
+ }
242
+
243
+ .color-legend {
244
+ padding: 20px;
245
+ background: #f8f9fa;
246
+ border-top: 1px solid #ecf0f1;
247
+ }
248
+
249
+ .color-legend h3 {
250
+ color: #2c3e50;
251
+ margin-bottom: 15px;
252
+ }
253
+
254
+ .color-grid {
255
+ display: grid;
256
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
257
+ gap: 15px;
258
+ }
259
+
260
+ .color-item {
261
+ display: flex;
262
+ align-items: center;
263
+ gap: 10px;
264
+ padding: 10px;
265
+ background: white;
266
+ border-radius: 5px;
267
+ }
268
+
269
+ .color-box {
270
+ width: 30px;
271
+ height: 30px;
272
+ border-radius: 4px;
273
+ border: 1px solid #ddd;
274
+ }
275
+ </style>
276
+ </head>
277
+ <body>
278
+ <div class="container">
279
+ <div class="header">
280
+ <h1>🔢 Mathematics Processes Database</h1>
281
+ <p>Programming Framework - Interactive Database Analysis</p>
282
+ <button class="refresh-btn" onclick="loadData()">🔄 Refresh Data</button>
283
+ </div>
284
+
285
+ <div id="loading" class="loading">
286
+ <h3>Loading mathematics processes database...</h3>
287
+ <p>Fetching process data from metadata.json</p>
288
+ </div>
289
+
290
+ <div id="error" class="error" style="display: none;">
291
+ <h3>❌ Error Loading Data</h3>
292
+ <p>Could not fetch mathematics processes metadata. Please check your connection and try again.</p>
293
+ </div>
294
+
295
+ <div id="content" style="display: none;">
296
+ <div class="stats-grid" id="statsGrid">
297
+ <!-- Stats will be populated here -->
298
+ </div>
299
+
300
+ <div class="table-container">
301
+ <div class="table-header">
302
+ <h2>📊 Process Database Table</h2>
303
+ <p style="margin: 10px 0 0 0; opacity: 0.8; font-size: 0.9em;">
304
+ 💡 Click on any process name to view its interactive flowchart
305
+ </p>
306
+ </div>
307
+ <table id="processTable">
308
+ <thead>
309
+ <tr>
310
+ <th onclick="sortTable(0)">Process Name ↕</th>
311
+ <th onclick="sortTable(1)">Subcategory ↕</th>
312
+ <th onclick="sortTable(2)">Complexity ↕</th>
313
+ <th onclick="sortTable(3)">Nodes ↕</th>
314
+ <th onclick="sortTable(4)">Edges ↕</th>
315
+ <th onclick="sortTable(5)">AND Gates ↕</th>
316
+ <th onclick="sortTable(6)">OR Gates ↕</th>
317
+ </tr>
318
+ </thead>
319
+ <tbody id="tableBody">
320
+ <!-- Data will be populated here -->
321
+ </tbody>
322
+ </table>
323
+ </div>
324
+
325
+ <div class="breakdown">
326
+ <h3>📈 Database Analysis</h3>
327
+ <div class="breakdown-grid" id="breakdownGrid">
328
+ <!-- Breakdown will be populated here -->
329
+ </div>
330
+ </div>
331
+
332
+ <div class="color-legend">
333
+ <h3>🎨 Color Scheme (5-Color System)</h3>
334
+ <div class="color-grid">
335
+ <div class="color-item">
336
+ <div class="color-box" style="background: #ff6b6b;"></div>
337
+ <div>
338
+ <strong>Red</strong><br>
339
+ <small>Triggers & Inputs</small>
340
+ </div>
341
+ </div>
342
+ <div class="color-item">
343
+ <div class="color-box" style="background: #ffd43b;"></div>
344
+ <div>
345
+ <strong>Yellow</strong><br>
346
+ <small>Structures & Objects</small>
347
+ </div>
348
+ </div>
349
+ <div class="color-item">
350
+ <div class="color-box" style="background: #51cf66;"></div>
351
+ <div>
352
+ <strong>Green</strong><br>
353
+ <small>Processing & Operations</small>
354
+ </div>
355
+ </div>
356
+ <div class="color-item">
357
+ <div class="color-box" style="background: #74c0fc;"></div>
358
+ <div>
359
+ <strong>Blue</strong><br>
360
+ <small>Intermediates & States</small>
361
+ </div>
362
+ </div>
363
+ <div class="color-item">
364
+ <div class="color-box" style="background: #b197fc;"></div>
365
+ <div>
366
+ <strong>Violet</strong><br>
367
+ <small>Products & Outputs</small>
368
+ </div>
369
+ </div>
370
+ </div>
371
+ </div>
372
+ </div>
373
+ </div>
374
+
375
+ <script>
376
+ // Determine metadata URL based on where this file is hosted
377
+ const METADATA_URL = window.location.hostname.includes('storage.googleapis.com')
378
+ ? 'https://storage.googleapis.com/regal-scholar-453620-r7-podcast-storage/mathematics-processes-database/metadata.json'
379
+ : (window.location.hostname.includes('huggingface.co'))
380
+ ? './mathematics-processes-database/metadata.json'
381
+ : './metadata.json';
382
+ let currentSortColumn = -1;
383
+ let sortDirection = 1;
384
+ let processes = [];
385
+
386
+ async function loadData() {
387
+ console.log('🔄 Starting data load from:', METADATA_URL);
388
+ document.getElementById('loading').style.display = 'block';
389
+ document.getElementById('error').style.display = 'none';
390
+ document.getElementById('content').style.display = 'none';
391
+
392
+ try {
393
+ const response = await fetch(METADATA_URL);
394
+ if (!response.ok) {
395
+ throw new Error(`HTTP ${response.status}: ${response.statusText}`);
396
+ }
397
+
398
+ const data = await response.json();
399
+ console.log('✅ Data loaded successfully:', data.totalProcesses, 'processes');
400
+
401
+ processes = data.processes || [];
402
+ populateData(data);
403
+
404
+ document.getElementById('loading').style.display = 'none';
405
+ document.getElementById('content').style.display = 'block';
406
+
407
+ } catch (error) {
408
+ console.error('❌ Error loading data:', error);
409
+ document.getElementById('loading').style.display = 'none';
410
+ document.getElementById('error').style.display = 'block';
411
+ document.getElementById('error').innerHTML = `
412
+ <h3>❌ Error Loading Data</h3>
413
+ <p>Could not fetch mathematics processes metadata.</p>
414
+ <p style="font-size: 0.9em; color: #95a5a6; margin-top: 10px;">
415
+ Error: ${error.message}
416
+ </p>
417
+ `;
418
+ }
419
+ }
420
+
421
+ function populateData(data) {
422
+ // Populate statistics
423
+ const stats = data.statistics || {};
424
+ document.getElementById('statsGrid').innerHTML = `
425
+ <div class="stat-card">
426
+ <div class="stat-number">${data.totalProcesses || 0}</div>
427
+ <div class="stat-label">Total Processes</div>
428
+ </div>
429
+ <div class="stat-card">
430
+ <div class="stat-number">${stats.totalNodes || 0}</div>
431
+ <div class="stat-label">Total Nodes</div>
432
+ </div>
433
+ <div class="stat-card">
434
+ <div class="stat-number">${stats.totalEdges || 0}</div>
435
+ <div class="stat-label">Total Edges</div>
436
+ </div>
437
+ <div class="stat-card">
438
+ <div class="stat-number">${data.subcategories || 0}</div>
439
+ <div class="stat-label">Subcategories</div>
440
+ </div>
441
+ `;
442
+
443
+ // Populate table
444
+ const tableBody = document.getElementById('tableBody');
445
+ tableBody.innerHTML = '';
446
+
447
+ const processList = data.processes || [];
448
+ processList.forEach(process => {
449
+ const row = document.createElement('tr');
450
+ const isGCS = window.location.hostname.includes('storage.googleapis.com');
451
+ const isHF = window.location.hostname.includes('huggingface.co');
452
+ const viewerUrl = isGCS
453
+ ? `https://storage.googleapis.com/regal-scholar-453620-r7-podcast-storage/mathematics-processes-database/processes/${process.subcategory}/${process.id}.html`
454
+ : (isHF)
455
+ ? `./mathematics-processes-database/processes/${process.subcategory}/${process.id}.html`
456
+ : `./processes/${process.subcategory}/${process.id}.html`;
457
+ row.innerHTML = `
458
+ <td class="process-name">
459
+ <a href="${viewerUrl}" target="_blank">${process.name}</a>
460
+ </td>
461
+ <td><span class="subcategory">${process.subcategory_name || process.subcategory}</span></td>
462
+ <td><span class="complexity ${process.complexity}">${process.complexity}</span></td>
463
+ <td class="number">${process.nodes}</td>
464
+ <td class="number">${process.edges}</td>
465
+ <td class="number">${process.andGates || 0}</td>
466
+ <td class="number">${process.orGates || 0}</td>
467
+ `;
468
+ tableBody.appendChild(row);
469
+ });
470
+
471
+ // Populate breakdown
472
+ const breakdown = {};
473
+ processList.forEach(p => {
474
+ const subcat = p.subcategory_name || p.subcategory;
475
+ breakdown[subcat] = (breakdown[subcat] || 0) + 1;
476
+ });
477
+
478
+ let breakdownHTML = '<div class="breakdown-card"><h4>Processes by Subcategory</h4>';
479
+ Object.entries(breakdown).sort((a, b) => b[1] - a[1]).forEach(([subcat, count]) => {
480
+ breakdownHTML += `
481
+ <div class="breakdown-item">
482
+ <span class="breakdown-label">${subcat}</span>
483
+ <span class="breakdown-count">${count}</span>
484
+ </div>
485
+ `;
486
+ });
487
+ breakdownHTML += '</div>';
488
+
489
+ const complexityBreakdown = {};
490
+ processList.forEach(p => {
491
+ const comp = p.complexity || 'unknown';
492
+ complexityBreakdown[comp] = (complexityBreakdown[comp] || 0) + 1;
493
+ });
494
+
495
+ breakdownHTML += '<div class="breakdown-card"><h4>Processes by Complexity</h4>';
496
+ Object.entries(complexityBreakdown).sort((a, b) => b[1] - a[1]).forEach(([comp, count]) => {
497
+ breakdownHTML += `
498
+ <div class="breakdown-item">
499
+ <span class="breakdown-label">${comp}</span>
500
+ <span class="breakdown-count">${count}</span>
501
+ </div>
502
+ `;
503
+ });
504
+ breakdownHTML += '</div>';
505
+
506
+ document.getElementById('breakdownGrid').innerHTML = breakdownHTML;
507
+ }
508
+
509
+ function sortTable(column) {
510
+ const table = document.getElementById('processTable');
511
+ const tbody = table.querySelector('tbody');
512
+ const rows = Array.from(tbody.querySelectorAll('tr'));
513
+
514
+ if (currentSortColumn === column) {
515
+ sortDirection *= -1;
516
+ } else {
517
+ currentSortColumn = column;
518
+ sortDirection = 1;
519
+ }
520
+
521
+ rows.sort((a, b) => {
522
+ const aText = a.cells[column].textContent.trim();
523
+ const bText = b.cells[column].textContent.trim();
524
+
525
+ // Try to parse as number
526
+ const aNum = parseFloat(aText);
527
+ const bNum = parseFloat(bText);
528
+
529
+ if (!isNaN(aNum) && !isNaN(bNum)) {
530
+ return (aNum - bNum) * sortDirection;
531
+ }
532
+
533
+ return aText.localeCompare(bText) * sortDirection;
534
+ });
535
+
536
+ rows.forEach(row => tbody.appendChild(row));
537
+ }
538
+
539
+ // Load data on page load
540
+ loadData();
541
+ </script>
542
+ </body>
543
+ </html>