noteconnection 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +198 -0
  3. package/dist/backend/CommunityDetection.js +58 -0
  4. package/dist/backend/FileLoader.js +110 -0
  5. package/dist/backend/GraphBuilder.js +347 -0
  6. package/dist/backend/GraphMetrics.js +70 -0
  7. package/dist/backend/algorithms/CycleDetection.js +63 -0
  8. package/dist/backend/algorithms/HybridEngine.js +70 -0
  9. package/dist/backend/algorithms/StatisticalAnalyzer.js +123 -0
  10. package/dist/backend/algorithms/TopologicalSort.js +69 -0
  11. package/dist/backend/algorithms/VectorSpace.js +87 -0
  12. package/dist/backend/build_dag.js +164 -0
  13. package/dist/backend/config.js +17 -0
  14. package/dist/backend/graph.js +108 -0
  15. package/dist/backend/main.js +67 -0
  16. package/dist/backend/parser.js +94 -0
  17. package/dist/backend/test_robustness/test_hybrid.js +60 -0
  18. package/dist/backend/test_robustness/test_statistics.js +58 -0
  19. package/dist/backend/test_robustness/test_vector.js +54 -0
  20. package/dist/backend/test_robustness.js +113 -0
  21. package/dist/backend/types.js +3 -0
  22. package/dist/backend/utils/frontmatterParser.js +121 -0
  23. package/dist/backend/utils/stringUtils.js +66 -0
  24. package/dist/backend/workers/keywordMatchWorker.js +22 -0
  25. package/dist/core/Graph.js +121 -0
  26. package/dist/core/Graph.test.js +37 -0
  27. package/dist/core/types.js +2 -0
  28. package/dist/frontend/analysis.js +356 -0
  29. package/dist/frontend/app.js +1447 -0
  30. package/dist/frontend/data.js +8356 -0
  31. package/dist/frontend/graph_data.json +8356 -0
  32. package/dist/frontend/index.html +279 -0
  33. package/dist/frontend/reader.js +177 -0
  34. package/dist/frontend/settings.js +84 -0
  35. package/dist/frontend/source_manager.js +61 -0
  36. package/dist/frontend/styles.css +577 -0
  37. package/dist/frontend/styles_analysis.css +145 -0
  38. package/dist/index.js +121 -0
  39. package/dist/server.js +149 -0
  40. package/package.json +39 -0
