diagcalc 3.2.0 → 3.2.2
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.
- package/README.md +39 -0
- package/package.json +9 -1
- package/styles.css +39 -17
package/README.md
CHANGED
|
@@ -10,6 +10,35 @@ Both interfaces use the same calculation engine.
|
|
|
10
10
|
## Repository
|
|
11
11
|
|
|
12
12
|
- GitHub: `https://github.com/tiagojct/diagcalc`
|
|
13
|
+
- Web app: `https://diagcalc.tiagojct.eu/`
|
|
14
|
+
- npm package: `https://www.npmjs.com/package/diagcalc`
|
|
15
|
+
|
|
16
|
+
## Description
|
|
17
|
+
|
|
18
|
+
DIAGCALC is designed for a simple job: start from a confusion matrix, calculate the main diagnostic test measures, and show how the test result changes the probability of disease.
|
|
19
|
+
|
|
20
|
+
It is built for teaching, self-study, and quick practical use. The web app is useful in the classroom and in browser-based demonstrations. The terminal app is useful for keyboard-driven work, SSH sessions, scripting, and lightweight environments.
|
|
21
|
+
|
|
22
|
+
## Operating Model
|
|
23
|
+
|
|
24
|
+
The app follows the same sequence used in many teaching sessions on diagnostic reasoning:
|
|
25
|
+
|
|
26
|
+
1. define the case or load a reference scenario
|
|
27
|
+
2. inspect the confusion matrix
|
|
28
|
+
3. estimate the pre-test probability
|
|
29
|
+
4. calculate core performance measures
|
|
30
|
+
5. interpret LR+ and LR-
|
|
31
|
+
6. update to post-test probability
|
|
32
|
+
|
|
33
|
+
The web and terminal interfaces both follow that workflow.
|
|
34
|
+
|
|
35
|
+
## Philosophy
|
|
36
|
+
|
|
37
|
+
- keep the calculator simple enough to use during teaching
|
|
38
|
+
- keep the maths explicit and easy to verify
|
|
39
|
+
- keep the interfaces lightweight and dependency-light
|
|
40
|
+
- keep the same results across web, TUI, and CLI
|
|
41
|
+
- support both interactive learning and automation
|
|
13
42
|
|
|
14
43
|
## Features
|
|
15
44
|
|
|
@@ -27,6 +56,8 @@ Both interfaces use the same calculation engine.
|
|
|
27
56
|
|
|
28
57
|
The web app is static. It does not need a build step.
|
|
29
58
|
|
|
59
|
+
It is intended for teaching sessions, demonstrations, and direct interactive exploration.
|
|
60
|
+
|
|
30
61
|
### Run locally
|
|
31
62
|
|
|
32
63
|
Open `index.html` directly in a browser, or serve the folder locally:
|
|
@@ -53,6 +84,8 @@ http://localhost:8080
|
|
|
53
84
|
|
|
54
85
|
The terminal app requires Node.js 18 or newer.
|
|
55
86
|
|
|
87
|
+
It is intended for keyboard-first use, quick calculations, reproducible terminal workflows, and scripting.
|
|
88
|
+
|
|
56
89
|
### Install locally
|
|
57
90
|
|
|
58
91
|
```bash
|
|
@@ -98,6 +131,8 @@ Get JSON output:
|
|
|
98
131
|
diag --dataset ddimer --format json
|
|
99
132
|
```
|
|
100
133
|
|
|
134
|
+
The CLI is useful when you want a one-shot calculation or when you want to integrate the calculator into scripts or other tooling.
|
|
135
|
+
|
|
101
136
|
### TUI controls
|
|
102
137
|
|
|
103
138
|
- `Tab` / `Ctrl-N`: next panel
|
|
@@ -144,6 +179,10 @@ npm install -g diagcalc
|
|
|
144
179
|
diag --tui
|
|
145
180
|
```
|
|
146
181
|
|
|
182
|
+
Package page:
|
|
183
|
+
|
|
184
|
+
- `https://www.npmjs.com/package/diagcalc`
|
|
185
|
+
|
|
147
186
|
## Project Structure
|
|
148
187
|
|
|
149
188
|
- `index.html` - web app markup
|
package/package.json
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "diagcalc",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"description": "Diagnostic calculator for the browser, terminal, and plain CLI.",
|
|
5
|
+
"homepage": "https://diagcalc.tiagojct.eu/",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/tiagojct/diagcalc.git"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/tiagojct/diagcalc/issues"
|
|
12
|
+
},
|
|
5
13
|
"license": "MIT",
|
|
6
14
|
"keywords": [
|
|
7
15
|
"diagnostics",
|
package/styles.css
CHANGED
|
@@ -34,12 +34,23 @@
|
|
|
34
34
|
--muted-text: var(--base-800);
|
|
35
35
|
--success-color: var(--green);
|
|
36
36
|
--accent-warm: var(--orange);
|
|
37
|
+
--page-accent-cool: rgba(32, 94, 166, 0.08);
|
|
38
|
+
--page-accent-warm: rgba(188, 82, 21, 0.05);
|
|
39
|
+
--intro-gradient-end: rgba(230, 228, 217, 0.4);
|
|
40
|
+
--panel-bg: rgba(242, 240, 229, 0.8);
|
|
41
|
+
--panel-soft-bg: rgba(255, 252, 240, 0.82);
|
|
42
|
+
--highlight-bg: rgba(255, 252, 240, 0.66);
|
|
43
|
+
--matrix-bg: rgba(255, 252, 240, 0.9);
|
|
44
|
+
--heading-strong: var(--base-900);
|
|
45
|
+
--reference-bg: var(--base-300);
|
|
46
|
+
--reference-text: var(--base-800);
|
|
47
|
+
--reference-muted: var(--base-700);
|
|
37
48
|
}
|
|
38
49
|
|
|
39
50
|
body {
|
|
40
51
|
font-family: "JetBrains Mono", monospace;
|
|
41
52
|
background-color: var(--background-color);
|
|
42
|
-
background-image: radial-gradient(circle at top left,
|
|
53
|
+
background-image: radial-gradient(circle at top left, var(--page-accent-cool), transparent 30%), linear-gradient(180deg, var(--page-accent-warm), transparent 22%);
|
|
43
54
|
color: var(--text-color);
|
|
44
55
|
margin: 0;
|
|
45
56
|
padding: 0;
|
|
@@ -64,7 +75,7 @@ footer {
|
|
|
64
75
|
}
|
|
65
76
|
|
|
66
77
|
.intro {
|
|
67
|
-
background: linear-gradient(180deg, var(--surface-color),
|
|
78
|
+
background: linear-gradient(180deg, var(--surface-color), var(--intro-gradient-end));
|
|
68
79
|
border-bottom: 2px solid var(--base-300);
|
|
69
80
|
}
|
|
70
81
|
|
|
@@ -136,7 +147,7 @@ h2 {
|
|
|
136
147
|
}
|
|
137
148
|
|
|
138
149
|
.highlight {
|
|
139
|
-
background-color:
|
|
150
|
+
background-color: var(--highlight-bg);
|
|
140
151
|
border: 2px solid var(--border-color);
|
|
141
152
|
border-radius: 8px;
|
|
142
153
|
padding: 1.25rem;
|
|
@@ -161,7 +172,7 @@ h2 {
|
|
|
161
172
|
}
|
|
162
173
|
|
|
163
174
|
.panel {
|
|
164
|
-
background-color:
|
|
175
|
+
background-color: var(--panel-bg);
|
|
165
176
|
border: 2px solid var(--border-color);
|
|
166
177
|
border-radius: 10px;
|
|
167
178
|
padding: 1.35rem;
|
|
@@ -243,7 +254,7 @@ select:focus {
|
|
|
243
254
|
|
|
244
255
|
optgroup {
|
|
245
256
|
font-weight: 600;
|
|
246
|
-
color: var(--
|
|
257
|
+
color: var(--heading-strong);
|
|
247
258
|
font-style: normal;
|
|
248
259
|
}
|
|
249
260
|
|
|
@@ -263,7 +274,7 @@ option {
|
|
|
263
274
|
border-radius: 8px;
|
|
264
275
|
padding: 1.25rem;
|
|
265
276
|
margin: 0 0 2rem;
|
|
266
|
-
background-color:
|
|
277
|
+
background-color: var(--matrix-bg);
|
|
267
278
|
}
|
|
268
279
|
|
|
269
280
|
.confusion-matrix legend {
|
|
@@ -358,7 +369,7 @@ button:hover {
|
|
|
358
369
|
|
|
359
370
|
.secondary {
|
|
360
371
|
background: transparent;
|
|
361
|
-
color: var(--
|
|
372
|
+
color: var(--muted-text);
|
|
362
373
|
border: 2px solid var(--border-color);
|
|
363
374
|
box-shadow: none;
|
|
364
375
|
}
|
|
@@ -407,7 +418,7 @@ button:hover {
|
|
|
407
418
|
}
|
|
408
419
|
|
|
409
420
|
.probability-chart {
|
|
410
|
-
background-color:
|
|
421
|
+
background-color: var(--panel-soft-bg);
|
|
411
422
|
border-radius: 8px;
|
|
412
423
|
padding: 1.5rem;
|
|
413
424
|
border: 2px solid var(--border-color);
|
|
@@ -465,7 +476,7 @@ button:hover {
|
|
|
465
476
|
}
|
|
466
477
|
|
|
467
478
|
.result-card {
|
|
468
|
-
background-color:
|
|
479
|
+
background-color: var(--panel-soft-bg);
|
|
469
480
|
border-radius: 8px;
|
|
470
481
|
padding: 1.5rem;
|
|
471
482
|
border: 2px solid var(--border-color);
|
|
@@ -478,7 +489,7 @@ button:hover {
|
|
|
478
489
|
.result-card h3 {
|
|
479
490
|
margin: 0;
|
|
480
491
|
font-size: 1.05rem;
|
|
481
|
-
color: var(--
|
|
492
|
+
color: var(--heading-strong);
|
|
482
493
|
}
|
|
483
494
|
|
|
484
495
|
.result-value {
|
|
@@ -523,7 +534,7 @@ button:hover {
|
|
|
523
534
|
.dataset-reference {
|
|
524
535
|
margin-top: 1rem;
|
|
525
536
|
padding: 1rem;
|
|
526
|
-
background-color: var(--
|
|
537
|
+
background-color: var(--reference-bg);
|
|
527
538
|
border-left: 4px solid var(--primary-color);
|
|
528
539
|
border-radius: 4px;
|
|
529
540
|
font-size: 0.9rem;
|
|
@@ -532,17 +543,17 @@ button:hover {
|
|
|
532
543
|
.dataset-reference h4 {
|
|
533
544
|
margin: 0 0 0.5rem;
|
|
534
545
|
font-size: 0.95rem;
|
|
535
|
-
color: var(--
|
|
546
|
+
color: var(--heading-strong);
|
|
536
547
|
}
|
|
537
548
|
|
|
538
549
|
.dataset-reference p {
|
|
539
550
|
margin: 0.25rem 0;
|
|
540
|
-
color: var(--
|
|
551
|
+
color: var(--reference-text);
|
|
541
552
|
}
|
|
542
553
|
|
|
543
554
|
.dataset-reference .reference-citation {
|
|
544
555
|
font-style: italic;
|
|
545
|
-
color: var(--
|
|
556
|
+
color: var(--reference-muted);
|
|
546
557
|
margin-top: 0.5rem;
|
|
547
558
|
}
|
|
548
559
|
|
|
@@ -559,7 +570,7 @@ button:hover {
|
|
|
559
570
|
.fagan-nomogram h3 {
|
|
560
571
|
margin: 0 0 0.5rem;
|
|
561
572
|
font-size: 1.2rem;
|
|
562
|
-
color: var(--
|
|
573
|
+
color: var(--heading-strong);
|
|
563
574
|
}
|
|
564
575
|
|
|
565
576
|
.fagan-nomogram canvas {
|
|
@@ -592,7 +603,7 @@ button:hover {
|
|
|
592
603
|
.reference-list {
|
|
593
604
|
margin: 1rem 0 0;
|
|
594
605
|
padding-left: 1.5rem;
|
|
595
|
-
color: var(--
|
|
606
|
+
color: var(--muted-text);
|
|
596
607
|
}
|
|
597
608
|
|
|
598
609
|
.reference-list li {
|
|
@@ -601,7 +612,7 @@ button:hover {
|
|
|
601
612
|
}
|
|
602
613
|
|
|
603
614
|
.reference-list strong {
|
|
604
|
-
color: var(--
|
|
615
|
+
color: var(--heading-strong);
|
|
605
616
|
}
|
|
606
617
|
|
|
607
618
|
/* Tooltip */
|
|
@@ -682,6 +693,17 @@ button:hover {
|
|
|
682
693
|
--muted-text: var(--base-800);
|
|
683
694
|
--success-color: var(--green);
|
|
684
695
|
--accent-warm: var(--orange);
|
|
696
|
+
--page-accent-cool: rgba(67, 133, 190, 0.14);
|
|
697
|
+
--page-accent-warm: rgba(218, 112, 44, 0.08);
|
|
698
|
+
--intro-gradient-end: rgba(28, 27, 26, 0.6);
|
|
699
|
+
--panel-bg: rgba(28, 27, 26, 0.86);
|
|
700
|
+
--panel-soft-bg: rgba(40, 39, 38, 0.9);
|
|
701
|
+
--highlight-bg: rgba(28, 27, 26, 0.82);
|
|
702
|
+
--matrix-bg: rgba(16, 15, 15, 0.82);
|
|
703
|
+
--heading-strong: var(--text-color);
|
|
704
|
+
--reference-bg: var(--base-300);
|
|
705
|
+
--reference-text: var(--text-color);
|
|
706
|
+
--reference-muted: var(--muted-text);
|
|
685
707
|
}
|
|
686
708
|
|
|
687
709
|
a {
|