@decidables/detectable-elements 0.2.7 → 0.2.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decidables/detectable-elements",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "detectable-elements: Web Components for visualizing Signal Detection Theory",
5
5
  "keywords": [
6
6
  "web component",
@@ -62,5 +62,5 @@
62
62
  "jstat": "^1.9.6",
63
63
  "lit": "^3.1.0"
64
64
  },
65
- "gitHead": "84c6fb7df16db2086e9f20496f873e67e05c56b4"
65
+ "gitHead": "eb7854f55122ecc8cca629bb95ec4b20e286f9d2"
66
66
  }
@@ -121,17 +121,17 @@ export default class DetectableTable extends DetectableElement {
121
121
  this.colors = ['none', 'accuracy', 'stimulus', 'response', 'outcome', 'all'];
122
122
  this.color = 'all';
123
123
 
124
- this.h = 40;
125
- this.m = 60;
126
- this.fa = 75;
127
- this.cr = 25;
128
- this.alignState();
129
-
130
124
  this.payoff = false;
131
125
  this.hPayoff = undefined; // Hit payoff
132
126
  this.mPayoff = undefined; // Miss payoff
133
127
  this.crPayoff = undefined; // Correct Rejection payoff
134
128
  this.faPayoff = undefined; // False Alarm payoff
129
+
130
+ this.h = 40;
131
+ this.m = 60;
132
+ this.fa = 75;
133
+ this.cr = 25;
134
+ this.alignState();
135
135
  }
136
136
 
137
137
  alignState() {
@@ -442,6 +442,10 @@ export default class DetectableTable extends DetectableElement {
442
442
  ];
443
443
  }
444
444
 