@@ -0,0 +1,577 @@
1
+ /* NoteConnection Main Styles */
2
+
3
+ body {
4
+ margin: 0;
5
+ overflow: hidden;
6
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
7
+ background-color: #1e1e1e; /* Dark theme */
8
+ color: #e0e0e0;
9
+ display: flex;
10
+ flex-direction: column;
11
+ height: 100vh;
12
+ }
13
+
14
+ #graph-wrapper {
15
+ flex: 1; /* Takes remaining space */
16
+ position: relative;
17
+ overflow: hidden;
18
+ min-height: 200px;
19
+ }
20
+
21
+ #graph-container {
22
+ width: 100%;
23
+ height: 100%;
24
+ position: absolute;
25
+ top: 0;
26
+ left: 0;
27
+ }
28
+
29
+ #controls {
30
+ position: absolute;
31
+ top: 20px;
32
+ left: 20px;
33
+ background: rgba(45, 45, 45, 0.95);
34
+ padding: 15px;
35
+ border-radius: 8px;
36
+ box-shadow: 0 4px 6px rgba(0,0,0,0.3);
37
+ z-index: 10;
38
+ border: 1px solid #444;
39
+ width: 240px;
40
+ }
41
+
42
+ /* Focus Mode Button */
43
+ #focus-exit-btn {
44
+ position: absolute;
45
+ top: 20px;
46
+ left: 50%; /* Center */
47
+ transform: translateX(-50%);
48
+ background: rgba(45, 45, 45, 0.95);
49
+ padding: 10px 20px;
50
+ border-radius: 8px;
51
+ box-shadow: 0 4px 6px rgba(0,0,0,0.3);
52
+ z-index: 100; /* Higher than controls */
53
+ border: 1px solid #61dafb;
54
+ display: flex;
55
+ align-items: center;
56
+ gap: 10px;
57
+ }
58
+
59
+ #focus-exit-btn button {
60
+ background: #2c5282;
61
+ color: white;
62
+ border: none;
63
+ padding: 5px 15px;
64
+ border-radius: 4px;
65
+ cursor: pointer;
66
+ font-size: 0.9rem;
67
+ }
68
+
69
+ #focus-exit-btn button:hover {
70
+ background: #3b6b9e;
71
+ }
72
+
73
+ h3 {
74
+ margin: 0 0 10px 0;
75
+ font-size: 1.2rem;
76
+ color: #61dafb;
77
+ }
78
+
79
+ .stats {
80
+ font-size: 0.85rem;
81
+ margin-bottom: 10px;
82
+ color: #aaa;
83
+ }
84
+
85
+ .filter-controls label {
86
+ display: block;
87
+ margin: 5px 0;
88
+ cursor: pointer;
89
+ font-size: 0.9rem;
90
+ }
91
+
92
+ .search-box input {
93
+ width: 100%;
94
+ padding: 5px;
95
+ margin-top: 5px;
96
+ border-radius: 4px;
97
+ border: 1px solid #555;
98
+ background: #333;
99
+ color: white;
100
+ box-sizing: border-box;
101
+ }
102
+
103
+ /* D3 Elements */
104
+ .node circle {
105
+ stroke: #fff;
106
+ stroke-width: 1.5px;
107
+ transition: all 0.3s ease;
108
+ }
109
+
110
+ .node text {
111
+ font-size: 10px;
112
+ fill: #ccc;
113
+ pointer-events: none;
114
+ text-shadow: 1px 1px 2px #000;
115
+ }
116
+
117
+ .link {
118
+ stroke: #555;
119
+ stroke-opacity: 0.6;
120
+ fill: none;
121
+ }
122
+
123
+ .link.highlight-in {
124
+ stroke: #ff6b6b;
125
+ stroke-opacity: 1;
126
+ stroke-width: 2px;
127
+ }
128
+
129
+ .link.highlight-out {
130
+ stroke: #4ecdc4;
131
+ stroke-opacity: 1;
132
+ stroke-width: 2px;
133
+ }
134
+
135
+ .node.highlight-main {
136
+ fill: #ffd700 !important;
137
+ stroke-width: 3px;
138
+ r: 8 !important;
139
+ }
140
+
141
+ /* Tooltip */
142
+ div.tooltip {
143
+ position: absolute;
144
+ text-align: left;
145
+ padding: 8px;
146
+ font-size: 12px;
147
+ background: rgba(0, 0, 0, 0.8);
148
+ border: 1px solid #777;
149
+ border-radius: 4px;
150
+ pointer-events: none;
151
+ color: white;
152
+ box-shadow: 0 2px 4px rgba(0,0,0,0.5);
153
+ z-index: 100;
154
+ }
155
+
156
+ /* --- Analysis Panel & Split Layout Styles --- */
157
+
158
+ /* Resizer Handle */
159
+ #analysis-resizer {
160
+ height: 6px;
161
+ background: #444;
162
+ cursor: row-resize;
163
+ display: none; /* Hidden by default */
164
+ z-index: 50;
165
+ border-top: 1px solid #555;
166
+ border-bottom: 1px solid #333;
167
+ transition: background 0.2s;
168
+ flex-shrink: 0;
169
+ }
170
+
171
+ #analysis-resizer:hover, #analysis-resizer.resizing {
172
+ background: #61dafb;
173
+ }
174
+
175
+ /* Bottom Analysis Panel */
176
+ #analysis-panel {
177
+ display: none; /* Hidden by default */
178
+ height: 300px; /* Default height */
179
+ min-height: 150px;
180
+ background-color: #2d2d2d;
181
+ border-top: 1px solid #555;
182
+ color: #e0e0e0;
183
+ flex-direction: column;
184
+ overflow: hidden;
185
+ flex-shrink: 0; /* Critical: Prevent being crushed */
186
+ box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
187
+ z-index: 60;
188
+ }
189
+
190
+ #analysis-panel.open {
191
+ display: flex !important; /* Force flex when open */
192
+ }
193
+
194
+ /* Quick Distribution Sparkline */
195
+ #quick-distribution {
196
+ margin-left: 10px;
197
+ padding-left: 10px;
198
+ border-left: 1px solid #555;
199
+ height: 24px;
200
+ display: inline-flex;
201
+ align-items: flex-end;
202
+ gap: 1px;
203
+ vertical-align: middle;
204
+ width: 100px;
205
+ }
206
+
207
+ /* Panel Internal Structure */
208
+ .panel-header {
209
+ padding: 8px 15px;
210
+ background: #333;
211
+ border-bottom: 1px solid #444;
212
+ display: flex;
213
+ justify-content: space-between;
214
+ align-items: center;
215
+ flex-shrink: 0;
216
+ }
217
+
218
+ .panel-header h2 {
219
+ margin: 0;
220
+ font-size: 1rem;
221
+ color: #61dafb;
222
+ }
223
+
224
+ .panel-body {
225
+ padding: 15px;
226
+ overflow-y: auto;
227
+ flex: 1;
228
+ display: flex;
229
+ flex-direction: column;
230
+ }
231
+
232
+ /* Close Button in Panel */
233
+ .close-panel {
234
+ color: #aaa;
235
+ font-size: 20px;
236
+ font-weight: bold;
237
+ cursor: pointer;
238
+ }
239
+
240
+ .close-panel:hover {
241
+ color: white;
242
+ }
243
+
244
+ /* Controls inside Panel */
245
+ #histogram-container {
246
+ width: 100%;
247
+ height: 180px;
248
+ background: #1e1e1e;
249
+ margin-bottom: 15px;
250
+ border: 1px solid #444;
251
+ flex-shrink: 0;
252
+ }
253
+
254
+ .export-controls {
255
+ display: grid;
256
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
257
+ gap: 15px;
258
+ background: #333;
259
+ padding: 15px;
260
+ border-radius: 4px;
261
+ }
262
+
263
+ .control-group {
264
+ display: flex;
265
+ flex-direction: column;
266
+ }
267
+
268
+ .stats-preview {
269
+ align-self: center;
270
+ font-weight: bold;
271
+ color: #61dafb;
272
+ }
273
+
274
+ .action-buttons {
275
+ display: flex;
276
+ gap: 10px;
277
+ align-items: flex-end;
278
+ }
279
+
280
+ /* Node Table Styles */
281
+ .sortable { cursor: pointer; user-select: none; }
282
+ .sortable:hover { color: white; }
283
+ .node-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 5px; padding: 4px 5px; border-bottom: 1px solid #333; font-size: 0.85rem; }
284
+ /* Settings Modal */
285
+ .modal-overlay {
286
+ position: fixed;
287
+ top: 0;
288
+ left: 0;
289
+ width: 100%;
290
+ height: 100%;
291
+ background: rgba(0, 0, 0, 0.7);
292
+ z-index: 2000;
293
+ display: flex;
294
+ justify-content: center;
295
+ align-items: center;
296
+ backdrop-filter: blur(2px);
297
+ }
298
+
299
+ .modal-content {
300
+ background: #2d2d2d;
301
+ width: 400px;
302
+ max-width: 90%;
303
+ border-radius: 8px;
304
+ border: 1px solid #555;
305
+ box-shadow: 0 10px 25px rgba(0,0,0,0.5);
306
+ display: flex;
307
+ flex-direction: column;
308
+ overflow: hidden;
309
+ }
310
+
311
+ .modal-header {
312
+ padding: 15px;
313
+ background: #333;
314
+ border-bottom: 1px solid #444;
315
+ display: flex;
316
+ justify-content: space-between;
317
+ align-items: center;
318
+ }
319
+
320
+ .modal-header h2 {
321
+ margin: 0;
322
+ font-size: 1.1rem;
323
+ color: #61dafb;
324
+ }
325
+
326
+ .modal-close {
327
+ cursor: pointer;
328
+ font-size: 1.2rem;
329
+ color: #aaa;
330
+ background: none;
331
+ border: none;
332
+ }
333
+
334
+ .modal-close:hover {
335
+ color: white;
336
+ }
337
+
338
+ .modal-body {
339
+ padding: 20px;
340
+ color: #e0e0e0;
341
+ }
342
+
343
+ .settings-group {
344
+ margin-bottom: 20px;
345
+ }
346
+
347
+ .settings-group h3 {
348
+ font-size: 0.9rem;
349
+ text-transform: uppercase;
350
+ color: #888;
351
+ margin-bottom: 10px;
352
+ border-bottom: 1px solid #444;
353
+ padding-bottom: 5px;
354
+ }
355
+
356
+ .setting-item {
357
+ display: flex;
358
+ align-items: center;
359
+ justify-content: space-between;
360
+ margin-bottom: 10px;
361
+ font-size: 0.9rem;
362
+ }
363
+
364
+ .setting-item label {
365
+ flex: 1;
366
+ }
367
+
368
+ .setting-item input[type="range"] {
369
+ flex: 2;
370
+ margin: 0 10px;
371
+ }
372
+
373
+ .setting-item .value-display {
374
+ width: 40px;
375
+ text-align: right;
376
+ font-family: monospace;
377
+ color: #61dafb;
378
+ }
379
+
380
+ .modal-footer {
381
+ padding: 15px;
382
+ background: #333;
383
+ border-top: 1px solid #444;
384
+ display: flex;
385
+ justify-content: flex-end;
386
+ gap: 10px;
387
+ }
388
+
389
+ .btn {
390
+ padding: 6px 12px;
391
+ border-radius: 4px;
392
+ cursor: pointer;
393
+ border: none;
394
+ font-size: 0.9rem;
395
+ }
396
+
397
+ .btn-secondary {
398
+ background: #555;
399
+ color: white;
400
+ }
401
+
402
+ .btn-primary {
403
+ background: #2c5282;
404
+ color: white;
405
+ }
406
+
407
+ /* Reading Window */
408
+ .reading-overlay {
409
+ position: fixed;
410
+ top: 0;
411
+ left: 0;
412
+ width: 100%;
413
+ height: 100%;
414
+ background: rgba(0, 0, 0, 0.6);
415
+ z-index: 1500;
416
+ display: flex;
417
+ justify-content: center;
418
+ align-items: center;
419
+ backdrop-filter: blur(3px);
420
+ }
421
+
422
+ .reading-box {
423
+ background: #1e1e1e;
424
+ color: #e0e0e0;
425
+ border: 1px solid #555;
426
+ box-shadow: 0 10px 30px rgba(0,0,0,0.8);
427
+ display: flex;
428
+ flex-direction: column;
429
+ overflow: hidden;
430
+ transition: all 0.3s ease;
431
+ }
432
+
433
+ .reading-box.window-mode {
434
+ width: 70%;
435
+ height: 80%;
436
+ border-radius: 8px;
437
+ }
438
+
439
+ .reading-box.fullscreen-mode {
440
+ width: 100%;
441
+ height: 100%;
442
+ border-radius: 0;
443
+ border: none;
444
+ }
445
+
446
+ .reading-header {
447
+ padding: 10px 20px;
448
+ background: #2d2d2d;
449
+ border-bottom: 1px solid #444;
450
+ display: flex;
451
+ justify-content: space-between;
452
+ align-items: center;
453
+ }
454
+
455
+ #reading-title {
456
+ font-size: 1.2rem;
457
+ font-weight: bold;
458
+ color: #61dafb;
459
+ }
460
+
461
+ .reading-controls {
462
+ display: flex;
463
+ gap: 10px;
464
+ }
465
+
466
+ .reader-btn {
467
+ background: #444;
468
+ border: 1px solid #555;
469
+ color: #e0e0e0;
470
+ border-radius: 4px;
471
+ cursor: pointer;
472
+ padding: 4px 8px;
473
+ font-size: 0.9rem;
474
+ }
475
+
476
+ .reader-btn:hover {
477
+ background: #555;
478
+ }
479
+
480
+ .reader-btn.close {
481
+ background: #742a2a;
482
+ border-color: #742a2a;
483
+ }
484
+
485
+ .reader-btn.close:hover {
486
+ background: #9b2c2c;
487
+ }
488
+
489
+ .reading-body {
490
+ padding: 30px;
491
+ overflow-y: auto;
492
+ font-family: 'Segoe UI', sans-serif;
493
+ line-height: 1.6;
494
+ flex: 1;
495
+ }
496
+
497
+ /* Content Styling */
498
+ .reading-body h1, .reading-body h2, .reading-body h3 {
499
+ color: #61dafb;
500
+ border-bottom: 1px solid #333;
501
+ padding-bottom: 5px;
502
+ }
503
+
504
+ .reading-body code {
505
+ background: #333;
506
+ padding: 2px 4px;
507
+ border-radius: 3px;
508
+ font-family: monospace;
509
+ }
510
+
511
+ .reading-body pre {
512
+ background: #252525;
513
+ padding: 10px;
514
+ border-radius: 5px;
515
+ overflow-x: auto;
516
+ border: 1px solid #444;
517
+ }
518
+
519
+ .reading-body blockquote {
520
+ border-left: 4px solid #61dafb;
521
+ margin: 0;
522
+ padding-left: 10px;
523
+ color: #aaa;
524
+ }
525
+
526
+ /* Image Resizing & Locking */
527
+ .reading-body img {
528
+ max-width: 100%;
529
+ height: auto;
530
+ border: 1px solid #444;
531
+ margin: 10px 0;
532
+ display: block;
533
+ }
534
+
535
+ /* Unlocked State: Allow Image Resizing via CSS */
536
+ .reading-body.unlocked img {
537
+ resize: both;
538
+ overflow: hidden; /* Required for resize to work */
539
+ cursor: nwse-resize;
540
+ max-width: none; /* Allow resizing beyond container if needed, or keep max-width */
541
+ }
542
+
543
+ /* Zoom support on body */
544
+ .reading-body.unlocked {
545
+ /* User can zoom via buttons logic */
546
+ }
547
+
548
+ .reading-body.locked {
549
+ /* Locked state */
550
+ }
551
+
552
+ /* Mermaid background */
553
+ .mermaid {
554
+ background: transparent;
555
+ border: 1px solid #444;
556
+ padding: 10px;
557
+ border-radius: 4px;
558
+ margin: 10px 0;
559
+ transition: border 0.3s;
560
+ }
561
+
562
+ /* Unlocked State: Allow Mermaid Resizing */
563
+ .reading-body.unlocked .mermaid {
564
+ resize: both;
565
+ overflow: hidden; /* Required for resize to work */
566
+ border: 1px dashed #61dafb; /* Visual cue */
567
+ min-width: 200px;
568
+ min-height: 100px;
569
+ max-width: 100%; /* Can be overridden by user resize */
570
+ }
571
+
572
+ /* Ensure SVG fills the resized container */
573
+ .mermaid svg {
574
+ width: 100% !important;
575
+ height: 100% !important;
576
+ max-width: none !important;
577
+ }
@@ -0,0 +1,145 @@
1
+ /* Split Pane Layout Styles */
2
+
3
+ /* Main Layout Setup */
4
+ body {
5
+ display: flex;
6
+ flex-direction: column;
7
+ height: 100vh;
8
+ margin: 0;
9
+ overflow: hidden;
10
+ }
11
+
12
+ #graph-wrapper {
13
+ flex: 1; /* Takes remaining space */
14
+ position: relative;
15
+ overflow: hidden;
16
+ min-height: 200px;
17
+ }
18
+
19
+ #graph-container {
20
+ width: 100%;
21
+ height: 100%;
22
+ position: absolute;
23
+ top: 0;
24
+ left: 0;
25
+ }
26
+
27
+ /* Resizer Handle */
28
+ #analysis-resizer {
29
+ height: 6px;
30
+ background: #444;
31
+ cursor: row-resize;
32
+ display: none; /* Hidden by default */
33
+ z-index: 50;
34
+ border-top: 1px solid #555;
35
+ border-bottom: 1px solid #333;
36
+ transition: background 0.2s;
37
+ }
38
+
39
+ #analysis-resizer:hover, #analysis-resizer.resizing {
40
+ background: #61dafb;
41
+ }
42
+
43
+ /* Bottom Analysis Panel */
44
+ #analysis-panel {
45
+ display: none; /* Hidden by default */
46
+ height: 300px; /* Default height */
47
+ min-height: 150px;
48
+ background-color: #2d2d2d;
49
+ border-top: 1px solid #555;
50
+ color: #e0e0e0;
51
+ display: none; /* Toggled via JS */
52
+ flex-direction: column;
53
+ overflow: hidden;
54
+ flex-shrink: 0; /* Critical: Prevent being crushed by graph-wrapper */
55
+ box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
56
+ z-index: 60;
57
+ }
58
+
59
+ #analysis-panel.open {
60
+ display: flex; /* Class-based toggle is safer */
61
+ }
62
+
63
+ /* Quick Distribution Sparkline */
64
+ #quick-distribution {
65
+ margin-left: 10px;
66
+ padding-left: 10px;
67
+ border-left: 1px solid #555;
68
+ height: 24px;
69
+ display: inline-flex;
70
+ align-items: flex-end;
71
+ gap: 1px;
72
+ vertical-align: middle;
73
+ width: 100px;
74
+ }
75
+
76
+ /* Panel Internal Structure */
77
+ .panel-header {
78
+ padding: 8px 15px;
79
+ background: #333;
80
+ border-bottom: 1px solid #444;
81
+ display: flex;
82
+ justify-content: space-between;
83
+ align-items: center;
84
+ flex-shrink: 0;
85
+ }
86
+
87
+ .panel-header h2 {
88
+ margin: 0;
89
+ font-size: 1rem;
90
+ color: #61dafb;
91
+ }
92
+
93
+ .panel-body {
94
+ padding: 15px;
95
+ overflow-y: auto;
96
+ flex: 1;
97
+ }
98
+
99
+ /* Close Button in Panel */
100
+ .close-panel {
101
+ color: #aaa;
102
+ font-size: 20px;
103
+ font-weight: bold;
104
+ cursor: pointer;
105
+ }
106
+
107
+ .close-panel:hover {
108
+ color: white;
109
+ }
110
+
111
+ /* Controls inside Panel */
112
+ #histogram-container {
113
+ width: 100%;
114
+ height: 180px; /* Adapted for panel */
115
+ background: #1e1e1e;
116
+ margin-bottom: 15px;
117
+ border: 1px solid #444;
118
+ }
119
+
120
+ /* Export Controls Grid for Horizontal Layout */
121
+ .export-controls {
122
+ display: grid;
123
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
124
+ gap: 15px;
125
+ background: #333;
126
+ padding: 15px;
127
+ border-radius: 4px;
128
+ }
129
+
130
+ .control-group {
131
+ display: flex;
132
+ flex-direction: column;
133
+ }
134
+
135
+ .stats-preview {
136
+ align-self: center;
137
+ font-weight: bold;
138
+ color: #61dafb;
139
+ }
140
+
141
+ .action-buttons {
142
+ display: flex;
143
+ gap: 10px;
144
+ align-items: flex-end;
145
+ }