@decidables/accumulable-elements 0.3.6 → 0.3.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/CHANGELOG.md +17 -0
- package/lib/accumulableElements.esm.js +69 -74
- package/lib/accumulableElements.esm.js.map +1 -1
- package/lib/accumulableElements.esm.min.js +121 -87
- package/lib/accumulableElements.esm.min.js.map +1 -1
- package/lib/accumulableElements.umd.js +69 -74
- package/lib/accumulableElements.umd.js.map +1 -1
- package/lib/accumulableElements.umd.min.js +125 -91
- package/lib/accumulableElements.umd.min.js.map +1 -1
- package/package.json +5 -5
- package/src/components/accumulable-control.js +1 -1
- package/src/components/accumulable-response.js +1 -1
- package/src/components/accumulable-table.js +1 -1
- package/src/components/ddm-fit.js +1 -1
- package/src/components/ddm-model.js +67 -27
- package/src/components/ddm-parameters.js +1 -1
- package/src/components/rdk-2afc-task.js +1 -1
- package/src/examples/ddm-example.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decidables/accumulable-elements",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "accumulable-elements: Web Components for visualizing the Diffusion Decision Model",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web component",
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@decidables/accumulable-math": "^0.2.5",
|
|
58
|
-
"@decidables/decidables-elements": "^0.5.
|
|
59
|
-
"@lit-labs/motion": "^1.0
|
|
58
|
+
"@decidables/decidables-elements": "^0.5.7",
|
|
59
|
+
"@lit-labs/motion": "^1.1.0",
|
|
60
60
|
"@observablehq/plot": "^0.6.17",
|
|
61
61
|
"bayes.js": "https://github.com/akrawitz/bayes.js.git#commit=c7b091b75f85a86b6a3965a983b31e23d9ef456f",
|
|
62
62
|
"d3": "^7.9.0",
|
|
63
|
-
"lit": "^3.3.
|
|
63
|
+
"lit": "^3.3.2"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "6fcd31a19c082ec41bde7d351bcb52161c5b654b"
|
|
66
66
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {css, html} from 'lit';
|
|
2
|
+
import {css, html, render} from 'lit';
|
|
3
3
|
import * as d3 from 'd3';
|
|
4
4
|
|
|
5
5
|
import DDMMath from '@decidables/accumulable-math';
|
|
@@ -477,31 +477,50 @@ export default class DDMModel extends DecidablesMixinResizeable(AccumulableEleme
|
|
|
477
477
|
/*
|
|
478
478
|
OVERLAYER
|
|
479
479
|
*/
|
|
480
|
-
.interactive {
|
|
480
|
+
.boundary.interactive {
|
|
481
|
+
cursor: ns-resize;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.t0z.interactive {
|
|
485
|
+
cursor: move;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.boundary.interactive,
|
|
489
|
+
.t0z.interactive {
|
|
481
490
|
filter: url("#shadow-2");
|
|
482
491
|
outline: none;
|
|
483
492
|
}
|
|
484
493
|
|
|
485
|
-
.interactive:hover
|
|
494
|
+
.boundary.interactive:hover,
|
|
495
|
+
.t0z.interactive:hover {
|
|
486
496
|
filter: url("#shadow-4");
|
|
497
|
+
|
|
498
|
+
/* HACK: This gets Safari to correctly apply the filter! */
|
|
499
|
+
/* https://github.com/emilbjorklund/svg-weirdness/issues/27 */
|
|
500
|
+
transform: translateX(0);
|
|
487
501
|
}
|
|
488
502
|
|
|
489
|
-
.interactive:active
|
|
503
|
+
.boundary.interactive:active,
|
|
504
|
+
.t0z.interactive:active {
|
|
490
505
|
filter: url("#shadow-8");
|
|
506
|
+
|
|
507
|
+
/* HACK: This gets Safari to correctly apply the filter! */
|
|
508
|
+
transform: translateY(0);
|
|
491
509
|
}
|
|
492
510
|
|
|
493
|
-
:host(.keyboard) .interactive:focus
|
|
511
|
+
:host(.keyboard) .boundary.interactive:focus,
|
|
512
|
+
:host(.keyboard) .t0z.interactive:focus {
|
|
494
513
|
filter: url("#shadow-8");
|
|
495
|
-
}
|
|
496
514
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
stroke: var(---color-element-emphasis);
|
|
500
|
-
stroke-width: 2;
|
|
515
|
+
/* HACK: This gets Safari to correctly apply the filter! */
|
|
516
|
+
transform: translateZ(0);
|
|
501
517
|
}
|
|
502
518
|
|
|
503
|
-
.
|
|
504
|
-
|
|
519
|
+
.t0z .point {
|
|
520
|
+
fill: var(---color-element-emphasis);
|
|
521
|
+
stroke-width: 0;
|
|
522
|
+
|
|
523
|
+
r: 6px;
|
|
505
524
|
}
|
|
506
525
|
|
|
507
526
|
.drift {
|
|
@@ -515,21 +534,38 @@ export default class DDMModel extends DecidablesMixinResizeable(AccumulableEleme
|
|
|
515
534
|
|
|
516
535
|
.drift.interactive {
|
|
517
536
|
cursor: ns-resize;
|
|
537
|
+
|
|
538
|
+
filter: url("#shadow-2");
|
|
539
|
+
outline: none;
|
|
540
|
+
|
|
541
|
+
/* HACK: This gets Safari to correctly apply the filter! */
|
|
542
|
+
fill: #000000;
|
|
543
|
+
fill-opacity: 0;
|
|
518
544
|
}
|
|
519
545
|
|
|
520
|
-
.drift
|
|
521
|
-
|
|
546
|
+
.drift.interactive:hover {
|
|
547
|
+
filter: url("#shadow-4");
|
|
548
|
+
|
|
549
|
+
/* HACK: This gets Safari to correctly apply the filter! */
|
|
550
|
+
fill: #ff0000;
|
|
522
551
|
}
|
|
523
552
|
|
|
524
|
-
.
|
|
525
|
-
|
|
553
|
+
.drift.interactive:active {
|
|
554
|
+
filter: url("#shadow-8");
|
|
555
|
+
|
|
556
|
+
/* HACK: This gets Safari to correctly apply the filter! */
|
|
557
|
+
fill: #00ff00;
|
|
526
558
|
}
|
|
527
559
|
|
|
528
|
-
.
|
|
529
|
-
|
|
530
|
-
stroke-width: 0;
|
|
560
|
+
:host(.keyboard) .drift.interactive:focus {
|
|
561
|
+
filter: url("#shadow-8");
|
|
531
562
|
|
|
532
|
-
|
|
563
|
+
/* HACK: This gets Safari to correctly apply the filter! */
|
|
564
|
+
fill: #0000ff;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.drift .arrow {
|
|
568
|
+
stroke-dasharray: none;
|
|
533
569
|
}
|
|
534
570
|
|
|
535
571
|
/* Make larger targets for touch users */
|
|
@@ -938,12 +974,16 @@ export default class DDMModel extends DecidablesMixinResizeable(AccumulableEleme
|
|
|
938
974
|
// ENTER
|
|
939
975
|
const svgEnter = svgUpdate.enter().append('svg')
|
|
940
976
|
.classed('main', true)
|
|
941
|
-
.
|
|
942
|
-
|
|
977
|
+
.each((datum, index, nodes) => {
|
|
978
|
+
// Filters for shadows
|
|
979
|
+
render(AccumulableElement.svgFilters, nodes[index]);
|
|
980
|
+
});
|
|
981
|
+
const svgMarkers = svgEnter.append('defs')
|
|
982
|
+
.classed('markers', true);
|
|
943
983
|
// Arrowhead marker for measures
|
|
944
984
|
const measureArrow = (parameter) => {
|
|
945
985
|
/* Hack to avoid lack of context-stroke and context-fill in Safari */
|
|
946
|
-
|
|
986
|
+
svgMarkers.append('marker')
|
|
947
987
|
.attr('id', `measure-arrow-${parameter}`)
|
|
948
988
|
.attr('class', `measure-arrow ${parameter}`)
|
|
949
989
|
.attr('orient', 'auto-start-reverse')
|
|
@@ -959,7 +999,7 @@ export default class DDMModel extends DecidablesMixinResizeable(AccumulableEleme
|
|
|
959
999
|
};
|
|
960
1000
|
const measureCappedArrow = (parameter) => {
|
|
961
1001
|
/* Hack to avoid lack of context-stroke and context-fill in Safari */
|
|
962
|
-
const marker =
|
|
1002
|
+
const marker = svgMarkers.append('marker')
|
|
963
1003
|
.attr('id', `measure-capped-arrow-${parameter}`)
|
|
964
1004
|
.attr('class', `measure-arrow capped ${parameter}`)
|
|
965
1005
|
.attr('orient', 'auto-start-reverse')
|
|
@@ -986,7 +1026,7 @@ export default class DDMModel extends DecidablesMixinResizeable(AccumulableEleme
|
|
|
986
1026
|
// Flat markers for SDs
|
|
987
1027
|
const sdCap = (outcome) => {
|
|
988
1028
|
/* Hack to avoid lack of context-stroke and context-fill in Safari */
|
|
989
|
-
|
|
1029
|
+
svgMarkers.append('marker')
|
|
990
1030
|
.attr('id', `model-sd-cap-${outcome}`)
|
|
991
1031
|
.attr('class', `model-sd cap ${outcome}`)
|
|
992
1032
|
.attr('orient', 'auto-start-reverse')
|
|
@@ -1001,7 +1041,7 @@ export default class DDMModel extends DecidablesMixinResizeable(AccumulableEleme
|
|
|
1001
1041
|
.attr('fill', 'context-stroke')
|
|
1002
1042
|
.attr('stroke-width', '2')
|
|
1003
1043
|
.attr('d', 'M 0 -4 l 0 8');
|
|
1004
|
-
|
|
1044
|
+
svgMarkers.append('marker')
|
|
1005
1045
|
.attr('id', `data-sd-cap-${outcome}`)
|
|
1006
1046
|
.attr('class', `data-sd cap ${outcome}`)
|
|
1007
1047
|
.attr('orient', 'auto-start-reverse')
|
|
@@ -1019,7 +1059,7 @@ export default class DDMModel extends DecidablesMixinResizeable(AccumulableEleme
|
|
|
1019
1059
|
};
|
|
1020
1060
|
sdCap('error');
|
|
1021
1061
|
sdCap('correct');
|
|
1022
|
-
const gradient =
|
|
1062
|
+
const gradient = svgMarkers.append('linearGradient')
|
|
1023
1063
|
.attr('id', 'path-animate')
|
|
1024
1064
|
.attr('gradientUnits', 'userSpaceOnUse')
|
|
1025
1065
|
.attr('color-interpolation', 'linearRGB')
|