@decidables/prospectable-elements 0.5.1 → 0.6.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 +23 -0
- package/lib/prospectableElements.esm.js +948 -972
- package/lib/prospectableElements.esm.js.map +1 -1
- package/lib/prospectableElements.esm.min.js +199 -223
- package/lib/prospectableElements.esm.min.js.map +1 -1
- package/lib/prospectableElements.umd.js +948 -972
- package/lib/prospectableElements.umd.js.map +1 -1
- package/lib/prospectableElements.umd.min.js +199 -223
- package/lib/prospectableElements.umd.min.js.map +1 -1
- package/package.json +8 -7
- package/src/components/cpt-parameters.js +1 -0
- package/src/components/cpt-probability.js +7 -7
- package/src/components/cpt-space.js +99 -25
- package/src/components/cpt-value.js +8 -8
- package/src/components/decision-space.js +99 -25
- package/src/components/prospectable-response.js +2 -0
- package/src/components/risky-option.js +18 -21
- package/src/equations/cpt-equation.js +2 -0
|
@@ -107,7 +107,7 @@ const {
|
|
|
107
107
|
hasChanged: f$3
|
|
108
108
|
};
|
|
109
109
|
Symbol.metadata ??= Symbol("metadata"), a$3.litPropertyMetadata ??= new WeakMap();
|
|
110
|
-
let y$
|
|
110
|
+
let y$2 = class y extends HTMLElement {
|
|
111
111
|
static addInitializer(t) {
|
|
112
112
|
this._$Ei(), (this.l ??= []).push(t);
|
|
113
113
|
}
|
|
@@ -311,10 +311,10 @@ let y$3 = class y extends HTMLElement {
|
|
|
311
311
|
updated(t) {}
|
|
312
312
|
firstUpdated(t) {}
|
|
313
313
|
};
|
|
314
|
-
y$
|
|
314
|
+
y$2.elementStyles = [], y$2.shadowRootOptions = {
|
|
315
315
|
mode: "open"
|
|
316
|
-
}, y$
|
|
317
|
-
ReactiveElement: y$
|
|
316
|
+
}, y$2[d$2("elementProperties")] = new Map(), y$2[d$2("finalized")] = new Map(), p$1?.({
|
|
317
|
+
ReactiveElement: y$2
|
|
318
318
|
}), (a$3.reactiveElementVersions ??= []).push("2.1.1");
|
|
319
319
|
|
|
320
320
|
/**
|
|
@@ -344,13 +344,13 @@ const t$1 = globalThis,
|
|
|
344
344
|
p = /'/g,
|
|
345
345
|
g$1 = /"/g,
|
|
346
346
|
$ = /^(?:script|style|textarea|title)$/i,
|
|
347
|
-
y$
|
|
347
|
+
y$1 = t => (i, ...s) => ({
|
|
348
348
|
_$litType$: t,
|
|
349
349
|
strings: i,
|
|
350
350
|
values: s
|
|
351
351
|
}),
|
|
352
|
-
x$
|
|
353
|
-
b$1 = y$
|
|
352
|
+
x$2 = y$1(1),
|
|
353
|
+
b$1 = y$1(2),
|
|
354
354
|
T = Symbol.for("lit-noChange"),
|
|
355
355
|
E$1 = Symbol.for("lit-nothing"),
|
|
356
356
|
A$2 = new WeakMap(),
|
|
@@ -472,7 +472,7 @@ let M$1 = class M {
|
|
|
472
472
|
for (; void 0 !== l;) {
|
|
473
473
|
if (o === l.index) {
|
|
474
474
|
let i;
|
|
475
|
-
2 === l.type ? i = new R(h, h.nextSibling, this, t) : 1 === l.type ? i = new l.ctor(h, l.name, l.strings, this, t) : 6 === l.type && (i = new z
|
|
475
|
+
2 === l.type ? i = new R(h, h.nextSibling, this, t) : 1 === l.type ? i = new l.ctor(h, l.name, l.strings, this, t) : 6 === l.type && (i = new z(h, this, t)), this._$AV.push(i), l = s[++n];
|
|
476
476
|
}
|
|
477
477
|
o !== l?.index && (h = C$1.nextNode(), o++);
|
|
478
478
|
}
|
|
@@ -602,7 +602,7 @@ class L extends k$1 {
|
|
|
602
602
|
"function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
|
-
|
|
605
|
+
class z {
|
|
606
606
|
constructor(t, i, s) {
|
|
607
607
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = i, this.options = s;
|
|
608
608
|
}
|
|
@@ -612,7 +612,7 @@ let z$1 = class z {
|
|
|
612
612
|
_$AI(t) {
|
|
613
613
|
S(this, t);
|
|
614
614
|
}
|
|
615
|
-
}
|
|
615
|
+
}
|
|
616
616
|
const j$1 = t$1.litHtmlPolyfillSupport;
|
|
617
617
|
j$1?.(N$1, R), (t$1.litHtmlVersions ??= []).push("3.3.1");
|
|
618
618
|
const B$1 = (t, i, s) => {
|
|
@@ -631,7 +631,7 @@ const B$1 = (t, i, s) => {
|
|
|
631
631
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
632
632
|
*/
|
|
633
633
|
const s$2 = globalThis;
|
|
634
|
-
let i$2 = class i extends y$
|
|
634
|
+
let i$2 = class i extends y$2 {
|
|
635
635
|
constructor() {
|
|
636
636
|
super(...arguments), this.renderOptions = {
|
|
637
637
|
host: this
|
|
@@ -1016,7 +1016,7 @@ function permute(source, keys) {
|
|
|
1016
1016
|
return Array.from(keys, key => source[key]);
|
|
1017
1017
|
}
|
|
1018
1018
|
|
|
1019
|
-
function sort$
|
|
1019
|
+
function sort$1(values, ...F) {
|
|
1020
1020
|
if (typeof values[Symbol.iterator] !== "function") throw new TypeError("values is not iterable");
|
|
1021
1021
|
values = Array.from(values);
|
|
1022
1022
|
let [f] = F;
|
|
@@ -1052,7 +1052,7 @@ function ascendingDefined$1(a, b) {
|
|
|
1052
1052
|
}
|
|
1053
1053
|
|
|
1054
1054
|
function groupSort(values, reduce, key) {
|
|
1055
|
-
return (reduce.length !== 2 ? sort$
|
|
1055
|
+
return (reduce.length !== 2 ? sort$1(rollup(values, reduce, key), ([ak, av], [bk, bv]) => ascending$1(av, bv) || ascending$1(ak, bk)) : sort$1(group(values, key), ([ak, av], [bk, bv]) => reduce(av, bv) || ascending$1(ak, bk))).map(([key]) => key);
|
|
1056
1056
|
}
|
|
1057
1057
|
|
|
1058
1058
|
const e10 = Math.sqrt(50),
|
|
@@ -7240,7 +7240,7 @@ function pointish(scale) {
|
|
|
7240
7240
|
};
|
|
7241
7241
|
return scale;
|
|
7242
7242
|
}
|
|
7243
|
-
function point$
|
|
7243
|
+
function point$4() {
|
|
7244
7244
|
return pointish(band.apply(null, arguments).paddingInner(1));
|
|
7245
7245
|
}
|
|
7246
7246
|
|
|
@@ -9246,21 +9246,21 @@ function curveLinear (context) {
|
|
|
9246
9246
|
return new Linear(context);
|
|
9247
9247
|
}
|
|
9248
9248
|
|
|
9249
|
-
function x$
|
|
9249
|
+
function x$1(p) {
|
|
9250
9250
|
return p[0];
|
|
9251
9251
|
}
|
|
9252
|
-
function y
|
|
9252
|
+
function y(p) {
|
|
9253
9253
|
return p[1];
|
|
9254
9254
|
}
|
|
9255
9255
|
|
|
9256
|
-
function shapeLine (x, y) {
|
|
9256
|
+
function shapeLine (x, y$1) {
|
|
9257
9257
|
var defined = constant$1(true),
|
|
9258
9258
|
context = null,
|
|
9259
9259
|
curve = curveLinear,
|
|
9260
9260
|
output = null,
|
|
9261
9261
|
path = withPath(line);
|
|
9262
|
-
x = typeof x === "function" ? x : x === undefined ? x$
|
|
9263
|
-
y = typeof y === "function" ? y : y === undefined ? y
|
|
9262
|
+
x = typeof x === "function" ? x : x === undefined ? x$1 : constant$1(x);
|
|
9263
|
+
y$1 = typeof y$1 === "function" ? y$1 : y$1 === undefined ? y : constant$1(y$1);
|
|
9264
9264
|
function line(data) {
|
|
9265
9265
|
var i,
|
|
9266
9266
|
n = (data = array(data)).length,
|
|
@@ -9272,7 +9272,7 @@ function shapeLine (x, y) {
|
|
|
9272
9272
|
if (!(i < n && defined(d = data[i], i, data)) === defined0) {
|
|
9273
9273
|
if (defined0 = !defined0) output.lineStart();else output.lineEnd();
|
|
9274
9274
|
}
|
|
9275
|
-
if (defined0) output.point(+x(d, i, data), +y(d, i, data));
|
|
9275
|
+
if (defined0) output.point(+x(d, i, data), +y$1(d, i, data));
|
|
9276
9276
|
}
|
|
9277
9277
|
if (buffer) return output = null, buffer + "" || null;
|
|
9278
9278
|
}
|
|
@@ -9280,7 +9280,7 @@ function shapeLine (x, y) {
|
|
|
9280
9280
|
return arguments.length ? (x = typeof _ === "function" ? _ : constant$1(+_), line) : x;
|
|
9281
9281
|
};
|
|
9282
9282
|
line.y = function (_) {
|
|
9283
|
-
return arguments.length ? (y = typeof _ === "function" ? _ : constant$1(+_), line) : y;
|
|
9283
|
+
return arguments.length ? (y$1 = typeof _ === "function" ? _ : constant$1(+_), line) : y$1;
|
|
9284
9284
|
};
|
|
9285
9285
|
line.defined = function (_) {
|
|
9286
9286
|
return arguments.length ? (defined = typeof _ === "function" ? _ : constant$1(!!_), line) : defined;
|
|
@@ -9602,7 +9602,7 @@ const symbolsStroke = [symbolCircle, symbolPlus, symbolTimes, symbolTriangle2, s
|
|
|
9602
9602
|
|
|
9603
9603
|
function noop () {}
|
|
9604
9604
|
|
|
9605
|
-
function point$
|
|
9605
|
+
function point$3(that, x, y) {
|
|
9606
9606
|
that._context.bezierCurveTo((2 * that._x0 + that._x1) / 3, (2 * that._y0 + that._y1) / 3, (that._x0 + 2 * that._x1) / 3, (that._y0 + 2 * that._y1) / 3, (that._x0 + 4 * that._x1 + x) / 6, (that._y0 + 4 * that._y1 + y) / 6);
|
|
9607
9607
|
}
|
|
9608
9608
|
function Basis(context) {
|
|
@@ -9622,7 +9622,7 @@ Basis.prototype = {
|
|
|
9622
9622
|
lineEnd: function () {
|
|
9623
9623
|
switch (this._point) {
|
|
9624
9624
|
case 3:
|
|
9625
|
-
point$
|
|
9625
|
+
point$3(this, this._x1, this._y1);
|
|
9626
9626
|
// falls through
|
|
9627
9627
|
case 2:
|
|
9628
9628
|
this._context.lineTo(this._x1, this._y1);
|
|
@@ -9646,7 +9646,7 @@ Basis.prototype = {
|
|
|
9646
9646
|
this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6);
|
|
9647
9647
|
// falls through
|
|
9648
9648
|
default:
|
|
9649
|
-
point$
|
|
9649
|
+
point$3(this, x, y);
|
|
9650
9650
|
break;
|
|
9651
9651
|
}
|
|
9652
9652
|
this._x0 = this._x1, this._x1 = x;
|
|
@@ -9708,7 +9708,7 @@ BasisClosed.prototype = {
|
|
|
9708
9708
|
this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6);
|
|
9709
9709
|
break;
|
|
9710
9710
|
default:
|
|
9711
|
-
point$
|
|
9711
|
+
point$3(this, x, y);
|
|
9712
9712
|
break;
|
|
9713
9713
|
}
|
|
9714
9714
|
this._x0 = this._x1, this._x1 = x;
|
|
@@ -9756,7 +9756,7 @@ BasisOpen.prototype = {
|
|
|
9756
9756
|
this._point = 4;
|
|
9757
9757
|
// falls through
|
|
9758
9758
|
default:
|
|
9759
|
-
point$
|
|
9759
|
+
point$3(this, x, y);
|
|
9760
9760
|
break;
|
|
9761
9761
|
}
|
|
9762
9762
|
this._x0 = this._x1, this._x1 = x;
|
|
@@ -9811,7 +9811,7 @@ var curveBundle = (function custom(beta) {
|
|
|
9811
9811
|
return bundle;
|
|
9812
9812
|
})(0.85);
|
|
9813
9813
|
|
|
9814
|
-
function point$
|
|
9814
|
+
function point$2(that, x, y) {
|
|
9815
9815
|
that._context.bezierCurveTo(that._x1 + that._k * (that._x2 - that._x0), that._y1 + that._k * (that._y2 - that._y0), that._x2 + that._k * (that._x1 - x), that._y2 + that._k * (that._y1 - y), that._x2, that._y2);
|
|
9816
9816
|
}
|
|
9817
9817
|
function Cardinal(context, tension) {
|
|
@@ -9835,7 +9835,7 @@ Cardinal.prototype = {
|
|
|
9835
9835
|
this._context.lineTo(this._x2, this._y2);
|
|
9836
9836
|
break;
|
|
9837
9837
|
case 3:
|
|
9838
|
-
point$
|
|
9838
|
+
point$2(this, this._x1, this._y1);
|
|
9839
9839
|
break;
|
|
9840
9840
|
}
|
|
9841
9841
|
if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
|
|
@@ -9856,7 +9856,7 @@ Cardinal.prototype = {
|
|
|
9856
9856
|
this._point = 3;
|
|
9857
9857
|
// falls through
|
|
9858
9858
|
default:
|
|
9859
|
-
point$
|
|
9859
|
+
point$2(this, x, y);
|
|
9860
9860
|
break;
|
|
9861
9861
|
}
|
|
9862
9862
|
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
|
|
@@ -9923,7 +9923,7 @@ CardinalClosed.prototype = {
|
|
|
9923
9923
|
this._x5 = x, this._y5 = y;
|
|
9924
9924
|
break;
|
|
9925
9925
|
default:
|
|
9926
|
-
point$
|
|
9926
|
+
point$2(this, x, y);
|
|
9927
9927
|
break;
|
|
9928
9928
|
}
|
|
9929
9929
|
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
|
|
@@ -9976,7 +9976,7 @@ CardinalOpen.prototype = {
|
|
|
9976
9976
|
this._point = 4;
|
|
9977
9977
|
// falls through
|
|
9978
9978
|
default:
|
|
9979
|
-
point$
|
|
9979
|
+
point$2(this, x, y);
|
|
9980
9980
|
break;
|
|
9981
9981
|
}
|
|
9982
9982
|
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
|
|
@@ -9993,7 +9993,7 @@ var curveCardinalOpen = (function custom(tension) {
|
|
|
9993
9993
|
return cardinal;
|
|
9994
9994
|
})(0);
|
|
9995
9995
|
|
|
9996
|
-
function point$
|
|
9996
|
+
function point$1(that, x, y) {
|
|
9997
9997
|
var x1 = that._x1,
|
|
9998
9998
|
y1 = that._y1,
|
|
9999
9999
|
x2 = that._x2,
|
|
@@ -10058,7 +10058,7 @@ CatmullRom.prototype = {
|
|
|
10058
10058
|
this._point = 3;
|
|
10059
10059
|
// falls through
|
|
10060
10060
|
default:
|
|
10061
|
-
point$
|
|
10061
|
+
point$1(this, x, y);
|
|
10062
10062
|
break;
|
|
10063
10063
|
}
|
|
10064
10064
|
this._l01_a = this._l12_a, this._l12_a = this._l23_a;
|
|
@@ -10132,7 +10132,7 @@ CatmullRomClosed.prototype = {
|
|
|
10132
10132
|
this._x5 = x, this._y5 = y;
|
|
10133
10133
|
break;
|
|
10134
10134
|
default:
|
|
10135
|
-
point$
|
|
10135
|
+
point$1(this, x, y);
|
|
10136
10136
|
break;
|
|
10137
10137
|
}
|
|
10138
10138
|
this._l01_a = this._l12_a, this._l12_a = this._l23_a;
|
|
@@ -10192,7 +10192,7 @@ CatmullRomOpen.prototype = {
|
|
|
10192
10192
|
this._point = 4;
|
|
10193
10193
|
// falls through
|
|
10194
10194
|
default:
|
|
10195
|
-
point$
|
|
10195
|
+
point$1(this, x, y);
|
|
10196
10196
|
break;
|
|
10197
10197
|
}
|
|
10198
10198
|
this._l01_a = this._l12_a, this._l12_a = this._l23_a;
|
|
@@ -10258,7 +10258,7 @@ function slope2(that, t) {
|
|
|
10258
10258
|
// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations
|
|
10259
10259
|
// "you can express cubic Hermite interpolation in terms of cubic Bézier curves
|
|
10260
10260
|
// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1".
|
|
10261
|
-
function point
|
|
10261
|
+
function point(that, t0, t1) {
|
|
10262
10262
|
var x0 = that._x0,
|
|
10263
10263
|
y0 = that._y0,
|
|
10264
10264
|
x1 = that._x1,
|
|
@@ -10286,7 +10286,7 @@ MonotoneX.prototype = {
|
|
|
10286
10286
|
this._context.lineTo(this._x1, this._y1);
|
|
10287
10287
|
break;
|
|
10288
10288
|
case 3:
|
|
10289
|
-
point
|
|
10289
|
+
point(this, this._t0, slope2(this, this._t0));
|
|
10290
10290
|
break;
|
|
10291
10291
|
}
|
|
10292
10292
|
if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
|
|
@@ -10306,10 +10306,10 @@ MonotoneX.prototype = {
|
|
|
10306
10306
|
break;
|
|
10307
10307
|
case 2:
|
|
10308
10308
|
this._point = 3;
|
|
10309
|
-
point
|
|
10309
|
+
point(this, slope2(this, t1 = slope3(this, x, y)), t1);
|
|
10310
10310
|
break;
|
|
10311
10311
|
default:
|
|
10312
|
-
point
|
|
10312
|
+
point(this, this._t0, t1 = slope3(this, x, y));
|
|
10313
10313
|
break;
|
|
10314
10314
|
}
|
|
10315
10315
|
this._x0 = this._x1, this._x1 = x;
|
|
@@ -10516,18 +10516,6 @@ class DecidablesElement extends i$2 {
|
|
|
10516
10516
|
getComputedStyleValue(property) {
|
|
10517
10517
|
return getComputedStyle(this).getPropertyValue(property).trim();
|
|
10518
10518
|
}
|
|
10519
|
-
firstUpdated(changedProperties) {
|
|
10520
|
-
super.firstUpdated(changedProperties);
|
|
10521
|
-
|
|
10522
|
-
// Use focus highlighting if keyboard is used at all
|
|
10523
|
-
select(this.renderRoot.host).classed('keyboard', true).on('mousemove.keyboard touchstart.keyboard', event => {
|
|
10524
|
-
const element = event.currentTarget;
|
|
10525
|
-
select(element.renderRoot.host).classed('keyboard', false).on('mousemove.keyboard touchstart.keyboard', null);
|
|
10526
|
-
}).on('keydown.keyboard', event => {
|
|
10527
|
-
const element = event.currentTarget;
|
|
10528
|
-
select(element.renderRoot.host).classed('keyboard', true).on('keydown.keyboard mousemove.keyboard touchstart.keyboard', null);
|
|
10529
|
-
});
|
|
10530
|
-
}
|
|
10531
10519
|
static get greys() {
|
|
10532
10520
|
const grey = '#999999';
|
|
10533
10521
|
const greys = {};
|
|
@@ -10663,7 +10651,7 @@ class DecidablesElement extends i$2 {
|
|
|
10663
10651
|
};
|
|
10664
10652
|
/* eslint-enable key-spacing, object-curly-newline */
|
|
10665
10653
|
}
|
|
10666
|
-
static cssBoxShadow(elevation,
|
|
10654
|
+
static cssBoxShadow(elevation, inverse = false) {
|
|
10667
10655
|
const umbraO = this.shadows.opacityUmbra + this.shadows.opacityBoost;
|
|
10668
10656
|
const penumbraO = this.shadows.opacityPenumbra + this.shadows.opacityBoost;
|
|
10669
10657
|
const ambientO = this.shadows.opacityAmbient + this.shadows.opacityBoost;
|
|
@@ -10673,9 +10661,9 @@ class DecidablesElement extends i$2 {
|
|
|
10673
10661
|
const umbraM = this.shadows.mapUmbra[elevation];
|
|
10674
10662
|
const penumbraM = this.shadows.mapPenumbra[elevation];
|
|
10675
10663
|
const ambientM = this.shadows.mapAmbient[elevation];
|
|
10676
|
-
const umbraS =
|
|
10677
|
-
const penumbraS =
|
|
10678
|
-
const ambientS =
|
|
10664
|
+
const umbraS = `${umbraM.y / 2}px ${umbraM.y}px ${umbraM.b}px ${umbraM.s}px`;
|
|
10665
|
+
const penumbraS = `${penumbraM.y / 2}px ${penumbraM.y}px ${penumbraM.b}px ${penumbraM.s}px`;
|
|
10666
|
+
const ambientS = `${ambientM.y / 2}px ${ambientM.y}px ${ambientM.b}px ${ambientM.s}px`;
|
|
10679
10667
|
return `${umbraS} ${umbraC}, ${penumbraS} ${penumbraC}, ${ambientS} ${ambientC}`;
|
|
10680
10668
|
}
|
|
10681
10669
|
static get svgFilters() {
|
|
@@ -10811,55 +10799,64 @@ class DecidablesButton extends DecidablesElement {
|
|
|
10811
10799
|
button {
|
|
10812
10800
|
width: 100%;
|
|
10813
10801
|
height: 100%;
|
|
10802
|
+
|
|
10814
10803
|
padding: 0.375rem 0.75rem;
|
|
10815
10804
|
|
|
10816
10805
|
font-family: var(---font-family-base);
|
|
10817
10806
|
font-size: 1.125rem;
|
|
10807
|
+
|
|
10818
10808
|
line-height: 1.5;
|
|
10809
|
+
|
|
10819
10810
|
color: var(---color-text-inverse);
|
|
10820
10811
|
|
|
10812
|
+
outline: none;
|
|
10813
|
+
|
|
10821
10814
|
border: 0;
|
|
10822
10815
|
border-radius: var(---border-radius);
|
|
10823
|
-
outline: none;
|
|
10824
10816
|
}
|
|
10825
10817
|
|
|
10826
10818
|
button:disabled {
|
|
10827
|
-
background-color: var(---decidables-button-background-color-disabled);
|
|
10828
10819
|
outline: none;
|
|
10820
|
+
|
|
10821
|
+
background-color: var(---decidables-button-background-color-disabled);
|
|
10829
10822
|
box-shadow: none;
|
|
10830
10823
|
}
|
|
10831
10824
|
|
|
10832
10825
|
button:enabled {
|
|
10833
10826
|
cursor: pointer;
|
|
10827
|
+
outline: none;
|
|
10834
10828
|
|
|
10835
10829
|
background-color: var(---decidables-button-background-color-enabled);
|
|
10836
|
-
outline: none;
|
|
10837
10830
|
box-shadow: var(---shadow-2);
|
|
10838
10831
|
}
|
|
10839
10832
|
|
|
10840
10833
|
button:enabled:hover {
|
|
10841
10834
|
outline: none;
|
|
10835
|
+
|
|
10842
10836
|
box-shadow: var(---shadow-4);
|
|
10843
10837
|
}
|
|
10844
10838
|
|
|
10845
10839
|
button:enabled:active {
|
|
10846
10840
|
outline: none;
|
|
10841
|
+
|
|
10847
10842
|
box-shadow: var(---shadow-8);
|
|
10848
10843
|
}
|
|
10849
10844
|
|
|
10850
|
-
|
|
10845
|
+
button:enabled:focus-visible {
|
|
10851
10846
|
outline: none;
|
|
10847
|
+
|
|
10852
10848
|
box-shadow: var(---shadow-4);
|
|
10853
10849
|
}
|
|
10854
10850
|
|
|
10855
|
-
|
|
10851
|
+
button:enabled:focus-visible:active {
|
|
10856
10852
|
outline: none;
|
|
10853
|
+
|
|
10857
10854
|
box-shadow: var(---shadow-8);
|
|
10858
10855
|
}
|
|
10859
10856
|
`];
|
|
10860
10857
|
}
|
|
10861
10858
|
render() {
|
|
10862
|
-
return x$
|
|
10859
|
+
return x$2`
|
|
10863
10860
|
<button ?disabled=${this.disabled}>
|
|
10864
10861
|
<slot></slot>
|
|
10865
10862
|
</button>
|
|
@@ -10970,10 +10967,6 @@ class DecidablesSlider extends DecidablesElement {
|
|
|
10970
10967
|
---decidables-slider-color: var(--decidables-slider-color, var(---color-element-enabled));
|
|
10971
10968
|
---decidables-spinner-background-color: var(--decidables-slider-background-color, none);
|
|
10972
10969
|
|
|
10973
|
-
---shadow-2-rotate: var(--shadow-2-rotate, ${r$4(this.cssBoxShadow(2, true, false))});
|
|
10974
|
-
---shadow-4-rotate: var(--shadow-4-rotate, ${r$4(this.cssBoxShadow(4, true, false))});
|
|
10975
|
-
---shadow-8-rotate: var(--shadow-8-rotate, ${r$4(this.cssBoxShadow(8, true, false))});
|
|
10976
|
-
|
|
10977
10970
|
display: flex;
|
|
10978
10971
|
|
|
10979
10972
|
flex-direction: column;
|
|
@@ -10988,12 +10981,14 @@ class DecidablesSlider extends DecidablesElement {
|
|
|
10988
10981
|
|
|
10989
10982
|
.range {
|
|
10990
10983
|
position: relative;
|
|
10984
|
+
|
|
10991
10985
|
display: flex;
|
|
10992
10986
|
|
|
10993
10987
|
flex-direction: row;
|
|
10994
10988
|
|
|
10995
10989
|
width: 3.5rem;
|
|
10996
10990
|
height: 4.75rem;
|
|
10991
|
+
|
|
10997
10992
|
margin: 0 0.25rem 0.25rem;
|
|
10998
10993
|
}
|
|
10999
10994
|
|
|
@@ -11005,21 +11000,20 @@ class DecidablesSlider extends DecidablesElement {
|
|
|
11005
11000
|
background: var(---decidables-spinner-background-color);
|
|
11006
11001
|
}
|
|
11007
11002
|
|
|
11008
|
-
/* Adapted from http://danielstern.ca/range.css/#/ */
|
|
11009
11003
|
/* Overall */
|
|
11010
11004
|
input[type=range] {
|
|
11011
|
-
width:
|
|
11012
|
-
height:
|
|
11005
|
+
width: 3.5rem;
|
|
11006
|
+
height: 4.75rem;
|
|
11007
|
+
|
|
11013
11008
|
padding: 0;
|
|
11014
11009
|
margin: 0;
|
|
11010
|
+
|
|
11011
|
+
appearance: none;
|
|
11015
11012
|
|
|
11016
11013
|
background-color: unset;
|
|
11017
11014
|
|
|
11018
|
-
|
|
11019
|
-
|
|
11020
|
-
|
|
11021
|
-
/* stylelint-disable-next-line property-no-vendor-prefix */
|
|
11022
|
-
-webkit-appearance: none;
|
|
11015
|
+
direction: rtl;
|
|
11016
|
+
writing-mode: vertical-lr;
|
|
11023
11017
|
}
|
|
11024
11018
|
|
|
11025
11019
|
input[type=range]:enabled {
|
|
@@ -11030,16 +11024,10 @@ class DecidablesSlider extends DecidablesElement {
|
|
|
11030
11024
|
outline: none;
|
|
11031
11025
|
}
|
|
11032
11026
|
|
|
11033
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11034
|
-
input[type=range]::-ms-tooltip {
|
|
11035
|
-
display: none;
|
|
11036
|
-
}
|
|
11037
|
-
|
|
11038
11027
|
/* Track */
|
|
11039
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11040
11028
|
input[type=range]::-webkit-slider-runnable-track {
|
|
11041
|
-
width:
|
|
11042
|
-
height:
|
|
11029
|
+
width: 4px;
|
|
11030
|
+
height: 100%;
|
|
11043
11031
|
|
|
11044
11032
|
background: var(---decidables-slider-background-color);
|
|
11045
11033
|
border: 0;
|
|
@@ -11051,10 +11039,9 @@ class DecidablesSlider extends DecidablesElement {
|
|
|
11051
11039
|
background: var(---decidables-slider-background-color);
|
|
11052
11040
|
}
|
|
11053
11041
|
|
|
11054
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11055
11042
|
input[type=range]::-moz-range-track {
|
|
11056
|
-
width:
|
|
11057
|
-
height:
|
|
11043
|
+
width: 4px;
|
|
11044
|
+
height: 100%;
|
|
11058
11045
|
|
|
11059
11046
|
background: var(---decidables-slider-background-color);
|
|
11060
11047
|
border: 0;
|
|
@@ -11062,57 +11049,17 @@ class DecidablesSlider extends DecidablesElement {
|
|
|
11062
11049
|
box-shadow: none;
|
|
11063
11050
|
}
|
|
11064
11051
|
|
|
11065
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11066
|
-
input[type=range]::-ms-track {
|
|
11067
|
-
width: 100%;
|
|
11068
|
-
height: 4px;
|
|
11069
|
-
|
|
11070
|
-
color: transparent;
|
|
11071
|
-
|
|
11072
|
-
background: transparent;
|
|
11073
|
-
border-color: transparent;
|
|
11074
|
-
}
|
|
11075
|
-
|
|
11076
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11077
|
-
input[type=range]::-ms-fill-lower {
|
|
11078
|
-
background: #cccccc;
|
|
11079
|
-
/* background: var(---decidables-slider-background-color); */
|
|
11080
|
-
border: 0;
|
|
11081
|
-
border-radius: 2px;
|
|
11082
|
-
box-shadow: none;
|
|
11083
|
-
}
|
|
11084
|
-
|
|
11085
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11086
|
-
input[type=range]::-ms-fill-upper {
|
|
11087
|
-
background: #cccccc;
|
|
11088
|
-
/* background: var(---decidables-slider-background-color); */
|
|
11089
|
-
border: 0;
|
|
11090
|
-
border-radius: 2px;
|
|
11091
|
-
box-shadow: none;
|
|
11092
|
-
}
|
|
11093
|
-
|
|
11094
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11095
|
-
input[type=range]:focus::-ms-fill-lower {
|
|
11096
|
-
background: var(---decidables-slider-background-color);
|
|
11097
|
-
}
|
|
11098
|
-
|
|
11099
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11100
|
-
input[type=range]:focus::-ms-fill-upper {
|
|
11101
|
-
background: var(---decidables-slider-background-color);
|
|
11102
|
-
}
|
|
11103
|
-
|
|
11104
11052
|
/* Thumb */
|
|
11105
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11106
11053
|
input[type=range]::-webkit-slider-thumb {
|
|
11107
|
-
width:
|
|
11108
|
-
height:
|
|
11109
|
-
|
|
11054
|
+
width: 20px;
|
|
11055
|
+
height: 10px;
|
|
11056
|
+
|
|
11057
|
+
margin-left: -8px;
|
|
11058
|
+
|
|
11059
|
+
appearance: none;
|
|
11110
11060
|
|
|
11111
11061
|
border: 0;
|
|
11112
11062
|
border-radius: 4px;
|
|
11113
|
-
|
|
11114
|
-
/* stylelint-disable-next-line property-no-vendor-prefix */
|
|
11115
|
-
-webkit-appearance: none;
|
|
11116
11063
|
}
|
|
11117
11064
|
|
|
11118
11065
|
input[type=range]:disabled::-webkit-slider-thumb {
|
|
@@ -11122,112 +11069,65 @@ class DecidablesSlider extends DecidablesElement {
|
|
|
11122
11069
|
|
|
11123
11070
|
input[type=range]:enabled::-webkit-slider-thumb {
|
|
11124
11071
|
background: var(---decidables-slider-color);
|
|
11125
|
-
box-shadow: var(---shadow-2
|
|
11072
|
+
box-shadow: var(---shadow-2);
|
|
11126
11073
|
}
|
|
11127
11074
|
|
|
11128
11075
|
input[type=range]:enabled:hover::-webkit-slider-thumb {
|
|
11129
|
-
box-shadow: var(---shadow-4
|
|
11076
|
+
box-shadow: var(---shadow-4);
|
|
11130
11077
|
}
|
|
11131
11078
|
|
|
11132
11079
|
input[type=range]:enabled:active::-webkit-slider-thumb {
|
|
11133
|
-
box-shadow: var(---shadow-8
|
|
11080
|
+
box-shadow: var(---shadow-8);
|
|
11134
11081
|
}
|
|
11135
11082
|
|
|
11136
|
-
|
|
11137
|
-
box-shadow: var(---shadow-4
|
|
11083
|
+
input[type=range]:enabled:focus-visible::-webkit-slider-thumb {
|
|
11084
|
+
box-shadow: var(---shadow-4);
|
|
11138
11085
|
}
|
|
11139
11086
|
|
|
11140
|
-
|
|
11141
|
-
box-shadow: var(---shadow-8
|
|
11087
|
+
input[type=range]:enabled:focus-visible:active::-webkit-slider-thumb {
|
|
11088
|
+
box-shadow: var(---shadow-8);
|
|
11142
11089
|
}
|
|
11143
11090
|
|
|
11144
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11145
11091
|
input[type=range]::-moz-range-thumb {
|
|
11146
|
-
width:
|
|
11147
|
-
height:
|
|
11092
|
+
width: 20px;
|
|
11093
|
+
height: 10px;
|
|
11148
11094
|
|
|
11149
11095
|
border: 0;
|
|
11150
11096
|
border-radius: 4px;
|
|
11151
11097
|
}
|
|
11152
11098
|
|
|
11153
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11154
11099
|
input[type=range]:disabled::-moz-range-thumb {
|
|
11155
11100
|
background: var(---decidables-slider-background-color);
|
|
11156
11101
|
box-shadow: none;
|
|
11157
11102
|
}
|
|
11158
11103
|
|
|
11159
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11160
11104
|
input[type=range]:enabled::-moz-range-thumb {
|
|
11161
11105
|
background: var(---decidables-slider-color);
|
|
11162
|
-
box-shadow: var(---shadow-2
|
|
11106
|
+
box-shadow: var(---shadow-2);
|
|
11163
11107
|
}
|
|
11164
11108
|
|
|
11165
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11166
11109
|
input[type=range]:enabled:hover::-moz-range-thumb {
|
|
11167
|
-
box-shadow: var(---shadow-4
|
|
11110
|
+
box-shadow: var(---shadow-4);
|
|
11168
11111
|
}
|
|
11169
11112
|
|
|
11170
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11171
11113
|
input[type=range]:enabled:active::-moz-range-thumb {
|
|
11172
|
-
box-shadow: var(---shadow-8
|
|
11173
|
-
}
|
|
11174
|
-
|
|
11175
|
-
:host(.keyboard) input[type=range]:enabled:focus::-moz-range-thumb {
|
|
11176
|
-
box-shadow: var(---shadow-4-rotate);
|
|
11177
|
-
}
|
|
11178
|
-
|
|
11179
|
-
:host(.keyboard) input[type=range]:enabled:focus:active::-moz-range-thumb {
|
|
11180
|
-
box-shadow: var(---shadow-8-rotate);
|
|
11181
|
-
}
|
|
11182
|
-
|
|
11183
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11184
|
-
input[type=range]::-ms-thumb {
|
|
11185
|
-
width: 10px;
|
|
11186
|
-
height: 20px;
|
|
11187
|
-
margin-top: 0;
|
|
11188
|
-
|
|
11189
|
-
background: #999999;
|
|
11190
|
-
/* background: var(---color-element-enabled); */
|
|
11191
|
-
border: 0;
|
|
11192
|
-
border-radius: 4px;
|
|
11193
|
-
box-shadow: var(---shadow-2-rotate);
|
|
11194
|
-
}
|
|
11195
|
-
|
|
11196
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11197
|
-
input[type=range]:disabled::-ms-thumb {
|
|
11198
|
-
background: var(---decidables-slider-background-color);
|
|
11199
|
-
box-shadow: none;
|
|
11200
|
-
}
|
|
11201
|
-
|
|
11202
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11203
|
-
input[type=range]:enabled::-ms-thumb {
|
|
11204
|
-
background: var(---decidables-slider-color);
|
|
11205
|
-
box-shadow: var(---shadow-2-rotate);
|
|
11206
|
-
}
|
|
11207
|
-
|
|
11208
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11209
|
-
input[type=range]:enabled:hover::-ms-thumb {
|
|
11210
|
-
box-shadow: var(---shadow-4-rotate);
|
|
11211
|
-
}
|
|
11212
|
-
|
|
11213
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
11214
|
-
input[type=range]:enabled:active::-ms-thumb {
|
|
11215
|
-
box-shadow: var(---shadow-8-rotate);
|
|
11114
|
+
box-shadow: var(---shadow-8);
|
|
11216
11115
|
}
|
|
11217
11116
|
|
|
11218
|
-
|
|
11219
|
-
|
|
11220
|
-
box-shadow: var(---shadow-4-rotate);
|
|
11117
|
+
input[type=range]:enabled:focus-visible::-moz-range-thumb {
|
|
11118
|
+
box-shadow: var(---shadow-4);
|
|
11221
11119
|
}
|
|
11222
11120
|
|
|
11223
|
-
|
|
11224
|
-
box-shadow: var(---shadow-8
|
|
11121
|
+
input[type=range]:enabled:focus-visible:active::-moz-range-thumb {
|
|
11122
|
+
box-shadow: var(---shadow-8);
|
|
11225
11123
|
}
|
|
11226
11124
|
|
|
11227
|
-
|
|
11125
|
+
/* Tick marks */
|
|
11126
|
+
.datalist {
|
|
11228
11127
|
position: absolute;
|
|
11229
11128
|
left: 2rem;
|
|
11230
11129
|
z-index: -1;
|
|
11130
|
+
|
|
11231
11131
|
display: flex;
|
|
11232
11132
|
|
|
11233
11133
|
flex-direction: column;
|
|
@@ -11240,31 +11140,30 @@ class DecidablesSlider extends DecidablesElement {
|
|
|
11240
11140
|
font-size: 0.75rem;
|
|
11241
11141
|
}
|
|
11242
11142
|
|
|
11243
|
-
option {
|
|
11244
|
-
padding: 0;
|
|
11245
|
-
|
|
11143
|
+
.option {
|
|
11246
11144
|
line-height: 0.8;
|
|
11247
|
-
|
|
11145
|
+
|
|
11146
|
+
white-space: nowrap;
|
|
11248
11147
|
}
|
|
11249
11148
|
|
|
11250
|
-
option::before {
|
|
11149
|
+
.option::before {
|
|
11251
11150
|
content: "– ";
|
|
11252
11151
|
}
|
|
11253
11152
|
`];
|
|
11254
11153
|
}
|
|
11255
11154
|
render() {
|
|
11256
|
-
return x$
|
|
11155
|
+
return x$2`
|
|
11257
11156
|
<label for="slider">
|
|
11258
11157
|
<slot></slot>
|
|
11259
11158
|
</label>
|
|
11260
11159
|
<div class="range">
|
|
11261
11160
|
<input ?disabled=${this.disabled} type="range" id="slider" min=${o$2(this.rangeMin)} max=${o$2(this.rangeMax)} step=${o$2(this.rangeStep)} .value=${this.rangeValue} @change=${this.rangeChanged.bind(this)} @input=${this.rangeInputted.bind(this)}>
|
|
11262
|
-
${this.scale ? x$
|
|
11263
|
-
<
|
|
11264
|
-
<option
|
|
11265
|
-
<option
|
|
11266
|
-
</
|
|
11267
|
-
` : x$
|
|
11161
|
+
${this.scale ? x$2`
|
|
11162
|
+
<div class="datalist">
|
|
11163
|
+
<div class="option">${o$2(this.max)}</div>
|
|
11164
|
+
<div class="option">${o$2(this.min)}</div>
|
|
11165
|
+
</div>
|
|
11166
|
+
` : x$2``}
|
|
11268
11167
|
</div>
|
|
11269
11168
|
<decidables-spinner ?disabled=${this.disabled} min=${o$2(this.min)} max=${o$2(this.max)} step=${o$2(this.step)} .value=${this.value} @input=${this.spinnerInputted.bind(this)}></decidables-spinner>
|
|
11270
11169
|
`;
|
|
@@ -11323,13 +11222,14 @@ class DecidablesSpinner extends DecidablesElement {
|
|
|
11323
11222
|
---decidables-spinner-prefix: var(--decidables-spinner-prefix, "");
|
|
11324
11223
|
|
|
11325
11224
|
---decidables-spinner-postfix: var(--decidables-spinner-postfix, "");
|
|
11326
|
-
---decidables-spinner-postfix-padding: var(--decidables-spinner-postfix-padding,
|
|
11225
|
+
---decidables-spinner-postfix-padding: var(--decidables-spinner-postfix-padding, 0rem);
|
|
11327
11226
|
|
|
11328
11227
|
display: block;
|
|
11329
11228
|
}
|
|
11330
11229
|
|
|
11331
11230
|
label {
|
|
11332
11231
|
position: relative;
|
|
11232
|
+
|
|
11333
11233
|
display: flex;
|
|
11334
11234
|
|
|
11335
11235
|
flex-direction: column;
|
|
@@ -11347,6 +11247,7 @@ class DecidablesSpinner extends DecidablesElement {
|
|
|
11347
11247
|
left: calc(50% - var(---decidables-spinner-input-width) / 2 + 0.25rem);
|
|
11348
11248
|
|
|
11349
11249
|
font-size: var(---decidables-spinner-font-size);
|
|
11250
|
+
|
|
11350
11251
|
line-height: normal;
|
|
11351
11252
|
|
|
11352
11253
|
content: var(---decidables-spinner-prefix);
|
|
@@ -11358,6 +11259,7 @@ class DecidablesSpinner extends DecidablesElement {
|
|
|
11358
11259
|
bottom: 1px;
|
|
11359
11260
|
|
|
11360
11261
|
font-size: var(---decidables-spinner-font-size);
|
|
11262
|
+
|
|
11361
11263
|
line-height: normal;
|
|
11362
11264
|
|
|
11363
11265
|
content: var(---decidables-spinner-postfix);
|
|
@@ -11365,20 +11267,24 @@ class DecidablesSpinner extends DecidablesElement {
|
|
|
11365
11267
|
|
|
11366
11268
|
input[type=number] {
|
|
11367
11269
|
width: var(---decidables-spinner-input-width);
|
|
11368
|
-
|
|
11270
|
+
|
|
11271
|
+
padding: 1px var(---decidables-spinner-postfix-padding) 1px 2px;
|
|
11272
|
+
margin: 0;
|
|
11369
11273
|
|
|
11370
11274
|
font-family: var(---font-family-base);
|
|
11371
11275
|
font-size: var(---decidables-spinner-font-size);
|
|
11276
|
+
|
|
11372
11277
|
color: inherit;
|
|
11278
|
+
|
|
11373
11279
|
text-align: right;
|
|
11374
11280
|
|
|
11281
|
+
appearance: none;
|
|
11282
|
+
outline: none;
|
|
11283
|
+
|
|
11375
11284
|
background: none;
|
|
11376
11285
|
border: 0;
|
|
11377
11286
|
border-radius: 0;
|
|
11378
|
-
outline: none;
|
|
11379
11287
|
box-shadow: var(---shadow-2);
|
|
11380
|
-
|
|
11381
|
-
-webkit-appearance: none; /* stylelint-disable-line property-no-vendor-prefix */
|
|
11382
11288
|
}
|
|
11383
11289
|
|
|
11384
11290
|
input[type=number]:hover {
|
|
@@ -11395,25 +11301,59 @@ class DecidablesSpinner extends DecidablesElement {
|
|
|
11395
11301
|
|
|
11396
11302
|
border: 0;
|
|
11397
11303
|
box-shadow: none;
|
|
11304
|
+
}
|
|
11305
|
+
|
|
11306
|
+
/* HACK: Manage spinners in Firefox */
|
|
11307
|
+
@supports (-moz-appearance: textfield) {
|
|
11308
|
+
input[type=number] {
|
|
11309
|
+
padding-right: calc(18px + var(---decidables-spinner-postfix-padding));
|
|
11310
|
+
|
|
11311
|
+
appearance: textfield;
|
|
11312
|
+
}
|
|
11313
|
+
|
|
11314
|
+
input[type=number]:hover,
|
|
11315
|
+
input[type=number]:focus,
|
|
11316
|
+
input[type=number]:active {
|
|
11317
|
+
padding-right: var(---decidables-spinner-postfix-padding);
|
|
11318
|
+
|
|
11319
|
+
appearance: none;
|
|
11320
|
+
}
|
|
11321
|
+
|
|
11322
|
+
input[type=number]:disabled {
|
|
11323
|
+
padding-right: calc(18px + var(---decidables-spinner-postfix-padding));
|
|
11324
|
+
|
|
11325
|
+
appearance: textfield;
|
|
11326
|
+
}
|
|
11327
|
+
}
|
|
11328
|
+
|
|
11329
|
+
/* HACK: Manage spinners in Chrome/Edge/Safari */
|
|
11330
|
+
input[type=number]::-webkit-inner-spin-button {
|
|
11331
|
+
/* Avoid oversized spinners in Safari */
|
|
11332
|
+
font-size: 1.125rem;
|
|
11333
|
+
|
|
11334
|
+
opacity: 0;
|
|
11335
|
+
}
|
|
11398
11336
|
|
|
11399
|
-
|
|
11400
|
-
|
|
11401
|
-
|
|
11402
|
-
|
|
11403
|
-
/* HACK: Use correct text color in Safari */
|
|
11404
|
-
-webkit-text-fill-color: var(---color-text);
|
|
11337
|
+
input[type=number]:hover::-webkit-inner-spin-button,
|
|
11338
|
+
input[type=number]:focus::-webkit-inner-spin-button,
|
|
11339
|
+
input[type=number]:active::-webkit-inner-spin-button {
|
|
11340
|
+
opacity: 1;
|
|
11405
11341
|
}
|
|
11406
11342
|
|
|
11407
|
-
/* HACK: Hide spinners in disabled input for Firefox and Safari */
|
|
11408
|
-
input[type=number]:disabled::-webkit-outer-spin-button,
|
|
11409
11343
|
input[type=number]:disabled::-webkit-inner-spin-button {
|
|
11410
|
-
|
|
11411
|
-
|
|
11344
|
+
opacity: 0;
|
|
11345
|
+
}
|
|
11346
|
+
|
|
11347
|
+
/* HACK: Adjust padding on mobile w/o spinners */
|
|
11348
|
+
@media only screen and (hover: none) and (pointer: coarse) {
|
|
11349
|
+
input[type=number] {
|
|
11350
|
+
padding-right: calc(1.125rem + var(---decidables-spinner-postfix-padding));
|
|
11351
|
+
}
|
|
11412
11352
|
}
|
|
11413
11353
|
`];
|
|
11414
11354
|
}
|
|
11415
11355
|
render() {
|
|
11416
|
-
return x$
|
|
11356
|
+
return x$2`
|
|
11417
11357
|
<label>
|
|
11418
11358
|
<slot></slot>
|
|
11419
11359
|
<input ?disabled=${this.disabled} type="number" min=${o$2(this.min)} max=${o$2(this.max)} step=${o$2(this.step)} .value=${this.value} @input=${this.inputted.bind(this)}>
|
|
@@ -11472,13 +11412,16 @@ class DecidablesSwitch extends DecidablesElement {
|
|
|
11472
11412
|
|
|
11473
11413
|
width: 1px;
|
|
11474
11414
|
height: 1px;
|
|
11415
|
+
|
|
11475
11416
|
padding: 0;
|
|
11476
11417
|
margin: -1px;
|
|
11418
|
+
|
|
11477
11419
|
overflow: hidden;
|
|
11478
11420
|
|
|
11479
11421
|
white-space: nowrap;
|
|
11480
11422
|
|
|
11481
11423
|
border: 0;
|
|
11424
|
+
|
|
11482
11425
|
clip-path: inset(100%); /* May cause a performance issue: https://github.com/h5bp/html5-boilerplate/issues/2021 */
|
|
11483
11426
|
}
|
|
11484
11427
|
|
|
@@ -11494,6 +11437,7 @@ class DecidablesSwitch extends DecidablesElement {
|
|
|
11494
11437
|
position: relative;
|
|
11495
11438
|
|
|
11496
11439
|
min-width: 24px;
|
|
11440
|
+
|
|
11497
11441
|
padding: 0 0 36px;
|
|
11498
11442
|
margin: 0.25rem 0.25rem 0;
|
|
11499
11443
|
|
|
@@ -11505,17 +11449,17 @@ class DecidablesSwitch extends DecidablesElement {
|
|
|
11505
11449
|
input[type=checkbox] + label + label::before,
|
|
11506
11450
|
input[type=checkbox] + label + label::after {
|
|
11507
11451
|
position: absolute;
|
|
11508
|
-
|
|
11509
11452
|
left: 50%;
|
|
11510
11453
|
|
|
11511
11454
|
margin: 0;
|
|
11512
11455
|
|
|
11513
|
-
content: "";
|
|
11514
|
-
|
|
11515
11456
|
outline: 0;
|
|
11516
11457
|
|
|
11517
|
-
|
|
11458
|
+
content: "";
|
|
11459
|
+
|
|
11518
11460
|
transform: translate(-50%, 0);
|
|
11461
|
+
|
|
11462
|
+
transition: all var(---transition-duration) ease;
|
|
11519
11463
|
}
|
|
11520
11464
|
|
|
11521
11465
|
input[type=checkbox] + label + label::before {
|
|
@@ -11563,21 +11507,18 @@ class DecidablesSwitch extends DecidablesElement {
|
|
|
11563
11507
|
box-shadow: var(---shadow-8);
|
|
11564
11508
|
}
|
|
11565
11509
|
|
|
11566
|
-
|
|
11567
|
-
:host(.keyboard) input[type=checkbox]:enabled:focus + label + label::after {
|
|
11510
|
+
input[type=checkbox]:enabled:focus-visible + label + label::after {
|
|
11568
11511
|
box-shadow: var(---shadow-4);
|
|
11569
11512
|
}
|
|
11570
11513
|
|
|
11571
|
-
|
|
11572
|
-
|
|
11573
|
-
:host(.keyboard) input[type=checkbox]:enabled:focus:active + label + label::after {
|
|
11514
|
+
input[type=checkbox]:enabled:focus-visible + label + label:active::after,
|
|
11515
|
+
input[type=checkbox]:enabled:focus-visible:active + label + label::after {
|
|
11574
11516
|
box-shadow: var(---shadow-8);
|
|
11575
11517
|
}
|
|
11576
|
-
/* stylelint-enable selector-max-compound-selectors */
|
|
11577
11518
|
`];
|
|
11578
11519
|
}
|
|
11579
11520
|
render() {
|
|
11580
|
-
return x$
|
|
11521
|
+
return x$2`
|
|
11581
11522
|
<input type="checkbox" id="switch" ?checked=${this.checked} ?disabled=${this.disabled} @change=${this.changed.bind(this)}>
|
|
11582
11523
|
<label for="switch">
|
|
11583
11524
|
<slot name="off-label"></slot>
|
|
@@ -11627,7 +11568,7 @@ class DecidablesToggle extends DecidablesElement {
|
|
|
11627
11568
|
`];
|
|
11628
11569
|
}
|
|
11629
11570
|
render() {
|
|
11630
|
-
return x$
|
|
11571
|
+
return x$2`
|
|
11631
11572
|
<fieldset ?disabled=${this.disabled}>
|
|
11632
11573
|
<legend><slot name="label"></slot></legend>
|
|
11633
11574
|
<slot></slot>
|
|
@@ -11693,39 +11634,46 @@ class DecidablesToggleOption extends DecidablesElement {
|
|
|
11693
11634
|
|
|
11694
11635
|
width: 1px;
|
|
11695
11636
|
height: 1px;
|
|
11637
|
+
|
|
11696
11638
|
padding: 0;
|
|
11697
11639
|
margin: -1px;
|
|
11640
|
+
|
|
11698
11641
|
overflow: hidden;
|
|
11699
11642
|
|
|
11700
11643
|
white-space: nowrap;
|
|
11701
11644
|
|
|
11702
11645
|
border: 0;
|
|
11646
|
+
|
|
11703
11647
|
clip-path: inset(100%); /* May cause a performance issue: https://github.com/h5bp/html5-boilerplate/issues/2021 */
|
|
11704
11648
|
}
|
|
11705
11649
|
|
|
11706
11650
|
input[type=radio] + label {
|
|
11707
11651
|
width: 100%;
|
|
11652
|
+
|
|
11708
11653
|
padding: 0.375rem 0.75rem;
|
|
11709
11654
|
|
|
11710
11655
|
font-family: var(---font-family-base);
|
|
11711
11656
|
font-size: 1.125rem;
|
|
11657
|
+
|
|
11712
11658
|
line-height: 1.5;
|
|
11659
|
+
|
|
11713
11660
|
color: var(---color-text-inverse);
|
|
11661
|
+
|
|
11714
11662
|
text-align: center;
|
|
11715
11663
|
|
|
11716
11664
|
cursor: pointer;
|
|
11665
|
+
outline: none;
|
|
11717
11666
|
|
|
11718
11667
|
background-color: var(---color-element-enabled);
|
|
11719
11668
|
border: 0;
|
|
11720
11669
|
border-radius: 0;
|
|
11721
|
-
outline: none;
|
|
11722
|
-
|
|
11723
11670
|
box-shadow: var(---shadow-2);
|
|
11724
11671
|
}
|
|
11725
11672
|
|
|
11726
11673
|
input[type=radio]:checked + label {
|
|
11727
|
-
background-color: var(---color-element-selected);
|
|
11728
11674
|
outline: none;
|
|
11675
|
+
|
|
11676
|
+
background-color: var(---color-element-selected);
|
|
11729
11677
|
box-shadow: var(---shadow-2);
|
|
11730
11678
|
}
|
|
11731
11679
|
|
|
@@ -11733,6 +11681,7 @@ class DecidablesToggleOption extends DecidablesElement {
|
|
|
11733
11681
|
z-index: 1;
|
|
11734
11682
|
|
|
11735
11683
|
outline: none;
|
|
11684
|
+
|
|
11736
11685
|
box-shadow: var(---shadow-4);
|
|
11737
11686
|
}
|
|
11738
11687
|
|
|
@@ -11740,6 +11689,7 @@ class DecidablesToggleOption extends DecidablesElement {
|
|
|
11740
11689
|
z-index: 2;
|
|
11741
11690
|
|
|
11742
11691
|
outline: none;
|
|
11692
|
+
|
|
11743
11693
|
box-shadow: var(---shadow-8);
|
|
11744
11694
|
}
|
|
11745
11695
|
|
|
@@ -11753,31 +11703,34 @@ class DecidablesToggleOption extends DecidablesElement {
|
|
|
11753
11703
|
border-bottom-left-radius: 0.25rem;
|
|
11754
11704
|
}
|
|
11755
11705
|
|
|
11756
|
-
|
|
11706
|
+
input[type=radio]:focus-visible + label {
|
|
11757
11707
|
z-index: 1;
|
|
11758
11708
|
|
|
11759
11709
|
outline: none;
|
|
11710
|
+
|
|
11760
11711
|
box-shadow: var(---shadow-4);
|
|
11761
11712
|
}
|
|
11762
11713
|
|
|
11763
|
-
|
|
11714
|
+
input[type=radio]:focus-visible:checked + label {
|
|
11764
11715
|
z-index: 1;
|
|
11765
11716
|
|
|
11766
|
-
background-color: var(---color-element-selected);
|
|
11767
11717
|
outline: none;
|
|
11718
|
+
|
|
11719
|
+
background-color: var(---color-element-selected);
|
|
11768
11720
|
box-shadow: var(---shadow-4);
|
|
11769
11721
|
}
|
|
11770
11722
|
|
|
11771
|
-
|
|
11723
|
+
input[type=radio]:focus-visible + label:active {
|
|
11772
11724
|
z-index: 2;
|
|
11773
11725
|
|
|
11774
11726
|
outline: none;
|
|
11727
|
+
|
|
11775
11728
|
box-shadow: var(---shadow-8);
|
|
11776
11729
|
}
|
|
11777
11730
|
`];
|
|
11778
11731
|
}
|
|
11779
11732
|
render() {
|
|
11780
|
-
return x$
|
|
11733
|
+
return x$2`
|
|
11781
11734
|
<input type="radio" id="toggle-option" name=${this.name} value=${this.value} .checked=${this.checked} @change=${this.changed.bind(this)}>
|
|
11782
11735
|
<label for="toggle-option">
|
|
11783
11736
|
<slot></slot>
|
|
@@ -12114,7 +12067,7 @@ const r = new Map(),
|
|
|
12114
12067
|
},
|
|
12115
12068
|
b = ["left", "top", "width", "height", "opacity", "color", "background"],
|
|
12116
12069
|
j = new WeakMap();
|
|
12117
|
-
|
|
12070
|
+
class x extends f {
|
|
12118
12071
|
constructor(t$1) {
|
|
12119
12072
|
if (super(t$1), this.t = false, this.i = null, this.o = null, this.h = true, this.shouldLog = false, t$1.type === t.CHILD) throw Error("The `animate` directive must be used in attribute position.");
|
|
12120
12073
|
this.createFinished();
|
|
@@ -12138,9 +12091,9 @@ let x$1 = class x extends f {
|
|
|
12138
12091
|
}
|
|
12139
12092
|
update(t, [i]) {
|
|
12140
12093
|
const s = void 0 === this.u;
|
|
12141
|
-
return s && (this.u = t.options?.host, this.u.addController(this), this.u.updateComplete.then(t => this.t = true), this.element = t.element, j.set(this.element, this)), this.optionsOrCallback = i, (s || "function" != typeof i) && this.
|
|
12094
|
+
return s && (this.u = t.options?.host, this.u.addController(this), this.u.updateComplete.then(t => this.t = true), this.element = t.element, j.set(this.element, this)), this.optionsOrCallback = i, (s || "function" != typeof i) && this.m(i), this.render(i);
|
|
12142
12095
|
}
|
|
12143
|
-
|
|
12096
|
+
m(t) {
|
|
12144
12097
|
t = t ?? {};
|
|
12145
12098
|
const i = this.getController();
|
|
12146
12099
|
void 0 !== i && ((t = {
|
|
@@ -12151,7 +12104,7 @@ let x$1 = class x extends f {
|
|
|
12151
12104
|
...t.keyframeOptions
|
|
12152
12105
|
}), t.properties ??= b, this.options = t;
|
|
12153
12106
|
}
|
|
12154
|
-
|
|
12107
|
+
p() {
|
|
12155
12108
|
const t = {},
|
|
12156
12109
|
i = this.element.getBoundingClientRect(),
|
|
12157
12110
|
s = getComputedStyle(this.element);
|
|
@@ -12172,20 +12125,20 @@ let x$1 = class x extends f {
|
|
|
12172
12125
|
})(t, this._)), this.h = this.t && !this.isDisabled() && !this.isAnimating() && i && this.element.isConnected, this.h && (this._ = Array.isArray(t) ? Array.from(t) : t), this.h;
|
|
12173
12126
|
}
|
|
12174
12127
|
hostUpdate() {
|
|
12175
|
-
"function" == typeof this.optionsOrCallback && this.
|
|
12128
|
+
"function" == typeof this.optionsOrCallback && this.m(this.optionsOrCallback()), this.v() && (this.A = this.p(), this.i = this.i ?? this.element.parentNode, this.o = this.element.nextSibling);
|
|
12176
12129
|
}
|
|
12177
12130
|
async hostUpdated() {
|
|
12178
12131
|
if (!this.h || !this.element.isConnected || this.options.skipInitial && !this.isHostRendered) return;
|
|
12179
12132
|
let t;
|
|
12180
12133
|
this.prepare(), await a;
|
|
12181
|
-
const i = this.
|
|
12182
|
-
s = this.
|
|
12183
|
-
e = this.
|
|
12134
|
+
const i = this.P(),
|
|
12135
|
+
s = this.V(this.options.keyframeOptions, i),
|
|
12136
|
+
e = this.p();
|
|
12184
12137
|
if (void 0 !== this.A) {
|
|
12185
12138
|
const {
|
|
12186
12139
|
from: s,
|
|
12187
12140
|
to: h
|
|
12188
|
-
} = this.
|
|
12141
|
+
} = this.O(this.A, e, i);
|
|
12189
12142
|
this.log("measured", [this.A, e, s, h]), t = this.calculateKeyframes(s, h);
|
|
12190
12143
|
} else {
|
|
12191
12144
|
const s = r.get(this.options.inId);
|
|
@@ -12194,7 +12147,7 @@ let x$1 = class x extends f {
|
|
|
12194
12147
|
const {
|
|
12195
12148
|
from: h,
|
|
12196
12149
|
to: n
|
|
12197
|
-
} = this.
|
|
12150
|
+
} = this.O(s, e, i);
|
|
12198
12151
|
t = this.calculateKeyframes(h, n), t = this.options.in ? [{
|
|
12199
12152
|
...this.options.in[0],
|
|
12200
12153
|
...t[0]
|
|
@@ -12204,10 +12157,10 @@ let x$1 = class x extends f {
|
|
|
12204
12157
|
this.animate(t, s);
|
|
12205
12158
|
}
|
|
12206
12159
|
resetStyles() {
|
|
12207
|
-
void 0 !== this.
|
|
12160
|
+
void 0 !== this.j && (this.element.setAttribute("style", this.j ?? ""), this.j = void 0);
|
|
12208
12161
|
}
|
|
12209
12162
|
commitStyles() {
|
|
12210
|
-
this.
|
|
12163
|
+
this.j = this.element.getAttribute("style"), this.webAnimation?.commitStyles(), this.webAnimation?.cancel();
|
|
12211
12164
|
}
|
|
12212
12165
|
reconnected() {}
|
|
12213
12166
|
async disconnected() {
|
|
@@ -12216,14 +12169,14 @@ let x$1 = class x extends f {
|
|
|
12216
12169
|
if (this.prepare(), await a(), this.i?.isConnected) {
|
|
12217
12170
|
const t = this.o && this.o.parentNode === this.i ? this.o : null;
|
|
12218
12171
|
if (this.i.insertBefore(this.element, t), this.options.stabilizeOut) {
|
|
12219
|
-
const t = this.
|
|
12172
|
+
const t = this.p();
|
|
12220
12173
|
this.log("stabilizing out");
|
|
12221
12174
|
const i = this.A.left - t.left,
|
|
12222
12175
|
s = this.A.top - t.top;
|
|
12223
12176
|
!("static" === getComputedStyle(this.element).position) || 0 === i && 0 === s || (this.element.style.position = "relative"), 0 !== i && (this.element.style.left = i + "px"), 0 !== s && (this.element.style.top = s + "px");
|
|
12224
12177
|
}
|
|
12225
12178
|
}
|
|
12226
|
-
const t = this.
|
|
12179
|
+
const t = this.V(this.options.keyframeOptions);
|
|
12227
12180
|
await this.animate(this.options.out, t), this.element.remove();
|
|
12228
12181
|
}
|
|
12229
12182
|
prepare() {
|
|
@@ -12235,7 +12188,7 @@ let x$1 = class x extends f {
|
|
|
12235
12188
|
didFinish(t) {
|
|
12236
12189
|
t && this.options.onComplete?.(this), this.A = void 0, this.animatingProperties = void 0, this.frames = void 0, this.resolveFinished();
|
|
12237
12190
|
}
|
|
12238
|
-
|
|
12191
|
+
P() {
|
|
12239
12192
|
const t = [];
|
|
12240
12193
|
for (let i = this.element.parentNode; i; i = i?.parentNode) {
|
|
12241
12194
|
const s = j.get(i);
|
|
@@ -12249,13 +12202,13 @@ let x$1 = class x extends f {
|
|
|
12249
12202
|
n.add(this.u);
|
|
12250
12203
|
}), t;
|
|
12251
12204
|
}
|
|
12252
|
-
|
|
12205
|
+
V(t, i = this.P()) {
|
|
12253
12206
|
const s = {
|
|
12254
12207
|
...A
|
|
12255
12208
|
};
|
|
12256
12209
|
return i.forEach(t => Object.assign(s, t.options.keyframeOptions)), Object.assign(s, t), s;
|
|
12257
12210
|
}
|
|
12258
|
-
|
|
12211
|
+
O(t, i, s) {
|
|
12259
12212
|
t = {
|
|
12260
12213
|
...t
|
|
12261
12214
|
}, i = {
|
|
@@ -12308,8 +12261,8 @@ let x$1 = class x extends f {
|
|
|
12308
12261
|
log(t, i) {
|
|
12309
12262
|
this.shouldLog && !this.isDisabled() && console.log(t, this.options.id, i);
|
|
12310
12263
|
}
|
|
12311
|
-
}
|
|
12312
|
-
const F = e(x
|
|
12264
|
+
}
|
|
12265
|
+
const F = e(x);
|
|
12313
12266
|
|
|
12314
12267
|
/*
|
|
12315
12268
|
CPTMath Static Class - Not intended for instantiation!
|
|
@@ -12479,11 +12432,13 @@ class CPTEquation extends ProspectableElement {
|
|
|
12479
12432
|
|
|
12480
12433
|
.addend {
|
|
12481
12434
|
position: relative;
|
|
12435
|
+
|
|
12482
12436
|
display: inline-block;
|
|
12483
12437
|
}
|
|
12484
12438
|
|
|
12485
12439
|
.comparison {
|
|
12486
12440
|
position: relative;
|
|
12441
|
+
|
|
12487
12442
|
display: inline-block;
|
|
12488
12443
|
|
|
12489
12444
|
font-size: 125%;
|
|
@@ -12765,20 +12720,20 @@ class CPTCalculation extends CPTEquation {
|
|
|
12765
12720
|
let us;
|
|
12766
12721
|
let uDiff;
|
|
12767
12722
|
if (this.numeric) {
|
|
12768
|
-
xw = x$
|
|
12723
|
+
xw = x$2`<decidables-spinner class="x xw"
|
|
12769
12724
|
?disabled=${!this.interactive}
|
|
12770
12725
|
.value=${this.xw}
|
|
12771
12726
|
@input=${this.xwInput.bind(this)}
|
|
12772
12727
|
>
|
|
12773
12728
|
<var class="math-var">x<sub class="subscript win">win</sub></var>
|
|
12774
12729
|
</decidables-spinner>`;
|
|
12775
|
-
xl = x$
|
|
12730
|
+
xl = x$2`<decidables-spinner class="x xl"
|
|
12776
12731
|
disabled
|
|
12777
12732
|
.value=${this.xl}
|
|
12778
12733
|
>
|
|
12779
12734
|
<var class="math-var">x<sub class="subscript loss">loss</sub></var>
|
|
12780
12735
|
</decidables-spinner>`;
|
|
12781
|
-
pw = x$
|
|
12736
|
+
pw = x$2`<decidables-spinner class="p pw"
|
|
12782
12737
|
?disabled=${!this.interactive}
|
|
12783
12738
|
min="0"
|
|
12784
12739
|
max="1"
|
|
@@ -12788,7 +12743,7 @@ class CPTCalculation extends CPTEquation {
|
|
|
12788
12743
|
>
|
|
12789
12744
|
<var class="math-var">p<sub class="subscript win">win</sub></var>
|
|
12790
12745
|
</decidables-spinner>`;
|
|
12791
|
-
xs = x$
|
|
12746
|
+
xs = x$2`<decidables-spinner class="x xs"
|
|
12792
12747
|
?disabled=${!this.interactive}
|
|
12793
12748
|
.value=${this.xs}
|
|
12794
12749
|
@input=${this.xsInput.bind(this)}
|
|
@@ -12825,73 +12780,73 @@ class CPTCalculation extends CPTEquation {
|
|
|
12825
12780
|
// >
|
|
12826
12781
|
// <var class="math-var">γ</var>
|
|
12827
12782
|
// </decidables-spinner>`;
|
|
12828
|
-
vw = x$
|
|
12783
|
+
vw = x$2`<decidables-spinner class="v vw"
|
|
12829
12784
|
disabled
|
|
12830
12785
|
.value=${+this.vw.toFixed(1)}
|
|
12831
12786
|
>
|
|
12832
12787
|
<var class="math-var">v<sub class="subscript win">win</sub></var>
|
|
12833
12788
|
</decidables-spinner>`;
|
|
12834
|
-
vl = x$
|
|
12789
|
+
vl = x$2`<decidables-spinner class="v vl"
|
|
12835
12790
|
disabled
|
|
12836
12791
|
.value=${+this.vl.toFixed(1)}
|
|
12837
12792
|
>
|
|
12838
12793
|
<var class="math-var">v<sub class="subscript loss">loss</sub></var>
|
|
12839
12794
|
</decidables-spinner>`;
|
|
12840
|
-
ww = x$
|
|
12795
|
+
ww = x$2`<decidables-spinner class="w ww"
|
|
12841
12796
|
disabled
|
|
12842
12797
|
.value=${+this.ww.toFixed(2)}
|
|
12843
12798
|
>
|
|
12844
12799
|
<var class="math-var">w<sub class="subscript win">win</sub></var>
|
|
12845
12800
|
</decidables-spinner>`;
|
|
12846
|
-
wl = x$
|
|
12801
|
+
wl = x$2`<decidables-spinner class="w wl"
|
|
12847
12802
|
disabled
|
|
12848
12803
|
.value=${+this.wl.toFixed(2)}
|
|
12849
12804
|
>
|
|
12850
12805
|
<var class="math-var">w<sub class="subscript loss">loss</sub></var>
|
|
12851
12806
|
</decidables-spinner>`;
|
|
12852
|
-
vs = x$
|
|
12807
|
+
vs = x$2`<decidables-spinner class="v vs"
|
|
12853
12808
|
disabled
|
|
12854
12809
|
.value=${+this.vs.toFixed(1)}
|
|
12855
12810
|
>
|
|
12856
12811
|
<var class="math-var">v<sub class="subscript sure">sure</sub></var>
|
|
12857
12812
|
</decidables-spinner>`;
|
|
12858
|
-
ug = x$
|
|
12813
|
+
ug = x$2`<decidables-spinner class="u ug"
|
|
12859
12814
|
disabled
|
|
12860
12815
|
.value=${+this.ug.toFixed(1)}
|
|
12861
12816
|
>
|
|
12862
12817
|
<var class="math-var">U<sub class="subscript gamble">gamble</sub></var>
|
|
12863
12818
|
</decidables-spinner>`;
|
|
12864
|
-
us = x$
|
|
12819
|
+
us = x$2`<decidables-spinner class="u us"
|
|
12865
12820
|
disabled
|
|
12866
12821
|
.value=${+this.us.toFixed(1)}
|
|
12867
12822
|
>
|
|
12868
12823
|
<var class="math-var">U<sub class="subscript sure">sure</sub></var>
|
|
12869
12824
|
</decidables-spinner>`;
|
|
12870
|
-
uDiff = x$
|
|
12825
|
+
uDiff = x$2`${this.uDiff > 0 ? x$2`<span class="comparison" ${F({
|
|
12871
12826
|
in: v
|
|
12872
|
-
})}>></span>` : this.uDiff < 0 ? x$
|
|
12827
|
+
})}>></span>` : this.uDiff < 0 ? x$2`<span class="comparison" ${F({
|
|
12873
12828
|
in: v
|
|
12874
|
-
})}><</span>` : x$
|
|
12829
|
+
})}><</span>` : x$2`<span class="comparison" ${F({
|
|
12875
12830
|
in: v
|
|
12876
12831
|
})}>=</span>`}`;
|
|
12877
12832
|
} else {
|
|
12878
|
-
xw = x$
|
|
12879
|
-
xl = x$
|
|
12880
|
-
pw = x$
|
|
12881
|
-
xs = x$
|
|
12833
|
+
xw = x$2`<var class="math-var x xw">x<sub class="subscript win">win</sub></var>`;
|
|
12834
|
+
xl = x$2`<var class="math-var x xl">x<sub class="subscript loss">loss</sub></var>`;
|
|
12835
|
+
pw = x$2`<var class="math-var p pw">p<sub class="subscript win">win</sub></var>`;
|
|
12836
|
+
xs = x$2`<var class="math-var x xs">x<sub class="subscript sure">sure</sub></var>`;
|
|
12882
12837
|
// a = html`<var class="math-var a">α</var>`;
|
|
12883
12838
|
// l = html`<var class="math-var l">λ</var>`;
|
|
12884
12839
|
// g = html`<var class="math-var g">γ</var>`;
|
|
12885
|
-
vw = x$
|
|
12886
|
-
vl = x$
|
|
12887
|
-
ww = x$
|
|
12888
|
-
wl = x$
|
|
12889
|
-
vs = x$
|
|
12890
|
-
ug = x$
|
|
12891
|
-
us = x$
|
|
12892
|
-
uDiff = x$
|
|
12893
|
-
}
|
|
12894
|
-
const equation = x$
|
|
12840
|
+
vw = x$2`<var class="math-var v vw">v<sub class="subscript win">win</sub></var>`;
|
|
12841
|
+
vl = x$2`<var class="math-var v vl">v<sub class="subscript loss">loss</sub></var>`;
|
|
12842
|
+
ww = x$2`<var class="math-var w ww">w<sub class="subscript win">win</sub></var>`;
|
|
12843
|
+
wl = x$2`<var class="math-var w wl">w<sub class="subscript loss">loss</sub></var>`;
|
|
12844
|
+
vs = x$2`<var class="math-var v vs">v<sub class="subscript sure">sure</sub></var>`;
|
|
12845
|
+
ug = x$2`<var class="math-var u ug">U<sub class="subscript gamble">gamble</sub></var>`;
|
|
12846
|
+
us = x$2`<var class="math-var u us">U<sub class="subscript sure">sure</sub></var>`;
|
|
12847
|
+
uDiff = x$2`<span class="comparison">≟</span>`;
|
|
12848
|
+
}
|
|
12849
|
+
const equation = x$2`
|
|
12895
12850
|
<tr>
|
|
12896
12851
|
<td class="right">
|
|
12897
12852
|
<span class="function v"><var class="math-var v tight">v</var><span class="paren tight">(</span>${xw}<span class="paren tight">)</span></span> <span class="function w"><var class="math-var w tight">w</var><span class="paren tight">(</span>${pw}<span class="paren tight">)</span></span><span class="plus">+</span><span class="function v"><var class="math-var v tight">v</var><span class="paren tight">(</span>${xl}<span class="paren tight">)</span></span> <span class="bracket tight">[</span><span class="tight">1</span><span class="minus">−</span><span class="function w"><var class="math-var w">w</var><span class="paren tight">(</span>${pw}<span class="paren tight">)</span></span><span class="bracket tight">]</span>
|
|
@@ -12925,7 +12880,7 @@ class CPTCalculation extends CPTEquation {
|
|
|
12925
12880
|
${us}
|
|
12926
12881
|
</td>
|
|
12927
12882
|
</tr>`;
|
|
12928
|
-
return x$
|
|
12883
|
+
return x$2`
|
|
12929
12884
|
<div class="holder">
|
|
12930
12885
|
<table class="equation">
|
|
12931
12886
|
<tbody>
|
|
@@ -13906,7 +13861,7 @@ function reverseTransform(data, facets) {
|
|
|
13906
13861
|
facets: facets.map(I => I.slice().reverse())
|
|
13907
13862
|
};
|
|
13908
13863
|
}
|
|
13909
|
-
function sort
|
|
13864
|
+
function sort(order, {
|
|
13910
13865
|
sort,
|
|
13911
13866
|
...options
|
|
13912
13867
|
} = {}) {
|
|
@@ -14150,7 +14105,7 @@ const reduceFirst = {
|
|
|
14150
14105
|
const reduceTitle = {
|
|
14151
14106
|
reduceIndex(I, X) {
|
|
14152
14107
|
const n = 5;
|
|
14153
|
-
const groups = sort$
|
|
14108
|
+
const groups = sort$1(rollup(I, V => V.length, i => X[i]), second);
|
|
14154
14109
|
const top = groups.slice(-n).reverse();
|
|
14155
14110
|
if (top.length < groups.length) {
|
|
14156
14111
|
const bottom = groups.slice(0, 1 - n);
|
|
@@ -15014,7 +14969,7 @@ function createScalePoint(key, channels, {
|
|
|
15014
14969
|
padding = 0.5,
|
|
15015
14970
|
...options
|
|
15016
14971
|
}) {
|
|
15017
|
-
return maybeRound(point$
|
|
14972
|
+
return maybeRound(point$4().align(align).padding(padding), channels, options, key);
|
|
15018
14973
|
}
|
|
15019
14974
|
function createScaleBand(key, channels, {
|
|
15020
14975
|
align = 0.5,
|
|
@@ -15051,7 +15006,7 @@ function inferDomain(channels, interval, key) {
|
|
|
15051
15006
|
if (values.size > 10e3 && registry.get(key) === position) {
|
|
15052
15007
|
throw new Error(`implicit ordinal domain of ${key} scale has more than 10,000 values`);
|
|
15053
15008
|
}
|
|
15054
|
-
return sort$
|
|
15009
|
+
return sort$1(values, ascendingDefined);
|
|
15055
15010
|
}
|
|
15056
15011
|
|
|
15057
15012
|
// If all channels provide a consistent hint, propagate it to the scale.
|
|
@@ -21774,7 +21729,7 @@ const defaults$1 = {
|
|
|
21774
21729
|
strokeWidth: 1.5
|
|
21775
21730
|
};
|
|
21776
21731
|
function withDefaultSort(options) {
|
|
21777
|
-
return options.sort === undefined && options.reverse === undefined ? sort
|
|
21732
|
+
return options.sort === undefined && options.reverse === undefined ? sort({
|
|
21778
21733
|
channel: "-r"
|
|
21779
21734
|
}, options) : options;
|
|
21780
21735
|
}
|
|
@@ -22138,7 +22093,7 @@ class CPTFit extends ProspectableElement {
|
|
|
22138
22093
|
`];
|
|
22139
22094
|
}
|
|
22140
22095
|
render() {
|
|
22141
|
-
return x$
|
|
22096
|
+
return x$2`
|
|
22142
22097
|
<div>
|
|
22143
22098
|
<div>After ${this.choices.length} trials:</div>
|
|
22144
22099
|
<div>Current:
|
|
@@ -22299,6 +22254,7 @@ class CPTParameters extends ProspectableElement {
|
|
|
22299
22254
|
|
|
22300
22255
|
decidables-slider {
|
|
22301
22256
|
line-height: 1;
|
|
22257
|
+
|
|
22302
22258
|
text-align: center;
|
|
22303
22259
|
}
|
|
22304
22260
|
|
|
@@ -22323,9 +22279,9 @@ class CPTParameters extends ProspectableElement {
|
|
|
22323
22279
|
`];
|
|
22324
22280
|
}
|
|
22325
22281
|
render() {
|
|
22326
|
-
return x$
|
|
22282
|
+
return x$2`
|
|
22327
22283
|
<div class="holder">
|
|
22328
|
-
${this.a != null ? x$
|
|
22284
|
+
${this.a != null ? x$2`<decidables-slider class="a"
|
|
22329
22285
|
?disabled=${!this.interactive}
|
|
22330
22286
|
scale
|
|
22331
22287
|
min=${CPTMath.a.MIN}
|
|
@@ -22334,8 +22290,8 @@ class CPTParameters extends ProspectableElement {
|
|
|
22334
22290
|
.value=${+this.a.toFixed(2)}
|
|
22335
22291
|
@change=${this.setAlpha.bind(this)}
|
|
22336
22292
|
@input=${this.setAlpha.bind(this)}
|
|
22337
|
-
><div>Alpha<br><span class="math-var">α</span></div></decidables-slider>` : x$
|
|
22338
|
-
${this.l != null ? x$
|
|
22293
|
+
><div>Alpha<br><span class="math-var">α</span></div></decidables-slider>` : x$2``}
|
|
22294
|
+
${this.l != null ? x$2`<decidables-slider class="l"
|
|
22339
22295
|
?disabled=${!this.interactive}
|
|
22340
22296
|
scale
|
|
22341
22297
|
min=${CPTMath.l.MIN}
|
|
@@ -22344,8 +22300,8 @@ class CPTParameters extends ProspectableElement {
|
|
|
22344
22300
|
.value=${+this.l.toFixed(2)}
|
|
22345
22301
|
@change=${this.setLambda.bind(this)}
|
|
22346
22302
|
@input=${this.setLambda.bind(this)}
|
|
22347
|
-
><div>Lambda<br><span class="math-var">λ</span></div></decidables-slider>` : x$
|
|
22348
|
-
${this.g != null ? x$
|
|
22303
|
+
><div>Lambda<br><span class="math-var">λ</span></div></decidables-slider>` : x$2``}
|
|
22304
|
+
${this.g != null ? x$2`<decidables-slider class="g"
|
|
22349
22305
|
?disabled=${!this.interactive}
|
|
22350
22306
|
scale
|
|
22351
22307
|
min=${CPTMath.g.MIN}
|
|
@@ -22354,7 +22310,7 @@ class CPTParameters extends ProspectableElement {
|
|
|
22354
22310
|
.value=${+this.g.toFixed(2)}
|
|
22355
22311
|
@change=${this.setGamma.bind(this)}
|
|
22356
22312
|
@input=${this.setGamma.bind(this)}
|
|
22357
|
-
><div>Gamma<br><span class="math-var">γ</span></div></decidables-slider>` : x$
|
|
22313
|
+
><div>Gamma<br><span class="math-var">γ</span></div></decidables-slider>` : x$2``}
|
|
22358
22314
|
</div>`;
|
|
22359
22315
|
}
|
|
22360
22316
|
}
|
|
@@ -22592,9 +22548,9 @@ class CPTProbability extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
22592
22548
|
|
|
22593
22549
|
.curve.interactive {
|
|
22594
22550
|
cursor: nwse-resize;
|
|
22551
|
+
outline: none;
|
|
22595
22552
|
|
|
22596
22553
|
filter: url("#shadow-2");
|
|
22597
|
-
outline: none;
|
|
22598
22554
|
}
|
|
22599
22555
|
|
|
22600
22556
|
.curve.interactive:hover {
|
|
@@ -22612,7 +22568,7 @@ class CPTProbability extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
22612
22568
|
transform: translateY(0);
|
|
22613
22569
|
}
|
|
22614
22570
|
|
|
22615
|
-
|
|
22571
|
+
.curve.interactive:focus-visible {
|
|
22616
22572
|
filter: url("#shadow-8");
|
|
22617
22573
|
|
|
22618
22574
|
/* HACK: This gets Safari to correctly apply the filter! */
|
|
@@ -22621,9 +22577,9 @@ class CPTProbability extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
22621
22577
|
|
|
22622
22578
|
.point.interactive {
|
|
22623
22579
|
cursor: nesw-resize;
|
|
22580
|
+
outline: none;
|
|
22624
22581
|
|
|
22625
22582
|
filter: url("#shadow-2");
|
|
22626
|
-
outline: none;
|
|
22627
22583
|
|
|
22628
22584
|
/* HACK: This gets Safari to correctly apply the filter! */
|
|
22629
22585
|
stroke: #000000;
|
|
@@ -22645,7 +22601,7 @@ class CPTProbability extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
22645
22601
|
stroke: #00ff00;
|
|
22646
22602
|
}
|
|
22647
22603
|
|
|
22648
|
-
|
|
22604
|
+
.point.interactive:focus-visible {
|
|
22649
22605
|
filter: url("#shadow-8");
|
|
22650
22606
|
|
|
22651
22607
|
/* HACK: This gets Safari to correctly apply the filter! */
|
|
@@ -22679,8 +22635,8 @@ class CPTProbability extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
22679
22635
|
|
|
22680
22636
|
.diagonal {
|
|
22681
22637
|
stroke: var(---color-element-border);
|
|
22682
|
-
stroke-dasharray: 4;
|
|
22683
22638
|
stroke-width: 1;
|
|
22639
|
+
stroke-dasharray: 4;
|
|
22684
22640
|
}
|
|
22685
22641
|
|
|
22686
22642
|
.curve {
|
|
@@ -22713,8 +22669,8 @@ class CPTProbability extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
22713
22669
|
font-size: 0.75rem;
|
|
22714
22670
|
|
|
22715
22671
|
dominant-baseline: middle;
|
|
22716
|
-
text-anchor: middle;
|
|
22717
22672
|
|
|
22673
|
+
text-anchor: middle;
|
|
22718
22674
|
fill: var(---color-text-inverse);
|
|
22719
22675
|
}
|
|
22720
22676
|
|
|
@@ -22726,15 +22682,15 @@ class CPTProbability extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
22726
22682
|
|
|
22727
22683
|
@media (pointer: coarse) {
|
|
22728
22684
|
.interactive .touch {
|
|
22729
|
-
stroke-linecap: round;
|
|
22730
22685
|
stroke-width: 12;
|
|
22686
|
+
stroke-linecap: round;
|
|
22731
22687
|
}
|
|
22732
22688
|
}
|
|
22733
22689
|
`];
|
|
22734
22690
|
}
|
|
22735
22691
|
render() {
|
|
22736
22692
|
/* eslint-disable-line class-methods-use-this */
|
|
22737
|
-
return x$
|
|
22693
|
+
return x$2``;
|
|
22738
22694
|
}
|
|
22739
22695
|
willUpdate() {
|
|
22740
22696
|
this.alignState();
|
|
@@ -23252,476 +23208,417 @@ class CPTProbability extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
23252
23208
|
}
|
|
23253
23209
|
customElements.define('cpt-probability', CPTProbability);
|
|
23254
23210
|
|
|
23255
|
-
|
|
23256
|
-
* Converts a point from 3D space to 2D space using orthographic projection.
|
|
23257
|
-
*
|
|
23258
|
-
* @param {Object} d - The 3D point to be projected.
|
|
23259
|
-
* @param {Object} options - Options for the projection.
|
|
23260
|
-
* @param {Array} options.origin - The origin point for the projection.
|
|
23261
|
-
* @param {number} options.scale - The scale factor for the projection.
|
|
23262
|
-
* @returns {Object} The projected point in 2D space.
|
|
23263
|
-
*/
|
|
23264
|
-
function orthographic(d, options) {
|
|
23265
|
-
/**
|
|
23266
|
-
* @typedef {Object} Point2D
|
|
23267
|
-
* @property {number} x - The x-coordinate in 2D space.
|
|
23268
|
-
* @property {number} y - The y-coordinate in 2D space.
|
|
23269
|
-
*/
|
|
23270
|
-
|
|
23271
|
-
/**
|
|
23272
|
-
* @type {Point2D}
|
|
23273
|
-
*/
|
|
23274
|
-
return {
|
|
23275
|
-
x: options.origin.x + options.scale * d.x,
|
|
23276
|
-
y: options.origin.y + options.scale * d.y
|
|
23277
|
-
};
|
|
23278
|
-
}
|
|
23279
|
-
|
|
23280
|
-
/**
|
|
23281
|
-
* Returns the x-coordinate of a point in 3D space.
|
|
23282
|
-
*
|
|
23283
|
-
* @param {Object} p - The point in 3D space represented as an object e.g {x: 0, y: 1, z: 0}
|
|
23284
|
-
* @returns {number} The x-coordinate of the point.
|
|
23285
|
-
*/
|
|
23286
|
-
function x(p) {
|
|
23287
|
-
return p.x;
|
|
23288
|
-
}
|
|
23289
|
-
|
|
23290
|
-
/**
|
|
23291
|
-
* Returns the y-coordinate of a point in 3D space.
|
|
23292
|
-
*
|
|
23293
|
-
* @param {Object} p - The point in 3D space represented as an object e.g x: 0, y: 1, z: 0}
|
|
23294
|
-
* @returns {number} The y-coordinate of the point.
|
|
23295
|
-
*/
|
|
23296
|
-
function y(p) {
|
|
23297
|
-
return p.y;
|
|
23298
|
-
}
|
|
23299
|
-
|
|
23300
|
-
/**
|
|
23301
|
-
* Returns the z-coordinate of a point in 3D space.
|
|
23302
|
-
*
|
|
23303
|
-
* @param {Object} p - The point in 3D space represented as an object e.g {x: 0, y: 1, z: 0}
|
|
23304
|
-
* @returns {number} The z-coordinate of the point.
|
|
23305
|
-
*/
|
|
23306
|
-
function z(p) {
|
|
23307
|
-
return p.z;
|
|
23308
|
-
}
|
|
23309
|
-
|
|
23310
|
-
/**
|
|
23311
|
-
* Comparator function to sort objects based on their centroid z-values.
|
|
23312
|
-
*
|
|
23313
|
-
* This function compares the z-values of the centroid property of two objects (a and b).
|
|
23314
|
-
* It returns a negative number if a should come before b, a positive number if a should come after b,
|
|
23315
|
-
* and 0 if a and b are considered equal in terms of sorting.
|
|
23316
|
-
*
|
|
23317
|
-
* @param {Object} a - The first object to compare.
|
|
23318
|
-
* @param {Object} b - The second object to compare.
|
|
23319
|
-
* @returns {number} - A negative, zero, or positive number indicating the sorting order.
|
|
23320
|
-
*
|
|
23321
|
-
* @example
|
|
23322
|
-
* // Sorting an array of objects based on centroid z-values
|
|
23323
|
-
* const sortedArray = unsortedArray.sort(sort);
|
|
23324
|
-
*/
|
|
23325
|
-
function sort(a, b) {
|
|
23326
|
-
// Extract z-values from objects
|
|
23327
|
-
const pa = a.centroid.z;
|
|
23328
|
-
const pb = b.centroid.z;
|
|
23211
|
+
var d33d$1 = {exports: {}};
|
|
23329
23212
|
|
|
23330
|
-
|
|
23331
|
-
|
|
23332
|
-
|
|
23213
|
+
var d33d = d33d$1.exports;
|
|
23214
|
+
(function (module, exports$1) {
|
|
23215
|
+
(function (i, h) {
|
|
23216
|
+
h(exports$1) ;
|
|
23217
|
+
})(d33d, function (i) {
|
|
23333
23218
|
|
|
23334
|
-
|
|
23335
|
-
|
|
23336
|
-
|
|
23337
|
-
|
|
23338
|
-
|
|
23339
|
-
|
|
23340
|
-
|
|
23341
|
-
|
|
23342
|
-
|
|
23343
|
-
|
|
23344
|
-
|
|
23345
|
-
|
|
23346
|
-
|
|
23347
|
-
|
|
23348
|
-
|
|
23349
|
-
|
|
23350
|
-
|
|
23351
|
-
|
|
23352
|
-
|
|
23353
|
-
|
|
23354
|
-
|
|
23355
|
-
|
|
23356
|
-
|
|
23357
|
-
|
|
23358
|
-
|
|
23359
|
-
|
|
23360
|
-
|
|
23361
|
-
|
|
23362
|
-
|
|
23363
|
-
|
|
23364
|
-
|
|
23365
|
-
|
|
23366
|
-
|
|
23367
|
-
|
|
23368
|
-
|
|
23369
|
-
|
|
23370
|
-
|
|
23371
|
-
|
|
23372
|
-
|
|
23373
|
-
|
|
23374
|
-
|
|
23375
|
-
|
|
23376
|
-
|
|
23377
|
-
|
|
23378
|
-
|
|
23379
|
-
|
|
23380
|
-
|
|
23381
|
-
|
|
23219
|
+
function h(r) {
|
|
23220
|
+
return `M${r[0].projected.x},${r[0].projected.y}L${r[1].projected.x},${r[1].projected.y}L${r[2].projected.x},${r[2].projected.y}L${r[3].projected.x},${r[3].projected.y}Z`;
|
|
23221
|
+
}
|
|
23222
|
+
function j(r) {
|
|
23223
|
+
return r.x;
|
|
23224
|
+
}
|
|
23225
|
+
function C(r) {
|
|
23226
|
+
return r.y;
|
|
23227
|
+
}
|
|
23228
|
+
function Z(r) {
|
|
23229
|
+
return r.z;
|
|
23230
|
+
}
|
|
23231
|
+
class c {
|
|
23232
|
+
constructor() {
|
|
23233
|
+
this._scale = 1, this._origin = {
|
|
23234
|
+
x: 0,
|
|
23235
|
+
y: 0
|
|
23236
|
+
}, this._rotateX = 0, this._rotateY = 0, this._rotateZ = 0, this._x = j, this._y = C, this._z = Z, this._rotationCenter = {
|
|
23237
|
+
x: 0,
|
|
23238
|
+
y: 0,
|
|
23239
|
+
z: 0
|
|
23240
|
+
};
|
|
23241
|
+
}
|
|
23242
|
+
scale(t) {
|
|
23243
|
+
return t ? (this._scale = t, this) : this._scale;
|
|
23244
|
+
}
|
|
23245
|
+
origin(t) {
|
|
23246
|
+
return t ? (this._origin = t, this) : this._origin;
|
|
23247
|
+
}
|
|
23248
|
+
rotationCenter(t) {
|
|
23249
|
+
return t ? (this._rotationCenter = t, this) : this._rotationCenter;
|
|
23250
|
+
}
|
|
23251
|
+
rotateX(t) {
|
|
23252
|
+
return t ? (this._rotateX = t, this) : this._rotateX;
|
|
23253
|
+
}
|
|
23254
|
+
rotateY(t) {
|
|
23255
|
+
return t ? (this._rotateY = t, this) : this._rotateY;
|
|
23256
|
+
}
|
|
23257
|
+
rotateZ(t) {
|
|
23258
|
+
return t ? (this._rotateZ = t, this) : this._rotateZ;
|
|
23259
|
+
}
|
|
23260
|
+
x(t) {
|
|
23261
|
+
return typeof t == "function" ? (this._x = t, this) : this._x;
|
|
23262
|
+
}
|
|
23263
|
+
y(t) {
|
|
23264
|
+
return typeof t == "function" ? (this._y = t, this) : this._y;
|
|
23265
|
+
}
|
|
23266
|
+
z(t) {
|
|
23267
|
+
return typeof t == "function" ? (this._z = t, this) : this._z;
|
|
23268
|
+
}
|
|
23269
|
+
}
|
|
23270
|
+
function z(r) {
|
|
23271
|
+
const t = [...r, r[0]];
|
|
23272
|
+
let n = 0;
|
|
23273
|
+
for (let e = 0; e < r.length; e += 1) {
|
|
23274
|
+
const o = t[e].rotated,
|
|
23275
|
+
s = t[e + 1].rotated;
|
|
23276
|
+
n += (s.x - o.x) * (s.y + o.y);
|
|
23277
|
+
}
|
|
23278
|
+
return n > 0;
|
|
23279
|
+
}
|
|
23280
|
+
function u(r) {
|
|
23281
|
+
let t = 0,
|
|
23282
|
+
n = 0,
|
|
23283
|
+
e = 0;
|
|
23284
|
+
for (let o = r.length - 1; o >= 0; o -= 1) {
|
|
23285
|
+
const s = r[o].rotated;
|
|
23286
|
+
t += s.x, n += s.y, e += s.z;
|
|
23287
|
+
}
|
|
23288
|
+
return {
|
|
23289
|
+
x: t / r.length,
|
|
23290
|
+
y: n / r.length,
|
|
23291
|
+
z: e / r.length
|
|
23292
|
+
};
|
|
23293
|
+
}
|
|
23294
|
+
function _(r, t) {
|
|
23295
|
+
const n = t.rotateCenter,
|
|
23296
|
+
e = {
|
|
23297
|
+
x: r.x - n.x,
|
|
23298
|
+
y: r.y - n.y,
|
|
23299
|
+
z: r.z - n.z
|
|
23300
|
+
},
|
|
23301
|
+
o = X(e, t.z),
|
|
23302
|
+
s = $(o, t.y),
|
|
23303
|
+
a = D(s, t.x);
|
|
23304
|
+
return {
|
|
23305
|
+
x: a.x + n.x,
|
|
23306
|
+
y: a.y + n.y,
|
|
23307
|
+
z: a.z + n.z
|
|
23308
|
+
};
|
|
23309
|
+
}
|
|
23310
|
+
function D(r, t) {
|
|
23311
|
+
const n = Math.sin(t),
|
|
23312
|
+
e = Math.cos(t);
|
|
23313
|
+
return {
|
|
23314
|
+
x: r.x,
|
|
23315
|
+
y: r.y * e - r.z * n,
|
|
23316
|
+
z: r.y * n + r.z * e
|
|
23317
|
+
};
|
|
23318
|
+
}
|
|
23319
|
+
function $(r, t) {
|
|
23320
|
+
const n = Math.sin(t),
|
|
23321
|
+
e = Math.cos(t);
|
|
23322
|
+
return {
|
|
23323
|
+
x: r.z * n + r.x * e,
|
|
23324
|
+
y: r.y,
|
|
23325
|
+
z: r.z * e - r.x * n
|
|
23326
|
+
};
|
|
23327
|
+
}
|
|
23328
|
+
function X(r, t) {
|
|
23329
|
+
const n = Math.sin(t),
|
|
23330
|
+
e = Math.cos(t);
|
|
23331
|
+
return {
|
|
23332
|
+
x: r.x * e - r.y * n,
|
|
23333
|
+
y: r.x * n + r.y * e,
|
|
23334
|
+
z: r.z
|
|
23335
|
+
};
|
|
23336
|
+
}
|
|
23337
|
+
function w(r, t) {
|
|
23338
|
+
return {
|
|
23339
|
+
x: t.origin.x + t.scale * r.x,
|
|
23340
|
+
y: t.origin.y + t.scale * r.y
|
|
23341
|
+
};
|
|
23342
|
+
}
|
|
23343
|
+
const d = (r, t) => r.map(n => {
|
|
23344
|
+
const e = {
|
|
23345
|
+
x: t.x(n),
|
|
23346
|
+
y: t.y(n),
|
|
23347
|
+
z: t.z(n)
|
|
23348
|
+
},
|
|
23349
|
+
o = _(e, {
|
|
23350
|
+
x: t.rotateX,
|
|
23351
|
+
y: t.rotateY,
|
|
23352
|
+
z: t.rotateZ,
|
|
23353
|
+
rotateCenter: t.rotateCenter
|
|
23354
|
+
}),
|
|
23355
|
+
s = w(o, {
|
|
23356
|
+
scale: t.scale,
|
|
23357
|
+
origin: t.origin
|
|
23358
|
+
});
|
|
23359
|
+
return {
|
|
23360
|
+
...n,
|
|
23361
|
+
rotated: o,
|
|
23362
|
+
projected: s
|
|
23363
|
+
};
|
|
23382
23364
|
});
|
|
23383
|
-
|
|
23384
|
-
|
|
23385
|
-
|
|
23386
|
-
|
|
23387
|
-
|
|
23388
|
-
|
|
23389
|
-
|
|
23390
|
-
|
|
23391
|
-
|
|
23392
|
-
|
|
23393
|
-
|
|
23394
|
-
|
|
23395
|
-
|
|
23396
|
-
|
|
23397
|
-
|
|
23398
|
-
|
|
23399
|
-
|
|
23400
|
-
|
|
23401
|
-
|
|
23402
|
-
|
|
23403
|
-
|
|
23404
|
-
|
|
23405
|
-
|
|
23406
|
-
|
|
23407
|
-
|
|
23408
|
-
|
|
23409
|
-
|
|
23410
|
-
|
|
23411
|
-
|
|
23412
|
-
|
|
23413
|
-
|
|
23414
|
-
|
|
23415
|
-
|
|
23416
|
-
|
|
23417
|
-
|
|
23418
|
-
|
|
23419
|
-
|
|
23420
|
-
|
|
23421
|
-
|
|
23422
|
-
|
|
23423
|
-
|
|
23424
|
-
|
|
23425
|
-
|
|
23426
|
-
|
|
23427
|
-
|
|
23428
|
-
|
|
23429
|
-
|
|
23430
|
-
|
|
23431
|
-
|
|
23432
|
-
|
|
23433
|
-
|
|
23434
|
-
|
|
23435
|
-
|
|
23436
|
-
|
|
23437
|
-
|
|
23438
|
-
|
|
23439
|
-
|
|
23440
|
-
|
|
23441
|
-
|
|
23442
|
-
|
|
23443
|
-
|
|
23444
|
-
|
|
23445
|
-
|
|
23446
|
-
|
|
23447
|
-
|
|
23448
|
-
|
|
23449
|
-
|
|
23450
|
-
|
|
23451
|
-
|
|
23452
|
-
|
|
23453
|
-
|
|
23454
|
-
|
|
23455
|
-
|
|
23456
|
-
|
|
23457
|
-
|
|
23458
|
-
|
|
23459
|
-
|
|
23460
|
-
|
|
23461
|
-
|
|
23462
|
-
|
|
23463
|
-
|
|
23464
|
-
|
|
23465
|
-
|
|
23466
|
-
|
|
23467
|
-
|
|
23468
|
-
|
|
23469
|
-
|
|
23470
|
-
|
|
23471
|
-
|
|
23472
|
-
|
|
23473
|
-
|
|
23474
|
-
|
|
23475
|
-
|
|
23476
|
-
|
|
23477
|
-
|
|
23478
|
-
|
|
23479
|
-
|
|
23480
|
-
|
|
23481
|
-
|
|
23482
|
-
|
|
23483
|
-
|
|
23484
|
-
|
|
23485
|
-
|
|
23486
|
-
|
|
23487
|
-
|
|
23488
|
-
|
|
23489
|
-
|
|
23490
|
-
|
|
23491
|
-
|
|
23492
|
-
|
|
23493
|
-
|
|
23494
|
-
|
|
23495
|
-
|
|
23496
|
-
|
|
23497
|
-
|
|
23498
|
-
|
|
23499
|
-
|
|
23500
|
-
|
|
23501
|
-
|
|
23502
|
-
|
|
23503
|
-
|
|
23504
|
-
|
|
23505
|
-
|
|
23506
|
-
|
|
23507
|
-
|
|
23508
|
-
|
|
23509
|
-
|
|
23510
|
-
|
|
23511
|
-
|
|
23512
|
-
|
|
23513
|
-
|
|
23514
|
-
|
|
23515
|
-
|
|
23516
|
-
|
|
23517
|
-
|
|
23518
|
-
|
|
23519
|
-
|
|
23520
|
-
|
|
23521
|
-
|
|
23522
|
-
|
|
23523
|
-
|
|
23524
|
-
|
|
23525
|
-
|
|
23526
|
-
|
|
23527
|
-
|
|
23528
|
-
|
|
23529
|
-
|
|
23530
|
-
|
|
23531
|
-
|
|
23532
|
-
|
|
23533
|
-
|
|
23534
|
-
|
|
23535
|
-
|
|
23536
|
-
|
|
23537
|
-
|
|
23538
|
-
|
|
23539
|
-
|
|
23540
|
-
|
|
23541
|
-
|
|
23542
|
-
|
|
23543
|
-
|
|
23544
|
-
|
|
23545
|
-
|
|
23546
|
-
|
|
23547
|
-
|
|
23548
|
-
|
|
23549
|
-
|
|
23550
|
-
|
|
23551
|
-
|
|
23552
|
-
|
|
23553
|
-
|
|
23554
|
-
|
|
23555
|
-
|
|
23556
|
-
|
|
23557
|
-
|
|
23558
|
-
|
|
23559
|
-
|
|
23560
|
-
|
|
23561
|
-
|
|
23562
|
-
|
|
23563
|
-
|
|
23564
|
-
|
|
23565
|
-
|
|
23566
|
-
}
|
|
23567
|
-
|
|
23568
|
-
|
|
23569
|
-
|
|
23570
|
-
|
|
23571
|
-
|
|
23572
|
-
|
|
23573
|
-
|
|
23574
|
-
|
|
23575
|
-
|
|
23576
|
-
|
|
23577
|
-
|
|
23578
|
-
|
|
23579
|
-
|
|
23580
|
-
|
|
23581
|
-
|
|
23582
|
-
|
|
23583
|
-
|
|
23584
|
-
|
|
23585
|
-
|
|
23586
|
-
|
|
23587
|
-
|
|
23588
|
-
|
|
23589
|
-
|
|
23590
|
-
|
|
23591
|
-
|
|
23592
|
-
|
|
23593
|
-
|
|
23594
|
-
|
|
23595
|
-
|
|
23596
|
-
|
|
23597
|
-
|
|
23598
|
-
|
|
23599
|
-
|
|
23600
|
-
|
|
23601
|
-
|
|
23602
|
-
|
|
23603
|
-
|
|
23604
|
-
|
|
23605
|
-
|
|
23606
|
-
|
|
23607
|
-
|
|
23608
|
-
|
|
23609
|
-
|
|
23610
|
-
|
|
23611
|
-
|
|
23612
|
-
|
|
23613
|
-
|
|
23614
|
-
|
|
23615
|
-
|
|
23616
|
-
|
|
23617
|
-
|
|
23618
|
-
|
|
23619
|
-
|
|
23620
|
-
|
|
23621
|
-
|
|
23622
|
-
|
|
23623
|
-
|
|
23624
|
-
|
|
23625
|
-
}
|
|
23626
|
-
|
|
23627
|
-
|
|
23628
|
-
|
|
23629
|
-
|
|
23630
|
-
|
|
23631
|
-
|
|
23632
|
-
|
|
23633
|
-
|
|
23634
|
-
|
|
23635
|
-
|
|
23636
|
-
|
|
23637
|
-
|
|
23638
|
-
|
|
23639
|
-
|
|
23640
|
-
z: p.z
|
|
23641
|
-
};
|
|
23642
|
-
}
|
|
23643
|
-
|
|
23644
|
-
function point(points, options, point, angles) {
|
|
23645
|
-
for (let i = points.length - 1; i >= 0; i--) {
|
|
23646
|
-
const p = points[i];
|
|
23647
|
-
p.rotated = rotateRzRyRx({
|
|
23648
|
-
x: point.x(p),
|
|
23649
|
-
y: point.y(p),
|
|
23650
|
-
z: point.z(p)
|
|
23651
|
-
}, angles);
|
|
23652
|
-
p.centroid = p.rotated;
|
|
23653
|
-
p.projected = options.project(p.rotated, options);
|
|
23654
|
-
}
|
|
23655
|
-
return points;
|
|
23656
|
-
}
|
|
23657
|
-
function points3D() {
|
|
23658
|
-
return generator3D(point, undefined);
|
|
23659
|
-
}
|
|
23660
|
-
|
|
23661
|
-
function drawPlane(d) {
|
|
23662
|
-
return `M${d[0].projected.x},${d[0].projected.y}L${d[1].projected.x},${d[1].projected.y}L${d[2].projected.x},${d[2].projected.y}L${d[3].projected.x},${d[3].projected.y}Z`;
|
|
23663
|
-
}
|
|
23664
|
-
|
|
23665
|
-
function gridPlane(grid, options, point$1, angles) {
|
|
23666
|
-
const points = point(grid, options, point$1, angles);
|
|
23667
|
-
const planes = [];
|
|
23668
|
-
const numPts = options.row;
|
|
23669
|
-
const numRow = points.length / numPts;
|
|
23670
|
-
let cnt = 0;
|
|
23671
|
-
for (var i = numRow - 1; i > 0; i--) {
|
|
23672
|
-
for (var j = numPts - 1; j > 0; j--) {
|
|
23673
|
-
var p1 = j + i * numPts,
|
|
23674
|
-
p4 = p1 - 1,
|
|
23675
|
-
p2 = p4 - numPts + 1,
|
|
23676
|
-
p3 = p2 - 1;
|
|
23677
|
-
var pl = [points[p1], points[p2], points[p3], points[p4]];
|
|
23678
|
-
pl.plane = `plane-${cnt++}`;
|
|
23679
|
-
pl.ccw = ccw(pl);
|
|
23680
|
-
pl.centroid = centroid(pl);
|
|
23681
|
-
planes.push(pl);
|
|
23682
|
-
}
|
|
23683
|
-
}
|
|
23684
|
-
return planes;
|
|
23685
|
-
}
|
|
23686
|
-
function gridPlanes3D() {
|
|
23687
|
-
return generator3D(gridPlane, drawPlane);
|
|
23688
|
-
}
|
|
23689
|
-
|
|
23690
|
-
function drawLineStrip(lineStrip) {
|
|
23691
|
-
const lastPoint = lineStrip[lineStrip.length - 1];
|
|
23692
|
-
let path = `M${lastPoint.projected.x},${lastPoint.projected.y}`;
|
|
23693
|
-
for (var i = lineStrip.length - 2; i >= 0; i--) {
|
|
23694
|
-
const p = lineStrip[i].projected;
|
|
23695
|
-
path += `L${p.x},${p.y}`;
|
|
23696
|
-
}
|
|
23697
|
-
return path;
|
|
23698
|
-
}
|
|
23699
|
-
|
|
23700
|
-
function lineStrip(lineStrip, options, point, angles) {
|
|
23701
|
-
for (let i = lineStrip.length - 1; i >= 0; i--) {
|
|
23702
|
-
const l = lineStrip[i];
|
|
23703
|
-
const m = l.length / 2;
|
|
23704
|
-
const t = parseInt(m);
|
|
23705
|
-
for (let j = l.length - 1; j >= 0; j--) {
|
|
23706
|
-
const p = l[j];
|
|
23707
|
-
p.rotated = rotateRzRyRx({
|
|
23708
|
-
x: point.x(p),
|
|
23709
|
-
y: point.y(p),
|
|
23710
|
-
z: point.z(p)
|
|
23711
|
-
}, angles);
|
|
23712
|
-
p.projected = options.project(p.rotated, options);
|
|
23713
|
-
}
|
|
23714
|
-
l.centroid = t === m ? centroid([l[m - 1], l[m]]) : {
|
|
23715
|
-
x: l[t].rotated.x,
|
|
23716
|
-
y: l[t].rotated.y,
|
|
23717
|
-
z: l[t].rotated.z
|
|
23718
|
-
};
|
|
23719
|
-
}
|
|
23720
|
-
return lineStrip;
|
|
23721
|
-
}
|
|
23722
|
-
function lineStrips3D() {
|
|
23723
|
-
return generator3D(lineStrip, drawLineStrip);
|
|
23724
|
-
}
|
|
23365
|
+
function l(r, t) {
|
|
23366
|
+
const n = r;
|
|
23367
|
+
return n.centroid = u(n), n.ccw = z(n), n.face = t, n;
|
|
23368
|
+
}
|
|
23369
|
+
class Y extends c {
|
|
23370
|
+
data(t) {
|
|
23371
|
+
return t.map(n => {
|
|
23372
|
+
const e = d(n, {
|
|
23373
|
+
origin: this.origin(),
|
|
23374
|
+
rotateCenter: this.rotationCenter(),
|
|
23375
|
+
rotateX: this.rotateX(),
|
|
23376
|
+
rotateY: this.rotateY(),
|
|
23377
|
+
rotateZ: this.rotateZ(),
|
|
23378
|
+
scale: this.scale(),
|
|
23379
|
+
x: this.x(),
|
|
23380
|
+
y: this.y(),
|
|
23381
|
+
z: this.z()
|
|
23382
|
+
}),
|
|
23383
|
+
o = l([e[0], e[1], e[2], e[3]], "front"),
|
|
23384
|
+
s = l([e[7], e[6], e[5], e[4]], "back"),
|
|
23385
|
+
a = l([e[4], e[5], e[1], e[0]], "left"),
|
|
23386
|
+
y = l([e[3], e[2], e[6], e[7]], "right"),
|
|
23387
|
+
x = l([e[4], e[0], e[3], e[7]], "top"),
|
|
23388
|
+
g = l([e[1], e[5], e[6], e[2]], "bottom");
|
|
23389
|
+
return e.faces = [o, s, a, y, x, g], e.centroid = {
|
|
23390
|
+
x: (a.centroid.x + y.centroid.x) / 2,
|
|
23391
|
+
y: (x.centroid.y + g.centroid.y) / 2,
|
|
23392
|
+
z: (o.centroid.z + s.centroid.z) / 2
|
|
23393
|
+
}, e;
|
|
23394
|
+
});
|
|
23395
|
+
}
|
|
23396
|
+
draw(t) {
|
|
23397
|
+
return h(t);
|
|
23398
|
+
}
|
|
23399
|
+
}
|
|
23400
|
+
function P() {
|
|
23401
|
+
return new Y();
|
|
23402
|
+
}
|
|
23403
|
+
class M extends c {
|
|
23404
|
+
constructor() {
|
|
23405
|
+
super(...arguments), this._rows = 1;
|
|
23406
|
+
}
|
|
23407
|
+
rows(t) {
|
|
23408
|
+
return t ? (this._rows = t, this) : this._rows;
|
|
23409
|
+
}
|
|
23410
|
+
data(t) {
|
|
23411
|
+
const n = this._rows,
|
|
23412
|
+
e = d(t, {
|
|
23413
|
+
origin: this.origin(),
|
|
23414
|
+
rotateCenter: this.rotationCenter(),
|
|
23415
|
+
rotateX: this.rotateX(),
|
|
23416
|
+
rotateY: this.rotateY(),
|
|
23417
|
+
rotateZ: this.rotateZ(),
|
|
23418
|
+
scale: this.scale(),
|
|
23419
|
+
x: this.x(),
|
|
23420
|
+
y: this.y(),
|
|
23421
|
+
z: this.z()
|
|
23422
|
+
}),
|
|
23423
|
+
o = e.length / n,
|
|
23424
|
+
s = [];
|
|
23425
|
+
let a = 0;
|
|
23426
|
+
for (let y = o - 1; y > 0; y -= 1) for (let x = n - 1; x > 0; x -= 1) {
|
|
23427
|
+
const g = x + y * n,
|
|
23428
|
+
m = g - 1,
|
|
23429
|
+
p = m - n + 1,
|
|
23430
|
+
N = p - 1,
|
|
23431
|
+
f = [e[g], e[p], e[N], e[m]];
|
|
23432
|
+
f.plane = `plane-${a}`, f.ccw = z(f), f.centroid = u(f), s.push(f), a += 1;
|
|
23433
|
+
}
|
|
23434
|
+
return s;
|
|
23435
|
+
}
|
|
23436
|
+
draw(t) {
|
|
23437
|
+
return h(t);
|
|
23438
|
+
}
|
|
23439
|
+
}
|
|
23440
|
+
function R() {
|
|
23441
|
+
return new M();
|
|
23442
|
+
}
|
|
23443
|
+
class b extends c {
|
|
23444
|
+
data(t) {
|
|
23445
|
+
return t.map(n => {
|
|
23446
|
+
const e = d(n, {
|
|
23447
|
+
origin: this.origin(),
|
|
23448
|
+
rotateCenter: this.rotationCenter(),
|
|
23449
|
+
rotateX: this.rotateX(),
|
|
23450
|
+
rotateY: this.rotateY(),
|
|
23451
|
+
rotateZ: this.rotateZ(),
|
|
23452
|
+
scale: this.scale(),
|
|
23453
|
+
x: this.x(),
|
|
23454
|
+
y: this.y(),
|
|
23455
|
+
z: this.z()
|
|
23456
|
+
});
|
|
23457
|
+
return e.centroid = u(e), e;
|
|
23458
|
+
});
|
|
23459
|
+
}
|
|
23460
|
+
}
|
|
23461
|
+
function L() {
|
|
23462
|
+
return new b();
|
|
23463
|
+
}
|
|
23464
|
+
function S(r) {
|
|
23465
|
+
const t = r[r.length - 1];
|
|
23466
|
+
let n = `M${t.projected.x},${t.projected.y}`;
|
|
23467
|
+
for (let e = r.length - 2; e >= 0; e -= 1) {
|
|
23468
|
+
const o = r[e].projected;
|
|
23469
|
+
n += `L${o.x},${o.y}`;
|
|
23470
|
+
}
|
|
23471
|
+
return n;
|
|
23472
|
+
}
|
|
23473
|
+
class A extends c {
|
|
23474
|
+
data(t) {
|
|
23475
|
+
return t.map(n => {
|
|
23476
|
+
const e = n.length / 2,
|
|
23477
|
+
o = Math.trunc(e),
|
|
23478
|
+
s = d(n, {
|
|
23479
|
+
origin: this.origin(),
|
|
23480
|
+
rotateCenter: this.rotationCenter(),
|
|
23481
|
+
rotateX: this.rotateX(),
|
|
23482
|
+
rotateY: this.rotateY(),
|
|
23483
|
+
rotateZ: this.rotateZ(),
|
|
23484
|
+
scale: this.scale(),
|
|
23485
|
+
x: this.x(),
|
|
23486
|
+
y: this.y(),
|
|
23487
|
+
z: this.z()
|
|
23488
|
+
});
|
|
23489
|
+
return s.centroid = o === e ? u([s[e - 1], s[e]]) : s[o].rotated, s;
|
|
23490
|
+
});
|
|
23491
|
+
}
|
|
23492
|
+
draw(t) {
|
|
23493
|
+
return S(t);
|
|
23494
|
+
}
|
|
23495
|
+
}
|
|
23496
|
+
function T() {
|
|
23497
|
+
return new A();
|
|
23498
|
+
}
|
|
23499
|
+
class k extends c {
|
|
23500
|
+
data(t) {
|
|
23501
|
+
return t.map(n => {
|
|
23502
|
+
const e = d(n, {
|
|
23503
|
+
origin: this.origin(),
|
|
23504
|
+
rotateCenter: this.rotationCenter(),
|
|
23505
|
+
rotateX: this.rotateX(),
|
|
23506
|
+
rotateY: this.rotateY(),
|
|
23507
|
+
rotateZ: this.rotateZ(),
|
|
23508
|
+
scale: this.scale(),
|
|
23509
|
+
x: this.x(),
|
|
23510
|
+
y: this.y(),
|
|
23511
|
+
z: this.z()
|
|
23512
|
+
});
|
|
23513
|
+
return e.ccw = z(e), e.centroid = u(e), e;
|
|
23514
|
+
});
|
|
23515
|
+
}
|
|
23516
|
+
draw(t) {
|
|
23517
|
+
return h(t);
|
|
23518
|
+
}
|
|
23519
|
+
}
|
|
23520
|
+
function F() {
|
|
23521
|
+
return new k();
|
|
23522
|
+
}
|
|
23523
|
+
class G extends c {
|
|
23524
|
+
data(t) {
|
|
23525
|
+
return t.map(n => {
|
|
23526
|
+
const e = {
|
|
23527
|
+
x: this.x()(n),
|
|
23528
|
+
y: this.y()(n),
|
|
23529
|
+
z: this.z()(n)
|
|
23530
|
+
},
|
|
23531
|
+
o = _(e, {
|
|
23532
|
+
x: this.rotateX(),
|
|
23533
|
+
y: this.rotateY(),
|
|
23534
|
+
z: this.rotateZ(),
|
|
23535
|
+
rotateCenter: this.rotationCenter()
|
|
23536
|
+
}),
|
|
23537
|
+
s = w(e, {
|
|
23538
|
+
scale: this.scale(),
|
|
23539
|
+
origin: this.origin()
|
|
23540
|
+
});
|
|
23541
|
+
return {
|
|
23542
|
+
...n,
|
|
23543
|
+
rotated: o,
|
|
23544
|
+
centroid: o,
|
|
23545
|
+
projected: s
|
|
23546
|
+
};
|
|
23547
|
+
});
|
|
23548
|
+
}
|
|
23549
|
+
}
|
|
23550
|
+
function O() {
|
|
23551
|
+
return new G();
|
|
23552
|
+
}
|
|
23553
|
+
function q(r) {
|
|
23554
|
+
const t = r[r.length - 1];
|
|
23555
|
+
let n = `M${t.projected.x},${t.projected.y}`;
|
|
23556
|
+
for (let e = r.length - 2; e >= 0; e -= 1) {
|
|
23557
|
+
const o = r[e].projected;
|
|
23558
|
+
n += `L${o.x},${o.y}`;
|
|
23559
|
+
}
|
|
23560
|
+
return `${n}Z`;
|
|
23561
|
+
}
|
|
23562
|
+
class B extends c {
|
|
23563
|
+
data(t) {
|
|
23564
|
+
return t.map(n => {
|
|
23565
|
+
const e = d(n, {
|
|
23566
|
+
origin: this.origin(),
|
|
23567
|
+
rotateCenter: this.rotationCenter(),
|
|
23568
|
+
rotateX: this.rotateX(),
|
|
23569
|
+
rotateY: this.rotateY(),
|
|
23570
|
+
rotateZ: this.rotateZ(),
|
|
23571
|
+
scale: this.scale(),
|
|
23572
|
+
x: this.x(),
|
|
23573
|
+
y: this.y(),
|
|
23574
|
+
z: this.z()
|
|
23575
|
+
});
|
|
23576
|
+
return e.ccw = z(e), e.centroid = u(e), e;
|
|
23577
|
+
});
|
|
23578
|
+
}
|
|
23579
|
+
draw(t) {
|
|
23580
|
+
return q(t);
|
|
23581
|
+
}
|
|
23582
|
+
}
|
|
23583
|
+
function E() {
|
|
23584
|
+
return new B();
|
|
23585
|
+
}
|
|
23586
|
+
const H = r => `M${r[0].projected.x},${r[0].projected.y}L${r[1].projected.x},${r[1].projected.y}L${r[2].projected.x},${r[2].projected.y}Z`;
|
|
23587
|
+
class I extends c {
|
|
23588
|
+
data(t) {
|
|
23589
|
+
return t.map(n => {
|
|
23590
|
+
const e = d(n, {
|
|
23591
|
+
origin: this.origin(),
|
|
23592
|
+
rotateCenter: this.rotationCenter(),
|
|
23593
|
+
rotateX: this.rotateX(),
|
|
23594
|
+
rotateY: this.rotateY(),
|
|
23595
|
+
rotateZ: this.rotateZ(),
|
|
23596
|
+
scale: this.scale(),
|
|
23597
|
+
x: this.x(),
|
|
23598
|
+
y: this.y(),
|
|
23599
|
+
z: this.z()
|
|
23600
|
+
});
|
|
23601
|
+
return e.ccw = z(e), e.centroid = u(e), e;
|
|
23602
|
+
});
|
|
23603
|
+
}
|
|
23604
|
+
draw(t) {
|
|
23605
|
+
return H(t);
|
|
23606
|
+
}
|
|
23607
|
+
}
|
|
23608
|
+
function J() {
|
|
23609
|
+
return new I();
|
|
23610
|
+
}
|
|
23611
|
+
function K(r, t) {
|
|
23612
|
+
const n = r.centroid.z,
|
|
23613
|
+
e = t.centroid.z;
|
|
23614
|
+
return n < e ? -1 : n > e ? 1 : 0;
|
|
23615
|
+
}
|
|
23616
|
+
i.cubes3D = P, i.gridPlanes3D = R, i.lineStrips3D = T, i.lines3D = L, i.planes3D = F, i.points3D = O, i.polygons3D = E, i.sort = K, i.triangles3D = J, Object.defineProperty(i, Symbol.toStringTag, {
|
|
23617
|
+
value: "Module"
|
|
23618
|
+
});
|
|
23619
|
+
});
|
|
23620
|
+
})(d33d$1, d33d$1.exports);
|
|
23621
|
+
var d33dExports = d33d$1.exports;
|
|
23725
23622
|
|
|
23726
23623
|
var cssKeywords = {
|
|
23727
23624
|
aliceblue: [240, 248, 255],
|
|
@@ -25794,6 +25691,7 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
25794
25691
|
font-weight: 600;
|
|
25795
25692
|
|
|
25796
25693
|
alignment-baseline: middle;
|
|
25694
|
+
|
|
25797
25695
|
text-anchor: middle;
|
|
25798
25696
|
}
|
|
25799
25697
|
|
|
@@ -25817,6 +25715,7 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
25817
25715
|
font-size: 0.75rem;
|
|
25818
25716
|
|
|
25819
25717
|
alignment-baseline: middle;
|
|
25718
|
+
|
|
25820
25719
|
text-anchor: end;
|
|
25821
25720
|
}
|
|
25822
25721
|
|
|
@@ -25857,6 +25756,7 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
25857
25756
|
font-weight: 600;
|
|
25858
25757
|
|
|
25859
25758
|
alignment-baseline: middle;
|
|
25759
|
+
|
|
25860
25760
|
text-anchor: middle;
|
|
25861
25761
|
}
|
|
25862
25762
|
|
|
@@ -25870,7 +25770,7 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
25870
25770
|
}
|
|
25871
25771
|
render() {
|
|
25872
25772
|
/* eslint-disable-line class-methods-use-this */
|
|
25873
|
-
return x$
|
|
25773
|
+
return x$2`
|
|
25874
25774
|
`;
|
|
25875
25775
|
}
|
|
25876
25776
|
willUpdate() {
|
|
@@ -25926,10 +25826,11 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
25926
25826
|
};
|
|
25927
25827
|
const startRotationX = -0.85 * Math.PI / 8;
|
|
25928
25828
|
const startRotationY = 3 * Math.PI / 8;
|
|
25929
|
-
const startRotationZ = 0;
|
|
25930
|
-
|
|
25931
|
-
const
|
|
25932
|
-
const
|
|
25829
|
+
const startRotationZ = 0.0000001; // Avoid d3-3d bug
|
|
25830
|
+
|
|
25831
|
+
const lineStrips3D = d33dExports.lineStrips3D().origin(startOrigin).scale(startScale).rotationCenter(startRotationCenter).rotateX(startRotationX + this.rotationX).rotateY(startRotationY + this.rotationY).rotateZ(startRotationZ);
|
|
25832
|
+
const points3d = d33dExports.points3D().origin(startOrigin).scale(startScale).rotationCenter(startRotationCenter).rotateX(startRotationX + this.rotationX).rotateY(startRotationY + this.rotationY).rotateZ(startRotationZ);
|
|
25833
|
+
const grid3d = d33dExports.gridPlanes3D().origin(startOrigin).scale(startScale).rotationCenter(startRotationCenter).rotateX(startRotationX + this.rotationX).rotateY(startRotationY + this.rotationY).rotateZ(startRotationZ);
|
|
25933
25834
|
|
|
25934
25835
|
// SVG Drag behaviors
|
|
25935
25836
|
const svgDrag = drag().on('start', event => {
|
|
@@ -25994,35 +25895,35 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
25994
25895
|
|
|
25995
25896
|
// Axes
|
|
25996
25897
|
// DATA-JOIN
|
|
25997
|
-
const axisXUpdate = svgMerge.selectAll('.axis-x').data(lineStrips3D
|
|
25898
|
+
const axisXUpdate = svgMerge.selectAll('.axis-x').data(lineStrips3D.x(datum => {
|
|
25998
25899
|
return datum.x;
|
|
25999
25900
|
}).y(() => {
|
|
26000
25901
|
return yScale.range()[0];
|
|
26001
25902
|
}).z(() => {
|
|
26002
25903
|
return zScale.range()[0];
|
|
26003
|
-
})(xAxis));
|
|
26004
|
-
const axisYUpdate = svgMerge.selectAll('.axis-y').data(lineStrips3D
|
|
25904
|
+
}).data(xAxis));
|
|
25905
|
+
const axisYUpdate = svgMerge.selectAll('.axis-y').data(lineStrips3D.x(() => {
|
|
26005
25906
|
return xScale.range()[0];
|
|
26006
25907
|
}).y(datum => {
|
|
26007
25908
|
return datum.y;
|
|
26008
25909
|
}).z(() => {
|
|
26009
25910
|
return zScale.range()[1];
|
|
26010
|
-
})(yAxis));
|
|
26011
|
-
const axisZUpdate = svgMerge.selectAll('.axis-z').data(lineStrips3D
|
|
25911
|
+
}).data(yAxis));
|
|
25912
|
+
const axisZUpdate = svgMerge.selectAll('.axis-z').data(lineStrips3D.x(() => {
|
|
26012
25913
|
return xScale.range()[0];
|
|
26013
25914
|
}).y(() => {
|
|
26014
25915
|
return yScale.range()[0];
|
|
26015
25916
|
}).z(datum => {
|
|
26016
25917
|
return datum.z;
|
|
26017
|
-
})(zAxis));
|
|
25918
|
+
}).data(zAxis));
|
|
26018
25919
|
// ENTER
|
|
26019
25920
|
const axisXEnter = axisXUpdate.enter().append('path').attr('class', 'd3-3d axis axis-x');
|
|
26020
25921
|
const axisYEnter = axisYUpdate.enter().append('path').attr('class', 'd3-3d axis axis-y');
|
|
26021
25922
|
const axisZEnter = axisZUpdate.enter().append('path').attr('class', 'd3-3d axis axis-z');
|
|
26022
25923
|
// MERGE
|
|
26023
|
-
const axisXMerge = axisXEnter.merge(axisXUpdate).attr('d', lineStrips3D
|
|
26024
|
-
const axisYMerge = axisYEnter.merge(axisYUpdate).attr('d', lineStrips3D
|
|
26025
|
-
const axisZMerge = axisZEnter.merge(axisZUpdate).attr('d', lineStrips3D
|
|
25924
|
+
const axisXMerge = axisXEnter.merge(axisXUpdate).attr('d', lineStrips3D.draw);
|
|
25925
|
+
const axisYMerge = axisYEnter.merge(axisYUpdate).attr('d', lineStrips3D.draw);
|
|
25926
|
+
const axisZMerge = axisZEnter.merge(axisZUpdate).attr('d', lineStrips3D.draw);
|
|
26026
25927
|
// EXIT
|
|
26027
25928
|
axisXMerge.exit().remove();
|
|
26028
25929
|
axisYMerge.exit().remove();
|
|
@@ -26030,34 +25931,52 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26030
25931
|
|
|
26031
25932
|
// Axis Titles
|
|
26032
25933
|
// DATA-JOIN
|
|
26033
|
-
const titlePathXUpdate = svgMerge.selectAll('.title-path-x').data(lineStrips3D
|
|
25934
|
+
const titlePathXUpdate = svgMerge.selectAll('.title-path-x').data(lineStrips3D.x(datum => {
|
|
26034
25935
|
return datum.id === 'min' ? datum.x - this.rem * 20 : datum.x + this.rem * 20;
|
|
26035
25936
|
}).y(() => {
|
|
26036
25937
|
return yScale.range()[0] + this.rem * 1.75;
|
|
26037
25938
|
}).z(() => {
|
|
26038
25939
|
return zScale.range()[0] + this.rem * 1.75;
|
|
26039
|
-
})(xAxis));
|
|
26040
|
-
const titlePathYUpdate = svgMerge.selectAll('.title-path-y').data(lineStrips3D
|
|
25940
|
+
}).data(xAxis));
|
|
25941
|
+
const titlePathYUpdate = svgMerge.selectAll('.title-path-y').data(lineStrips3D.x(() => {
|
|
26041
25942
|
return xScale.range()[0] - this.rem * 1.75;
|
|
26042
25943
|
}).y(datum => {
|
|
26043
25944
|
return datum.id === 'min' ? datum.y + this.rem * 20 : datum.y - this.rem * 20;
|
|
26044
25945
|
}).z(() => {
|
|
26045
25946
|
return zScale.range()[1] - this.rem * 1.75;
|
|
26046
|
-
})(yAxis));
|
|
26047
|
-
const titlePathZUpdate = svgMerge.selectAll('.title-path-z').data(lineStrips3D
|
|
25947
|
+
}).data(yAxis));
|
|
25948
|
+
const titlePathZUpdate = svgMerge.selectAll('.title-path-z').data(lineStrips3D.x(() => {
|
|
26048
25949
|
return xScale.range()[0] - this.rem * 1.75;
|
|
26049
25950
|
}).y(() => {
|
|
26050
25951
|
return yScale.range()[0] + this.rem * 1.75;
|
|
26051
25952
|
}).z(datum => {
|
|
26052
25953
|
return datum.id === 'min' ? datum.z - this.rem * 20 : datum.z + this.rem * 20;
|
|
26053
|
-
})(zAxis));
|
|
26054
|
-
const titleXUpdate = svgMerge.selectAll('.title-x').data(
|
|
25954
|
+
}).data(zAxis));
|
|
25955
|
+
const titleXUpdate = svgMerge.selectAll('.title-x').data(lineStrips3D.x(datum => {
|
|
25956
|
+
return datum.id === 'min' ? datum.x - this.rem * 20 : datum.x + this.rem * 20;
|
|
25957
|
+
}).y(() => {
|
|
25958
|
+
return yScale.range()[0] + this.rem * 1.75;
|
|
25959
|
+
}).z(() => {
|
|
25960
|
+
return zScale.range()[0] + this.rem * 1.75;
|
|
25961
|
+
}).data(xAxis), datum => {
|
|
26055
25962
|
return datum[0].title;
|
|
26056
25963
|
});
|
|
26057
|
-
const titleYUpdate = svgMerge.selectAll('.title-y').data(
|
|
25964
|
+
const titleYUpdate = svgMerge.selectAll('.title-y').data(lineStrips3D.x(() => {
|
|
25965
|
+
return xScale.range()[0] - this.rem * 1.75;
|
|
25966
|
+
}).y(datum => {
|
|
25967
|
+
return datum.id === 'min' ? datum.y + this.rem * 20 : datum.y - this.rem * 20;
|
|
25968
|
+
}).z(() => {
|
|
25969
|
+
return zScale.range()[1] - this.rem * 1.75;
|
|
25970
|
+
}).data(yAxis), datum => {
|
|
26058
25971
|
return datum[0].title;
|
|
26059
25972
|
});
|
|
26060
|
-
const titleZUpdate = svgMerge.selectAll('.title-z').data(
|
|
25973
|
+
const titleZUpdate = svgMerge.selectAll('.title-z').data(lineStrips3D.x(() => {
|
|
25974
|
+
return xScale.range()[0] - this.rem * 1.75;
|
|
25975
|
+
}).y(() => {
|
|
25976
|
+
return yScale.range()[0] + this.rem * 1.75;
|
|
25977
|
+
}).z(datum => {
|
|
25978
|
+
return datum.id === 'min' ? datum.z - this.rem * 20 : datum.z + this.rem * 20;
|
|
25979
|
+
}).data(zAxis), datum => {
|
|
26061
25980
|
return datum[0].title;
|
|
26062
25981
|
});
|
|
26063
25982
|
// ENTER
|
|
@@ -26071,9 +25990,9 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26071
25990
|
const titleZEnter = titleZUpdate.enter().append('text').attr('class', 'd3-3d title title-z');
|
|
26072
25991
|
titleZEnter.append('textPath').attr('href', '#title-z').attr('startOffset', '50%');
|
|
26073
25992
|
// MERGE
|
|
26074
|
-
const titlePathXMerge = titlePathXEnter.merge(titlePathXUpdate).attr('d', lineStrips3D
|
|
26075
|
-
const titlePathYMerge = titlePathYEnter.merge(titlePathYUpdate).attr('d', lineStrips3D
|
|
26076
|
-
const titlePathZMerge = titlePathZEnter.merge(titlePathZUpdate).attr('d', lineStrips3D
|
|
25993
|
+
const titlePathXMerge = titlePathXEnter.merge(titlePathXUpdate).attr('d', lineStrips3D.draw);
|
|
25994
|
+
const titlePathYMerge = titlePathYEnter.merge(titlePathYUpdate).attr('d', lineStrips3D.draw);
|
|
25995
|
+
const titlePathZMerge = titlePathZEnter.merge(titlePathZUpdate).attr('d', lineStrips3D.draw);
|
|
26077
25996
|
const titleXMerge = titleXEnter.merge(titleXUpdate).select('textPath').html(datum => {
|
|
26078
25997
|
return datum[0].title;
|
|
26079
25998
|
});
|
|
@@ -26126,35 +26045,35 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26126
26045
|
|
|
26127
26046
|
// Axis Ticks
|
|
26128
26047
|
// DATA-JOIN
|
|
26129
|
-
const ticksXUpdate = svgMerge.selectAll('.tick-x').data(lineStrips3D
|
|
26048
|
+
const ticksXUpdate = svgMerge.selectAll('.tick-x').data(lineStrips3D.x(datum => {
|
|
26130
26049
|
return datum.x;
|
|
26131
26050
|
}).y(datum => {
|
|
26132
26051
|
return datum.id === 'min' ? yScale.range()[0] : yScale.range()[0] + this.rem * 0.35;
|
|
26133
26052
|
}).z(datum => {
|
|
26134
26053
|
return datum.id === 'min' ? zScale.range()[0] : zScale.range()[0] + this.rem * 0.35;
|
|
26135
|
-
})(xTicks));
|
|
26136
|
-
const ticksYUpdate = svgMerge.selectAll('.tick-y').data(lineStrips3D
|
|
26054
|
+
}).data(xTicks));
|
|
26055
|
+
const ticksYUpdate = svgMerge.selectAll('.tick-y').data(lineStrips3D.x(datum => {
|
|
26137
26056
|
return datum.id === 'min' ? xScale.range()[0] : xScale.range()[0] - this.rem * 0.35;
|
|
26138
26057
|
}).y(datum => {
|
|
26139
26058
|
return datum.y;
|
|
26140
26059
|
}).z(datum => {
|
|
26141
26060
|
return datum.id === 'min' ? zScale.range()[1] : zScale.range()[1] - this.rem * 0.35;
|
|
26142
|
-
})(yTicks));
|
|
26143
|
-
const ticksZUpdate = svgMerge.selectAll('.tick-z').data(lineStrips3D
|
|
26061
|
+
}).data(yTicks));
|
|
26062
|
+
const ticksZUpdate = svgMerge.selectAll('.tick-z').data(lineStrips3D.x(datum => {
|
|
26144
26063
|
return datum.id === 'min' ? xScale.range()[0] : xScale.range()[0] - this.rem * 0.35;
|
|
26145
26064
|
}).y(datum => {
|
|
26146
26065
|
return datum.id === 'min' ? yScale.range()[0] : yScale.range()[0] + this.rem * 0.35;
|
|
26147
26066
|
}).z(datum => {
|
|
26148
26067
|
return datum.z;
|
|
26149
|
-
})(zTicks));
|
|
26068
|
+
}).data(zTicks));
|
|
26150
26069
|
// ENTER
|
|
26151
26070
|
const ticksXEnter = ticksXUpdate.enter().append('path').attr('class', 'd3-3d tick tick-x');
|
|
26152
26071
|
const ticksYEnter = ticksYUpdate.enter().append('path').attr('class', 'd3-3d tick tick-y');
|
|
26153
26072
|
const ticksZEnter = ticksZUpdate.enter().append('path').attr('class', 'd3-3d tick tick-z');
|
|
26154
26073
|
// MERGE
|
|
26155
|
-
const ticksXMerge = ticksXEnter.merge(ticksXUpdate).attr('d', lineStrips3D
|
|
26156
|
-
const ticksYMerge = ticksYEnter.merge(ticksYUpdate).attr('d', lineStrips3D
|
|
26157
|
-
const ticksZMerge = ticksZEnter.merge(ticksZUpdate).attr('d', lineStrips3D
|
|
26074
|
+
const ticksXMerge = ticksXEnter.merge(ticksXUpdate).attr('d', lineStrips3D.draw);
|
|
26075
|
+
const ticksYMerge = ticksYEnter.merge(ticksYUpdate).attr('d', lineStrips3D.draw);
|
|
26076
|
+
const ticksZMerge = ticksZEnter.merge(ticksZUpdate).attr('d', lineStrips3D.draw);
|
|
26158
26077
|
// EXIT
|
|
26159
26078
|
ticksXMerge.exit().remove();
|
|
26160
26079
|
ticksYMerge.exit().remove();
|
|
@@ -26162,40 +26081,58 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26162
26081
|
|
|
26163
26082
|
// Axis Tick Labels
|
|
26164
26083
|
// DATA-JOIN
|
|
26165
|
-
const labelPathsXUpdate = svgMerge.selectAll('.label-path-x').data(lineStrips3D
|
|
26084
|
+
const labelPathsXUpdate = svgMerge.selectAll('.label-path-x').data(lineStrips3D.x(datum => {
|
|
26166
26085
|
return datum.x;
|
|
26167
26086
|
}).y(datum => {
|
|
26168
26087
|
return datum.id === 'min' ? yScale.range()[0] + this.rem * 4 : yScale.range()[0] + this.rem * 0.5;
|
|
26169
26088
|
}).z(datum => {
|
|
26170
26089
|
return datum.id === 'min' ? zScale.range()[0] + this.rem * 4 : zScale.range()[0] + this.rem * 0.5;
|
|
26171
|
-
})(xTicks), datum => {
|
|
26090
|
+
}).data(xTicks), datum => {
|
|
26172
26091
|
return datum[0].label;
|
|
26173
26092
|
});
|
|
26174
|
-
const labelPathsYUpdate = svgMerge.selectAll('.label-path-y').data(lineStrips3D
|
|
26093
|
+
const labelPathsYUpdate = svgMerge.selectAll('.label-path-y').data(lineStrips3D.x(datum => {
|
|
26175
26094
|
return datum.id === 'min' ? xScale.range()[0] - this.rem * 0.5 : xScale.range()[0] - this.rem * 4;
|
|
26176
26095
|
}).y(datum => {
|
|
26177
26096
|
return datum.y;
|
|
26178
26097
|
}).z(datum => {
|
|
26179
26098
|
return datum.id === 'min' ? zScale.range()[1] - this.rem * 0.5 : zScale.range()[1] - this.rem * 4;
|
|
26180
|
-
})(yTicks), datum => {
|
|
26099
|
+
}).data(yTicks), datum => {
|
|
26181
26100
|
return datum[0].label;
|
|
26182
26101
|
});
|
|
26183
|
-
const labelPathsZUpdate = svgMerge.selectAll('.label-path-z').data(lineStrips3D
|
|
26102
|
+
const labelPathsZUpdate = svgMerge.selectAll('.label-path-z').data(lineStrips3D.x(datum => {
|
|
26184
26103
|
return datum.id === 'min' ? xScale.range()[0] - this.rem * 4 : xScale.range()[0] - this.rem * 0.5;
|
|
26185
26104
|
}).y(datum => {
|
|
26186
26105
|
return datum.id === 'min' ? yScale.range()[0] + this.rem * 4 : yScale.range()[0] + this.rem * 0.5;
|
|
26187
26106
|
}).z(datum => {
|
|
26188
26107
|
return datum.z;
|
|
26189
|
-
})(zTicks), datum => {
|
|
26108
|
+
}).data(zTicks), datum => {
|
|
26190
26109
|
return datum[0].label;
|
|
26191
26110
|
});
|
|
26192
|
-
const labelsXUpdate = svgMerge.selectAll('.label-x').data(
|
|
26111
|
+
const labelsXUpdate = svgMerge.selectAll('.label-x').data(lineStrips3D.x(datum => {
|
|
26112
|
+
return datum.x;
|
|
26113
|
+
}).y(datum => {
|
|
26114
|
+
return datum.id === 'min' ? yScale.range()[0] + this.rem * 4 : yScale.range()[0] + this.rem * 0.5;
|
|
26115
|
+
}).z(datum => {
|
|
26116
|
+
return datum.id === 'min' ? zScale.range()[0] + this.rem * 4 : zScale.range()[0] + this.rem * 0.5;
|
|
26117
|
+
}).data(xTicks), datum => {
|
|
26193
26118
|
return datum[0].label;
|
|
26194
26119
|
});
|
|
26195
|
-
const labelsYUpdate = svgMerge.selectAll('.label-y').data(
|
|
26120
|
+
const labelsYUpdate = svgMerge.selectAll('.label-y').data(lineStrips3D.x(datum => {
|
|
26121
|
+
return datum.id === 'min' ? xScale.range()[0] - this.rem * 0.5 : xScale.range()[0] - this.rem * 4;
|
|
26122
|
+
}).y(datum => {
|
|
26123
|
+
return datum.y;
|
|
26124
|
+
}).z(datum => {
|
|
26125
|
+
return datum.id === 'min' ? zScale.range()[1] - this.rem * 0.5 : zScale.range()[1] - this.rem * 4;
|
|
26126
|
+
}).data(yTicks), datum => {
|
|
26196
26127
|
return datum[0].label;
|
|
26197
26128
|
});
|
|
26198
|
-
const labelsZUpdate = svgMerge.selectAll('.label-z').data(
|
|
26129
|
+
const labelsZUpdate = svgMerge.selectAll('.label-z').data(lineStrips3D.x(datum => {
|
|
26130
|
+
return datum.id === 'min' ? xScale.range()[0] - this.rem * 4 : xScale.range()[0] - this.rem * 0.5;
|
|
26131
|
+
}).y(datum => {
|
|
26132
|
+
return datum.id === 'min' ? yScale.range()[0] + this.rem * 4 : yScale.range()[0] + this.rem * 0.5;
|
|
26133
|
+
}).z(datum => {
|
|
26134
|
+
return datum.z;
|
|
26135
|
+
}).data(zTicks), datum => {
|
|
26199
26136
|
return datum[0].label;
|
|
26200
26137
|
});
|
|
26201
26138
|
// ENTER
|
|
@@ -26221,9 +26158,9 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26221
26158
|
return `#label-z-${index}`;
|
|
26222
26159
|
}).attr('startOffset', '100%');
|
|
26223
26160
|
// MERGE
|
|
26224
|
-
const labelPathsXMerge = labelPathsXEnter.merge(labelPathsXUpdate).attr('d', lineStrips3D
|
|
26225
|
-
const labelPathsYMerge = labelPathsYEnter.merge(labelPathsYUpdate).attr('d', lineStrips3D
|
|
26226
|
-
const labelPathsZMerge = labelPathsZEnter.merge(labelPathsZUpdate).attr('d', lineStrips3D
|
|
26161
|
+
const labelPathsXMerge = labelPathsXEnter.merge(labelPathsXUpdate).attr('d', lineStrips3D.draw);
|
|
26162
|
+
const labelPathsYMerge = labelPathsYEnter.merge(labelPathsYUpdate).attr('d', lineStrips3D.draw);
|
|
26163
|
+
const labelPathsZMerge = labelPathsZEnter.merge(labelPathsZUpdate).attr('d', lineStrips3D.draw);
|
|
26227
26164
|
const labelsXMerge = labelsXEnter.merge(labelsXUpdate).select('textPath').text(datum => {
|
|
26228
26165
|
return datum[0].label;
|
|
26229
26166
|
});
|
|
@@ -26249,7 +26186,7 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26249
26186
|
return yScale(datum.g);
|
|
26250
26187
|
}).z(datum => {
|
|
26251
26188
|
return zScale(datum.l);
|
|
26252
|
-
})(this.point ? [{
|
|
26189
|
+
}).data(this.point ? [{
|
|
26253
26190
|
a: this.a,
|
|
26254
26191
|
g: this.g,
|
|
26255
26192
|
l: this.l,
|
|
@@ -26327,7 +26264,7 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26327
26264
|
return yScale(datum.g);
|
|
26328
26265
|
}).z(datum => {
|
|
26329
26266
|
return zScale(datum.l);
|
|
26330
|
-
})(this.boundary).filter(datum => {
|
|
26267
|
+
}).data(this.boundary).filter(datum => {
|
|
26331
26268
|
return datum[0].a >= this.range.a.start && datum[0].a <= this.range.a.stop && datum[1].a >= this.range.a.start && datum[1].a <= this.range.a.stop && datum[2].a >= this.range.a.start && datum[2].a <= this.range.a.stop && datum[3].a >= this.range.a.start && datum[3].a <= this.range.a.stop;
|
|
26332
26269
|
}) : []);
|
|
26333
26270
|
// ENTER
|
|
@@ -26353,21 +26290,21 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26353
26290
|
return yScale(datum.g);
|
|
26354
26291
|
}).z(datum => {
|
|
26355
26292
|
return zScale(datum.l);
|
|
26356
|
-
})(this.mapXY));
|
|
26293
|
+
}).data(this.mapXY));
|
|
26357
26294
|
const mapXZUpdate = svgMerge.selectAll('.map-xz').data(grid3d.rows(range$1(this.range.l.start, this.range.l.stop + 0.01, this.range.l.step).length).x(datum => {
|
|
26358
26295
|
return xScale(datum.a);
|
|
26359
26296
|
}).y(datum => {
|
|
26360
26297
|
return yScale(datum.g);
|
|
26361
26298
|
}).z(datum => {
|
|
26362
26299
|
return zScale(datum.l);
|
|
26363
|
-
})(this.mapXZ));
|
|
26300
|
+
}).data(this.mapXZ));
|
|
26364
26301
|
const mapYZUpdate = svgMerge.selectAll('.map-yz').data(grid3d.rows(range$1(this.range.l.start, this.range.l.stop + 0.01, this.range.l.step).length).x(datum => {
|
|
26365
26302
|
return xScale(datum.a);
|
|
26366
26303
|
}).y(datum => {
|
|
26367
26304
|
return yScale(datum.g);
|
|
26368
26305
|
}).z(datum => {
|
|
26369
26306
|
return zScale(datum.l);
|
|
26370
|
-
})(this.mapYZ));
|
|
26307
|
+
}).data(this.mapYZ));
|
|
26371
26308
|
// ENTER
|
|
26372
26309
|
const mapXYEnter = mapXYUpdate.enter().append('path').attr('class', 'd3-3d map map-xy');
|
|
26373
26310
|
const mapXZEnter = mapXZUpdate.enter().append('path').attr('class', 'd3-3d map map-xz');
|
|
@@ -26406,7 +26343,7 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26406
26343
|
mapYZUpdate.exit().remove();
|
|
26407
26344
|
|
|
26408
26345
|
// Depth sorting
|
|
26409
|
-
select(this.renderRoot).selectAll('.d3-3d').sort(
|
|
26346
|
+
select(this.renderRoot).selectAll('.d3-3d').sort(d33dExports.sort);
|
|
26410
26347
|
|
|
26411
26348
|
// Color Legend
|
|
26412
26349
|
// DATA-JOIN
|
|
@@ -26693,9 +26630,9 @@ class CPTValue extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26693
26630
|
.curve-p.interactive,
|
|
26694
26631
|
.curve-n.interactive {
|
|
26695
26632
|
cursor: nwse-resize;
|
|
26633
|
+
outline: none;
|
|
26696
26634
|
|
|
26697
26635
|
filter: url("#shadow-2");
|
|
26698
|
-
outline: none;
|
|
26699
26636
|
}
|
|
26700
26637
|
|
|
26701
26638
|
.curve-p.interactive:hover,
|
|
@@ -26715,8 +26652,8 @@ class CPTValue extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26715
26652
|
transform: translateY(0);
|
|
26716
26653
|
}
|
|
26717
26654
|
|
|
26718
|
-
|
|
26719
|
-
|
|
26655
|
+
.curve-p.interactive:focus-visible,
|
|
26656
|
+
.curve-n.interactive:focus-visible {
|
|
26720
26657
|
filter: url("#shadow-8");
|
|
26721
26658
|
|
|
26722
26659
|
/* HACK: This gets Safari to correctly apply the filter! */
|
|
@@ -26725,9 +26662,9 @@ class CPTValue extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26725
26662
|
|
|
26726
26663
|
.point.interactive {
|
|
26727
26664
|
cursor: nesw-resize;
|
|
26665
|
+
outline: none;
|
|
26728
26666
|
|
|
26729
26667
|
filter: url("#shadow-2");
|
|
26730
|
-
outline: none;
|
|
26731
26668
|
|
|
26732
26669
|
/* HACK: This gets Safari to correctly apply the filter! */
|
|
26733
26670
|
stroke: #000000;
|
|
@@ -26749,7 +26686,7 @@ class CPTValue extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26749
26686
|
stroke: #00ff00;
|
|
26750
26687
|
}
|
|
26751
26688
|
|
|
26752
|
-
|
|
26689
|
+
.point.interactive:focus-visible {
|
|
26753
26690
|
filter: url("#shadow-8");
|
|
26754
26691
|
|
|
26755
26692
|
/* HACK: This gets Safari to correctly apply the filter! */
|
|
@@ -26789,8 +26726,8 @@ class CPTValue extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26789
26726
|
|
|
26790
26727
|
.diagonal {
|
|
26791
26728
|
stroke: var(---color-element-border);
|
|
26792
|
-
stroke-dasharray: 4;
|
|
26793
26729
|
stroke-width: 1;
|
|
26730
|
+
stroke-dasharray: 4;
|
|
26794
26731
|
}
|
|
26795
26732
|
|
|
26796
26733
|
.curve-p,
|
|
@@ -26824,8 +26761,8 @@ class CPTValue extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26824
26761
|
font-size: 0.75rem;
|
|
26825
26762
|
|
|
26826
26763
|
dominant-baseline: middle;
|
|
26827
|
-
text-anchor: middle;
|
|
26828
26764
|
|
|
26765
|
+
text-anchor: middle;
|
|
26829
26766
|
fill: var(---color-text-inverse);
|
|
26830
26767
|
}
|
|
26831
26768
|
|
|
@@ -26837,15 +26774,15 @@ class CPTValue extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26837
26774
|
|
|
26838
26775
|
@media (pointer: coarse) {
|
|
26839
26776
|
.interactive .touch {
|
|
26840
|
-
stroke-linecap: round;
|
|
26841
26777
|
stroke-width: 12;
|
|
26778
|
+
stroke-linecap: round;
|
|
26842
26779
|
}
|
|
26843
26780
|
}
|
|
26844
26781
|
`];
|
|
26845
26782
|
}
|
|
26846
26783
|
render() {
|
|
26847
26784
|
/* eslint-disable-line class-methods-use-this */
|
|
26848
|
-
return x$
|
|
26785
|
+
return x$2``;
|
|
26849
26786
|
}
|
|
26850
26787
|
willUpdate() {
|
|
26851
26788
|
this.alignState();
|
|
@@ -27854,6 +27791,7 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
27854
27791
|
font-weight: 600;
|
|
27855
27792
|
|
|
27856
27793
|
alignment-baseline: middle;
|
|
27794
|
+
|
|
27857
27795
|
text-anchor: middle;
|
|
27858
27796
|
}
|
|
27859
27797
|
|
|
@@ -27877,6 +27815,7 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
27877
27815
|
font-size: 0.75rem;
|
|
27878
27816
|
|
|
27879
27817
|
alignment-baseline: middle;
|
|
27818
|
+
|
|
27880
27819
|
text-anchor: end;
|
|
27881
27820
|
}
|
|
27882
27821
|
|
|
@@ -27917,6 +27856,7 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
27917
27856
|
font-weight: 600;
|
|
27918
27857
|
|
|
27919
27858
|
alignment-baseline: middle;
|
|
27859
|
+
|
|
27920
27860
|
text-anchor: middle;
|
|
27921
27861
|
}
|
|
27922
27862
|
|
|
@@ -27930,7 +27870,7 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
27930
27870
|
}
|
|
27931
27871
|
render() {
|
|
27932
27872
|
/* eslint-disable-line class-methods-use-this */
|
|
27933
|
-
return x$
|
|
27873
|
+
return x$2`
|
|
27934
27874
|
`;
|
|
27935
27875
|
}
|
|
27936
27876
|
willUpdate() {
|
|
@@ -27986,10 +27926,11 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
27986
27926
|
};
|
|
27987
27927
|
const startRotationX = -0.85 * Math.PI / 8;
|
|
27988
27928
|
const startRotationY = 3 * Math.PI / 8;
|
|
27989
|
-
const startRotationZ = 0;
|
|
27990
|
-
|
|
27991
|
-
const
|
|
27992
|
-
const
|
|
27929
|
+
const startRotationZ = 0.0000001; // Avoid d3-3d bug
|
|
27930
|
+
|
|
27931
|
+
const lineStrips3D = d33dExports.lineStrips3D().origin(startOrigin).scale(startScale).rotationCenter(startRotationCenter).rotateX(startRotationX + this.rotationX).rotateY(startRotationY + this.rotationY).rotateZ(startRotationZ);
|
|
27932
|
+
const points3d = d33dExports.points3D().origin(startOrigin).scale(startScale).rotationCenter(startRotationCenter).rotateX(startRotationX + this.rotationX).rotateY(startRotationY + this.rotationY).rotateZ(startRotationZ);
|
|
27933
|
+
const grid3d = d33dExports.gridPlanes3D().origin(startOrigin).scale(startScale).rotationCenter(startRotationCenter).rotateX(startRotationX + this.rotationX).rotateY(startRotationY + this.rotationY).rotateZ(startRotationZ);
|
|
27993
27934
|
|
|
27994
27935
|
// SVG Drag behaviors
|
|
27995
27936
|
const svgDrag = drag().on('start', event => {
|
|
@@ -28054,35 +27995,35 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28054
27995
|
|
|
28055
27996
|
// Axes
|
|
28056
27997
|
// DATA-JOIN
|
|
28057
|
-
const axisXUpdate = svgMerge.selectAll('.axis-x').data(lineStrips3D
|
|
27998
|
+
const axisXUpdate = svgMerge.selectAll('.axis-x').data(lineStrips3D.x(datum => {
|
|
28058
27999
|
return datum.x;
|
|
28059
28000
|
}).y(() => {
|
|
28060
28001
|
return yScale.range()[0];
|
|
28061
28002
|
}).z(() => {
|
|
28062
28003
|
return zScale.range()[0];
|
|
28063
|
-
})(xAxis));
|
|
28064
|
-
const axisYUpdate = svgMerge.selectAll('.axis-y').data(lineStrips3D
|
|
28004
|
+
}).data(xAxis));
|
|
28005
|
+
const axisYUpdate = svgMerge.selectAll('.axis-y').data(lineStrips3D.x(() => {
|
|
28065
28006
|
return xScale.range()[0];
|
|
28066
28007
|
}).y(datum => {
|
|
28067
28008
|
return datum.y;
|
|
28068
28009
|
}).z(() => {
|
|
28069
28010
|
return zScale.range()[1];
|
|
28070
|
-
})(yAxis));
|
|
28071
|
-
const axisZUpdate = svgMerge.selectAll('.axis-z').data(lineStrips3D
|
|
28011
|
+
}).data(yAxis));
|
|
28012
|
+
const axisZUpdate = svgMerge.selectAll('.axis-z').data(lineStrips3D.x(() => {
|
|
28072
28013
|
return xScale.range()[0];
|
|
28073
28014
|
}).y(() => {
|
|
28074
28015
|
return yScale.range()[0];
|
|
28075
28016
|
}).z(datum => {
|
|
28076
28017
|
return datum.z;
|
|
28077
|
-
})(zAxis));
|
|
28018
|
+
}).data(zAxis));
|
|
28078
28019
|
// ENTER
|
|
28079
28020
|
const axisXEnter = axisXUpdate.enter().append('path').attr('class', 'd3-3d axis axis-x');
|
|
28080
28021
|
const axisYEnter = axisYUpdate.enter().append('path').attr('class', 'd3-3d axis axis-y');
|
|
28081
28022
|
const axisZEnter = axisZUpdate.enter().append('path').attr('class', 'd3-3d axis axis-z');
|
|
28082
28023
|
// MERGE
|
|
28083
|
-
const axisXMerge = axisXEnter.merge(axisXUpdate).attr('d', lineStrips3D
|
|
28084
|
-
const axisYMerge = axisYEnter.merge(axisYUpdate).attr('d', lineStrips3D
|
|
28085
|
-
const axisZMerge = axisZEnter.merge(axisZUpdate).attr('d', lineStrips3D
|
|
28024
|
+
const axisXMerge = axisXEnter.merge(axisXUpdate).attr('d', lineStrips3D.draw);
|
|
28025
|
+
const axisYMerge = axisYEnter.merge(axisYUpdate).attr('d', lineStrips3D.draw);
|
|
28026
|
+
const axisZMerge = axisZEnter.merge(axisZUpdate).attr('d', lineStrips3D.draw);
|
|
28086
28027
|
// EXIT
|
|
28087
28028
|
axisXMerge.exit().remove();
|
|
28088
28029
|
axisYMerge.exit().remove();
|
|
@@ -28090,34 +28031,52 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28090
28031
|
|
|
28091
28032
|
// Axis Titles
|
|
28092
28033
|
// DATA-JOIN
|
|
28093
|
-
const titlePathXUpdate = svgMerge.selectAll('.title-path-x').data(lineStrips3D
|
|
28034
|
+
const titlePathXUpdate = svgMerge.selectAll('.title-path-x').data(lineStrips3D.x(datum => {
|
|
28094
28035
|
return datum.id === 'min' ? datum.x - this.rem * 20 : datum.x + this.rem * 20;
|
|
28095
28036
|
}).y(() => {
|
|
28096
28037
|
return yScale.range()[0] + this.rem * 1.75;
|
|
28097
28038
|
}).z(() => {
|
|
28098
28039
|
return zScale.range()[0] + this.rem * 1.75;
|
|
28099
|
-
})(xAxis));
|
|
28100
|
-
const titlePathYUpdate = svgMerge.selectAll('.title-path-y').data(lineStrips3D
|
|
28040
|
+
}).data(xAxis));
|
|
28041
|
+
const titlePathYUpdate = svgMerge.selectAll('.title-path-y').data(lineStrips3D.x(() => {
|
|
28101
28042
|
return xScale.range()[0] - this.rem * 1.75;
|
|
28102
28043
|
}).y(datum => {
|
|
28103
28044
|
return datum.id === 'min' ? datum.y + this.rem * 20 : datum.y - this.rem * 20;
|
|
28104
28045
|
}).z(() => {
|
|
28105
28046
|
return zScale.range()[1] - this.rem * 1.75;
|
|
28106
|
-
})(yAxis));
|
|
28107
|
-
const titlePathZUpdate = svgMerge.selectAll('.title-path-z').data(lineStrips3D
|
|
28047
|
+
}).data(yAxis));
|
|
28048
|
+
const titlePathZUpdate = svgMerge.selectAll('.title-path-z').data(lineStrips3D.x(() => {
|
|
28108
28049
|
return xScale.range()[0] - this.rem * 1.75;
|
|
28109
28050
|
}).y(() => {
|
|
28110
28051
|
return yScale.range()[0] + this.rem * 1.75;
|
|
28111
28052
|
}).z(datum => {
|
|
28112
28053
|
return datum.id === 'min' ? datum.z - this.rem * 20 : datum.z + this.rem * 20;
|
|
28113
|
-
})(zAxis));
|
|
28114
|
-
const titleXUpdate = svgMerge.selectAll('.title-x').data(
|
|
28054
|
+
}).data(zAxis));
|
|
28055
|
+
const titleXUpdate = svgMerge.selectAll('.title-x').data(lineStrips3D.x(datum => {
|
|
28056
|
+
return datum.id === 'min' ? datum.x - this.rem * 20 : datum.x + this.rem * 20;
|
|
28057
|
+
}).y(() => {
|
|
28058
|
+
return yScale.range()[0] + this.rem * 1.75;
|
|
28059
|
+
}).z(() => {
|
|
28060
|
+
return zScale.range()[0] + this.rem * 1.75;
|
|
28061
|
+
}).data(xAxis), datum => {
|
|
28115
28062
|
return datum[0].title;
|
|
28116
28063
|
});
|
|
28117
|
-
const titleYUpdate = svgMerge.selectAll('.title-y').data(
|
|
28064
|
+
const titleYUpdate = svgMerge.selectAll('.title-y').data(lineStrips3D.x(() => {
|
|
28065
|
+
return xScale.range()[0] - this.rem * 1.75;
|
|
28066
|
+
}).y(datum => {
|
|
28067
|
+
return datum.id === 'min' ? datum.y + this.rem * 20 : datum.y - this.rem * 20;
|
|
28068
|
+
}).z(() => {
|
|
28069
|
+
return zScale.range()[1] - this.rem * 1.75;
|
|
28070
|
+
}).data(yAxis), datum => {
|
|
28118
28071
|
return datum[0].title;
|
|
28119
28072
|
});
|
|
28120
|
-
const titleZUpdate = svgMerge.selectAll('.title-z').data(
|
|
28073
|
+
const titleZUpdate = svgMerge.selectAll('.title-z').data(lineStrips3D.x(() => {
|
|
28074
|
+
return xScale.range()[0] - this.rem * 1.75;
|
|
28075
|
+
}).y(() => {
|
|
28076
|
+
return yScale.range()[0] + this.rem * 1.75;
|
|
28077
|
+
}).z(datum => {
|
|
28078
|
+
return datum.id === 'min' ? datum.z - this.rem * 20 : datum.z + this.rem * 20;
|
|
28079
|
+
}).data(zAxis), datum => {
|
|
28121
28080
|
return datum[0].title;
|
|
28122
28081
|
});
|
|
28123
28082
|
// ENTER
|
|
@@ -28131,9 +28090,9 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28131
28090
|
const titleZEnter = titleZUpdate.enter().append('text').attr('class', 'd3-3d title title-z');
|
|
28132
28091
|
titleZEnter.append('textPath').attr('href', '#title-z').attr('startOffset', '50%');
|
|
28133
28092
|
// MERGE
|
|
28134
|
-
const titlePathXMerge = titlePathXEnter.merge(titlePathXUpdate).attr('d', lineStrips3D
|
|
28135
|
-
const titlePathYMerge = titlePathYEnter.merge(titlePathYUpdate).attr('d', lineStrips3D
|
|
28136
|
-
const titlePathZMerge = titlePathZEnter.merge(titlePathZUpdate).attr('d', lineStrips3D
|
|
28093
|
+
const titlePathXMerge = titlePathXEnter.merge(titlePathXUpdate).attr('d', lineStrips3D.draw);
|
|
28094
|
+
const titlePathYMerge = titlePathYEnter.merge(titlePathYUpdate).attr('d', lineStrips3D.draw);
|
|
28095
|
+
const titlePathZMerge = titlePathZEnter.merge(titlePathZUpdate).attr('d', lineStrips3D.draw);
|
|
28137
28096
|
const titleXMerge = titleXEnter.merge(titleXUpdate).select('textPath').html(datum => {
|
|
28138
28097
|
return datum[0].title;
|
|
28139
28098
|
});
|
|
@@ -28186,35 +28145,35 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28186
28145
|
|
|
28187
28146
|
// Axis Ticks
|
|
28188
28147
|
// DATA-JOIN
|
|
28189
|
-
const ticksXUpdate = svgMerge.selectAll('.tick-x').data(lineStrips3D
|
|
28148
|
+
const ticksXUpdate = svgMerge.selectAll('.tick-x').data(lineStrips3D.x(datum => {
|
|
28190
28149
|
return datum.x;
|
|
28191
28150
|
}).y(datum => {
|
|
28192
28151
|
return datum.id === 'min' ? yScale.range()[0] : yScale.range()[0] + this.rem * 0.35;
|
|
28193
28152
|
}).z(datum => {
|
|
28194
28153
|
return datum.id === 'min' ? zScale.range()[0] : zScale.range()[0] + this.rem * 0.35;
|
|
28195
|
-
})(xTicks));
|
|
28196
|
-
const ticksYUpdate = svgMerge.selectAll('.tick-y').data(lineStrips3D
|
|
28154
|
+
}).data(xTicks));
|
|
28155
|
+
const ticksYUpdate = svgMerge.selectAll('.tick-y').data(lineStrips3D.x(datum => {
|
|
28197
28156
|
return datum.id === 'min' ? xScale.range()[0] : xScale.range()[0] - this.rem * 0.35;
|
|
28198
28157
|
}).y(datum => {
|
|
28199
28158
|
return datum.y;
|
|
28200
28159
|
}).z(datum => {
|
|
28201
28160
|
return datum.id === 'min' ? zScale.range()[1] : zScale.range()[1] - this.rem * 0.35;
|
|
28202
|
-
})(yTicks));
|
|
28203
|
-
const ticksZUpdate = svgMerge.selectAll('.tick-z').data(lineStrips3D
|
|
28161
|
+
}).data(yTicks));
|
|
28162
|
+
const ticksZUpdate = svgMerge.selectAll('.tick-z').data(lineStrips3D.x(datum => {
|
|
28204
28163
|
return datum.id === 'min' ? xScale.range()[0] : xScale.range()[0] - this.rem * 0.35;
|
|
28205
28164
|
}).y(datum => {
|
|
28206
28165
|
return datum.id === 'min' ? yScale.range()[0] : yScale.range()[0] + this.rem * 0.35;
|
|
28207
28166
|
}).z(datum => {
|
|
28208
28167
|
return datum.z;
|
|
28209
|
-
})(zTicks));
|
|
28168
|
+
}).data(zTicks));
|
|
28210
28169
|
// ENTER
|
|
28211
28170
|
const ticksXEnter = ticksXUpdate.enter().append('path').attr('class', 'd3-3d tick tick-x');
|
|
28212
28171
|
const ticksYEnter = ticksYUpdate.enter().append('path').attr('class', 'd3-3d tick tick-y');
|
|
28213
28172
|
const ticksZEnter = ticksZUpdate.enter().append('path').attr('class', 'd3-3d tick tick-z');
|
|
28214
28173
|
// MERGE
|
|
28215
|
-
const ticksXMerge = ticksXEnter.merge(ticksXUpdate).attr('d', lineStrips3D
|
|
28216
|
-
const ticksYMerge = ticksYEnter.merge(ticksYUpdate).attr('d', lineStrips3D
|
|
28217
|
-
const ticksZMerge = ticksZEnter.merge(ticksZUpdate).attr('d', lineStrips3D
|
|
28174
|
+
const ticksXMerge = ticksXEnter.merge(ticksXUpdate).attr('d', lineStrips3D.draw);
|
|
28175
|
+
const ticksYMerge = ticksYEnter.merge(ticksYUpdate).attr('d', lineStrips3D.draw);
|
|
28176
|
+
const ticksZMerge = ticksZEnter.merge(ticksZUpdate).attr('d', lineStrips3D.draw);
|
|
28218
28177
|
// EXIT
|
|
28219
28178
|
ticksXMerge.exit().remove();
|
|
28220
28179
|
ticksYMerge.exit().remove();
|
|
@@ -28222,40 +28181,58 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28222
28181
|
|
|
28223
28182
|
// Axis Tick Labels
|
|
28224
28183
|
// DATA-JOIN
|
|
28225
|
-
const labelPathsXUpdate = svgMerge.selectAll('.label-path-x').data(lineStrips3D
|
|
28184
|
+
const labelPathsXUpdate = svgMerge.selectAll('.label-path-x').data(lineStrips3D.x(datum => {
|
|
28226
28185
|
return datum.x;
|
|
28227
28186
|
}).y(datum => {
|
|
28228
28187
|
return datum.id === 'min' ? yScale.range()[0] + this.rem * 4 : yScale.range()[0] + this.rem * 0.5;
|
|
28229
28188
|
}).z(datum => {
|
|
28230
28189
|
return datum.id === 'min' ? zScale.range()[0] + this.rem * 4 : zScale.range()[0] + this.rem * 0.5;
|
|
28231
|
-
})(xTicks), datum => {
|
|
28190
|
+
}).data(xTicks), datum => {
|
|
28232
28191
|
return datum[0].label;
|
|
28233
28192
|
});
|
|
28234
|
-
const labelPathsYUpdate = svgMerge.selectAll('.label-path-y').data(lineStrips3D
|
|
28193
|
+
const labelPathsYUpdate = svgMerge.selectAll('.label-path-y').data(lineStrips3D.x(datum => {
|
|
28235
28194
|
return datum.id === 'min' ? xScale.range()[0] - this.rem * 0.5 : xScale.range()[0] - this.rem * 4;
|
|
28236
28195
|
}).y(datum => {
|
|
28237
28196
|
return datum.y;
|
|
28238
28197
|
}).z(datum => {
|
|
28239
28198
|
return datum.id === 'min' ? zScale.range()[1] - this.rem * 0.5 : zScale.range()[1] - this.rem * 4;
|
|
28240
|
-
})(yTicks), datum => {
|
|
28199
|
+
}).data(yTicks), datum => {
|
|
28241
28200
|
return datum[0].label;
|
|
28242
28201
|
});
|
|
28243
|
-
const labelPathsZUpdate = svgMerge.selectAll('.label-path-z').data(lineStrips3D
|
|
28202
|
+
const labelPathsZUpdate = svgMerge.selectAll('.label-path-z').data(lineStrips3D.x(datum => {
|
|
28244
28203
|
return datum.id === 'min' ? xScale.range()[0] - this.rem * 4 : xScale.range()[0] - this.rem * 0.5;
|
|
28245
28204
|
}).y(datum => {
|
|
28246
28205
|
return datum.id === 'min' ? yScale.range()[0] + this.rem * 4 : yScale.range()[0] + this.rem * 0.5;
|
|
28247
28206
|
}).z(datum => {
|
|
28248
28207
|
return datum.z;
|
|
28249
|
-
})(zTicks), datum => {
|
|
28208
|
+
}).data(zTicks), datum => {
|
|
28250
28209
|
return datum[0].label;
|
|
28251
28210
|
});
|
|
28252
|
-
const labelsXUpdate = svgMerge.selectAll('.label-x').data(
|
|
28211
|
+
const labelsXUpdate = svgMerge.selectAll('.label-x').data(lineStrips3D.x(datum => {
|
|
28212
|
+
return datum.x;
|
|
28213
|
+
}).y(datum => {
|
|
28214
|
+
return datum.id === 'min' ? yScale.range()[0] + this.rem * 4 : yScale.range()[0] + this.rem * 0.5;
|
|
28215
|
+
}).z(datum => {
|
|
28216
|
+
return datum.id === 'min' ? zScale.range()[0] + this.rem * 4 : zScale.range()[0] + this.rem * 0.5;
|
|
28217
|
+
}).data(xTicks), datum => {
|
|
28253
28218
|
return datum[0].label;
|
|
28254
28219
|
});
|
|
28255
|
-
const labelsYUpdate = svgMerge.selectAll('.label-y').data(
|
|
28220
|
+
const labelsYUpdate = svgMerge.selectAll('.label-y').data(lineStrips3D.x(datum => {
|
|
28221
|
+
return datum.id === 'min' ? xScale.range()[0] - this.rem * 0.5 : xScale.range()[0] - this.rem * 4;
|
|
28222
|
+
}).y(datum => {
|
|
28223
|
+
return datum.y;
|
|
28224
|
+
}).z(datum => {
|
|
28225
|
+
return datum.id === 'min' ? zScale.range()[1] - this.rem * 0.5 : zScale.range()[1] - this.rem * 4;
|
|
28226
|
+
}).data(yTicks), datum => {
|
|
28256
28227
|
return datum[0].label;
|
|
28257
28228
|
});
|
|
28258
|
-
const labelsZUpdate = svgMerge.selectAll('.label-z').data(
|
|
28229
|
+
const labelsZUpdate = svgMerge.selectAll('.label-z').data(lineStrips3D.x(datum => {
|
|
28230
|
+
return datum.id === 'min' ? xScale.range()[0] - this.rem * 4 : xScale.range()[0] - this.rem * 0.5;
|
|
28231
|
+
}).y(datum => {
|
|
28232
|
+
return datum.id === 'min' ? yScale.range()[0] + this.rem * 4 : yScale.range()[0] + this.rem * 0.5;
|
|
28233
|
+
}).z(datum => {
|
|
28234
|
+
return datum.z;
|
|
28235
|
+
}).data(zTicks), datum => {
|
|
28259
28236
|
return datum[0].label;
|
|
28260
28237
|
});
|
|
28261
28238
|
// ENTER
|
|
@@ -28281,9 +28258,9 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28281
28258
|
return `#label-z-${index}`;
|
|
28282
28259
|
}).attr('startOffset', '100%');
|
|
28283
28260
|
// MERGE
|
|
28284
|
-
const labelPathsXMerge = labelPathsXEnter.merge(labelPathsXUpdate).attr('d', lineStrips3D
|
|
28285
|
-
const labelPathsYMerge = labelPathsYEnter.merge(labelPathsYUpdate).attr('d', lineStrips3D
|
|
28286
|
-
const labelPathsZMerge = labelPathsZEnter.merge(labelPathsZUpdate).attr('d', lineStrips3D
|
|
28261
|
+
const labelPathsXMerge = labelPathsXEnter.merge(labelPathsXUpdate).attr('d', lineStrips3D.draw);
|
|
28262
|
+
const labelPathsYMerge = labelPathsYEnter.merge(labelPathsYUpdate).attr('d', lineStrips3D.draw);
|
|
28263
|
+
const labelPathsZMerge = labelPathsZEnter.merge(labelPathsZUpdate).attr('d', lineStrips3D.draw);
|
|
28287
28264
|
const labelsXMerge = labelsXEnter.merge(labelsXUpdate).select('textPath').text(datum => {
|
|
28288
28265
|
return datum[0].label;
|
|
28289
28266
|
});
|
|
@@ -28309,7 +28286,7 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28309
28286
|
return yScale(datum.pw);
|
|
28310
28287
|
}).z(datum => {
|
|
28311
28288
|
return zScale(datum.xw);
|
|
28312
|
-
})(this.choices.slice(this.point === 'rest' ? 1 : 0, this.point === 'first' ? 1 : undefined)), datum => {
|
|
28289
|
+
}).data(this.choices.slice(this.point === 'rest' ? 1 : 0, this.point === 'first' ? 1 : undefined)), datum => {
|
|
28313
28290
|
return datum.name;
|
|
28314
28291
|
});
|
|
28315
28292
|
// ENTER
|
|
@@ -28384,7 +28361,7 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28384
28361
|
return yScale(datum.pw);
|
|
28385
28362
|
}).z(datum => {
|
|
28386
28363
|
return zScale(datum.xw);
|
|
28387
|
-
})(this.boundary).filter(datum => {
|
|
28364
|
+
}).data(this.boundary).filter(datum => {
|
|
28388
28365
|
return datum[0].pw >= this.range.pw.start && datum[0].pw <= this.range.pw.stop && datum[1].pw >= this.range.pw.start && datum[1].pw <= this.range.pw.stop && datum[2].pw >= this.range.pw.start && datum[2].pw <= this.range.pw.stop && datum[3].pw >= this.range.pw.start && datum[3].pw <= this.range.pw.stop;
|
|
28389
28366
|
}) : []);
|
|
28390
28367
|
// ENTER
|
|
@@ -28410,21 +28387,21 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28410
28387
|
return yScale(datum.pw);
|
|
28411
28388
|
}).z(datum => {
|
|
28412
28389
|
return zScale(datum.xw);
|
|
28413
|
-
})(this.mapXY));
|
|
28390
|
+
}).data(this.mapXY));
|
|
28414
28391
|
const mapXZUpdate = svgMerge.selectAll('.map-xz').data(grid3d.rows(range$1(this.range.xw.start, this.range.xw.stop + 0.01, this.range.xw.step).length).x(datum => {
|
|
28415
28392
|
return xScale(datum.xs);
|
|
28416
28393
|
}).y(datum => {
|
|
28417
28394
|
return yScale(datum.pw);
|
|
28418
28395
|
}).z(datum => {
|
|
28419
28396
|
return zScale(datum.xw);
|
|
28420
|
-
})(this.mapXZ));
|
|
28397
|
+
}).data(this.mapXZ));
|
|
28421
28398
|
const mapYZUpdate = svgMerge.selectAll('.map-yz').data(grid3d.rows(range$1(this.range.xw.start, this.range.xw.stop + 0.01, this.range.xw.step).length).x(datum => {
|
|
28422
28399
|
return xScale(datum.xs);
|
|
28423
28400
|
}).y(datum => {
|
|
28424
28401
|
return yScale(datum.pw);
|
|
28425
28402
|
}).z(datum => {
|
|
28426
28403
|
return zScale(datum.xw);
|
|
28427
|
-
})(this.mapYZ));
|
|
28404
|
+
}).data(this.mapYZ));
|
|
28428
28405
|
// ENTER
|
|
28429
28406
|
const mapXYEnter = mapXYUpdate.enter().append('path').attr('class', 'd3-3d map map-xy');
|
|
28430
28407
|
const mapXZEnter = mapXZUpdate.enter().append('path').attr('class', 'd3-3d map map-xz');
|
|
@@ -28463,7 +28440,7 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28463
28440
|
mapYZUpdate.exit().remove();
|
|
28464
28441
|
|
|
28465
28442
|
// Depth sorting
|
|
28466
|
-
select(this.renderRoot).selectAll('.d3-3d').sort(
|
|
28443
|
+
select(this.renderRoot).selectAll('.d3-3d').sort(d33dExports.sort);
|
|
28467
28444
|
|
|
28468
28445
|
// Color Legend
|
|
28469
28446
|
// DATA-JOIN
|
|
@@ -28627,17 +28604,17 @@ class ProspectableControl extends ProspectableElement {
|
|
|
28627
28604
|
`];
|
|
28628
28605
|
}
|
|
28629
28606
|
render() {
|
|
28630
|
-
return x$
|
|
28607
|
+
return x$2`
|
|
28631
28608
|
<div class="holder">
|
|
28632
|
-
${this.trials != null ? x$
|
|
28633
|
-
${this.duration != null ? x$
|
|
28634
|
-
${this.run || this.pause || this.reset ? x$
|
|
28609
|
+
${this.trials != null ? x$2`<decidables-slider min="1" max="100" step="1" .value=${this.trials} @change=${this.setTrials.bind(this)} @input=${this.setTrials.bind(this)}>Trials</decidables-slider>` : x$2``}
|
|
28610
|
+
${this.duration != null ? x$2`<decidables-slider min="10" max="4000" step="10" .value=${this.duration} @change=${this.setDuration.bind(this)} @input=${this.setDuration.bind(this)}>Duration</decidables-slider>` : x$2``}
|
|
28611
|
+
${this.run || this.pause || this.reset ? x$2`
|
|
28635
28612
|
<div class="buttons">
|
|
28636
|
-
${this.run ? x$
|
|
28637
|
-
${this.pause ? x$
|
|
28638
|
-
${this.reset ? x$
|
|
28613
|
+
${this.run ? x$2`<decidables-button name="run" ?disabled=${this.state === 'running' || this.state === 'ended'} @click=${this.doRun.bind(this)}>Run</decidables-button>` : x$2``}
|
|
28614
|
+
${this.pause ? x$2`<decidables-button name="pause" ?disabled=${this.state !== 'running'} @click=${this.doPause.bind(this)}>Pause</decidables-button>` : x$2``}
|
|
28615
|
+
${this.reset ? x$2`<decidables-button name="reset" ?disabled=${this.state === 'resetted'} @click=${this.doReset.bind(this)}>Reset</decidables-button>` : x$2``}
|
|
28639
28616
|
</div>
|
|
28640
|
-
` : x$
|
|
28617
|
+
` : x$2``}
|
|
28641
28618
|
</div>`;
|
|
28642
28619
|
}
|
|
28643
28620
|
}
|
|
@@ -28879,6 +28856,7 @@ class ProspectableResponse extends ProspectableElement {
|
|
|
28879
28856
|
|
|
28880
28857
|
width: 5.25rem;
|
|
28881
28858
|
height: 3.5rem;
|
|
28859
|
+
|
|
28882
28860
|
padding: 0.375rem 0.75rem;
|
|
28883
28861
|
margin: 0.25rem;
|
|
28884
28862
|
|
|
@@ -28906,6 +28884,7 @@ class ProspectableResponse extends ProspectableElement {
|
|
|
28906
28884
|
|
|
28907
28885
|
.feedback .outcome {
|
|
28908
28886
|
font-weight: 600;
|
|
28887
|
+
|
|
28909
28888
|
line-height: 1.15;
|
|
28910
28889
|
}
|
|
28911
28890
|
|
|
@@ -28925,31 +28904,31 @@ class ProspectableResponse extends ProspectableElement {
|
|
|
28925
28904
|
`];
|
|
28926
28905
|
}
|
|
28927
28906
|
render() {
|
|
28928
|
-
return x$
|
|
28907
|
+
return x$2`
|
|
28929
28908
|
<div class="holder">
|
|
28930
|
-
${this.trial ? x$
|
|
28909
|
+
${this.trial ? x$2`
|
|
28931
28910
|
<div class="trials">
|
|
28932
28911
|
<div class="trial">
|
|
28933
28912
|
<span class="label">Trial: </span><span class="count">${this.trialCount}</span><span class="of"> of </span><span class="total">${this.trialTotal}</span>
|
|
28934
28913
|
</div>
|
|
28935
|
-
</div>` : x$
|
|
28914
|
+
</div>` : x$2``}
|
|
28936
28915
|
<div class="responses">
|
|
28937
28916
|
<decidables-button name="gamble" class="response ${this.state === 'feedback' && this.response === 'gamble' ? 'selected' : this.state === 'waiting' ? 'waiting' : ''}" ?disabled=${this.state !== 'waiting' || this.interactive !== true} @click=${this.gamble.bind(this)}>Gamble</decidables-button>
|
|
28938
28917
|
<decidables-button name="sure" class="response ${this.state === 'feedback' && this.response === 'sure' ? 'selected' : this.state === 'waiting' ? 'waiting' : ''}" ?disabled=${this.state !== 'waiting' || this.interactive !== true} @click=${this.sure.bind(this)}>Sure</decidables-button>
|
|
28939
28918
|
</div>
|
|
28940
|
-
${this.feedback !== 'none' || this.payoff !== 'none' ? x$
|
|
28919
|
+
${this.feedback !== 'none' || this.payoff !== 'none' ? x$2`
|
|
28941
28920
|
<div class="feedbacks">
|
|
28942
28921
|
<div class="feedback gamble
|
|
28943
28922
|
${this.state === 'feedback' && this.feedback === 'outcome' && this.response === 'gamble' ? this.outcome : ''}">
|
|
28944
|
-
${this.state === 'feedback' && this.feedback === 'outcome' && this.response === 'gamble' ? this.outcome === 'better' ? x$
|
|
28945
|
-
${this.payoff === 'both' || this.payoff === 'selection' && this.response === 'gamble' ? x$
|
|
28923
|
+
${this.state === 'feedback' && this.feedback === 'outcome' && this.response === 'gamble' ? this.outcome === 'better' ? x$2`<span class="outcome">Better</span>` : this.outcome === 'worse' ? x$2`<span class="outcome">Worse</span>` : this.outcome === 'even' ? x$2`<span class="outcome">Even</span>` : x$2`<span class="outcome">No<br>Response</span>` : ''}
|
|
28924
|
+
${this.payoff === 'both' || this.payoff === 'selection' && this.response === 'gamble' ? x$2`<span class="payoff">${this.response === 'gamble' ? 'Win:' : 'Miss:'} $${this.gamblePayoff}</span>` : x$2``}
|
|
28946
28925
|
</div>
|
|
28947
28926
|
<div class="feedback sure
|
|
28948
28927
|
${this.state === 'feedback' && this.feedback === 'outcome' && this.response === 'sure' ? this.outcome : ''}">
|
|
28949
|
-
${this.state === 'feedback' && this.feedback === 'outcome' && this.response === 'sure' ? this.outcome === 'better' ? x$
|
|
28950
|
-
${this.payoff === 'both' || this.payoff === 'selection' && this.response === 'sure' ? x$
|
|
28928
|
+
${this.state === 'feedback' && this.feedback === 'outcome' && this.response === 'sure' ? this.outcome === 'better' ? x$2`<span class="outcome">Better</span>` : this.outcome === 'worse' ? x$2`<span class="outcome">Worse</span>` : this.outcome === 'even' ? x$2`<span class="outcome">Even</span>` : x$2`<span class="outcome">No<br>Response</span>` : ''}
|
|
28929
|
+
${this.payoff === 'both' || this.payoff === 'selection' && this.response === 'sure' ? x$2`<span class="payoff">${this.response === 'sure' ? 'Win:' : 'Miss:'} $${this.surePayoff}</span>` : x$2``}
|
|
28951
28930
|
</div>
|
|
28952
|
-
</div>` : x$
|
|
28931
|
+
</div>` : x$2``}
|
|
28953
28932
|
</div>`;
|
|
28954
28933
|
}
|
|
28955
28934
|
}
|
|
@@ -28970,6 +28949,8 @@ class RiskyOption extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28970
28949
|
--decidables-spinner-input-width: 4rem;
|
|
28971
28950
|
--decidables-spinner-prefix: "$";
|
|
28972
28951
|
|
|
28952
|
+
position: relative;
|
|
28953
|
+
|
|
28973
28954
|
display: inline-block;
|
|
28974
28955
|
|
|
28975
28956
|
width: 10rem;
|
|
@@ -28979,6 +28960,7 @@ class RiskyOption extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28979
28960
|
.main {
|
|
28980
28961
|
width: 100%;
|
|
28981
28962
|
height: 100%;
|
|
28963
|
+
|
|
28982
28964
|
overflow: visible;
|
|
28983
28965
|
}
|
|
28984
28966
|
|
|
@@ -28995,9 +28977,9 @@ class RiskyOption extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28995
28977
|
|
|
28996
28978
|
.arc.interactive {
|
|
28997
28979
|
cursor: ns-resize;
|
|
28980
|
+
outline: none;
|
|
28998
28981
|
|
|
28999
28982
|
filter: url("#shadow-2");
|
|
29000
|
-
outline: none;
|
|
29001
28983
|
}
|
|
29002
28984
|
|
|
29003
28985
|
.arc.interactive:hover {
|
|
@@ -29008,7 +28990,7 @@ class RiskyOption extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
29008
28990
|
filter: url("#shadow-8");
|
|
29009
28991
|
}
|
|
29010
28992
|
|
|
29011
|
-
|
|
28993
|
+
.arc.interactive:focus-visible {
|
|
29012
28994
|
filter: url("#shadow-8");
|
|
29013
28995
|
}
|
|
29014
28996
|
|
|
@@ -29027,23 +29009,20 @@ class RiskyOption extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
29027
29009
|
.label.static {
|
|
29028
29010
|
font-size: 1.75rem;
|
|
29029
29011
|
|
|
29012
|
+
dominant-baseline: middle;
|
|
29013
|
+
|
|
29030
29014
|
user-select: none;
|
|
29031
29015
|
|
|
29032
|
-
dominant-baseline: middle;
|
|
29033
29016
|
text-anchor: middle;
|
|
29034
29017
|
}
|
|
29035
29018
|
|
|
29036
29019
|
.label.interactive {
|
|
29020
|
+
position: absolute;
|
|
29021
|
+
|
|
29037
29022
|
width: var(--decidables-spinner-input-width);
|
|
29038
29023
|
height: calc(var(--decidables-spinner-font-size) * 1.5);
|
|
29039
|
-
overflow: visible;
|
|
29040
|
-
}
|
|
29041
29024
|
|
|
29042
|
-
|
|
29043
|
-
/* https://stackoverflow.com/questions/51313873/svg-foreignobject-not-working-properly-on-safari */
|
|
29044
|
-
/* https://bugs.webkit.org/show_bug.cgi?id=23113 */
|
|
29045
|
-
.label.interactive decidables-spinner {
|
|
29046
|
-
position: fixed;
|
|
29025
|
+
overflow: visible;
|
|
29047
29026
|
}
|
|
29048
29027
|
|
|
29049
29028
|
.label.interactive.win decidables-spinner {
|
|
@@ -29061,7 +29040,7 @@ class RiskyOption extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
29061
29040
|
}
|
|
29062
29041
|
render() {
|
|
29063
29042
|
/* eslint-disable-line class-methods-use-this */
|
|
29064
|
-
return x$
|
|
29043
|
+
return x$2`
|
|
29065
29044
|
<slot></slot>
|
|
29066
29045
|
`;
|
|
29067
29046
|
}
|
|
@@ -29242,11 +29221,11 @@ class RiskyOption extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
29242
29221
|
// Labels
|
|
29243
29222
|
// DATA-JOIN
|
|
29244
29223
|
const labelStaticUpdate = pieMerge.selectAll('.label.static').data(arcsStatic);
|
|
29245
|
-
const labelInteractiveUpdate =
|
|
29224
|
+
const labelInteractiveUpdate = select(this.renderRoot).selectAll('.label.interactive').data(arcsInteractive);
|
|
29246
29225
|
// ENTER
|
|
29247
29226
|
const labelStaticEnter = labelStaticUpdate.enter().append('text');
|
|
29248
|
-
const labelInteractiveEnter = labelInteractiveUpdate.enter().append('
|
|
29249
|
-
labelInteractiveEnter.append('
|
|
29227
|
+
const labelInteractiveEnter = labelInteractiveUpdate.enter().append('xhtml:div');
|
|
29228
|
+
labelInteractiveEnter.append('decidables-spinner').on('input', (event, datum) => {
|
|
29250
29229
|
datum.data.x = parseFloat(event.target.value);
|
|
29251
29230
|
this.dispatchEvent(new CustomEvent('risky-outcome-change', {
|
|
29252
29231
|
detail: {
|
|
@@ -29272,21 +29251,18 @@ class RiskyOption extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
29272
29251
|
});
|
|
29273
29252
|
const labelInteractiveMerge = labelInteractiveEnter.merge(labelInteractiveUpdate).attr('class', datum => {
|
|
29274
29253
|
return `label interactive ${datum.data.name}`;
|
|
29275
|
-
}).attr('
|
|
29276
|
-
// HACK: Center spinner here instead of CSS for Safari SVG foreignObject
|
|
29277
|
-
// x: calc(var(--decidables-spinner-input-width) / -2);
|
|
29278
|
-
// y: calc(var(--decidables-spinner-font-size) * 1.5 / -2);
|
|
29254
|
+
}).attr('style', datum => {
|
|
29279
29255
|
const inputWidth = parseFloat(this.getComputedStyleValue('--decidables-spinner-input-width'));
|
|
29280
29256
|
const fontSize = parseFloat(this.getComputedStyleValue('--decidables-spinner-font-size'));
|
|
29281
29257
|
const rem = parseFloat(getComputedStyle(document.documentElement).getPropertyValue('font-size'), 10);
|
|
29282
|
-
const x = inputWidth * rem / -2;
|
|
29283
|
-
const y = fontSize * rem * 1.5 / -2;
|
|
29258
|
+
const x = width / 2 + inputWidth * rem / -2;
|
|
29259
|
+
const y = height / 2 + fontSize * rem * 1.5 / -2;
|
|
29284
29260
|
if (arcs.length === 1) {
|
|
29285
|
-
return `
|
|
29261
|
+
return `left: ${x}px; top: ${y}px;`;
|
|
29286
29262
|
}
|
|
29287
29263
|
const radius = Math.min(width, height) / 2 * 0.6;
|
|
29288
29264
|
const arcLabel = arc().innerRadius(radius).outerRadius(radius);
|
|
29289
|
-
return `
|
|
29265
|
+
return `left: ${arcLabel.centroid(datum)[0] + x}px; top: ${arcLabel.centroid(datum)[1] + y}px;`;
|
|
29290
29266
|
});
|
|
29291
29267
|
labelInteractiveMerge.select('decidables-spinner').attr('value', datum => {
|
|
29292
29268
|
return `${datum.data.x.toFixed(0)}`;
|
|
@@ -29342,7 +29318,7 @@ class RiskyOutcome extends ProspectableElement {
|
|
|
29342
29318
|
}
|
|
29343
29319
|
render() {
|
|
29344
29320
|
/* eslint-disable-line class-methods-use-this */
|
|
29345
|
-
return x$
|
|
29321
|
+
return x$2``;
|
|
29346
29322
|
}
|
|
29347
29323
|
}
|
|
29348
29324
|
customElements.define('risky-outcome', RiskyOutcome);
|
|
@@ -29441,16 +29417,16 @@ class RiskyChoice extends ProspectableElement {
|
|
|
29441
29417
|
this.sendEvent();
|
|
29442
29418
|
}
|
|
29443
29419
|
render() {
|
|
29444
|
-
return x$
|
|
29420
|
+
return x$2`
|
|
29445
29421
|
<div class="holder">
|
|
29446
29422
|
<risky-option class="gamble" ?interactive=${this.interactive} @risky-outcome-change=${this.winChange.bind(this)}>
|
|
29447
|
-
${this.state === 'choice' ? x$
|
|
29423
|
+
${this.state === 'choice' ? x$2`
|
|
29448
29424
|
<risky-outcome probability="${1 - this.pw}" value="${this.xl}" name="loss"></risky-outcome>
|
|
29449
29425
|
<risky-outcome ?interactive=${this.interactive} probability="${this.pw}" value="${this.xw}" name="win"></risky-outcome>` : ''}
|
|
29450
29426
|
</risky-option><span class="query"
|
|
29451
|
-
>${this.state === 'choice' ? '?' : this.state === 'fixation' ? '+' : x$
|
|
29427
|
+
>${this.state === 'choice' ? '?' : this.state === 'fixation' ? '+' : x$2`∙`}</span
|
|
29452
29428
|
><risky-option class="sure" ?interactive=${this.interactive} @risky-outcome-change=${this.sureChange.bind(this)}>
|
|
29453
|
-
${this.state === 'choice' ? x$
|
|
29429
|
+
${this.state === 'choice' ? x$2`
|
|
29454
29430
|
<risky-outcome ?interactive=${this.interactive} probability="1" value="${this.xs}" name="sure"></risky-outcome>` : ''}
|
|
29455
29431
|
</risky-option>
|
|
29456
29432
|
</div>`;
|
|
@@ -29560,7 +29536,7 @@ class RiskyTask extends ProspectableElement {
|
|
|
29560
29536
|
`];
|
|
29561
29537
|
}
|
|
29562
29538
|
render() {
|
|
29563
|
-
return x$
|
|
29539
|
+
return x$2`
|
|
29564
29540
|
<div class="holder">
|
|
29565
29541
|
<risky-choice state="${this.state === 'stimulus' ? 'choice' : this.state === 'iti' ? 'fixation' : 'blank'}" probability="${this.pw}" win="${this.xw}" loss="${this.xl}" sure="${this.xs}"></risky-choice>
|
|
29566
29542
|
</div>`;
|
|
@@ -29754,7 +29730,7 @@ class CPTEquationPG2W extends CPTEquation {
|
|
|
29754
29730
|
let g;
|
|
29755
29731
|
let w;
|
|
29756
29732
|
if (this.numeric) {
|
|
29757
|
-
p = x$
|
|
29733
|
+
p = x$2`<decidables-spinner class="p bottom"
|
|
29758
29734
|
?disabled=${!this.interactive}
|
|
29759
29735
|
min="0"
|
|
29760
29736
|
max="1"
|
|
@@ -29764,7 +29740,7 @@ class CPTEquationPG2W extends CPTEquation {
|
|
|
29764
29740
|
>
|
|
29765
29741
|
<var class="math-var">p</var>
|
|
29766
29742
|
</decidables-spinner>`;
|
|
29767
|
-
g = x$
|
|
29743
|
+
g = x$2`<decidables-spinner class="g bottom"
|
|
29768
29744
|
?disabled=${!this.interactive}
|
|
29769
29745
|
min=${CPTMath.g.MIN}
|
|
29770
29746
|
max=${CPTMath.g.MAX}
|
|
@@ -29774,7 +29750,7 @@ class CPTEquationPG2W extends CPTEquation {
|
|
|
29774
29750
|
>
|
|
29775
29751
|
<var class="math-var">γ</var>
|
|
29776
29752
|
</decidables-spinner>`;
|
|
29777
|
-
w = x$
|
|
29753
|
+
w = x$2`<decidables-spinner class="w bottom"
|
|
29778
29754
|
disabled
|
|
29779
29755
|
min="0"
|
|
29780
29756
|
max="1"
|
|
@@ -29784,11 +29760,11 @@ class CPTEquationPG2W extends CPTEquation {
|
|
|
29784
29760
|
<var class="math-var">w</var>
|
|
29785
29761
|
</decidables-spinner>`;
|
|
29786
29762
|
} else {
|
|
29787
|
-
p = x$
|
|
29788
|
-
g = x$
|
|
29789
|
-
w = x$
|
|
29763
|
+
p = x$2`<var class="math-var p">p</var>`;
|
|
29764
|
+
g = x$2`<var class="math-var g">γ</var>`;
|
|
29765
|
+
w = x$2`<var class="math-var w">w</var>`;
|
|
29790
29766
|
}
|
|
29791
|
-
const equation = x$
|
|
29767
|
+
const equation = x$2`
|
|
29792
29768
|
<tr>
|
|
29793
29769
|
<td rowspan="2">
|
|
29794
29770
|
${w}<span class="equals">=</span>
|
|
@@ -29802,7 +29778,7 @@ class CPTEquationPG2W extends CPTEquation {
|
|
|
29802
29778
|
<span class="bracket tight">[</span>${p}<sup class="exp">${g}</sup><span class="plus">+</span><span class="paren tight">(</span>1<span class="minus">−</span>${p}<span class="paren tight">)</span><sup class="exp">${g}</sup><span class="bracket tight">]</span><sup class="exp">1/${g}</sup>
|
|
29803
29779
|
</td>
|
|
29804
29780
|
</tr>`;
|
|
29805
|
-
return x$
|
|
29781
|
+
return x$2`
|
|
29806
29782
|
<div class="holder">
|
|
29807
29783
|
<table class="equation">
|
|
29808
29784
|
<tbody>
|
|
@@ -29902,7 +29878,7 @@ class CPTEquationVW2U extends CPTEquation {
|
|
|
29902
29878
|
let v;
|
|
29903
29879
|
if (numeric) {
|
|
29904
29880
|
const index = Number.parseInt(subscript, 10) - 1;
|
|
29905
|
-
v = x$
|
|
29881
|
+
v = x$2`<decidables-spinner class="v"
|
|
29906
29882
|
?disabled=${!this.interactive}
|
|
29907
29883
|
.value=${this.v[index]}
|
|
29908
29884
|
@input=${this.vInput.bind(this, index)}
|
|
@@ -29910,7 +29886,7 @@ class CPTEquationVW2U extends CPTEquation {
|
|
|
29910
29886
|
<var class="math-var">v<sub class="subscript ${className}">${subscript}</sub></var>
|
|
29911
29887
|
</decidables-spinner>`;
|
|
29912
29888
|
} else {
|
|
29913
|
-
v = x$
|
|
29889
|
+
v = x$2`<var class="math-var v">v<sub class="subscript ${className}">${subscript}</sub></var>`;
|
|
29914
29890
|
}
|
|
29915
29891
|
return v;
|
|
29916
29892
|
}
|
|
@@ -29918,7 +29894,7 @@ class CPTEquationVW2U extends CPTEquation {
|
|
|
29918
29894
|
let w;
|
|
29919
29895
|
if (numeric) {
|
|
29920
29896
|
const index = Number.parseInt(subscript, 10) - 1;
|
|
29921
|
-
w = x$
|
|
29897
|
+
w = x$2`<decidables-spinner class="w"
|
|
29922
29898
|
?disabled=${!this.interactive}
|
|
29923
29899
|
min="0"
|
|
29924
29900
|
max="1"
|
|
@@ -29929,7 +29905,7 @@ class CPTEquationVW2U extends CPTEquation {
|
|
|
29929
29905
|
<var class="math-var">w<sub class="subscript ${className}">${subscript}</sub></var>
|
|
29930
29906
|
</decidables-spinner>`;
|
|
29931
29907
|
} else {
|
|
29932
|
-
w = x$
|
|
29908
|
+
w = x$2`<var class="math-var w">w<sub class="subscript ${className}">${subscript}</sub></var>`;
|
|
29933
29909
|
}
|
|
29934
29910
|
return w;
|
|
29935
29911
|
}
|
|
@@ -29940,13 +29916,13 @@ class CPTEquationVW2U extends CPTEquation {
|
|
|
29940
29916
|
let u;
|
|
29941
29917
|
let n;
|
|
29942
29918
|
if (this.numeric) {
|
|
29943
|
-
u = x$
|
|
29919
|
+
u = x$2`<decidables-spinner class="u"
|
|
29944
29920
|
disabled
|
|
29945
29921
|
.value=${+this.u.toFixed(3)}
|
|
29946
29922
|
>
|
|
29947
29923
|
<var class="math-var">U</var>
|
|
29948
29924
|
</decidables-spinner>`;
|
|
29949
|
-
n = x$
|
|
29925
|
+
n = x$2`<decidables-spinner class="n"
|
|
29950
29926
|
?disabled=${!this.interactive}
|
|
29951
29927
|
min="1"
|
|
29952
29928
|
max="4"
|
|
@@ -29957,10 +29933,10 @@ class CPTEquationVW2U extends CPTEquation {
|
|
|
29957
29933
|
<var class="math-var">n</var>
|
|
29958
29934
|
</decidables-spinner>`;
|
|
29959
29935
|
} else {
|
|
29960
|
-
u = x$
|
|
29961
|
-
n = x$
|
|
29936
|
+
u = x$2`<var class="math-var u">U</var>`;
|
|
29937
|
+
n = x$2`<var class="math-var subscript">n</var>`;
|
|
29962
29938
|
}
|
|
29963
|
-
const equation = x$
|
|
29939
|
+
const equation = x$2`
|
|
29964
29940
|
<tr>
|
|
29965
29941
|
<td>
|
|
29966
29942
|
${u}<span class="equals">=</span>
|
|
@@ -29977,14 +29953,14 @@ class CPTEquationVW2U extends CPTEquation {
|
|
|
29977
29953
|
</td>
|
|
29978
29954
|
<td>
|
|
29979
29955
|
${this.numeric ? Array(this.nMax).fill().map((_, index) => {
|
|
29980
|
-
return index < this.n ? x$
|
|
29956
|
+
return index < this.n ? x$2`<span class="addend tight" ${F({
|
|
29981
29957
|
in: d,
|
|
29982
29958
|
out: d
|
|
29983
|
-
})}>${index !== 0 ? x$
|
|
29984
|
-
}) : x$
|
|
29959
|
+
})}>${index !== 0 ? x$2`<span class="plus">+</span>` : x$2``}${this.vTemplate(index + 1, 'math-num', true)} ${this.wTemplate(index + 1, 'math-num', true)}</span>` : null;
|
|
29960
|
+
}) : x$2`${this.vTemplate('1', 'math-num', false)} ${this.wTemplate('1', 'math-num', false)}<span class="plus">+</span><span class="ellipsis">…</span><span class="plus">+</span>${this.vTemplate('n', 'math-var', false)} ${this.wTemplate('n', 'math-var', false)}`}
|
|
29985
29961
|
</td>
|
|
29986
29962
|
</tr>`;
|
|
29987
|
-
return x$
|
|
29963
|
+
return x$2`
|
|
29988
29964
|
<div class="holder">
|
|
29989
29965
|
<table class="equation">
|
|
29990
29966
|
<tbody>
|
|
@@ -30073,7 +30049,7 @@ class CPTEquationXAL2V extends CPTEquation {
|
|
|
30073
30049
|
let l;
|
|
30074
30050
|
let v;
|
|
30075
30051
|
if (this.numeric) {
|
|
30076
|
-
x = x$
|
|
30052
|
+
x = x$2`<decidables-spinner class="x bottom"
|
|
30077
30053
|
?disabled=${!this.interactive}
|
|
30078
30054
|
step="1"
|
|
30079
30055
|
.value=${this.x}
|
|
@@ -30081,7 +30057,7 @@ class CPTEquationXAL2V extends CPTEquation {
|
|
|
30081
30057
|
>
|
|
30082
30058
|
<var class="math-var">x</var>
|
|
30083
30059
|
</decidables-spinner>`;
|
|
30084
|
-
a = x$
|
|
30060
|
+
a = x$2`<decidables-spinner class="a bottom"
|
|
30085
30061
|
?disabled=${!this.interactive}
|
|
30086
30062
|
min=${CPTMath.a.MIN}
|
|
30087
30063
|
max=${CPTMath.a.MAX}
|
|
@@ -30091,7 +30067,7 @@ class CPTEquationXAL2V extends CPTEquation {
|
|
|
30091
30067
|
>
|
|
30092
30068
|
<var class="math-var">α</var>
|
|
30093
30069
|
</decidables-spinner>`;
|
|
30094
|
-
l = x$
|
|
30070
|
+
l = x$2`<decidables-spinner class="l bottom"
|
|
30095
30071
|
?disabled=${!this.interactive}
|
|
30096
30072
|
min=${CPTMath.l.MIN}
|
|
30097
30073
|
step=${CPTMath.l.STEP}
|
|
@@ -30100,16 +30076,16 @@ class CPTEquationXAL2V extends CPTEquation {
|
|
|
30100
30076
|
>
|
|
30101
30077
|
<var class="math-var">λ</var>
|
|
30102
30078
|
</decidables-spinner>`;
|
|
30103
|
-
v = x$
|
|
30079
|
+
v = x$2`<decidables-spinner class="v bottom" disabled step=".001" .value="${+this.v.toFixed(3)}">
|
|
30104
30080
|
<var class="math-var">v</var>
|
|
30105
30081
|
</decidables-spinner>`;
|
|
30106
30082
|
} else {
|
|
30107
|
-
x = x$
|
|
30108
|
-
a = x$
|
|
30109
|
-
l = x$
|
|
30110
|
-
v = x$
|
|
30083
|
+
x = x$2`<var class="math-var x">x</var>`;
|
|
30084
|
+
a = x$2`<var class="math-var a">α</var>`;
|
|
30085
|
+
l = x$2`<var class="math-var l">λ</var>`;
|
|
30086
|
+
v = x$2`<var class="math-var v">v</var>`;
|
|
30111
30087
|
}
|
|
30112
|
-
const equation = x$
|
|
30088
|
+
const equation = x$2`
|
|
30113
30089
|
<tr>
|
|
30114
30090
|
<td rowspan="2">
|
|
30115
30091
|
${v}<span class="equals">=</span><span class="brace tight">{</span>
|
|
@@ -30123,7 +30099,7 @@ class CPTEquationXAL2V extends CPTEquation {
|
|
|
30123
30099
|
<span class="minus tight">−</span>${l}<span class="paren tight">(</span><span class="minus tight">−</span>${x}<span class="paren tight">)</span><sup class="exp">${a}</sup>, if ${x}<span class="equals"><</span>0
|
|
30124
30100
|
</td>
|
|
30125
30101
|
</tr>`;
|
|
30126
|
-
return x$
|
|
30102
|
+
return x$2`
|
|
30127
30103
|
<div class="holder">
|
|
30128
30104
|
<table class="equation">
|
|
30129
30105
|
<tbody>
|
|
@@ -30190,7 +30166,7 @@ class CPTExample extends ProspectableElement {
|
|
|
30190
30166
|
}
|
|
30191
30167
|
render() {
|
|
30192
30168
|
/* eslint-disable-line class-methods-use-this */
|
|
30193
|
-
return x$
|
|
30169
|
+
return x$2`
|
|
30194
30170
|
<div class="holder">
|
|
30195
30171
|
<div class="body">
|
|
30196
30172
|
<slot>Empty!</slot>
|