445
+ willUpdate() {
446
+ this.alignState();
447
+ }
448
+
445
449
  render() {
446
450
  const payoffFormatter = new Intl.NumberFormat('en-US', {
447
451
  style: 'currency',
@@ -458,7 +462,6 @@ export default class DetectableTable extends DetectableElement {
458
462
  }).reduce((string, part) => { return string + part; });
459
463
  };
460
464
 
461
- this.alignState();
462
465
  let h;
463
466
  let m;
464
467
  let fa;
@@ -363,11 +363,13 @@ export default class ROCSpace extends DecidablesMixinResizeable(DetectableElemen
363
363
  `;
364
364
  }
365
365
 
366
+ willUpdate() {
367
+ this.alignState();
368
+ }
369
+
366
370
  update(changedProperties) {
367
371
  super.update(changedProperties);
368
372
 
369
- this.alignState();
370
-
371
373
  // Bail out if we can't get the width/height/rem
372
374
  if (Number.isNaN(this.width) || Number.isNaN(this.height) || Number.isNaN(this.rem)) {
373
375
  return;
@@ -477,11 +477,13 @@ export default class SDTModel extends DecidablesMixinResizeable(DetectableElemen
477
477
  }));
478
478
  }
479
479
 
480
+ willUpdate() {
481
+ this.alignState();
482
+ }
483
+
480
484
  update(changedProperties) {
481
485
  super.update(changedProperties);
482
486
 
483
- this.alignState();
484
-
485
487
  // Bail out if we can't get the width/height
486
488
  if (Number.isNaN(this.width) || Number.isNaN(this.height) || Number.isNaN(this.rem)) {
487
489
  return;
@@ -88,8 +88,11 @@ export default class SDTEquationDC2Far extends SDTEquation {
88
88
  this.sendEvent();
89
89
  }
90
90
 
91
- render() {
91
+ willUpdate() {
92
92
  this.alignState();
93
+ }
94
+
95
+ render() {
93
96
  let d;
94
97
  let c;
95
98
  let s;
@@ -88,8 +88,11 @@ export default class SDTEquationDC2Hr extends SDTEquation {
88
88
  this.sendEvent();
89
89
  }
90
90
 
91
- render() {
91
+ willUpdate() {
92
92
  this.alignState();
93
+ }
94
+
95
+ render() {
93
96
  let d;
94
97
  let c;
95
98
  let s;
@@ -68,8 +68,11 @@ export default class SDTEquationFaCr2Far extends SDTEquation {
68
68
  this.sendEvent();
69
69
  }
70
70
 
71
- render() {
71
+ willUpdate() {
72
72
  this.alignState();
73
+ }
74
+
75
+ render() {
73
76
  let fa;
74
77
  let cr;
75
78
  let far;
@@ -68,8 +68,11 @@ export default class SDTEquationHFa2Ppv extends SDTEquation {
68
68
  this.sendEvent();
69
69
  }
70
70
 
71
- render() {
71
+ willUpdate() {
72
72
  this.alignState();
73
+ }
74
+
75
+ render() {
73
76
  let h;
74
77
  let fa;
75
78
  let ppv;
@@ -68,8 +68,11 @@ export default class SDTEquationHM2Hr extends SDTEquation {
68
68
  this.sendEvent();
69
69
  }
70
70
 
71
- render() {
71
+ willUpdate() {
72
72
  this.alignState();
73
+ }
74
+
75
+ render() {
73
76
  let h;
74
77
  let m;
75
78
  let hr;
@@ -94,8 +94,11 @@ export default class SDTEquationHMFaCr2Acc extends SDTEquation {
94
94
  this.sendEvent();
95
95
  }
96
96
 
97
- render() {
97
+ willUpdate() {
98
98
  this.alignState();
99
+ }
100
+
101
+ render() {
99
102
  let h;
100
103
  let m;
101
104
  let fa;
@@ -88,8 +88,11 @@ export default class SDTEquationHrFar2C extends SDTEquation {
88
88
  this.sendEvent();
89
89
  }
90
90
 
91
- render() {
91
+ willUpdate() {
92
92
  this.alignState();
93
+ }
94
+
95
+ render() {
93
96
  let hr;
94
97
  let far;
95
98
  let s;
@@ -88,8 +88,11 @@ export default class SDTEquationHrFar2D extends SDTEquation {
88
88
  this.sendEvent();
89
89
  }
90
90
 
91
- render() {
91
+ willUpdate() {
92
92
  this.alignState();
93
+ }
94
+
95
+ render() {
93
96
  let hr;
94
97
  let far;
95
98
  let s;
@@ -68,8 +68,11 @@ export default class SDTEquationMCr2Fomr extends SDTEquation {
68
68
  this.sendEvent();
69
69
  }
70
70
 
71
- render() {
71
+ willUpdate() {
72
72
  this.alignState();
73
+ }
74
+
75
+ render() {
73
76
  let m;
74
77
  let cr;
75
78
  let fomr;
@@ -8,7 +8,9 @@ import SDTExample from './sdt-example';
8
8
  <sdt-example-interactive>
9
9
  */
10
10
  export default class SDTExampleDoubleInteractive extends SDTExample {
11
- firstUpdated(/* changedProperties */) {
11
+ connectedCallback() {
12
+ super.connectedCallback();
13
+
12
14
  this.one = {};
13
15
  this.one.h = 95;
14
16
  this.one.m = 5;
@@ -8,7 +8,9 @@ import SDTExample from './sdt-example';
8
8
  <sdt-example-human>
9
9
  */
10
10
  export default class SDTExampleHuman extends SDTExample {
11
- firstUpdated(/* changedProperties */) {
11
+ connectedCallback() {
12
+ super.connectedCallback();
13
+
12
14
  this.count = 1;
13
15
 
14
16
  this.detectableControl = this.querySelector('detectable-control');
@@ -8,7 +8,9 @@ import SDTExample from './sdt-example';
8
8
  <sdt-example-interactive>
9
9
  */
10
10
  export default class SDTExampleInteractive extends SDTExample {
11
- firstUpdated(/* changedProperties */) {
11
+ connectedCallback() {
12
+ super.connectedCallback();
13
+
12
14
  this.detectableControl = this.querySelector('detectable-control');
13
15
  this.detectableTable = this.querySelector('detectable-table');
14
16
  this.rocSpace = this.querySelector('roc-space');
@@ -8,7 +8,9 @@ import SDTExample from './sdt-example';
8
8
  <sdt-example-model>
9
9
  */
10
10
  export default class SDTExampleModel extends SDTExample {
11
- firstUpdated(/* changedProperties */) {
11
+ connectedCallback() {
12
+ super.connectedCallback();
13
+
12
14
  this.count = 1;
13
15
 
14
16
  this.detectableControl = this.querySelector('detectable-control');
@@ -30,7 +30,9 @@ export default class SDTExampleMultiple extends SDTExample {
30
30
  this.values = [0, 1];
31
31
  }
32
32
 
33
- firstUpdated(/* changedProperties */) {
33
+ connectedCallback() {
34
+ super.connectedCallback();
35
+
34
36
  this.detectableControl = this.querySelector('detectable-control');
35
37
  this.rocSpace = this.querySelector('roc-space');
36
38
  this.sdtModel = this.querySelector('sdt-model');
@@ -7,7 +7,9 @@ import SDTExample from './sdt-example';
7
7
  <sdt-example-unequal>
8
8
  */
9
9
  export default class SDTExampleUnequal extends SDTExample {
10
- firstUpdated(/* changedProperties */) {
10
+ connectedCallback() {
11
+ super.connectedCallback();
12
+
11
13
  this.detectableControl = this.querySelector('detectable-control');
12
14
  this.rocSpace = this.querySelector('roc-space');
13
15
  this.sdtModel = this.querySelector('sdt-model');