@decidables/detectable-elements 0.2.16 → 0.3.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.
- package/CHANGELOG.md +21 -0
- package/README.md +150 -14
- package/lib/detectableElements.esm.js +4245 -3504
- package/lib/detectableElements.esm.js.map +1 -1
- package/lib/detectableElements.esm.min.js +833 -530
- package/lib/detectableElements.esm.min.js.map +1 -1
- package/lib/detectableElements.umd.js +4233 -3491
- package/lib/detectableElements.umd.js.map +1 -1
- package/lib/detectableElements.umd.min.js +833 -530
- package/lib/detectableElements.umd.min.js.map +1 -1
- package/package.json +4 -4
- package/src/components/detectable-control.js +8 -6
- package/src/components/detectable-response.js +24 -0
- package/src/components/index.js +4 -3
- package/src/components/roc-space.js +15 -11
- package/src/components/sdt-model.js +101 -98
- package/src/components/sdt-parameters.js +163 -0
- package/src/equations/dc2far.js +28 -7
- package/src/equations/dc2hr.js +29 -7
- package/src/equations/facr2far.js +19 -3
- package/src/equations/hfa2ppv.js +19 -3
- package/src/equations/hm2hr.js +19 -3
- package/src/equations/hmfacr2acc.js +31 -5
- package/src/equations/hrfar2c.js +29 -5
- package/src/equations/hrfar2d.js +29 -5
- package/src/equations/mcr2fomr.js +19 -3
- package/src/examples/double-interactive.js +1 -1
- package/src/examples/human.js +221 -89
- package/src/examples/interactive.js +226 -88
- package/src/examples/model.js +222 -97
- package/src/examples/multiple.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.3.0](https://github.com/decidables/decidables/compare/@decidables/detectable-elements@0.2.16...@decidables/detectable-elements@0.3.0) (2025-05-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **detectable-elements:** add sdt-parameters to examples ([235b07e](https://github.com/decidables/decidables/commit/235b07ea503ffe7af831499cd09d63bb3c0281aa))
|
|
12
|
+
* **detectable-elements:** added sdt-parameters for adjusting and showing parameters ([1d5f62a](https://github.com/decidables/decidables/commit/1d5f62a357de82ccb5584fad5283501a52dd8d4a))
|
|
13
|
+
* **detectable-elements:** detectable-response accepts keyboard input ([d79b679](https://github.com/decidables/decidables/commit/d79b679ad73d1011729def549e9bc7c4c74ea546))
|
|
14
|
+
* **detectable-elements:** for `sdt-model` use 'all' as an alias for 'outcome' color ([9b0a0e8](https://github.com/decidables/decidables/commit/9b0a0e87b7fec32a5f4c8579b210ea370e594bf8))
|
|
15
|
+
* **detectable-elements:** standardized examples ([00743d5](https://github.com/decidables/decidables/commit/00743d53094bd7d1fe38a7a1ee2d0091f1d889fe))
|
|
16
|
+
* **detectable-elements:** use default parameter values ([a89c321](https://github.com/decidables/decidables/commit/a89c32182e7293e94a3eeef96c873b2b58946ac6))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* **detectable-elements:** allow controls to be shown or not in examples ([3d3fa61](https://github.com/decidables/decidables/commit/3d3fa614dc6396b5f6f4e18757816a6068f59827))
|
|
22
|
+
* **detectable-elements:** sdt-model and roc-space improved touch targets ([4bef6ae](https://github.com/decidables/decidables/commit/4bef6aee6b95a9e92dee3902a449854d336956d6))
|
|
23
|
+
* **detectable-elements:** set defaults for example attributes ([7057fb0](https://github.com/decidables/decidables/commit/7057fb0b1c9177bc45249ad483dbad8cd1e3406e))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
6
27
|
## [0.2.16](https://github.com/decidables/decidables/compare/@decidables/detectable-elements@0.2.15...@decidables/detectable-elements@0.2.16) (2025-02-06)
|
|
7
28
|
|
|
8
29
|
**Note:** Version bump only for package @decidables/detectable-elements
|
package/README.md
CHANGED
|
@@ -146,6 +146,9 @@ This element provides 'present' and 'absent' response buttons. It can also displ
|
|
|
146
146
|
of the trials, display feedback in terms of accuracy or SDT outcome, and display the current trial
|
|
147
147
|
and total payoff.
|
|
148
148
|
|
|
149
|
+
Also accepts keyboard responses: <kbd>ArrowUp</kbd> for 'Present' button and <kbd>ArrowDown</kbd> for
|
|
150
|
+
'Absent' button.
|
|
151
|
+
|
|
149
152
|
##### Attributes
|
|
150
153
|
|
|
151
154
|
- `interactive: boolean = false`
|
|
@@ -652,6 +655,46 @@ responses, or the outcomes.
|
|
|
652
655
|
<sdt-model interactive color="outcome" distributions threshold unequal sensitivity bias variance histogram d="2" c="1" s="1.5"></sdt-model>
|
|
653
656
|
```
|
|
654
657
|
|
|
658
|
+
#### `SDTParameters` / `<sdt-parameters>`
|
|
659
|
+
|
|
660
|
+
Control panel for SDT model parameters
|
|
661
|
+
|
|
662
|
+
A configurable set of controls for user manipulation of SDT model parameters. Controls can be
|
|
663
|
+
provided for the sensitivity (d'), bias (c), and variance (s) parameters.
|
|
664
|
+
|
|
665
|
+
##### Attributes
|
|
666
|
+
|
|
667
|
+
- `d: number = undefined`
|
|
668
|
+
- Parameter d′ (sensitivity)
|
|
669
|
+
- `c: number = undefined`
|
|
670
|
+
- Parameter c (bias)
|
|
671
|
+
- `s: number = undefined`
|
|
672
|
+
- Parameter σ (variance)
|
|
673
|
+
|
|
674
|
+
##### Custom Events
|
|
675
|
+
|
|
676
|
+
- `sdt-parameters-d`
|
|
677
|
+
- Indicates an update to d′ (sensitivity)
|
|
678
|
+
- `detail`
|
|
679
|
+
- `d: number`
|
|
680
|
+
- New value for d′
|
|
681
|
+
- `sdt-parameters-l`
|
|
682
|
+
- Indicates an update to c (bias)
|
|
683
|
+
- `detail`
|
|
684
|
+
- `c: number`
|
|
685
|
+
- New value for c
|
|
686
|
+
- `sdt-parameters-s`
|
|
687
|
+
- Indicates an update to σ (variance)
|
|
688
|
+
- `detail`
|
|
689
|
+
- `s: number`
|
|
690
|
+
- New value for σ
|
|
691
|
+
|
|
692
|
+
##### Example
|
|
693
|
+
|
|
694
|
+
```html
|
|
695
|
+
<sdt-parameters interactive d="1" c="0" s="1"></sdt-parameters>
|
|
696
|
+
```
|
|
697
|
+
|
|
655
698
|
### Equations
|
|
656
699
|
|
|
657
700
|
Interactive equations for SDT
|
|
@@ -1062,6 +1105,22 @@ space, and a visual rendering of signal detection theory. The table of results,
|
|
|
1062
1105
|
SDT model should not be interactive, because their values are received from the user's task
|
|
1063
1106
|
performance.
|
|
1064
1107
|
|
|
1108
|
+
##### Attributes
|
|
1109
|
+
|
|
1110
|
+
**Note:** Attribute values set on the example don't need to be set on the individual components
|
|
1111
|
+
as they will be propagated and kept in sync. However for detectable-control you will need to
|
|
1112
|
+
indicate control visibility (as shown in the example below).
|
|
1113
|
+
|
|
1114
|
+
- `trials: number = 10`
|
|
1115
|
+
- Number of sampled trials to display
|
|
1116
|
+
- `duration: number = 2000`
|
|
1117
|
+
- The duration of the stimulus, wait, and inter-trial interval on each trial, initialized to the
|
|
1118
|
+
value provided in milliseconds
|
|
1119
|
+
- `coherence: number = 0.5`
|
|
1120
|
+
- The proportion of coherent dots in the visual stimulus
|
|
1121
|
+
- `payoff: number = 0`
|
|
1122
|
+
- The relative dollar payoff for hits and misses compared to false alarms and correct rejections
|
|
1123
|
+
|
|
1065
1124
|
##### Slots
|
|
1066
1125
|
|
|
1067
1126
|
- *unnamed*
|
|
@@ -1083,13 +1142,13 @@ performance.
|
|
|
1083
1142
|
##### Example
|
|
1084
1143
|
|
|
1085
1144
|
```html
|
|
1086
|
-
<detectable-example-human>
|
|
1087
|
-
<detectable-control
|
|
1088
|
-
<rdk-task
|
|
1145
|
+
<detectable-example-human trials="10" duration="1000" coherence=".5">
|
|
1146
|
+
<detectable-control trials duration coherence run pause reset></detectable-control>
|
|
1147
|
+
<rdk-task></rdk-task>
|
|
1089
1148
|
<detectable-response interactive trial feedback="outcome"></detectable-response>
|
|
1090
|
-
<detectable-table numeric summary="stimulusRates accuracy"
|
|
1091
|
-
<roc-space point="all" iso-d="all" iso-c="all"
|
|
1092
|
-
<sdt-model threshold bias distributions sensitivity histogram color="outcome"
|
|
1149
|
+
<detectable-table numeric summary="stimulusRates accuracy"></detectable-table>
|
|
1150
|
+
<roc-space point="all" iso-d="all" iso-c="all"></roc-space>
|
|
1151
|
+
<sdt-model threshold bias distributions sensitivity histogram color="outcome"></sdt-model>
|
|
1093
1152
|
</detectable-example-human>
|
|
1094
1153
|
```
|
|
1095
1154
|
|
|
@@ -1102,6 +1161,48 @@ model parameters. Can include controls, a table of results, ROC space, and a vis
|
|
|
1102
1161
|
signal detection theory. The table of results, ROC space, and the SDT model should be interactive,
|
|
1103
1162
|
to allow the user to modify values and see the implications for the other components.
|
|
1104
1163
|
|
|
1164
|
+
##### Attributes
|
|
1165
|
+
|
|
1166
|
+
**Note:** Attribute values set on the example don't need to be set on the individual components
|
|
1167
|
+
as they will be propagated and kept in sync. However for detectable-control you will need to
|
|
1168
|
+
indicate control visibility.
|
|
1169
|
+
|
|
1170
|
+
- `color: string = 'all'`
|
|
1171
|
+
- Select how to color the cells in the results table
|
|
1172
|
+
- Options
|
|
1173
|
+
- `'none'`
|
|
1174
|
+
- No use of color
|
|
1175
|
+
- `'accuracy'`
|
|
1176
|
+
- Color based on accuracy of responses
|
|
1177
|
+
- `'stimulus'`
|
|
1178
|
+
- Color based on *signal* or *noise* stimulus
|
|
1179
|
+
- `'response'`
|
|
1180
|
+
- Color based on *'signal'* or *'noise'* response
|
|
1181
|
+
- `'outcome'`
|
|
1182
|
+
- Color based on outcome of *hit*, *miss*, *false alarm* or *correct rejection*
|
|
1183
|
+
- `'all'`
|
|
1184
|
+
- Color based on stimulus, response, and outcome
|
|
1185
|
+
- `zRoc: boolean = false`
|
|
1186
|
+
- Whether to use z-transformed ROC coordinates (`true`) or ROC coordinates (`false`)
|
|
1187
|
+
- `hits: number = undefined`
|
|
1188
|
+
- Number of hits
|
|
1189
|
+
- `misses: number = undefined`
|
|
1190
|
+
- Number of misses
|
|
1191
|
+
- `false-alarms: number = undefined`
|
|
1192
|
+
- Number of false alarms
|
|
1193
|
+
- `correct-rejections: number = undefined`
|
|
1194
|
+
- Number of correct rejections
|
|
1195
|
+
- `far: number = undefined`
|
|
1196
|
+
- False alarm rate for the first (`'default'`) *location*
|
|
1197
|
+
- `hr: number = undefined`
|
|
1198
|
+
- Hit rate for the first (`'default'`) *location*
|
|
1199
|
+
- `d: number = 1`
|
|
1200
|
+
- Set the sensitivity, *d`*
|
|
1201
|
+
- `c: number = 0`
|
|
1202
|
+
- Set the bias, *c*
|
|
1203
|
+
- `s: number = 1`
|
|
1204
|
+
- Set the variance of the *signal* distribution, *s*
|
|
1205
|
+
|
|
1105
1206
|
##### Slots
|
|
1106
1207
|
|
|
1107
1208
|
- *unnamed*
|
|
@@ -1119,8 +1220,8 @@ to allow the user to modify values and see the implications for the other compon
|
|
|
1119
1220
|
##### Example
|
|
1120
1221
|
|
|
1121
1222
|
```html
|
|
1122
|
-
<detectable-example-interactive>
|
|
1123
|
-
<detectable-table numeric interactive summary="stimulusRates accuracy"
|
|
1223
|
+
<detectable-example-interactive hits="80" misses="20" false-alarms="10" correct-rejections="90">
|
|
1224
|
+
<detectable-table numeric interactive summary="stimulusRates accuracy" ></detectable-table>
|
|
1124
1225
|
<roc-space interactive point="all" iso-d="all" iso-c="all"></roc-space>
|
|
1125
1226
|
<sdt-model interactive threshold bias distributions sensitivity color="outcome"></sdt-model>
|
|
1126
1227
|
</detectable-example-interactive>
|
|
@@ -1167,6 +1268,41 @@ ROC space, and a visual rendering of signal detection theory. The SDT model shou
|
|
|
1167
1268
|
so the user can modify the model. The table of results and ROC space should not be interactive,
|
|
1168
1269
|
because their values are received from the model's task performance.
|
|
1169
1270
|
|
|
1271
|
+
##### Attributes
|
|
1272
|
+
|
|
1273
|
+
**Note:** Attribute values set on the example don't need to be set on the individual components
|
|
1274
|
+
as they will be propagated and kept in sync. However for detectable-control you will need to
|
|
1275
|
+
indicate control visibility (as shown in the example below).
|
|
1276
|
+
|
|
1277
|
+
- `trials: number = 10`
|
|
1278
|
+
- Number of sampled trials to display
|
|
1279
|
+
- `duration: number = 2000`
|
|
1280
|
+
- The duration of the stimulus, wait, and inter-trial interval on each trial, initialized to the
|
|
1281
|
+
value provided in milliseconds
|
|
1282
|
+
- `coherence: number = 0.5`
|
|
1283
|
+
- The proportion of coherent dots in the visual stimulus
|
|
1284
|
+
- `color: string = 'all'`
|
|
1285
|
+
- Select how to color the cells in the results table
|
|
1286
|
+
- Options
|
|
1287
|
+
- `'none'`
|
|
1288
|
+
- No use of color
|
|
1289
|
+
- `'accuracy'`
|
|
1290
|
+
- Color based on accuracy of responses
|
|
1291
|
+
- `'stimulus'`
|
|
1292
|
+
- Color based on *signal* or *noise* stimulus
|
|
1293
|
+
- `'response'`
|
|
1294
|
+
- Color based on *'signal'* or *'noise'* response
|
|
1295
|
+
- `'outcome'`
|
|
1296
|
+
- Color based on outcome of *hit*, *miss*, *false alarm* or *correct rejection*
|
|
1297
|
+
- `'all'`
|
|
1298
|
+
- Color based on stimulus, response, and outcome
|
|
1299
|
+
- `d: number = 1`
|
|
1300
|
+
- Set the sensitivity, *d`*
|
|
1301
|
+
- `c: number = 0`
|
|
1302
|
+
- Set the bias, *c*
|
|
1303
|
+
- `s: number = 1`
|
|
1304
|
+
- Set the variance of the *signal* distribution, *s*
|
|
1305
|
+
|
|
1170
1306
|
##### Slots
|
|
1171
1307
|
|
|
1172
1308
|
- *unnamed*
|
|
@@ -1188,13 +1324,13 @@ because their values are received from the model's task performance.
|
|
|
1188
1324
|
##### Example
|
|
1189
1325
|
|
|
1190
1326
|
```html
|
|
1191
|
-
<detectable-example-model>
|
|
1192
|
-
<detectable-control run pause reset
|
|
1193
|
-
<rdk-task
|
|
1194
|
-
<sdt-model interactive threshold bias distributions sensitivity histogram
|
|
1327
|
+
<detectable-example-model trials="10" duration="500" coherence=".5" color="all" d="1" c=".5">
|
|
1328
|
+
<detectable-control trials duration coherence run pause reset></detectable-control>
|
|
1329
|
+
<rdk-task></rdk-task>
|
|
1330
|
+
<sdt-model interactive threshold bias distributions sensitivity histogram></sdt-model>
|
|
1195
1331
|
<detectable-response trial feedback="outcome"></detectable-response>
|
|
1196
|
-
<detectable-table numeric summary="stimulusRates accuracy"
|
|
1197
|
-
<roc-space
|
|
1332
|
+
<detectable-table numeric summary="stimulusRates accuracy"></detectable-table>
|
|
1333
|
+
<roc-space point="all" iso-d="all" iso-c="all"></roc-space>
|
|
1198
1334
|
</detectable-example-model>
|
|
1199
1335
|
```
|
|
1200
1336
|
|