@decidables/detectable-elements 0.2.0 → 0.2.1
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 +8 -0
- package/README.md +328 -328
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.2.1](https://github.com/decidables/decidables/compare/@decidables/detectable-elements@0.2.0...@decidables/detectable-elements@0.2.1) (2022-04-27)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @decidables/detectable-elements
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [0.2.0](https://github.com/decidables/decidables/compare/@decidables/detectable-elements@0.1.3...@decidables/detectable-elements@0.2.0) (2022-04-07)
|
|
7
15
|
|
|
8
16
|
|
package/README.md
CHANGED
|
@@ -33,6 +33,305 @@ for use in HTML.
|
|
|
33
33
|
|
|
34
34
|
Building blocks for interactive visualizations of SDT
|
|
35
35
|
|
|
36
|
+
#### `DetectableControl` / `<detectable-control>`
|
|
37
|
+
|
|
38
|
+
Control panel for SDT demos
|
|
39
|
+
|
|
40
|
+
A configurable set of controls for user manipulation of examples of signal detection theory.
|
|
41
|
+
Controls can be provided for the number of trials, the timing of trials, the coherence of the dots
|
|
42
|
+
on *signal* trials, the balance of payoff on incentivized trials, the coloring used in the results
|
|
43
|
+
table, the use of ROC or zROC coordinates in ROC space, and for running, pausing, or resetting a
|
|
44
|
+
block of trials.
|
|
45
|
+
|
|
46
|
+
##### Attributes
|
|
47
|
+
|
|
48
|
+
- `trials: number = undefined`
|
|
49
|
+
- Show a slider for setting the number of trials, initialized to the value provided
|
|
50
|
+
- Options
|
|
51
|
+
- `1` to `100` in steps of `1`
|
|
52
|
+
- `duration: number = undefined`
|
|
53
|
+
- Show a slider for setting the duration of the stimulus, wait, and inter-trial interval on each
|
|
54
|
+
trial, initialized to the value provided in milliseconds
|
|
55
|
+
- Options
|
|
56
|
+
- `10` to `2000` in steps of `10`
|
|
57
|
+
- `coherence: number = undefined`
|
|
58
|
+
- Show a slider for setting the proportion of coherent dots on *signal* trials
|
|
59
|
+
- Options
|
|
60
|
+
- `0` to `1` in steps of `0.01`
|
|
61
|
+
- `payoff: number = undefined`
|
|
62
|
+
- Show a slider for setting the relative dollar payoff for hits and misses compared to false
|
|
63
|
+
alarms and correct rejections
|
|
64
|
+
- Options
|
|
65
|
+
- `0` to `100` in steps of `1`
|
|
66
|
+
- `color: string = undefined`
|
|
67
|
+
- Show a set of options to select how to color the cells in the results table
|
|
68
|
+
- Options
|
|
69
|
+
- `'none'`
|
|
70
|
+
- No use of color
|
|
71
|
+
- `'accuracy'`
|
|
72
|
+
- Color based on accuracy of responses
|
|
73
|
+
- `'stimulus'`
|
|
74
|
+
- Color based on *signal* or *noise* stimulus
|
|
75
|
+
- `'response'`
|
|
76
|
+
- Color based on *'signal'* or *'noise'* response
|
|
77
|
+
- `'outcome'`
|
|
78
|
+
- Color based on outcome of *hit*, *miss*, *false alarm* or *correct rejection*
|
|
79
|
+
- `'all'`
|
|
80
|
+
- Color based on stimulus, response, and outcome
|
|
81
|
+
- `zRoc: boolean = undefined`
|
|
82
|
+
- Show a switch to set whether to use z-transformed ROC coordinates (`true`) or ROC coordinates
|
|
83
|
+
(`false`)
|
|
84
|
+
- `run: boolean = false`
|
|
85
|
+
- Show a button to run the task
|
|
86
|
+
- `pause: boolean = false`
|
|
87
|
+
- Show a button to pause the task
|
|
88
|
+
- `reset: boolean = false`
|
|
89
|
+
- Show a button to reset the task
|
|
90
|
+
|
|
91
|
+
##### Methods
|
|
92
|
+
|
|
93
|
+
- `complete()`
|
|
94
|
+
- Indicates that a trial block is done, so it can no longer be paused
|
|
95
|
+
|
|
96
|
+
##### Custom Events
|
|
97
|
+
|
|
98
|
+
- `detectable-control-trials`
|
|
99
|
+
- Indicates the number of trials slider has been adjusted
|
|
100
|
+
- `detail`
|
|
101
|
+
- `trials: number`
|
|
102
|
+
- The new number of trials
|
|
103
|
+
- `detectable-control-duration`
|
|
104
|
+
- Indicates the duration of trials slider has been adjusted
|
|
105
|
+
- `detail`
|
|
106
|
+
- `duration: number`
|
|
107
|
+
- The new duration
|
|
108
|
+
- `detectable-control-coherence`
|
|
109
|
+
- Indicates the coherence of stimulus dots slider has been adjusted
|
|
110
|
+
- `detail`
|
|
111
|
+
- `coherence: number`
|
|
112
|
+
- The new coherence
|
|
113
|
+
- `detectable-control-payoff`
|
|
114
|
+
- Indicates the payoff slider has been adjusted
|
|
115
|
+
- `detail`
|
|
116
|
+
- `payoff: number`
|
|
117
|
+
- The new payoff
|
|
118
|
+
- `detectable-control-color`
|
|
119
|
+
- Indicates the color selection for the results table has been toggled
|
|
120
|
+
- `detail`
|
|
121
|
+
- `color: string`
|
|
122
|
+
- The new color scheme
|
|
123
|
+
- `detectable-control-z-roc`
|
|
124
|
+
- Indicates the plot coordinates switch have been changed
|
|
125
|
+
- `detail`
|
|
126
|
+
- `zRoc: boolean`
|
|
127
|
+
- Whether or not to use z-transformed coordinates now
|
|
128
|
+
- `detectable-control-run`
|
|
129
|
+
- Indicates the run button has been pushed
|
|
130
|
+
- `detectable-control-pause`
|
|
131
|
+
- Indicates the pause button has been pushed
|
|
132
|
+
- `detectable-control-reset`
|
|
133
|
+
- Indicates the reset button has been pushed
|
|
134
|
+
|
|
135
|
+
##### Example
|
|
136
|
+
|
|
137
|
+
```html
|
|
138
|
+
<detectable-control trials="15" duration="1500" coherence="0.2" payoff="75" color="outcome" z-roc run pause reset></detectable-control>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
#### `DetectableResponse` / `<detectable-response>`
|
|
142
|
+
|
|
143
|
+
Response buttons, feedback, and payoffs for signal detection tasks
|
|
144
|
+
|
|
145
|
+
This element provides 'present' and 'absent' response buttons. It can also display a running count
|
|
146
|
+
of the trials, display feedback in terms of accuracy or SDT outcome, and display the current trial
|
|
147
|
+
and total payoff.
|
|
148
|
+
|
|
149
|
+
##### Attributes
|
|
150
|
+
|
|
151
|
+
- `interactive: boolean = false`
|
|
152
|
+
- Allow user to respond, instead of just displaying simulated model responses
|
|
153
|
+
- `feedback: string = 'outcome'`
|
|
154
|
+
- What type of feedback to display
|
|
155
|
+
- Options
|
|
156
|
+
- `'none'`
|
|
157
|
+
- No feedback
|
|
158
|
+
- `'accuracy'`
|
|
159
|
+
- Feedback in terms of accuracy, i.e. 'correct' or 'error'
|
|
160
|
+
- `'outcome'`
|
|
161
|
+
- Feedback in terms of outcome, i.e. 'hit, 'miss', 'false alarm', or 'correct rejection'
|
|
162
|
+
- `trial: boolean = false`
|
|
163
|
+
- Display the running count of trials, i.e. 'Trial: 2 of 10'
|
|
164
|
+
- `payoff: string = 'none'`
|
|
165
|
+
- What payoff information to display
|
|
166
|
+
- Options
|
|
167
|
+
- `'none'`
|
|
168
|
+
- No payoff information displayed
|
|
169
|
+
- `'trial'`
|
|
170
|
+
- Only display payoff for the current trial
|
|
171
|
+
- `'total'`
|
|
172
|
+
- Display payoff for the current trial and display the total payoff for the block
|
|
173
|
+
- `hit-payoff: number = 0`
|
|
174
|
+
- Value of payoff for a hit
|
|
175
|
+
- `miss-payoff: number = 0`
|
|
176
|
+
- Value of payoff for a miss
|
|
177
|
+
- `correct-rejection-payoff: number = 0`
|
|
178
|
+
- Value of payoff for a correct rejection
|
|
179
|
+
- `false-alarm-payoff: number = 0`
|
|
180
|
+
- Value of payoff for a false alarm
|
|
181
|
+
- `no-response-payoff: number = 0`
|
|
182
|
+
- Value of payoff for no response
|
|
183
|
+
|
|
184
|
+
##### Methods
|
|
185
|
+
|
|
186
|
+
- `start(signal, trial)`
|
|
187
|
+
- Indicates that a trial has started, and its time to wait for a response
|
|
188
|
+
- Parameters
|
|
189
|
+
- `signal: string`
|
|
190
|
+
- Whether this is a signal `'present'` or `'absent'` trial
|
|
191
|
+
- `trial: number`
|
|
192
|
+
- The count of the trial within the block
|
|
193
|
+
- `stop()`
|
|
194
|
+
- Indicates that the trial is over and it is time to display any requested feedback
|
|
195
|
+
- **Note:** If no response has been made yet, the trial is recorded as having no response
|
|
196
|
+
- `present()`
|
|
197
|
+
- Emulate a 'present' response
|
|
198
|
+
- `absent()`
|
|
199
|
+
- Emulate an 'absent' response
|
|
200
|
+
- `responded(response)`
|
|
201
|
+
- Emulate a response
|
|
202
|
+
- Parameters
|
|
203
|
+
- `response: string`
|
|
204
|
+
- Whether to emulate a `'present'` or `'absent'` response
|
|
205
|
+
- `reset()`
|
|
206
|
+
- Reset to the state at the start of a block of trials
|
|
207
|
+
|
|
208
|
+
##### Custom Events
|
|
209
|
+
|
|
210
|
+
- `detectable-response`
|
|
211
|
+
- Indicates that a response has been made on this trial
|
|
212
|
+
- `detail`
|
|
213
|
+
- `trial: number`
|
|
214
|
+
- The count of this trial in the block
|
|
215
|
+
- `signal: string`
|
|
216
|
+
- Whether the signal was actually `'present'` or `'absent'`
|
|
217
|
+
- `response: string`
|
|
218
|
+
- Whether the response was `'present'` or `'absent'`
|
|
219
|
+
- `outcome: string`
|
|
220
|
+
- The outcome of the trial as a hit (`'h'`), miss (`'m'`), correct rejection (`'cr'`), or
|
|
221
|
+
false alarm (`'fa'`)
|
|
222
|
+
- `payoff: number`
|
|
223
|
+
- The payoff for this trial
|
|
224
|
+
- `h: number`
|
|
225
|
+
- Total hits in this block
|
|
226
|
+
- `m: number`
|
|
227
|
+
- Total misses in this block
|
|
228
|
+
- `fa: number`
|
|
229
|
+
- Total false alarms in this block
|
|
230
|
+
- `cr: number`
|
|
231
|
+
- Total correct rejections in this block
|
|
232
|
+
- `nr: number`
|
|
233
|
+
- Total no responses in this block
|
|
234
|
+
- `totalPayoff: number`
|
|
235
|
+
- Total payoff for the block
|
|
236
|
+
|
|
237
|
+
##### Example
|
|
238
|
+
|
|
239
|
+
```html
|
|
240
|
+
<detectable-response interactive feedback="outcome" trial payoff="total" hit-payoff="60" miss-payoff="-60" false-alarm-payoff="-40" correct-rejection-payoff="40" no-response-payoff="-100"></detectable-response>
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
#### `DetectableTable` / `<detectable-table>`
|
|
244
|
+
|
|
245
|
+
Interactive table of SDT outcomes
|
|
246
|
+
|
|
247
|
+
A results table for signal detection tasks. The results are presented in a two by two table
|
|
248
|
+
organized by stimuli (signal present or absent) and responses ('present' or 'absent') leading to
|
|
249
|
+
four possible outcomes: hits, misses, false alarms, and correct rejections. Results on signal
|
|
250
|
+
present trials are optionally marginalized with the hit rate and those on signal absent trials with
|
|
251
|
+
the false alarm rate. Results on response 'present' trials are optionally marginalized with the
|
|
252
|
+
positive predictive value and those on response 'absent' trials with the false omission rate. And
|
|
253
|
+
overall results are optionally marginalized with accuracy.
|
|
254
|
+
|
|
255
|
+
##### Attributes
|
|
256
|
+
|
|
257
|
+
- `interactive: boolean = false`
|
|
258
|
+
- Allow user to change values in the table
|
|
259
|
+
- `numeric: boolean = false`
|
|
260
|
+
- Show numeric values instead of just labelling the cells
|
|
261
|
+
- `summary: Set = <empty>`
|
|
262
|
+
- Which marginals to display
|
|
263
|
+
- Expressed in HTML as a space-separated list
|
|
264
|
+
- Options
|
|
265
|
+
- `'stimulusRates'`
|
|
266
|
+
- Display hit rate and false alarm rate
|
|
267
|
+
- `'responseRates'`
|
|
268
|
+
- Display positive predictive value and false omission rate
|
|
269
|
+
- `'accuracy'`
|
|
270
|
+
- Display overall accuracy
|
|
271
|
+
- `color: string = 'outcome'`
|
|
272
|
+
- How to color the cells
|
|
273
|
+
- Options
|
|
274
|
+
- `'none'`
|
|
275
|
+
- No colors
|
|
276
|
+
- `'accuracy'`
|
|
277
|
+
- Color based on accuracy, i.e. *correct* or *error*
|
|
278
|
+
- `'stimulus'`
|
|
279
|
+
- Color based on stimulus *present* or *absent*
|
|
280
|
+
- `'response'`
|
|
281
|
+
- Color based on response *'present'* or *'absent'*
|
|
282
|
+
- `'outcome'`
|
|
283
|
+
- Color based on *hits*, *misses*, *false alarms* and *correct rejections*
|
|
284
|
+
- `'all'`
|
|
285
|
+
- Color based on stimulus, response, and outcome
|
|
286
|
+
- `hits: number = 40`
|
|
287
|
+
- Number of hits
|
|
288
|
+
- `misses: number = 60`
|
|
289
|
+
- Number of misses
|
|
290
|
+
- `false-alarms: number = 75`
|
|
291
|
+
- Number of false alarms
|
|
292
|
+
- `correct-rejections: number = 25`
|
|
293
|
+
- Number of correct rejections
|
|
294
|
+
- `payoff: boolean = false`
|
|
295
|
+
- Whether to display payoffs
|
|
296
|
+
- `hit-payoff: number = undefined`
|
|
297
|
+
- Payoff for hits
|
|
298
|
+
- `miss-payoff: number = undefined`
|
|
299
|
+
- Payoff for misses
|
|
300
|
+
- `correct-rejection-payoff: number = undefined`
|
|
301
|
+
- Payoff for correct rejections
|
|
302
|
+
- `false-alarm-payoff: number = undefined`
|
|
303
|
+
- Payoff for false alarms
|
|
304
|
+
|
|
305
|
+
##### Custom Events
|
|
306
|
+
|
|
307
|
+
- `detectable-table-change`
|
|
308
|
+
- One or more values in the table have changed
|
|
309
|
+
- `detail`
|
|
310
|
+
- `h: number`
|
|
311
|
+
- Hits
|
|
312
|
+
- `m: number`
|
|
313
|
+
- Misses
|
|
314
|
+
- `fa: number`
|
|
315
|
+
- False alarms
|
|
316
|
+
- `cr: number`
|
|
317
|
+
- Correct rejections
|
|
318
|
+
- `hr: number`
|
|
319
|
+
- Hit rate
|
|
320
|
+
- `far: number`
|
|
321
|
+
- False alarm rate
|
|
322
|
+
- `ppv: number`
|
|
323
|
+
- Positive predictive value
|
|
324
|
+
- `fomr: number`
|
|
325
|
+
- False omission rate
|
|
326
|
+
- `acc: number`
|
|
327
|
+
- Accuracy
|
|
328
|
+
|
|
329
|
+
##### Example
|
|
330
|
+
|
|
331
|
+
```html
|
|
332
|
+
<detectable-table interactive numeric summary="stimulusRates responseRates accuracy" = color="outcome" hits="80" misses="20" false-alarms="35" correct-rejections="65" payoff hit-payoff="60" miss-payoff="-60" false-alarm-payoff="-40" correct-rejection-payoff="40"></detectable-table>
|
|
333
|
+
```
|
|
334
|
+
|
|
36
335
|
#### `RDKTask` / `<rdt-task>`
|
|
37
336
|
|
|
38
337
|
Displays stimuli for random dot kinematogram signal detection task
|
|
@@ -190,145 +489,40 @@ iso-bias, or iso-accuracy.
|
|
|
190
489
|
- The `name` `'default'` is reserved for the first location
|
|
191
490
|
- Parameters
|
|
192
491
|
- `d: number`
|
|
193
|
-
- Sensitivity
|
|
194
|
-
- `c: number`
|
|
195
|
-
- Bias
|
|
196
|
-
- `name: string = 'default'`
|
|
197
|
-
- A unique name to identify the *location* being set
|
|
198
|
-
- `label: string = ''`
|
|
199
|
-
- A visual label to use in the plot for this location
|
|
200
|
-
- `s: number = 1`
|
|
201
|
-
- Unequal variance parameter (default of `1` is equal variance)
|
|
202
|
-
|
|
203
|
-
##### Custom Events
|
|
204
|
-
|
|
205
|
-
- `roc-point-change`
|
|
206
|
-
- Indicates a location on the plot has been moved
|
|
207
|
-
- `detail`
|
|
208
|
-
- `name: string`
|
|
209
|
-
- A unique name to identify the *location*
|
|
210
|
-
- `far: number`
|
|
211
|
-
- False alarm rate
|
|
212
|
-
- `hr: number`
|
|
213
|
-
- Hit rate
|
|
214
|
-
- `d: number`
|
|
215
|
-
- Sensitivity
|
|
216
|
-
- `c: number`
|
|
217
|
-
- Bias
|
|
218
|
-
- `s: number`
|
|
219
|
-
- Variance
|
|
220
|
-
- `label: string`
|
|
221
|
-
- Display label
|
|
222
|
-
|
|
223
|
-
##### Example
|
|
224
|
-
|
|
225
|
-
```html
|
|
226
|
-
<roc-space interactive contour="bias" point="all" isoD="first" isoC="first" z-roc far="0.2" hr="0.9"></roc-space>
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
#### `DetectableControl` / `<detectable-control>`
|
|
230
|
-
|
|
231
|
-
Control panel for SDT demos
|
|
232
|
-
|
|
233
|
-
A configurable set of controls for user manipulation of examples of signal detection theory.
|
|
234
|
-
Controls can be provided for the number of trials, the timing of trials, the coherence of the dots
|
|
235
|
-
on *signal* trials, the balance of payoff on incentivized trials, the coloring used in the results
|
|
236
|
-
table, the use of ROC or zROC coordinates in ROC space, and for running, pausing, or resetting a
|
|
237
|
-
block of trials.
|
|
238
|
-
|
|
239
|
-
##### Attributes
|
|
240
|
-
|
|
241
|
-
- `trials: number = undefined`
|
|
242
|
-
- Show a slider for setting the number of trials, initialized to the value provided
|
|
243
|
-
- Options
|
|
244
|
-
- `1` to `100` in steps of `1`
|
|
245
|
-
- `duration: number = undefined`
|
|
246
|
-
- Show a slider for setting the duration of the stimulus, wait, and inter-trial interval on each
|
|
247
|
-
trial, initialized to the value provided in milliseconds
|
|
248
|
-
- Options
|
|
249
|
-
- `10` to `2000` in steps of `10`
|
|
250
|
-
- `coherence: number = undefined`
|
|
251
|
-
- Show a slider for setting the proportion of coherent dots on *signal* trials
|
|
252
|
-
- Options
|
|
253
|
-
- `0` to `1` in steps of `0.01`
|
|
254
|
-
- `payoff: number = undefined`
|
|
255
|
-
- Show a slider for setting the relative dollar payoff for hits and misses compared to false
|
|
256
|
-
alarms and correct rejections
|
|
257
|
-
- Options
|
|
258
|
-
- `0` to `100` in steps of `1`
|
|
259
|
-
- `color: string = undefined`
|
|
260
|
-
- Show a set of options to select how to color the cells in the results table
|
|
261
|
-
- Options
|
|
262
|
-
- `'none'`
|
|
263
|
-
- No use of color
|
|
264
|
-
- `'accuracy'`
|
|
265
|
-
- Color based on accuracy of responses
|
|
266
|
-
- `'stimulus'`
|
|
267
|
-
- Color based on *signal* or *noise* stimulus
|
|
268
|
-
- `'response'`
|
|
269
|
-
- Color based on *'signal'* or *'noise'* response
|
|
270
|
-
- `'outcome'`
|
|
271
|
-
- Color based on outcome of *hit*, *miss*, *false alarm* or *correct rejection*
|
|
272
|
-
- `'all'`
|
|
273
|
-
- Color based on stimulus, response, and outcome
|
|
274
|
-
- `zRoc: boolean = undefined`
|
|
275
|
-
- Show a switch to set whether to use z-transformed ROC coordinates (`true`) or ROC coordinates
|
|
276
|
-
(`false`)
|
|
277
|
-
- `run: boolean = false`
|
|
278
|
-
- Show a button to run the task
|
|
279
|
-
- `pause: boolean = false`
|
|
280
|
-
- Show a button to pause the task
|
|
281
|
-
- `reset: boolean = false`
|
|
282
|
-
- Show a button to reset the task
|
|
283
|
-
|
|
284
|
-
##### Methods
|
|
285
|
-
|
|
286
|
-
- `complete()`
|
|
287
|
-
- Indicates that a trial block is done, so it can no longer be paused
|
|
492
|
+
- Sensitivity
|
|
493
|
+
- `c: number`
|
|
494
|
+
- Bias
|
|
495
|
+
- `name: string = 'default'`
|
|
496
|
+
- A unique name to identify the *location* being set
|
|
497
|
+
- `label: string = ''`
|
|
498
|
+
- A visual label to use in the plot for this location
|
|
499
|
+
- `s: number = 1`
|
|
500
|
+
- Unequal variance parameter (default of `1` is equal variance)
|
|
288
501
|
|
|
289
502
|
##### Custom Events
|
|
290
503
|
|
|
291
|
-
- `
|
|
292
|
-
- Indicates
|
|
293
|
-
- `detail`
|
|
294
|
-
- `trials: number`
|
|
295
|
-
- The new number of trials
|
|
296
|
-
- `detectable-control-duration`
|
|
297
|
-
- Indicates the duration of trials slider has been adjusted
|
|
298
|
-
- `detail`
|
|
299
|
-
- `duration: number`
|
|
300
|
-
- The new duration
|
|
301
|
-
- `detectable-control-coherence`
|
|
302
|
-
- Indicates the coherence of stimulus dots slider has been adjusted
|
|
303
|
-
- `detail`
|
|
304
|
-
- `coherence: number`
|
|
305
|
-
- The new coherence
|
|
306
|
-
- `detectable-control-payoff`
|
|
307
|
-
- Indicates the payoff slider has been adjusted
|
|
308
|
-
- `detail`
|
|
309
|
-
- `payoff: number`
|
|
310
|
-
- The new payoff
|
|
311
|
-
- `detectable-control-color`
|
|
312
|
-
- Indicates the color selection for the results table has been toggled
|
|
313
|
-
- `detail`
|
|
314
|
-
- `color: string`
|
|
315
|
-
- The new color scheme
|
|
316
|
-
- `detectable-control-z-roc`
|
|
317
|
-
- Indicates the plot coordinates switch have been changed
|
|
504
|
+
- `roc-point-change`
|
|
505
|
+
- Indicates a location on the plot has been moved
|
|
318
506
|
- `detail`
|
|
319
|
-
- `
|
|
320
|
-
-
|
|
321
|
-
- `
|
|
322
|
-
|
|
323
|
-
- `
|
|
324
|
-
|
|
325
|
-
- `
|
|
326
|
-
|
|
507
|
+
- `name: string`
|
|
508
|
+
- A unique name to identify the *location*
|
|
509
|
+
- `far: number`
|
|
510
|
+
- False alarm rate
|
|
511
|
+
- `hr: number`
|
|
512
|
+
- Hit rate
|
|
513
|
+
- `d: number`
|
|
514
|
+
- Sensitivity
|
|
515
|
+
- `c: number`
|
|
516
|
+
- Bias
|
|
517
|
+
- `s: number`
|
|
518
|
+
- Variance
|
|
519
|
+
- `label: string`
|
|
520
|
+
- Display label
|
|
327
521
|
|
|
328
522
|
##### Example
|
|
329
523
|
|
|
330
524
|
```html
|
|
331
|
-
<
|
|
525
|
+
<roc-space interactive contour="bias" point="all" isoD="first" isoC="first" z-roc far="0.2" hr="0.9"></roc-space>
|
|
332
526
|
```
|
|
333
527
|
|
|
334
528
|
#### `SDTModel` / `<sdt-model>`
|
|
@@ -458,200 +652,6 @@ responses, or the outcomes.
|
|
|
458
652
|
<sdt-model interactive color="outcome" distributions threshold unequal sensitivity bias variance histogram d="2" c="1" s="1.5"></sdt-model>
|
|
459
653
|
```
|
|
460
654
|
|
|
461
|
-
#### `DetectableResponse` / `<detectable-response>`
|
|
462
|
-
|
|
463
|
-
Response buttons, feedback, and payoffs for signal detection tasks
|
|
464
|
-
|
|
465
|
-
This element provides 'present' and 'absent' response buttons. It can also display a running count
|
|
466
|
-
of the trials, display feedback in terms of accuracy or SDT outcome, and display the current trial
|
|
467
|
-
and total payoff.
|
|
468
|
-
|
|
469
|
-
##### Attributes
|
|
470
|
-
|
|
471
|
-
- `interactive: boolean = false`
|
|
472
|
-
- Allow user to respond, instead of just displaying simulated model responses
|
|
473
|
-
- `feedback: string = 'outcome'`
|
|
474
|
-
- What type of feedback to display
|
|
475
|
-
- Options
|
|
476
|
-
- `'none'`
|
|
477
|
-
- No feedback
|
|
478
|
-
- `'accuracy'`
|
|
479
|
-
- Feedback in terms of accuracy, i.e. 'correct' or 'error'
|
|
480
|
-
- `'outcome'`
|
|
481
|
-
- Feedback in terms of outcome, i.e. 'hit, 'miss', 'false alarm', or 'correct rejection'
|
|
482
|
-
- `trial: boolean = false`
|
|
483
|
-
- Display the running count of trials, i.e. 'Trial: 2 of 10'
|
|
484
|
-
- `payoff: string = 'none'`
|
|
485
|
-
- What payoff information to display
|
|
486
|
-
- Options
|
|
487
|
-
- `'none'`
|
|
488
|
-
- No payoff information displayed
|
|
489
|
-
- `'trial'`
|
|
490
|
-
- Only display payoff for the current trial
|
|
491
|
-
- `'total'`
|
|
492
|
-
- Display payoff for the current trial and display the total payoff for the block
|
|
493
|
-
- `hit-payoff: number = 0`
|
|
494
|
-
- Value of payoff for a hit
|
|
495
|
-
- `miss-payoff: number = 0`
|
|
496
|
-
- Value of payoff for a miss
|
|
497
|
-
- `correct-rejection-payoff: number = 0`
|
|
498
|
-
- Value of payoff for a correct rejection
|
|
499
|
-
- `false-alarm-payoff: number = 0`
|
|
500
|
-
- Value of payoff for a false alarm
|
|
501
|
-
- `no-response-payoff: number = 0`
|
|
502
|
-
- Value of payoff for no response
|
|
503
|
-
|
|
504
|
-
##### Methods
|
|
505
|
-
|
|
506
|
-
- `start(signal, trial)`
|
|
507
|
-
- Indicates that a trial has started, and its time to wait for a response
|
|
508
|
-
- Parameters
|
|
509
|
-
- `signal: string`
|
|
510
|
-
- Whether this is a signal `'present'` or `'absent'` trial
|
|
511
|
-
- `trial: number`
|
|
512
|
-
- The count of the trial within the block
|
|
513
|
-
- `stop()`
|
|
514
|
-
- Indicates that the trial is over and it is time to display any requested feedback
|
|
515
|
-
- **Note:** If no response has been made yet, the trial is recorded as having no response
|
|
516
|
-
- `present()`
|
|
517
|
-
- Emulate a 'present' response
|
|
518
|
-
- `absent()`
|
|
519
|
-
- Emulate an 'absent' response
|
|
520
|
-
- `responded(response)`
|
|
521
|
-
- Emulate a response
|
|
522
|
-
- Parameters
|
|
523
|
-
- `response: string`
|
|
524
|
-
- Whether to emulate a `'present'` or `'absent'` response
|
|
525
|
-
- `reset()`
|
|
526
|
-
- Reset to the state at the start of a block of trials
|
|
527
|
-
|
|
528
|
-
##### Custom Events
|
|
529
|
-
|
|
530
|
-
- `detectable-response`
|
|
531
|
-
- Indicates that a response has been made on this trial
|
|
532
|
-
- `detail`
|
|
533
|
-
- `trial: number`
|
|
534
|
-
- The count of this trial in the block
|
|
535
|
-
- `signal: string`
|
|
536
|
-
- Whether the signal was actually `'present'` or `'absent'`
|
|
537
|
-
- `response: string`
|
|
538
|
-
- Whether the response was `'present'` or `'absent'`
|
|
539
|
-
- `outcome: string`
|
|
540
|
-
- The outcome of the trial as a hit (`'h'`), miss (`'m'`), correct rejection (`'cr'`), or
|
|
541
|
-
false alarm (`'fa'`)
|
|
542
|
-
- `payoff: number`
|
|
543
|
-
- The payoff for this trial
|
|
544
|
-
- `h: number`
|
|
545
|
-
- Total hits in this block
|
|
546
|
-
- `m: number`
|
|
547
|
-
- Total misses in this block
|
|
548
|
-
- `fa: number`
|
|
549
|
-
- Total false alarms in this block
|
|
550
|
-
- `cr: number`
|
|
551
|
-
- Total correct rejections in this block
|
|
552
|
-
- `nr: number`
|
|
553
|
-
- Total no responses in this block
|
|
554
|
-
- `totalPayoff: number`
|
|
555
|
-
- Total payoff for the block
|
|
556
|
-
|
|
557
|
-
##### Example
|
|
558
|
-
|
|
559
|
-
```html
|
|
560
|
-
<detectable-response interactive feedback="outcome" trial payoff="total" hit-payoff="60" miss-payoff="-60" false-alarm-payoff="-40" correct-rejection-payoff="40" no-response-payoff="-100"></detectable-response>
|
|
561
|
-
```
|
|
562
|
-
|
|
563
|
-
#### `DetectableTable` / `<detectable-table>`
|
|
564
|
-
|
|
565
|
-
Interactive table of SDT outcomes
|
|
566
|
-
|
|
567
|
-
A results table for signal detection tasks. The results are presented in a two by two table
|
|
568
|
-
organized by stimuli (signal present or absent) and responses ('present' or 'absent') leading to
|
|
569
|
-
four possible outcomes: hits, misses, false alarms, and correct rejections. Results on signal
|
|
570
|
-
present trials are optionally marginalized with the hit rate and those on signal absent trials with
|
|
571
|
-
the false alarm rate. Results on response 'present' trials are optionally marginalized with the
|
|
572
|
-
positive predictive value and those on response 'absent' trials with the false omission rate. And
|
|
573
|
-
overall results are optionally marginalized with accuracy.
|
|
574
|
-
|
|
575
|
-
##### Attributes
|
|
576
|
-
|
|
577
|
-
- `interactive: boolean = false`
|
|
578
|
-
- Allow user to change values in the table
|
|
579
|
-
- `numeric: boolean = false`
|
|
580
|
-
- Show numeric values instead of just labelling the cells
|
|
581
|
-
- `summary: Set = <empty>`
|
|
582
|
-
- Which marginals to display
|
|
583
|
-
- Expressed in HTML as a space-separated list
|
|
584
|
-
- Options
|
|
585
|
-
- `'stimulusRates'`
|
|
586
|
-
- Display hit rate and false alarm rate
|
|
587
|
-
- `'responseRates'`
|
|
588
|
-
- Display positive predictive value and false omission rate
|
|
589
|
-
- `'accuracy'`
|
|
590
|
-
- Display overall accuracy
|
|
591
|
-
- `color: string = 'outcome'`
|
|
592
|
-
- How to color the cells
|
|
593
|
-
- Options
|
|
594
|
-
- `'none'`
|
|
595
|
-
- No colors
|
|
596
|
-
- `'accuracy'`
|
|
597
|
-
- Color based on accuracy, i.e. *correct* or *error*
|
|
598
|
-
- `'stimulus'`
|
|
599
|
-
- Color based on stimulus *present* or *absent*
|
|
600
|
-
- `'response'`
|
|
601
|
-
- Color based on response *'present'* or *'absent'*
|
|
602
|
-
- `'outcome'`
|
|
603
|
-
- Color based on *hits*, *misses*, *false alarms* and *correct rejections*
|
|
604
|
-
- `'all'`
|
|
605
|
-
- Color based on stimulus, response, and outcome
|
|
606
|
-
- `hits: number = 40`
|
|
607
|
-
- Number of hits
|
|
608
|
-
- `misses: number = 60`
|
|
609
|
-
- Number of misses
|
|
610
|
-
- `false-alarms: number = 75`
|
|
611
|
-
- Number of false alarms
|
|
612
|
-
- `correct-rejections: number = 25`
|
|
613
|
-
- Number of correct rejections
|
|
614
|
-
- `payoff: boolean = false`
|
|
615
|
-
- Whether to display payoffs
|
|
616
|
-
- `hit-payoff: number = undefined`
|
|
617
|
-
- Payoff for hits
|
|
618
|
-
- `miss-payoff: number = undefined`
|
|
619
|
-
- Payoff for misses
|
|
620
|
-
- `correct-rejection-payoff: number = undefined`
|
|
621
|
-
- Payoff for correct rejections
|
|
622
|
-
- `false-alarm-payoff: number = undefined`
|
|
623
|
-
- Payoff for false alarms
|
|
624
|
-
|
|
625
|
-
##### Custom Events
|
|
626
|
-
|
|
627
|
-
- `detectable-table-change`
|
|
628
|
-
- One or more values in the table have changed
|
|
629
|
-
- `detail`
|
|
630
|
-
- `h: number`
|
|
631
|
-
- Hits
|
|
632
|
-
- `m: number`
|
|
633
|
-
- Misses
|
|
634
|
-
- `fa: number`
|
|
635
|
-
- False alarms
|
|
636
|
-
- `cr: number`
|
|
637
|
-
- Correct rejections
|
|
638
|
-
- `hr: number`
|
|
639
|
-
- Hit rate
|
|
640
|
-
- `far: number`
|
|
641
|
-
- False alarm rate
|
|
642
|
-
- `ppv: number`
|
|
643
|
-
- Positive predictive value
|
|
644
|
-
- `fomr: number`
|
|
645
|
-
- False omission rate
|
|
646
|
-
- `acc: number`
|
|
647
|
-
- Accuracy
|
|
648
|
-
|
|
649
|
-
##### Example
|
|
650
|
-
|
|
651
|
-
```html
|
|
652
|
-
<detectable-table interactive numeric summary="stimulusRates responseRates accuracy" = color="outcome" hits="80" misses="20" false-alarms="35" correct-rejections="65" payoff hit-payoff="60" miss-payoff="-60" false-alarm-payoff="-40" correct-rejection-payoff="40"></detectable-table>
|
|
653
|
-
```
|
|
654
|
-
|
|
655
655
|
### Equations
|
|
656
656
|
|
|
657
657
|
Interactive equations for SDT
|
|
@@ -1046,7 +1046,7 @@ export default class SDTEquationSomething extends SDTEquation {
|
|
|
1046
1046
|
}
|
|
1047
1047
|
```
|
|
1048
1048
|
|
|
1049
|
-
`SDTEquation` extends `DetectableElement` extends `
|
|
1049
|
+
`SDTEquation` extends `DetectableElement` extends `DecidablesElement` extends `LitElement`
|
|
1050
1050
|
|
|
1051
1051
|
### Examples
|
|
1052
1052
|
|
|
@@ -1287,7 +1287,7 @@ export default class DetectableExampleSomething extends DetectableExample {
|
|
|
1287
1287
|
}
|
|
1288
1288
|
```
|
|
1289
1289
|
|
|
1290
|
-
`DetectableExample` extends `DetectableElement` extends `
|
|
1290
|
+
`DetectableExample` extends `DetectableElement` extends `DecidablesElement` extends `LitElement`
|
|
1291
1291
|
|
|
1292
1292
|
### Base class
|
|
1293
1293
|
|
|
@@ -1303,7 +1303,7 @@ export default class DetectableElementSomething extends DetectableElement {
|
|
|
1303
1303
|
}
|
|
1304
1304
|
```
|
|
1305
1305
|
|
|
1306
|
-
`DetectableElement` extends `
|
|
1306
|
+
`DetectableElement` extends `DecidablesElement` extends `LitElement`
|
|
1307
1307
|
|
|
1308
1308
|
## Development
|
|
1309
1309
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decidables/detectable-elements",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "detectable-elements: Web Components for visualizing Signal Detection Theory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web component",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@decidables/decidables-elements": "^0.3.1",
|
|
60
|
-
"@decidables/detectable-math": "^0.1.
|
|
60
|
+
"@decidables/detectable-math": "^0.1.2",
|
|
61
61
|
"d3": "^7.3.0",
|
|
62
62
|
"jstat": "^1.9.5",
|
|
63
63
|
"lit": "^2.2.1"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "269fba00d14e58101b4bf26974411298c162869b"
|
|
66
66
|
}
|