@decidables/prospectable-elements 0.5.0 → 0.5.2
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 +18 -0
- package/lib/prospectableElements.esm.js +758 -743
- package/lib/prospectableElements.esm.js.map +1 -1
- package/lib/prospectableElements.esm.min.js +95 -95
- package/lib/prospectableElements.esm.min.js.map +1 -1
- package/lib/prospectableElements.umd.js +758 -743
- package/lib/prospectableElements.umd.js.map +1 -1
- package/lib/prospectableElements.umd.min.js +30 -30
- package/lib/prospectableElements.umd.min.js.map +1 -1
- package/package.json +6 -6
- package/src/components/cpt-space.js +99 -28
- package/src/components/decision-space.js +99 -28
|
@@ -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;
|
|
@@ -10859,7 +10859,7 @@ class DecidablesButton extends DecidablesElement {
|
|
|
10859
10859
|
`];
|
|
10860
10860
|
}
|
|
10861
10861
|
render() {
|
|
10862
|
-
return x$
|
|
10862
|
+
return x$2`
|
|
10863
10863
|
<button ?disabled=${this.disabled}>
|
|
10864
10864
|
<slot></slot>
|
|
10865
10865
|
</button>
|
|
@@ -11253,18 +11253,18 @@ class DecidablesSlider extends DecidablesElement {
|
|
|
11253
11253
|
`];
|
|
11254
11254
|
}
|
|
11255
11255
|
render() {
|
|
11256
|
-
return x$
|
|
11256
|
+
return x$2`
|
|
11257
11257
|
<label for="slider">
|
|
11258
11258
|
<slot></slot>
|
|
11259
11259
|
</label>
|
|
11260
11260
|
<div class="range">
|
|
11261
11261
|
<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$
|
|
11262
|
+
${this.scale ? x$2`
|
|
11263
11263
|
<datalist id="ticks">
|
|
11264
11264
|
<option value=${o$2(this.rangeMax)} label=${o$2(this.max)}></option>
|
|
11265
11265
|
<option value=${o$2(this.rangeMin)} label=${o$2(this.min)}></option>
|
|
11266
11266
|
</datalist>
|
|
11267
|
-
` : x$
|
|
11267
|
+
` : x$2``}
|
|
11268
11268
|
</div>
|
|
11269
11269
|
<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
11270
|
`;
|
|
@@ -11413,7 +11413,7 @@ class DecidablesSpinner extends DecidablesElement {
|
|
|
11413
11413
|
`];
|
|
11414
11414
|
}
|
|
11415
11415
|
render() {
|
|
11416
|
-
return x$
|
|
11416
|
+
return x$2`
|
|
11417
11417
|
<label>
|
|
11418
11418
|
<slot></slot>
|
|
11419
11419
|
<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)}>
|
|
@@ -11577,7 +11577,7 @@ class DecidablesSwitch extends DecidablesElement {
|
|
|
11577
11577
|
`];
|
|
11578
11578
|
}
|
|
11579
11579
|
render() {
|
|
11580
|
-
return x$
|
|
11580
|
+
return x$2`
|
|
11581
11581
|
<input type="checkbox" id="switch" ?checked=${this.checked} ?disabled=${this.disabled} @change=${this.changed.bind(this)}>
|
|
11582
11582
|
<label for="switch">
|
|
11583
11583
|
<slot name="off-label"></slot>
|
|
@@ -11627,7 +11627,7 @@ class DecidablesToggle extends DecidablesElement {
|
|
|
11627
11627
|
`];
|
|
11628
11628
|
}
|
|
11629
11629
|
render() {
|
|
11630
|
-
return x$
|
|
11630
|
+
return x$2`
|
|
11631
11631
|
<fieldset ?disabled=${this.disabled}>
|
|
11632
11632
|
<legend><slot name="label"></slot></legend>
|
|
11633
11633
|
<slot></slot>
|
|
@@ -11777,7 +11777,7 @@ class DecidablesToggleOption extends DecidablesElement {
|
|
|
11777
11777
|
`];
|
|
11778
11778
|
}
|
|
11779
11779
|
render() {
|
|
11780
|
-
return x$
|
|
11780
|
+
return x$2`
|
|
11781
11781
|
<input type="radio" id="toggle-option" name=${this.name} value=${this.value} .checked=${this.checked} @change=${this.changed.bind(this)}>
|
|
11782
11782
|
<label for="toggle-option">
|
|
11783
11783
|
<slot></slot>
|
|
@@ -12114,7 +12114,7 @@ const r = new Map(),
|
|
|
12114
12114
|
},
|
|
12115
12115
|
b = ["left", "top", "width", "height", "opacity", "color", "background"],
|
|
12116
12116
|
j = new WeakMap();
|
|
12117
|
-
|
|
12117
|
+
class x extends f {
|
|
12118
12118
|
constructor(t$1) {
|
|
12119
12119
|
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
12120
|
this.createFinished();
|
|
@@ -12138,9 +12138,9 @@ let x$1 = class x extends f {
|
|
|
12138
12138
|
}
|
|
12139
12139
|
update(t, [i]) {
|
|
12140
12140
|
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.
|
|
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.m(i), this.render(i);
|
|
12142
12142
|
}
|
|
12143
|
-
|
|
12143
|
+
m(t) {
|
|
12144
12144
|
t = t ?? {};
|
|
12145
12145
|
const i = this.getController();
|
|
12146
12146
|
void 0 !== i && ((t = {
|
|
@@ -12151,7 +12151,7 @@ let x$1 = class x extends f {
|
|
|
12151
12151
|
...t.keyframeOptions
|
|
12152
12152
|
}), t.properties ??= b, this.options = t;
|
|
12153
12153
|
}
|
|
12154
|
-
|
|
12154
|
+
p() {
|
|
12155
12155
|
const t = {},
|
|
12156
12156
|
i = this.element.getBoundingClientRect(),
|
|
12157
12157
|
s = getComputedStyle(this.element);
|
|
@@ -12172,20 +12172,20 @@ let x$1 = class x extends f {
|
|
|
12172
12172
|
})(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
12173
|
}
|
|
12174
12174
|
hostUpdate() {
|
|
12175
|
-
"function" == typeof this.optionsOrCallback && this.
|
|
12175
|
+
"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
12176
|
}
|
|
12177
12177
|
async hostUpdated() {
|
|
12178
12178
|
if (!this.h || !this.element.isConnected || this.options.skipInitial && !this.isHostRendered) return;
|
|
12179
12179
|
let t;
|
|
12180
12180
|
this.prepare(), await a;
|
|
12181
|
-
const i = this.
|
|
12182
|
-
s = this.
|
|
12183
|
-
e = this.
|
|
12181
|
+
const i = this.P(),
|
|
12182
|
+
s = this.V(this.options.keyframeOptions, i),
|
|
12183
|
+
e = this.p();
|
|
12184
12184
|
if (void 0 !== this.A) {
|
|
12185
12185
|
const {
|
|
12186
12186
|
from: s,
|
|
12187
12187
|
to: h
|
|
12188
|
-
} = this.
|
|
12188
|
+
} = this.O(this.A, e, i);
|
|
12189
12189
|
this.log("measured", [this.A, e, s, h]), t = this.calculateKeyframes(s, h);
|
|
12190
12190
|
} else {
|
|
12191
12191
|
const s = r.get(this.options.inId);
|
|
@@ -12194,7 +12194,7 @@ let x$1 = class x extends f {
|
|
|
12194
12194
|
const {
|
|
12195
12195
|
from: h,
|
|
12196
12196
|
to: n
|
|
12197
|
-
} = this.
|
|
12197
|
+
} = this.O(s, e, i);
|
|
12198
12198
|
t = this.calculateKeyframes(h, n), t = this.options.in ? [{
|
|
12199
12199
|
...this.options.in[0],
|
|
12200
12200
|
...t[0]
|
|
@@ -12204,10 +12204,10 @@ let x$1 = class x extends f {
|
|
|
12204
12204
|
this.animate(t, s);
|
|
12205
12205
|
}
|
|
12206
12206
|
resetStyles() {
|
|
12207
|
-
void 0 !== this.
|
|
12207
|
+
void 0 !== this.j && (this.element.setAttribute("style", this.j ?? ""), this.j = void 0);
|
|
12208
12208
|
}
|
|
12209
12209
|
commitStyles() {
|
|
12210
|
-
this.
|
|
12210
|
+
this.j = this.element.getAttribute("style"), this.webAnimation?.commitStyles(), this.webAnimation?.cancel();
|
|
12211
12211
|
}
|
|
12212
12212
|
reconnected() {}
|
|
12213
12213
|
async disconnected() {
|
|
@@ -12216,14 +12216,14 @@ let x$1 = class x extends f {
|
|
|
12216
12216
|
if (this.prepare(), await a(), this.i?.isConnected) {
|
|
12217
12217
|
const t = this.o && this.o.parentNode === this.i ? this.o : null;
|
|
12218
12218
|
if (this.i.insertBefore(this.element, t), this.options.stabilizeOut) {
|
|
12219
|
-
const t = this.
|
|
12219
|
+
const t = this.p();
|
|
12220
12220
|
this.log("stabilizing out");
|
|
12221
12221
|
const i = this.A.left - t.left,
|
|
12222
12222
|
s = this.A.top - t.top;
|
|
12223
12223
|
!("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
12224
|
}
|
|
12225
12225
|
}
|
|
12226
|
-
const t = this.
|
|
12226
|
+
const t = this.V(this.options.keyframeOptions);
|
|
12227
12227
|
await this.animate(this.options.out, t), this.element.remove();
|
|
12228
12228
|
}
|
|
12229
12229
|
prepare() {
|
|
@@ -12235,7 +12235,7 @@ let x$1 = class x extends f {
|
|
|
12235
12235
|
didFinish(t) {
|
|
12236
12236
|
t && this.options.onComplete?.(this), this.A = void 0, this.animatingProperties = void 0, this.frames = void 0, this.resolveFinished();
|
|
12237
12237
|
}
|
|
12238
|
-
|
|
12238
|
+
P() {
|
|
12239
12239
|
const t = [];
|
|
12240
12240
|
for (let i = this.element.parentNode; i; i = i?.parentNode) {
|
|
12241
12241
|
const s = j.get(i);
|
|
@@ -12249,13 +12249,13 @@ let x$1 = class x extends f {
|
|
|
12249
12249
|
n.add(this.u);
|
|
12250
12250
|
}), t;
|
|
12251
12251
|
}
|
|
12252
|
-
|
|
12252
|
+
V(t, i = this.P()) {
|
|
12253
12253
|
const s = {
|
|
12254
12254
|
...A
|
|
12255
12255
|
};
|
|
12256
12256
|
return i.forEach(t => Object.assign(s, t.options.keyframeOptions)), Object.assign(s, t), s;
|
|
12257
12257
|
}
|
|
12258
|
-
|
|
12258
|
+
O(t, i, s) {
|
|
12259
12259
|
t = {
|
|
12260
12260
|
...t
|
|
12261
12261
|
}, i = {
|
|
@@ -12308,8 +12308,8 @@ let x$1 = class x extends f {
|
|
|
12308
12308
|
log(t, i) {
|
|
12309
12309
|
this.shouldLog && !this.isDisabled() && console.log(t, this.options.id, i);
|
|
12310
12310
|
}
|
|
12311
|
-
}
|
|
12312
|
-
const F = e(x
|
|
12311
|
+
}
|
|
12312
|
+
const F = e(x);
|
|
12313
12313
|
|
|
12314
12314
|
/*
|
|
12315
12315
|
CPTMath Static Class - Not intended for instantiation!
|
|
@@ -12765,20 +12765,20 @@ class CPTCalculation extends CPTEquation {
|
|
|
12765
12765
|
let us;
|
|
12766
12766
|
let uDiff;
|
|
12767
12767
|
if (this.numeric) {
|
|
12768
|
-
xw = x$
|
|
12768
|
+
xw = x$2`<decidables-spinner class="x xw"
|
|
12769
12769
|
?disabled=${!this.interactive}
|
|
12770
12770
|
.value=${this.xw}
|
|
12771
12771
|
@input=${this.xwInput.bind(this)}
|
|
12772
12772
|
>
|
|
12773
12773
|
<var class="math-var">x<sub class="subscript win">win</sub></var>
|
|
12774
12774
|
</decidables-spinner>`;
|
|
12775
|
-
xl = x$
|
|
12775
|
+
xl = x$2`<decidables-spinner class="x xl"
|
|
12776
12776
|
disabled
|
|
12777
12777
|
.value=${this.xl}
|
|
12778
12778
|
>
|
|
12779
12779
|
<var class="math-var">x<sub class="subscript loss">loss</sub></var>
|
|
12780
12780
|
</decidables-spinner>`;
|
|
12781
|
-
pw = x$
|
|
12781
|
+
pw = x$2`<decidables-spinner class="p pw"
|
|
12782
12782
|
?disabled=${!this.interactive}
|
|
12783
12783
|
min="0"
|
|
12784
12784
|
max="1"
|
|
@@ -12788,7 +12788,7 @@ class CPTCalculation extends CPTEquation {
|
|
|
12788
12788
|
>
|
|
12789
12789
|
<var class="math-var">p<sub class="subscript win">win</sub></var>
|
|
12790
12790
|
</decidables-spinner>`;
|
|
12791
|
-
xs = x$
|
|
12791
|
+
xs = x$2`<decidables-spinner class="x xs"
|
|
12792
12792
|
?disabled=${!this.interactive}
|
|
12793
12793
|
.value=${this.xs}
|
|
12794
12794
|
@input=${this.xsInput.bind(this)}
|
|
@@ -12825,73 +12825,73 @@ class CPTCalculation extends CPTEquation {
|
|
|
12825
12825
|
// >
|
|
12826
12826
|
// <var class="math-var">γ</var>
|
|
12827
12827
|
// </decidables-spinner>`;
|
|
12828
|
-
vw = x$
|
|
12828
|
+
vw = x$2`<decidables-spinner class="v vw"
|
|
12829
12829
|
disabled
|
|
12830
12830
|
.value=${+this.vw.toFixed(1)}
|
|
12831
12831
|
>
|
|
12832
12832
|
<var class="math-var">v<sub class="subscript win">win</sub></var>
|
|
12833
12833
|
</decidables-spinner>`;
|
|
12834
|
-
vl = x$
|
|
12834
|
+
vl = x$2`<decidables-spinner class="v vl"
|
|
12835
12835
|
disabled
|
|
12836
12836
|
.value=${+this.vl.toFixed(1)}
|
|
12837
12837
|
>
|
|
12838
12838
|
<var class="math-var">v<sub class="subscript loss">loss</sub></var>
|
|
12839
12839
|
</decidables-spinner>`;
|
|
12840
|
-
ww = x$
|
|
12840
|
+
ww = x$2`<decidables-spinner class="w ww"
|
|
12841
12841
|
disabled
|
|
12842
12842
|
.value=${+this.ww.toFixed(2)}
|
|
12843
12843
|
>
|
|
12844
12844
|
<var class="math-var">w<sub class="subscript win">win</sub></var>
|
|
12845
12845
|
</decidables-spinner>`;
|
|
12846
|
-
wl = x$
|
|
12846
|
+
wl = x$2`<decidables-spinner class="w wl"
|
|
12847
12847
|
disabled
|
|
12848
12848
|
.value=${+this.wl.toFixed(2)}
|
|
12849
12849
|
>
|
|
12850
12850
|
<var class="math-var">w<sub class="subscript loss">loss</sub></var>
|
|
12851
12851
|
</decidables-spinner>`;
|
|
12852
|
-
vs = x$
|
|
12852
|
+
vs = x$2`<decidables-spinner class="v vs"
|
|
12853
12853
|
disabled
|
|
12854
12854
|
.value=${+this.vs.toFixed(1)}
|
|
12855
12855
|
>
|
|
12856
12856
|
<var class="math-var">v<sub class="subscript sure">sure</sub></var>
|
|
12857
12857
|
</decidables-spinner>`;
|
|
12858
|
-
ug = x$
|
|
12858
|
+
ug = x$2`<decidables-spinner class="u ug"
|
|
12859
12859
|
disabled
|
|
12860
12860
|
.value=${+this.ug.toFixed(1)}
|
|
12861
12861
|
>
|
|
12862
12862
|
<var class="math-var">U<sub class="subscript gamble">gamble</sub></var>
|
|
12863
12863
|
</decidables-spinner>`;
|
|
12864
|
-
us = x$
|
|
12864
|
+
us = x$2`<decidables-spinner class="u us"
|
|
12865
12865
|
disabled
|
|
12866
12866
|
.value=${+this.us.toFixed(1)}
|
|
12867
12867
|
>
|
|
12868
12868
|
<var class="math-var">U<sub class="subscript sure">sure</sub></var>
|
|
12869
12869
|
</decidables-spinner>`;
|
|
12870
|
-
uDiff = x$
|
|
12870
|
+
uDiff = x$2`${this.uDiff > 0 ? x$2`<span class="comparison" ${F({
|
|
12871
12871
|
in: v
|
|
12872
|
-
})}>></span>` : this.uDiff < 0 ? x$
|
|
12872
|
+
})}>></span>` : this.uDiff < 0 ? x$2`<span class="comparison" ${F({
|
|
12873
12873
|
in: v
|
|
12874
|
-
})}><</span>` : x$
|
|
12874
|
+
})}><</span>` : x$2`<span class="comparison" ${F({
|
|
12875
12875
|
in: v
|
|
12876
12876
|
})}>=</span>`}`;
|
|
12877
12877
|
} else {
|
|
12878
|
-
xw = x$
|
|
12879
|
-
xl = x$
|
|
12880
|
-
pw = x$
|
|
12881
|
-
xs = x$
|
|
12878
|
+
xw = x$2`<var class="math-var x xw">x<sub class="subscript win">win</sub></var>`;
|
|
12879
|
+
xl = x$2`<var class="math-var x xl">x<sub class="subscript loss">loss</sub></var>`;
|
|
12880
|
+
pw = x$2`<var class="math-var p pw">p<sub class="subscript win">win</sub></var>`;
|
|
12881
|
+
xs = x$2`<var class="math-var x xs">x<sub class="subscript sure">sure</sub></var>`;
|
|
12882
12882
|
// a = html`<var class="math-var a">α</var>`;
|
|
12883
12883
|
// l = html`<var class="math-var l">λ</var>`;
|
|
12884
12884
|
// 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$
|
|
12885
|
+
vw = x$2`<var class="math-var v vw">v<sub class="subscript win">win</sub></var>`;
|
|
12886
|
+
vl = x$2`<var class="math-var v vl">v<sub class="subscript loss">loss</sub></var>`;
|
|
12887
|
+
ww = x$2`<var class="math-var w ww">w<sub class="subscript win">win</sub></var>`;
|
|
12888
|
+
wl = x$2`<var class="math-var w wl">w<sub class="subscript loss">loss</sub></var>`;
|
|
12889
|
+
vs = x$2`<var class="math-var v vs">v<sub class="subscript sure">sure</sub></var>`;
|
|
12890
|
+
ug = x$2`<var class="math-var u ug">U<sub class="subscript gamble">gamble</sub></var>`;
|
|
12891
|
+
us = x$2`<var class="math-var u us">U<sub class="subscript sure">sure</sub></var>`;
|
|
12892
|
+
uDiff = x$2`<span class="comparison">≟</span>`;
|
|
12893
|
+
}
|
|
12894
|
+
const equation = x$2`
|
|
12895
12895
|
<tr>
|
|
12896
12896
|
<td class="right">
|
|
12897
12897
|
<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 +12925,7 @@ class CPTCalculation extends CPTEquation {
|
|
|
12925
12925
|
${us}
|
|
12926
12926
|
</td>
|
|
12927
12927
|
</tr>`;
|
|
12928
|
-
return x$
|
|
12928
|
+
return x$2`
|
|
12929
12929
|
<div class="holder">
|
|
12930
12930
|
<table class="equation">
|
|
12931
12931
|
<tbody>
|
|
@@ -13906,7 +13906,7 @@ function reverseTransform(data, facets) {
|
|
|
13906
13906
|
facets: facets.map(I => I.slice().reverse())
|
|
13907
13907
|
};
|
|
13908
13908
|
}
|
|
13909
|
-
function sort
|
|
13909
|
+
function sort(order, {
|
|
13910
13910
|
sort,
|
|
13911
13911
|
...options
|
|
13912
13912
|
} = {}) {
|
|
@@ -14150,7 +14150,7 @@ const reduceFirst = {
|
|
|
14150
14150
|
const reduceTitle = {
|
|
14151
14151
|
reduceIndex(I, X) {
|
|
14152
14152
|
const n = 5;
|
|
14153
|
-
const groups = sort$
|
|
14153
|
+
const groups = sort$1(rollup(I, V => V.length, i => X[i]), second);
|
|
14154
14154
|
const top = groups.slice(-n).reverse();
|
|
14155
14155
|
if (top.length < groups.length) {
|
|
14156
14156
|
const bottom = groups.slice(0, 1 - n);
|
|
@@ -15014,7 +15014,7 @@ function createScalePoint(key, channels, {
|
|
|
15014
15014
|
padding = 0.5,
|
|
15015
15015
|
...options
|
|
15016
15016
|
}) {
|
|
15017
|
-
return maybeRound(point$
|
|
15017
|
+
return maybeRound(point$4().align(align).padding(padding), channels, options, key);
|
|
15018
15018
|
}
|
|
15019
15019
|
function createScaleBand(key, channels, {
|
|
15020
15020
|
align = 0.5,
|
|
@@ -15051,7 +15051,7 @@ function inferDomain(channels, interval, key) {
|
|
|
15051
15051
|
if (values.size > 10e3 && registry.get(key) === position) {
|
|
15052
15052
|
throw new Error(`implicit ordinal domain of ${key} scale has more than 10,000 values`);
|
|
15053
15053
|
}
|
|
15054
|
-
return sort$
|
|
15054
|
+
return sort$1(values, ascendingDefined);
|
|
15055
15055
|
}
|
|
15056
15056
|
|
|
15057
15057
|
// If all channels provide a consistent hint, propagate it to the scale.
|
|
@@ -21774,7 +21774,7 @@ const defaults$1 = {
|
|
|
21774
21774
|
strokeWidth: 1.5
|
|
21775
21775
|
};
|
|
21776
21776
|
function withDefaultSort(options) {
|
|
21777
|
-
return options.sort === undefined && options.reverse === undefined ? sort
|
|
21777
|
+
return options.sort === undefined && options.reverse === undefined ? sort({
|
|
21778
21778
|
channel: "-r"
|
|
21779
21779
|
}, options) : options;
|
|
21780
21780
|
}
|
|
@@ -22138,7 +22138,7 @@ class CPTFit extends ProspectableElement {
|
|
|
22138
22138
|
`];
|
|
22139
22139
|
}
|
|
22140
22140
|
render() {
|
|
22141
|
-
return x$
|
|
22141
|
+
return x$2`
|
|
22142
22142
|
<div>
|
|
22143
22143
|
<div>After ${this.choices.length} trials:</div>
|
|
22144
22144
|
<div>Current:
|
|
@@ -22323,9 +22323,9 @@ class CPTParameters extends ProspectableElement {
|
|
|
22323
22323
|
`];
|
|
22324
22324
|
}
|
|
22325
22325
|
render() {
|
|
22326
|
-
return x$
|
|
22326
|
+
return x$2`
|
|
22327
22327
|
<div class="holder">
|
|
22328
|
-
${this.a != null ? x$
|
|
22328
|
+
${this.a != null ? x$2`<decidables-slider class="a"
|
|
22329
22329
|
?disabled=${!this.interactive}
|
|
22330
22330
|
scale
|
|
22331
22331
|
min=${CPTMath.a.MIN}
|
|
@@ -22334,8 +22334,8 @@ class CPTParameters extends ProspectableElement {
|
|
|
22334
22334
|
.value=${+this.a.toFixed(2)}
|
|
22335
22335
|
@change=${this.setAlpha.bind(this)}
|
|
22336
22336
|
@input=${this.setAlpha.bind(this)}
|
|
22337
|
-
><div>Alpha<br><span class="math-var">α</span></div></decidables-slider>` : x$
|
|
22338
|
-
${this.l != null ? x$
|
|
22337
|
+
><div>Alpha<br><span class="math-var">α</span></div></decidables-slider>` : x$2``}
|
|
22338
|
+
${this.l != null ? x$2`<decidables-slider class="l"
|
|
22339
22339
|
?disabled=${!this.interactive}
|
|
22340
22340
|
scale
|
|
22341
22341
|
min=${CPTMath.l.MIN}
|
|
@@ -22344,8 +22344,8 @@ class CPTParameters extends ProspectableElement {
|
|
|
22344
22344
|
.value=${+this.l.toFixed(2)}
|
|
22345
22345
|
@change=${this.setLambda.bind(this)}
|
|
22346
22346
|
@input=${this.setLambda.bind(this)}
|
|
22347
|
-
><div>Lambda<br><span class="math-var">λ</span></div></decidables-slider>` : x$
|
|
22348
|
-
${this.g != null ? x$
|
|
22347
|
+
><div>Lambda<br><span class="math-var">λ</span></div></decidables-slider>` : x$2``}
|
|
22348
|
+
${this.g != null ? x$2`<decidables-slider class="g"
|
|
22349
22349
|
?disabled=${!this.interactive}
|
|
22350
22350
|
scale
|
|
22351
22351
|
min=${CPTMath.g.MIN}
|
|
@@ -22354,7 +22354,7 @@ class CPTParameters extends ProspectableElement {
|
|
|
22354
22354
|
.value=${+this.g.toFixed(2)}
|
|
22355
22355
|
@change=${this.setGamma.bind(this)}
|
|
22356
22356
|
@input=${this.setGamma.bind(this)}
|
|
22357
|
-
><div>Gamma<br><span class="math-var">γ</span></div></decidables-slider>` : x$
|
|
22357
|
+
><div>Gamma<br><span class="math-var">γ</span></div></decidables-slider>` : x$2``}
|
|
22358
22358
|
</div>`;
|
|
22359
22359
|
}
|
|
22360
22360
|
}
|
|
@@ -22734,7 +22734,7 @@ class CPTProbability extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
22734
22734
|
}
|
|
22735
22735
|
render() {
|
|
22736
22736
|
/* eslint-disable-line class-methods-use-this */
|
|
22737
|
-
return x$
|
|
22737
|
+
return x$2``;
|
|
22738
22738
|
}
|
|
22739
22739
|
willUpdate() {
|
|
22740
22740
|
this.alignState();
|
|
@@ -23252,476 +23252,417 @@ class CPTProbability extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
23252
23252
|
}
|
|
23253
23253
|
customElements.define('cpt-probability', CPTProbability);
|
|
23254
23254
|
|
|
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;
|
|
23255
|
+
var d33d$1 = {exports: {}};
|
|
23329
23256
|
|
|
23330
|
-
|
|
23331
|
-
|
|
23332
|
-
|
|
23257
|
+
var d33d = d33d$1.exports;
|
|
23258
|
+
(function (module, exports$1) {
|
|
23259
|
+
(function (i, h) {
|
|
23260
|
+
h(exports$1) ;
|
|
23261
|
+
})(d33d, function (i) {
|
|
23333
23262
|
|
|
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
|
-
|
|
23263
|
+
function h(r) {
|
|
23264
|
+
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`;
|
|
23265
|
+
}
|
|
23266
|
+
function j(r) {
|
|
23267
|
+
return r.x;
|
|
23268
|
+
}
|
|
23269
|
+
function C(r) {
|
|
23270
|
+
return r.y;
|
|
23271
|
+
}
|
|
23272
|
+
function Z(r) {
|
|
23273
|
+
return r.z;
|
|
23274
|
+
}
|
|
23275
|
+
class c {
|
|
23276
|
+
constructor() {
|
|
23277
|
+
this._scale = 1, this._origin = {
|
|
23278
|
+
x: 0,
|
|
23279
|
+
y: 0
|
|
23280
|
+
}, this._rotateX = 0, this._rotateY = 0, this._rotateZ = 0, this._x = j, this._y = C, this._z = Z, this._rotationCenter = {
|
|
23281
|
+
x: 0,
|
|
23282
|
+
y: 0,
|
|
23283
|
+
z: 0
|
|
23284
|
+
};
|
|
23285
|
+
}
|
|
23286
|
+
scale(t) {
|
|
23287
|
+
return t ? (this._scale = t, this) : this._scale;
|
|
23288
|
+
}
|
|
23289
|
+
origin(t) {
|
|
23290
|
+
return t ? (this._origin = t, this) : this._origin;
|
|
23291
|
+
}
|
|
23292
|
+
rotationCenter(t) {
|
|
23293
|
+
return t ? (this._rotationCenter = t, this) : this._rotationCenter;
|
|
23294
|
+
}
|
|
23295
|
+
rotateX(t) {
|
|
23296
|
+
return t ? (this._rotateX = t, this) : this._rotateX;
|
|
23297
|
+
}
|
|
23298
|
+
rotateY(t) {
|
|
23299
|
+
return t ? (this._rotateY = t, this) : this._rotateY;
|
|
23300
|
+
}
|
|
23301
|
+
rotateZ(t) {
|
|
23302
|
+
return t ? (this._rotateZ = t, this) : this._rotateZ;
|
|
23303
|
+
}
|
|
23304
|
+
x(t) {
|
|
23305
|
+
return typeof t == "function" ? (this._x = t, this) : this._x;
|
|
23306
|
+
}
|
|
23307
|
+
y(t) {
|
|
23308
|
+
return typeof t == "function" ? (this._y = t, this) : this._y;
|
|
23309
|
+
}
|
|
23310
|
+
z(t) {
|
|
23311
|
+
return typeof t == "function" ? (this._z = t, this) : this._z;
|
|
23312
|
+
}
|
|
23313
|
+
}
|
|
23314
|
+
function z(r) {
|
|
23315
|
+
const t = [...r, r[0]];
|
|
23316
|
+
let n = 0;
|
|
23317
|
+
for (let e = 0; e < r.length; e += 1) {
|
|
23318
|
+
const o = t[e].rotated,
|
|
23319
|
+
s = t[e + 1].rotated;
|
|
23320
|
+
n += (s.x - o.x) * (s.y + o.y);
|
|
23321
|
+
}
|
|
23322
|
+
return n > 0;
|
|
23323
|
+
}
|
|
23324
|
+
function u(r) {
|
|
23325
|
+
let t = 0,
|
|
23326
|
+
n = 0,
|
|
23327
|
+
e = 0;
|
|
23328
|
+
for (let o = r.length - 1; o >= 0; o -= 1) {
|
|
23329
|
+
const s = r[o].rotated;
|
|
23330
|
+
t += s.x, n += s.y, e += s.z;
|
|
23331
|
+
}
|
|
23332
|
+
return {
|
|
23333
|
+
x: t / r.length,
|
|
23334
|
+
y: n / r.length,
|
|
23335
|
+
z: e / r.length
|
|
23336
|
+
};
|
|
23337
|
+
}
|
|
23338
|
+
function _(r, t) {
|
|
23339
|
+
const n = t.rotateCenter,
|
|
23340
|
+
e = {
|
|
23341
|
+
x: r.x - n.x,
|
|
23342
|
+
y: r.y - n.y,
|
|
23343
|
+
z: r.z - n.z
|
|
23344
|
+
},
|
|
23345
|
+
o = X(e, t.z),
|
|
23346
|
+
s = $(o, t.y),
|
|
23347
|
+
a = D(s, t.x);
|
|
23348
|
+
return {
|
|
23349
|
+
x: a.x + n.x,
|
|
23350
|
+
y: a.y + n.y,
|
|
23351
|
+
z: a.z + n.z
|
|
23352
|
+
};
|
|
23353
|
+
}
|
|
23354
|
+
function D(r, t) {
|
|
23355
|
+
const n = Math.sin(t),
|
|
23356
|
+
e = Math.cos(t);
|
|
23357
|
+
return {
|
|
23358
|
+
x: r.x,
|
|
23359
|
+
y: r.y * e - r.z * n,
|
|
23360
|
+
z: r.y * n + r.z * e
|
|
23361
|
+
};
|
|
23362
|
+
}
|
|
23363
|
+
function $(r, t) {
|
|
23364
|
+
const n = Math.sin(t),
|
|
23365
|
+
e = Math.cos(t);
|
|
23366
|
+
return {
|
|
23367
|
+
x: r.z * n + r.x * e,
|
|
23368
|
+
y: r.y,
|
|
23369
|
+
z: r.z * e - r.x * n
|
|
23370
|
+
};
|
|
23371
|
+
}
|
|
23372
|
+
function X(r, t) {
|
|
23373
|
+
const n = Math.sin(t),
|
|
23374
|
+
e = Math.cos(t);
|
|
23375
|
+
return {
|
|
23376
|
+
x: r.x * e - r.y * n,
|
|
23377
|
+
y: r.x * n + r.y * e,
|
|
23378
|
+
z: r.z
|
|
23379
|
+
};
|
|
23380
|
+
}
|
|
23381
|
+
function w(r, t) {
|
|
23382
|
+
return {
|
|
23383
|
+
x: t.origin.x + t.scale * r.x,
|
|
23384
|
+
y: t.origin.y + t.scale * r.y
|
|
23385
|
+
};
|
|
23386
|
+
}
|
|
23387
|
+
const d = (r, t) => r.map(n => {
|
|
23388
|
+
const e = {
|
|
23389
|
+
x: t.x(n),
|
|
23390
|
+
y: t.y(n),
|
|
23391
|
+
z: t.z(n)
|
|
23392
|
+
},
|
|
23393
|
+
o = _(e, {
|
|
23394
|
+
x: t.rotateX,
|
|
23395
|
+
y: t.rotateY,
|
|
23396
|
+
z: t.rotateZ,
|
|
23397
|
+
rotateCenter: t.rotateCenter
|
|
23398
|
+
}),
|
|
23399
|
+
s = w(o, {
|
|
23400
|
+
scale: t.scale,
|
|
23401
|
+
origin: t.origin
|
|
23402
|
+
});
|
|
23403
|
+
return {
|
|
23404
|
+
...n,
|
|
23405
|
+
rotated: o,
|
|
23406
|
+
projected: s
|
|
23407
|
+
};
|
|
23382
23408
|
});
|
|
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
|
-
}
|
|
23409
|
+
function l(r, t) {
|
|
23410
|
+
const n = r;
|
|
23411
|
+
return n.centroid = u(n), n.ccw = z(n), n.face = t, n;
|
|
23412
|
+
}
|
|
23413
|
+
class Y extends c {
|
|
23414
|
+
data(t) {
|
|
23415
|
+
return t.map(n => {
|
|
23416
|
+
const e = d(n, {
|
|
23417
|
+
origin: this.origin(),
|
|
23418
|
+
rotateCenter: this.rotationCenter(),
|
|
23419
|
+
rotateX: this.rotateX(),
|
|
23420
|
+
rotateY: this.rotateY(),
|
|
23421
|
+
rotateZ: this.rotateZ(),
|
|
23422
|
+
scale: this.scale(),
|
|
23423
|
+
x: this.x(),
|
|
23424
|
+
y: this.y(),
|
|
23425
|
+
z: this.z()
|
|
23426
|
+
}),
|
|
23427
|
+
o = l([e[0], e[1], e[2], e[3]], "front"),
|
|
23428
|
+
s = l([e[7], e[6], e[5], e[4]], "back"),
|
|
23429
|
+
a = l([e[4], e[5], e[1], e[0]], "left"),
|
|
23430
|
+
y = l([e[3], e[2], e[6], e[7]], "right"),
|
|
23431
|
+
x = l([e[4], e[0], e[3], e[7]], "top"),
|
|
23432
|
+
g = l([e[1], e[5], e[6], e[2]], "bottom");
|
|
23433
|
+
return e.faces = [o, s, a, y, x, g], e.centroid = {
|
|
23434
|
+
x: (a.centroid.x + y.centroid.x) / 2,
|
|
23435
|
+
y: (x.centroid.y + g.centroid.y) / 2,
|
|
23436
|
+
z: (o.centroid.z + s.centroid.z) / 2
|
|
23437
|
+
}, e;
|
|
23438
|
+
});
|
|
23439
|
+
}
|
|
23440
|
+
draw(t) {
|
|
23441
|
+
return h(t);
|
|
23442
|
+
}
|
|
23443
|
+
}
|
|
23444
|
+
function P() {
|
|
23445
|
+
return new Y();
|
|
23446
|
+
}
|
|
23447
|
+
class M extends c {
|
|
23448
|
+
constructor() {
|
|
23449
|
+
super(...arguments), this._rows = 1;
|
|
23450
|
+
}
|
|
23451
|
+
rows(t) {
|
|
23452
|
+
return t ? (this._rows = t, this) : this._rows;
|
|
23453
|
+
}
|
|
23454
|
+
data(t) {
|
|
23455
|
+
const n = this._rows,
|
|
23456
|
+
e = d(t, {
|
|
23457
|
+
origin: this.origin(),
|
|
23458
|
+
rotateCenter: this.rotationCenter(),
|
|
23459
|
+
rotateX: this.rotateX(),
|
|
23460
|
+
rotateY: this.rotateY(),
|
|
23461
|
+
rotateZ: this.rotateZ(),
|
|
23462
|
+
scale: this.scale(),
|
|
23463
|
+
x: this.x(),
|
|
23464
|
+
y: this.y(),
|
|
23465
|
+
z: this.z()
|
|
23466
|
+
}),
|
|
23467
|
+
o = e.length / n,
|
|
23468
|
+
s = [];
|
|
23469
|
+
let a = 0;
|
|
23470
|
+
for (let y = o - 1; y > 0; y -= 1) for (let x = n - 1; x > 0; x -= 1) {
|
|
23471
|
+
const g = x + y * n,
|
|
23472
|
+
m = g - 1,
|
|
23473
|
+
p = m - n + 1,
|
|
23474
|
+
N = p - 1,
|
|
23475
|
+
f = [e[g], e[p], e[N], e[m]];
|
|
23476
|
+
f.plane = `plane-${a}`, f.ccw = z(f), f.centroid = u(f), s.push(f), a += 1;
|
|
23477
|
+
}
|
|
23478
|
+
return s;
|
|
23479
|
+
}
|
|
23480
|
+
draw(t) {
|
|
23481
|
+
return h(t);
|
|
23482
|
+
}
|
|
23483
|
+
}
|
|
23484
|
+
function R() {
|
|
23485
|
+
return new M();
|
|
23486
|
+
}
|
|
23487
|
+
class b extends c {
|
|
23488
|
+
data(t) {
|
|
23489
|
+
return t.map(n => {
|
|
23490
|
+
const e = d(n, {
|
|
23491
|
+
origin: this.origin(),
|
|
23492
|
+
rotateCenter: this.rotationCenter(),
|
|
23493
|
+
rotateX: this.rotateX(),
|
|
23494
|
+
rotateY: this.rotateY(),
|
|
23495
|
+
rotateZ: this.rotateZ(),
|
|
23496
|
+
scale: this.scale(),
|
|
23497
|
+
x: this.x(),
|
|
23498
|
+
y: this.y(),
|
|
23499
|
+
z: this.z()
|
|
23500
|
+
});
|
|
23501
|
+
return e.centroid = u(e), e;
|
|
23502
|
+
});
|
|
23503
|
+
}
|
|
23504
|
+
}
|
|
23505
|
+
function L() {
|
|
23506
|
+
return new b();
|
|
23507
|
+
}
|
|
23508
|
+
function S(r) {
|
|
23509
|
+
const t = r[r.length - 1];
|
|
23510
|
+
let n = `M${t.projected.x},${t.projected.y}`;
|
|
23511
|
+
for (let e = r.length - 2; e >= 0; e -= 1) {
|
|
23512
|
+
const o = r[e].projected;
|
|
23513
|
+
n += `L${o.x},${o.y}`;
|
|
23514
|
+
}
|
|
23515
|
+
return n;
|
|
23516
|
+
}
|
|
23517
|
+
class A extends c {
|
|
23518
|
+
data(t) {
|
|
23519
|
+
return t.map(n => {
|
|
23520
|
+
const e = n.length / 2,
|
|
23521
|
+
o = Math.trunc(e),
|
|
23522
|
+
s = d(n, {
|
|
23523
|
+
origin: this.origin(),
|
|
23524
|
+
rotateCenter: this.rotationCenter(),
|
|
23525
|
+
rotateX: this.rotateX(),
|
|
23526
|
+
rotateY: this.rotateY(),
|
|
23527
|
+
rotateZ: this.rotateZ(),
|
|
23528
|
+
scale: this.scale(),
|
|
23529
|
+
x: this.x(),
|
|
23530
|
+
y: this.y(),
|
|
23531
|
+
z: this.z()
|
|
23532
|
+
});
|
|
23533
|
+
return s.centroid = o === e ? u([s[e - 1], s[e]]) : s[o].rotated, s;
|
|
23534
|
+
});
|
|
23535
|
+
}
|
|
23536
|
+
draw(t) {
|
|
23537
|
+
return S(t);
|
|
23538
|
+
}
|
|
23539
|
+
}
|
|
23540
|
+
function T() {
|
|
23541
|
+
return new A();
|
|
23542
|
+
}
|
|
23543
|
+
class k extends c {
|
|
23544
|
+
data(t) {
|
|
23545
|
+
return t.map(n => {
|
|
23546
|
+
const e = d(n, {
|
|
23547
|
+
origin: this.origin(),
|
|
23548
|
+
rotateCenter: this.rotationCenter(),
|
|
23549
|
+
rotateX: this.rotateX(),
|
|
23550
|
+
rotateY: this.rotateY(),
|
|
23551
|
+
rotateZ: this.rotateZ(),
|
|
23552
|
+
scale: this.scale(),
|
|
23553
|
+
x: this.x(),
|
|
23554
|
+
y: this.y(),
|
|
23555
|
+
z: this.z()
|
|
23556
|
+
});
|
|
23557
|
+
return e.ccw = z(e), e.centroid = u(e), e;
|
|
23558
|
+
});
|
|
23559
|
+
}
|
|
23560
|
+
draw(t) {
|
|
23561
|
+
return h(t);
|
|
23562
|
+
}
|
|
23563
|
+
}
|
|
23564
|
+
function F() {
|
|
23565
|
+
return new k();
|
|
23566
|
+
}
|
|
23567
|
+
class G extends c {
|
|
23568
|
+
data(t) {
|
|
23569
|
+
return t.map(n => {
|
|
23570
|
+
const e = {
|
|
23571
|
+
x: this.x()(n),
|
|
23572
|
+
y: this.y()(n),
|
|
23573
|
+
z: this.z()(n)
|
|
23574
|
+
},
|
|
23575
|
+
o = _(e, {
|
|
23576
|
+
x: this.rotateX(),
|
|
23577
|
+
y: this.rotateY(),
|
|
23578
|
+
z: this.rotateZ(),
|
|
23579
|
+
rotateCenter: this.rotationCenter()
|
|
23580
|
+
}),
|
|
23581
|
+
s = w(e, {
|
|
23582
|
+
scale: this.scale(),
|
|
23583
|
+
origin: this.origin()
|
|
23584
|
+
});
|
|
23585
|
+
return {
|
|
23586
|
+
...n,
|
|
23587
|
+
rotated: o,
|
|
23588
|
+
centroid: o,
|
|
23589
|
+
projected: s
|
|
23590
|
+
};
|
|
23591
|
+
});
|
|
23592
|
+
}
|
|
23593
|
+
}
|
|
23594
|
+
function O() {
|
|
23595
|
+
return new G();
|
|
23596
|
+
}
|
|
23597
|
+
function q(r) {
|
|
23598
|
+
const t = r[r.length - 1];
|
|
23599
|
+
let n = `M${t.projected.x},${t.projected.y}`;
|
|
23600
|
+
for (let e = r.length - 2; e >= 0; e -= 1) {
|
|
23601
|
+
const o = r[e].projected;
|
|
23602
|
+
n += `L${o.x},${o.y}`;
|
|
23603
|
+
}
|
|
23604
|
+
return `${n}Z`;
|
|
23605
|
+
}
|
|
23606
|
+
class B extends c {
|
|
23607
|
+
data(t) {
|
|
23608
|
+
return t.map(n => {
|
|
23609
|
+
const e = d(n, {
|
|
23610
|
+
origin: this.origin(),
|
|
23611
|
+
rotateCenter: this.rotationCenter(),
|
|
23612
|
+
rotateX: this.rotateX(),
|
|
23613
|
+
rotateY: this.rotateY(),
|
|
23614
|
+
rotateZ: this.rotateZ(),
|
|
23615
|
+
scale: this.scale(),
|
|
23616
|
+
x: this.x(),
|
|
23617
|
+
y: this.y(),
|
|
23618
|
+
z: this.z()
|
|
23619
|
+
});
|
|
23620
|
+
return e.ccw = z(e), e.centroid = u(e), e;
|
|
23621
|
+
});
|
|
23622
|
+
}
|
|
23623
|
+
draw(t) {
|
|
23624
|
+
return q(t);
|
|
23625
|
+
}
|
|
23626
|
+
}
|
|
23627
|
+
function E() {
|
|
23628
|
+
return new B();
|
|
23629
|
+
}
|
|
23630
|
+
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`;
|
|
23631
|
+
class I extends c {
|
|
23632
|
+
data(t) {
|
|
23633
|
+
return t.map(n => {
|
|
23634
|
+
const e = d(n, {
|
|
23635
|
+
origin: this.origin(),
|
|
23636
|
+
rotateCenter: this.rotationCenter(),
|
|
23637
|
+
rotateX: this.rotateX(),
|
|
23638
|
+
rotateY: this.rotateY(),
|
|
23639
|
+
rotateZ: this.rotateZ(),
|
|
23640
|
+
scale: this.scale(),
|
|
23641
|
+
x: this.x(),
|
|
23642
|
+
y: this.y(),
|
|
23643
|
+
z: this.z()
|
|
23644
|
+
});
|
|
23645
|
+
return e.ccw = z(e), e.centroid = u(e), e;
|
|
23646
|
+
});
|
|
23647
|
+
}
|
|
23648
|
+
draw(t) {
|
|
23649
|
+
return H(t);
|
|
23650
|
+
}
|
|
23651
|
+
}
|
|
23652
|
+
function J() {
|
|
23653
|
+
return new I();
|
|
23654
|
+
}
|
|
23655
|
+
function K(r, t) {
|
|
23656
|
+
const n = r.centroid.z,
|
|
23657
|
+
e = t.centroid.z;
|
|
23658
|
+
return n < e ? -1 : n > e ? 1 : 0;
|
|
23659
|
+
}
|
|
23660
|
+
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, {
|
|
23661
|
+
value: "Module"
|
|
23662
|
+
});
|
|
23663
|
+
});
|
|
23664
|
+
})(d33d$1, d33d$1.exports);
|
|
23665
|
+
var d33dExports = d33d$1.exports;
|
|
23725
23666
|
|
|
23726
23667
|
var cssKeywords = {
|
|
23727
23668
|
aliceblue: [240, 248, 255],
|
|
@@ -25870,7 +25811,7 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
25870
25811
|
}
|
|
25871
25812
|
render() {
|
|
25872
25813
|
/* eslint-disable-line class-methods-use-this */
|
|
25873
|
-
return x$
|
|
25814
|
+
return x$2`
|
|
25874
25815
|
`;
|
|
25875
25816
|
}
|
|
25876
25817
|
willUpdate() {
|
|
@@ -25926,10 +25867,11 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
25926
25867
|
};
|
|
25927
25868
|
const startRotationX = -0.85 * Math.PI / 8;
|
|
25928
25869
|
const startRotationY = 3 * Math.PI / 8;
|
|
25929
|
-
const startRotationZ = 0;
|
|
25930
|
-
|
|
25931
|
-
const
|
|
25932
|
-
const
|
|
25870
|
+
const startRotationZ = 0.0000001; // Avoid d3-3d bug
|
|
25871
|
+
|
|
25872
|
+
const lineStrips3D = d33dExports.lineStrips3D().origin(startOrigin).scale(startScale).rotationCenter(startRotationCenter).rotateX(startRotationX + this.rotationX).rotateY(startRotationY + this.rotationY).rotateZ(startRotationZ);
|
|
25873
|
+
const points3d = d33dExports.points3D().origin(startOrigin).scale(startScale).rotationCenter(startRotationCenter).rotateX(startRotationX + this.rotationX).rotateY(startRotationY + this.rotationY).rotateZ(startRotationZ);
|
|
25874
|
+
const grid3d = d33dExports.gridPlanes3D().origin(startOrigin).scale(startScale).rotationCenter(startRotationCenter).rotateX(startRotationX + this.rotationX).rotateY(startRotationY + this.rotationY).rotateZ(startRotationZ);
|
|
25933
25875
|
|
|
25934
25876
|
// SVG Drag behaviors
|
|
25935
25877
|
const svgDrag = drag().on('start', event => {
|
|
@@ -25952,9 +25894,9 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
25952
25894
|
rem: this.rem
|
|
25953
25895
|
}]);
|
|
25954
25896
|
// ENTER
|
|
25955
|
-
const svgEnter = svgUpdate.enter().append('svg').classed('main', true);
|
|
25897
|
+
const svgEnter = svgUpdate.enter().append('svg').classed('main', true).call(svgDrag);
|
|
25956
25898
|
// MERGE
|
|
25957
|
-
const svgMerge = svgEnter.merge(svgUpdate).attr('viewBox', `0 0 ${elementSize} ${elementSize}`)
|
|
25899
|
+
const svgMerge = svgEnter.merge(svgUpdate).attr('viewBox', `0 0 ${elementSize} ${elementSize}`);
|
|
25958
25900
|
|
|
25959
25901
|
// Gradient Def
|
|
25960
25902
|
const gradientEnter = svgEnter.append('defs').append('linearGradient').attr('id', 'gradient-legend')
|
|
@@ -25994,35 +25936,35 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
25994
25936
|
|
|
25995
25937
|
// Axes
|
|
25996
25938
|
// DATA-JOIN
|
|
25997
|
-
const axisXUpdate = svgMerge.selectAll('.axis-x').data(lineStrips3D
|
|
25939
|
+
const axisXUpdate = svgMerge.selectAll('.axis-x').data(lineStrips3D.x(datum => {
|
|
25998
25940
|
return datum.x;
|
|
25999
25941
|
}).y(() => {
|
|
26000
25942
|
return yScale.range()[0];
|
|
26001
25943
|
}).z(() => {
|
|
26002
25944
|
return zScale.range()[0];
|
|
26003
|
-
})(xAxis));
|
|
26004
|
-
const axisYUpdate = svgMerge.selectAll('.axis-y').data(lineStrips3D
|
|
25945
|
+
}).data(xAxis));
|
|
25946
|
+
const axisYUpdate = svgMerge.selectAll('.axis-y').data(lineStrips3D.x(() => {
|
|
26005
25947
|
return xScale.range()[0];
|
|
26006
25948
|
}).y(datum => {
|
|
26007
25949
|
return datum.y;
|
|
26008
25950
|
}).z(() => {
|
|
26009
25951
|
return zScale.range()[1];
|
|
26010
|
-
})(yAxis));
|
|
26011
|
-
const axisZUpdate = svgMerge.selectAll('.axis-z').data(lineStrips3D
|
|
25952
|
+
}).data(yAxis));
|
|
25953
|
+
const axisZUpdate = svgMerge.selectAll('.axis-z').data(lineStrips3D.x(() => {
|
|
26012
25954
|
return xScale.range()[0];
|
|
26013
25955
|
}).y(() => {
|
|
26014
25956
|
return yScale.range()[0];
|
|
26015
25957
|
}).z(datum => {
|
|
26016
25958
|
return datum.z;
|
|
26017
|
-
})(zAxis));
|
|
25959
|
+
}).data(zAxis));
|
|
26018
25960
|
// ENTER
|
|
26019
25961
|
const axisXEnter = axisXUpdate.enter().append('path').attr('class', 'd3-3d axis axis-x');
|
|
26020
25962
|
const axisYEnter = axisYUpdate.enter().append('path').attr('class', 'd3-3d axis axis-y');
|
|
26021
25963
|
const axisZEnter = axisZUpdate.enter().append('path').attr('class', 'd3-3d axis axis-z');
|
|
26022
25964
|
// 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
|
|
25965
|
+
const axisXMerge = axisXEnter.merge(axisXUpdate).attr('d', lineStrips3D.draw);
|
|
25966
|
+
const axisYMerge = axisYEnter.merge(axisYUpdate).attr('d', lineStrips3D.draw);
|
|
25967
|
+
const axisZMerge = axisZEnter.merge(axisZUpdate).attr('d', lineStrips3D.draw);
|
|
26026
25968
|
// EXIT
|
|
26027
25969
|
axisXMerge.exit().remove();
|
|
26028
25970
|
axisYMerge.exit().remove();
|
|
@@ -26030,34 +25972,52 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26030
25972
|
|
|
26031
25973
|
// Axis Titles
|
|
26032
25974
|
// DATA-JOIN
|
|
26033
|
-
const titlePathXUpdate = svgMerge.selectAll('.title-path-x').data(lineStrips3D
|
|
25975
|
+
const titlePathXUpdate = svgMerge.selectAll('.title-path-x').data(lineStrips3D.x(datum => {
|
|
26034
25976
|
return datum.id === 'min' ? datum.x - this.rem * 20 : datum.x + this.rem * 20;
|
|
26035
25977
|
}).y(() => {
|
|
26036
25978
|
return yScale.range()[0] + this.rem * 1.75;
|
|
26037
25979
|
}).z(() => {
|
|
26038
25980
|
return zScale.range()[0] + this.rem * 1.75;
|
|
26039
|
-
})(xAxis));
|
|
26040
|
-
const titlePathYUpdate = svgMerge.selectAll('.title-path-y').data(lineStrips3D
|
|
25981
|
+
}).data(xAxis));
|
|
25982
|
+
const titlePathYUpdate = svgMerge.selectAll('.title-path-y').data(lineStrips3D.x(() => {
|
|
26041
25983
|
return xScale.range()[0] - this.rem * 1.75;
|
|
26042
25984
|
}).y(datum => {
|
|
26043
25985
|
return datum.id === 'min' ? datum.y + this.rem * 20 : datum.y - this.rem * 20;
|
|
26044
25986
|
}).z(() => {
|
|
26045
25987
|
return zScale.range()[1] - this.rem * 1.75;
|
|
26046
|
-
})(yAxis));
|
|
26047
|
-
const titlePathZUpdate = svgMerge.selectAll('.title-path-z').data(lineStrips3D
|
|
25988
|
+
}).data(yAxis));
|
|
25989
|
+
const titlePathZUpdate = svgMerge.selectAll('.title-path-z').data(lineStrips3D.x(() => {
|
|
26048
25990
|
return xScale.range()[0] - this.rem * 1.75;
|
|
26049
25991
|
}).y(() => {
|
|
26050
25992
|
return yScale.range()[0] + this.rem * 1.75;
|
|
26051
25993
|
}).z(datum => {
|
|
26052
25994
|
return datum.id === 'min' ? datum.z - this.rem * 20 : datum.z + this.rem * 20;
|
|
26053
|
-
})(zAxis));
|
|
26054
|
-
const titleXUpdate = svgMerge.selectAll('.title-x').data(
|
|
25995
|
+
}).data(zAxis));
|
|
25996
|
+
const titleXUpdate = svgMerge.selectAll('.title-x').data(lineStrips3D.x(datum => {
|
|
25997
|
+
return datum.id === 'min' ? datum.x - this.rem * 20 : datum.x + this.rem * 20;
|
|
25998
|
+
}).y(() => {
|
|
25999
|
+
return yScale.range()[0] + this.rem * 1.75;
|
|
26000
|
+
}).z(() => {
|
|
26001
|
+
return zScale.range()[0] + this.rem * 1.75;
|
|
26002
|
+
}).data(xAxis), datum => {
|
|
26055
26003
|
return datum[0].title;
|
|
26056
26004
|
});
|
|
26057
|
-
const titleYUpdate = svgMerge.selectAll('.title-y').data(
|
|
26005
|
+
const titleYUpdate = svgMerge.selectAll('.title-y').data(lineStrips3D.x(() => {
|
|
26006
|
+
return xScale.range()[0] - this.rem * 1.75;
|
|
26007
|
+
}).y(datum => {
|
|
26008
|
+
return datum.id === 'min' ? datum.y + this.rem * 20 : datum.y - this.rem * 20;
|
|
26009
|
+
}).z(() => {
|
|
26010
|
+
return zScale.range()[1] - this.rem * 1.75;
|
|
26011
|
+
}).data(yAxis), datum => {
|
|
26058
26012
|
return datum[0].title;
|
|
26059
26013
|
});
|
|
26060
|
-
const titleZUpdate = svgMerge.selectAll('.title-z').data(
|
|
26014
|
+
const titleZUpdate = svgMerge.selectAll('.title-z').data(lineStrips3D.x(() => {
|
|
26015
|
+
return xScale.range()[0] - this.rem * 1.75;
|
|
26016
|
+
}).y(() => {
|
|
26017
|
+
return yScale.range()[0] + this.rem * 1.75;
|
|
26018
|
+
}).z(datum => {
|
|
26019
|
+
return datum.id === 'min' ? datum.z - this.rem * 20 : datum.z + this.rem * 20;
|
|
26020
|
+
}).data(zAxis), datum => {
|
|
26061
26021
|
return datum[0].title;
|
|
26062
26022
|
});
|
|
26063
26023
|
// ENTER
|
|
@@ -26071,9 +26031,9 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26071
26031
|
const titleZEnter = titleZUpdate.enter().append('text').attr('class', 'd3-3d title title-z');
|
|
26072
26032
|
titleZEnter.append('textPath').attr('href', '#title-z').attr('startOffset', '50%');
|
|
26073
26033
|
// 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
|
|
26034
|
+
const titlePathXMerge = titlePathXEnter.merge(titlePathXUpdate).attr('d', lineStrips3D.draw);
|
|
26035
|
+
const titlePathYMerge = titlePathYEnter.merge(titlePathYUpdate).attr('d', lineStrips3D.draw);
|
|
26036
|
+
const titlePathZMerge = titlePathZEnter.merge(titlePathZUpdate).attr('d', lineStrips3D.draw);
|
|
26077
26037
|
const titleXMerge = titleXEnter.merge(titleXUpdate).select('textPath').html(datum => {
|
|
26078
26038
|
return datum[0].title;
|
|
26079
26039
|
});
|
|
@@ -26126,35 +26086,35 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26126
26086
|
|
|
26127
26087
|
// Axis Ticks
|
|
26128
26088
|
// DATA-JOIN
|
|
26129
|
-
const ticksXUpdate = svgMerge.selectAll('.tick-x').data(lineStrips3D
|
|
26089
|
+
const ticksXUpdate = svgMerge.selectAll('.tick-x').data(lineStrips3D.x(datum => {
|
|
26130
26090
|
return datum.x;
|
|
26131
26091
|
}).y(datum => {
|
|
26132
26092
|
return datum.id === 'min' ? yScale.range()[0] : yScale.range()[0] + this.rem * 0.35;
|
|
26133
26093
|
}).z(datum => {
|
|
26134
26094
|
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
|
|
26095
|
+
}).data(xTicks));
|
|
26096
|
+
const ticksYUpdate = svgMerge.selectAll('.tick-y').data(lineStrips3D.x(datum => {
|
|
26137
26097
|
return datum.id === 'min' ? xScale.range()[0] : xScale.range()[0] - this.rem * 0.35;
|
|
26138
26098
|
}).y(datum => {
|
|
26139
26099
|
return datum.y;
|
|
26140
26100
|
}).z(datum => {
|
|
26141
26101
|
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
|
|
26102
|
+
}).data(yTicks));
|
|
26103
|
+
const ticksZUpdate = svgMerge.selectAll('.tick-z').data(lineStrips3D.x(datum => {
|
|
26144
26104
|
return datum.id === 'min' ? xScale.range()[0] : xScale.range()[0] - this.rem * 0.35;
|
|
26145
26105
|
}).y(datum => {
|
|
26146
26106
|
return datum.id === 'min' ? yScale.range()[0] : yScale.range()[0] + this.rem * 0.35;
|
|
26147
26107
|
}).z(datum => {
|
|
26148
26108
|
return datum.z;
|
|
26149
|
-
})(zTicks));
|
|
26109
|
+
}).data(zTicks));
|
|
26150
26110
|
// ENTER
|
|
26151
26111
|
const ticksXEnter = ticksXUpdate.enter().append('path').attr('class', 'd3-3d tick tick-x');
|
|
26152
26112
|
const ticksYEnter = ticksYUpdate.enter().append('path').attr('class', 'd3-3d tick tick-y');
|
|
26153
26113
|
const ticksZEnter = ticksZUpdate.enter().append('path').attr('class', 'd3-3d tick tick-z');
|
|
26154
26114
|
// 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
|
|
26115
|
+
const ticksXMerge = ticksXEnter.merge(ticksXUpdate).attr('d', lineStrips3D.draw);
|
|
26116
|
+
const ticksYMerge = ticksYEnter.merge(ticksYUpdate).attr('d', lineStrips3D.draw);
|
|
26117
|
+
const ticksZMerge = ticksZEnter.merge(ticksZUpdate).attr('d', lineStrips3D.draw);
|
|
26158
26118
|
// EXIT
|
|
26159
26119
|
ticksXMerge.exit().remove();
|
|
26160
26120
|
ticksYMerge.exit().remove();
|
|
@@ -26162,40 +26122,58 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26162
26122
|
|
|
26163
26123
|
// Axis Tick Labels
|
|
26164
26124
|
// DATA-JOIN
|
|
26165
|
-
const labelPathsXUpdate = svgMerge.selectAll('.label-path-x').data(lineStrips3D
|
|
26125
|
+
const labelPathsXUpdate = svgMerge.selectAll('.label-path-x').data(lineStrips3D.x(datum => {
|
|
26166
26126
|
return datum.x;
|
|
26167
26127
|
}).y(datum => {
|
|
26168
26128
|
return datum.id === 'min' ? yScale.range()[0] + this.rem * 4 : yScale.range()[0] + this.rem * 0.5;
|
|
26169
26129
|
}).z(datum => {
|
|
26170
26130
|
return datum.id === 'min' ? zScale.range()[0] + this.rem * 4 : zScale.range()[0] + this.rem * 0.5;
|
|
26171
|
-
})(xTicks), datum => {
|
|
26131
|
+
}).data(xTicks), datum => {
|
|
26172
26132
|
return datum[0].label;
|
|
26173
26133
|
});
|
|
26174
|
-
const labelPathsYUpdate = svgMerge.selectAll('.label-path-y').data(lineStrips3D
|
|
26134
|
+
const labelPathsYUpdate = svgMerge.selectAll('.label-path-y').data(lineStrips3D.x(datum => {
|
|
26175
26135
|
return datum.id === 'min' ? xScale.range()[0] - this.rem * 0.5 : xScale.range()[0] - this.rem * 4;
|
|
26176
26136
|
}).y(datum => {
|
|
26177
26137
|
return datum.y;
|
|
26178
26138
|
}).z(datum => {
|
|
26179
26139
|
return datum.id === 'min' ? zScale.range()[1] - this.rem * 0.5 : zScale.range()[1] - this.rem * 4;
|
|
26180
|
-
})(yTicks), datum => {
|
|
26140
|
+
}).data(yTicks), datum => {
|
|
26181
26141
|
return datum[0].label;
|
|
26182
26142
|
});
|
|
26183
|
-
const labelPathsZUpdate = svgMerge.selectAll('.label-path-z').data(lineStrips3D
|
|
26143
|
+
const labelPathsZUpdate = svgMerge.selectAll('.label-path-z').data(lineStrips3D.x(datum => {
|
|
26184
26144
|
return datum.id === 'min' ? xScale.range()[0] - this.rem * 4 : xScale.range()[0] - this.rem * 0.5;
|
|
26185
26145
|
}).y(datum => {
|
|
26186
26146
|
return datum.id === 'min' ? yScale.range()[0] + this.rem * 4 : yScale.range()[0] + this.rem * 0.5;
|
|
26187
26147
|
}).z(datum => {
|
|
26188
26148
|
return datum.z;
|
|
26189
|
-
})(zTicks), datum => {
|
|
26149
|
+
}).data(zTicks), datum => {
|
|
26190
26150
|
return datum[0].label;
|
|
26191
26151
|
});
|
|
26192
|
-
const labelsXUpdate = svgMerge.selectAll('.label-x').data(
|
|
26152
|
+
const labelsXUpdate = svgMerge.selectAll('.label-x').data(lineStrips3D.x(datum => {
|
|
26153
|
+
return datum.x;
|
|
26154
|
+
}).y(datum => {
|
|
26155
|
+
return datum.id === 'min' ? yScale.range()[0] + this.rem * 4 : yScale.range()[0] + this.rem * 0.5;
|
|
26156
|
+
}).z(datum => {
|
|
26157
|
+
return datum.id === 'min' ? zScale.range()[0] + this.rem * 4 : zScale.range()[0] + this.rem * 0.5;
|
|
26158
|
+
}).data(xTicks), datum => {
|
|
26193
26159
|
return datum[0].label;
|
|
26194
26160
|
});
|
|
26195
|
-
const labelsYUpdate = svgMerge.selectAll('.label-y').data(
|
|
26161
|
+
const labelsYUpdate = svgMerge.selectAll('.label-y').data(lineStrips3D.x(datum => {
|
|
26162
|
+
return datum.id === 'min' ? xScale.range()[0] - this.rem * 0.5 : xScale.range()[0] - this.rem * 4;
|
|
26163
|
+
}).y(datum => {
|
|
26164
|
+
return datum.y;
|
|
26165
|
+
}).z(datum => {
|
|
26166
|
+
return datum.id === 'min' ? zScale.range()[1] - this.rem * 0.5 : zScale.range()[1] - this.rem * 4;
|
|
26167
|
+
}).data(yTicks), datum => {
|
|
26196
26168
|
return datum[0].label;
|
|
26197
26169
|
});
|
|
26198
|
-
const labelsZUpdate = svgMerge.selectAll('.label-z').data(
|
|
26170
|
+
const labelsZUpdate = svgMerge.selectAll('.label-z').data(lineStrips3D.x(datum => {
|
|
26171
|
+
return datum.id === 'min' ? xScale.range()[0] - this.rem * 4 : xScale.range()[0] - this.rem * 0.5;
|
|
26172
|
+
}).y(datum => {
|
|
26173
|
+
return datum.id === 'min' ? yScale.range()[0] + this.rem * 4 : yScale.range()[0] + this.rem * 0.5;
|
|
26174
|
+
}).z(datum => {
|
|
26175
|
+
return datum.z;
|
|
26176
|
+
}).data(zTicks), datum => {
|
|
26199
26177
|
return datum[0].label;
|
|
26200
26178
|
});
|
|
26201
26179
|
// ENTER
|
|
@@ -26221,9 +26199,9 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26221
26199
|
return `#label-z-${index}`;
|
|
26222
26200
|
}).attr('startOffset', '100%');
|
|
26223
26201
|
// 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
|
|
26202
|
+
const labelPathsXMerge = labelPathsXEnter.merge(labelPathsXUpdate).attr('d', lineStrips3D.draw);
|
|
26203
|
+
const labelPathsYMerge = labelPathsYEnter.merge(labelPathsYUpdate).attr('d', lineStrips3D.draw);
|
|
26204
|
+
const labelPathsZMerge = labelPathsZEnter.merge(labelPathsZUpdate).attr('d', lineStrips3D.draw);
|
|
26227
26205
|
const labelsXMerge = labelsXEnter.merge(labelsXUpdate).select('textPath').text(datum => {
|
|
26228
26206
|
return datum[0].label;
|
|
26229
26207
|
});
|
|
@@ -26249,7 +26227,7 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26249
26227
|
return yScale(datum.g);
|
|
26250
26228
|
}).z(datum => {
|
|
26251
26229
|
return zScale(datum.l);
|
|
26252
|
-
})(this.point ? [{
|
|
26230
|
+
}).data(this.point ? [{
|
|
26253
26231
|
a: this.a,
|
|
26254
26232
|
g: this.g,
|
|
26255
26233
|
l: this.l,
|
|
@@ -26327,7 +26305,7 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26327
26305
|
return yScale(datum.g);
|
|
26328
26306
|
}).z(datum => {
|
|
26329
26307
|
return zScale(datum.l);
|
|
26330
|
-
})(this.boundary).filter(datum => {
|
|
26308
|
+
}).data(this.boundary).filter(datum => {
|
|
26331
26309
|
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
26310
|
}) : []);
|
|
26333
26311
|
// ENTER
|
|
@@ -26353,21 +26331,21 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26353
26331
|
return yScale(datum.g);
|
|
26354
26332
|
}).z(datum => {
|
|
26355
26333
|
return zScale(datum.l);
|
|
26356
|
-
})(this.mapXY));
|
|
26334
|
+
}).data(this.mapXY));
|
|
26357
26335
|
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
26336
|
return xScale(datum.a);
|
|
26359
26337
|
}).y(datum => {
|
|
26360
26338
|
return yScale(datum.g);
|
|
26361
26339
|
}).z(datum => {
|
|
26362
26340
|
return zScale(datum.l);
|
|
26363
|
-
})(this.mapXZ));
|
|
26341
|
+
}).data(this.mapXZ));
|
|
26364
26342
|
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
26343
|
return xScale(datum.a);
|
|
26366
26344
|
}).y(datum => {
|
|
26367
26345
|
return yScale(datum.g);
|
|
26368
26346
|
}).z(datum => {
|
|
26369
26347
|
return zScale(datum.l);
|
|
26370
|
-
})(this.mapYZ));
|
|
26348
|
+
}).data(this.mapYZ));
|
|
26371
26349
|
// ENTER
|
|
26372
26350
|
const mapXYEnter = mapXYUpdate.enter().append('path').attr('class', 'd3-3d map map-xy');
|
|
26373
26351
|
const mapXZEnter = mapXZUpdate.enter().append('path').attr('class', 'd3-3d map map-xz');
|
|
@@ -26406,7 +26384,7 @@ class CPTSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26406
26384
|
mapYZUpdate.exit().remove();
|
|
26407
26385
|
|
|
26408
26386
|
// Depth sorting
|
|
26409
|
-
select(this.renderRoot).selectAll('.d3-3d').sort(
|
|
26387
|
+
select(this.renderRoot).selectAll('.d3-3d').sort(d33dExports.sort);
|
|
26410
26388
|
|
|
26411
26389
|
// Color Legend
|
|
26412
26390
|
// DATA-JOIN
|
|
@@ -26845,7 +26823,7 @@ class CPTValue extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
26845
26823
|
}
|
|
26846
26824
|
render() {
|
|
26847
26825
|
/* eslint-disable-line class-methods-use-this */
|
|
26848
|
-
return x$
|
|
26826
|
+
return x$2``;
|
|
26849
26827
|
}
|
|
26850
26828
|
willUpdate() {
|
|
26851
26829
|
this.alignState();
|
|
@@ -27930,7 +27908,7 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
27930
27908
|
}
|
|
27931
27909
|
render() {
|
|
27932
27910
|
/* eslint-disable-line class-methods-use-this */
|
|
27933
|
-
return x$
|
|
27911
|
+
return x$2`
|
|
27934
27912
|
`;
|
|
27935
27913
|
}
|
|
27936
27914
|
willUpdate() {
|
|
@@ -27986,10 +27964,11 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
27986
27964
|
};
|
|
27987
27965
|
const startRotationX = -0.85 * Math.PI / 8;
|
|
27988
27966
|
const startRotationY = 3 * Math.PI / 8;
|
|
27989
|
-
const startRotationZ = 0;
|
|
27990
|
-
|
|
27991
|
-
const
|
|
27992
|
-
const
|
|
27967
|
+
const startRotationZ = 0.0000001; // Avoid d3-3d bug
|
|
27968
|
+
|
|
27969
|
+
const lineStrips3D = d33dExports.lineStrips3D().origin(startOrigin).scale(startScale).rotationCenter(startRotationCenter).rotateX(startRotationX + this.rotationX).rotateY(startRotationY + this.rotationY).rotateZ(startRotationZ);
|
|
27970
|
+
const points3d = d33dExports.points3D().origin(startOrigin).scale(startScale).rotationCenter(startRotationCenter).rotateX(startRotationX + this.rotationX).rotateY(startRotationY + this.rotationY).rotateZ(startRotationZ);
|
|
27971
|
+
const grid3d = d33dExports.gridPlanes3D().origin(startOrigin).scale(startScale).rotationCenter(startRotationCenter).rotateX(startRotationX + this.rotationX).rotateY(startRotationY + this.rotationY).rotateZ(startRotationZ);
|
|
27993
27972
|
|
|
27994
27973
|
// SVG Drag behaviors
|
|
27995
27974
|
const svgDrag = drag().on('start', event => {
|
|
@@ -28012,9 +27991,9 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28012
27991
|
rem: this.rem
|
|
28013
27992
|
}]);
|
|
28014
27993
|
// ENTER
|
|
28015
|
-
const svgEnter = svgUpdate.enter().append('svg').classed('main', true);
|
|
27994
|
+
const svgEnter = svgUpdate.enter().append('svg').classed('main', true).call(svgDrag);
|
|
28016
27995
|
// MERGE
|
|
28017
|
-
const svgMerge = svgEnter.merge(svgUpdate).attr('viewBox', `0 0 ${elementSize} ${elementSize}`)
|
|
27996
|
+
const svgMerge = svgEnter.merge(svgUpdate).attr('viewBox', `0 0 ${elementSize} ${elementSize}`);
|
|
28018
27997
|
|
|
28019
27998
|
// Gradient Def
|
|
28020
27999
|
const gradientEnter = svgEnter.append('defs').append('linearGradient').attr('id', 'gradient-legend')
|
|
@@ -28054,35 +28033,35 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28054
28033
|
|
|
28055
28034
|
// Axes
|
|
28056
28035
|
// DATA-JOIN
|
|
28057
|
-
const axisXUpdate = svgMerge.selectAll('.axis-x').data(lineStrips3D
|
|
28036
|
+
const axisXUpdate = svgMerge.selectAll('.axis-x').data(lineStrips3D.x(datum => {
|
|
28058
28037
|
return datum.x;
|
|
28059
28038
|
}).y(() => {
|
|
28060
28039
|
return yScale.range()[0];
|
|
28061
28040
|
}).z(() => {
|
|
28062
28041
|
return zScale.range()[0];
|
|
28063
|
-
})(xAxis));
|
|
28064
|
-
const axisYUpdate = svgMerge.selectAll('.axis-y').data(lineStrips3D
|
|
28042
|
+
}).data(xAxis));
|
|
28043
|
+
const axisYUpdate = svgMerge.selectAll('.axis-y').data(lineStrips3D.x(() => {
|
|
28065
28044
|
return xScale.range()[0];
|
|
28066
28045
|
}).y(datum => {
|
|
28067
28046
|
return datum.y;
|
|
28068
28047
|
}).z(() => {
|
|
28069
28048
|
return zScale.range()[1];
|
|
28070
|
-
})(yAxis));
|
|
28071
|
-
const axisZUpdate = svgMerge.selectAll('.axis-z').data(lineStrips3D
|
|
28049
|
+
}).data(yAxis));
|
|
28050
|
+
const axisZUpdate = svgMerge.selectAll('.axis-z').data(lineStrips3D.x(() => {
|
|
28072
28051
|
return xScale.range()[0];
|
|
28073
28052
|
}).y(() => {
|
|
28074
28053
|
return yScale.range()[0];
|
|
28075
28054
|
}).z(datum => {
|
|
28076
28055
|
return datum.z;
|
|
28077
|
-
})(zAxis));
|
|
28056
|
+
}).data(zAxis));
|
|
28078
28057
|
// ENTER
|
|
28079
28058
|
const axisXEnter = axisXUpdate.enter().append('path').attr('class', 'd3-3d axis axis-x');
|
|
28080
28059
|
const axisYEnter = axisYUpdate.enter().append('path').attr('class', 'd3-3d axis axis-y');
|
|
28081
28060
|
const axisZEnter = axisZUpdate.enter().append('path').attr('class', 'd3-3d axis axis-z');
|
|
28082
28061
|
// 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
|
|
28062
|
+
const axisXMerge = axisXEnter.merge(axisXUpdate).attr('d', lineStrips3D.draw);
|
|
28063
|
+
const axisYMerge = axisYEnter.merge(axisYUpdate).attr('d', lineStrips3D.draw);
|
|
28064
|
+
const axisZMerge = axisZEnter.merge(axisZUpdate).attr('d', lineStrips3D.draw);
|
|
28086
28065
|
// EXIT
|
|
28087
28066
|
axisXMerge.exit().remove();
|
|
28088
28067
|
axisYMerge.exit().remove();
|
|
@@ -28090,34 +28069,52 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28090
28069
|
|
|
28091
28070
|
// Axis Titles
|
|
28092
28071
|
// DATA-JOIN
|
|
28093
|
-
const titlePathXUpdate = svgMerge.selectAll('.title-path-x').data(lineStrips3D
|
|
28072
|
+
const titlePathXUpdate = svgMerge.selectAll('.title-path-x').data(lineStrips3D.x(datum => {
|
|
28094
28073
|
return datum.id === 'min' ? datum.x - this.rem * 20 : datum.x + this.rem * 20;
|
|
28095
28074
|
}).y(() => {
|
|
28096
28075
|
return yScale.range()[0] + this.rem * 1.75;
|
|
28097
28076
|
}).z(() => {
|
|
28098
28077
|
return zScale.range()[0] + this.rem * 1.75;
|
|
28099
|
-
})(xAxis));
|
|
28100
|
-
const titlePathYUpdate = svgMerge.selectAll('.title-path-y').data(lineStrips3D
|
|
28078
|
+
}).data(xAxis));
|
|
28079
|
+
const titlePathYUpdate = svgMerge.selectAll('.title-path-y').data(lineStrips3D.x(() => {
|
|
28101
28080
|
return xScale.range()[0] - this.rem * 1.75;
|
|
28102
28081
|
}).y(datum => {
|
|
28103
28082
|
return datum.id === 'min' ? datum.y + this.rem * 20 : datum.y - this.rem * 20;
|
|
28104
28083
|
}).z(() => {
|
|
28105
28084
|
return zScale.range()[1] - this.rem * 1.75;
|
|
28106
|
-
})(yAxis));
|
|
28107
|
-
const titlePathZUpdate = svgMerge.selectAll('.title-path-z').data(lineStrips3D
|
|
28085
|
+
}).data(yAxis));
|
|
28086
|
+
const titlePathZUpdate = svgMerge.selectAll('.title-path-z').data(lineStrips3D.x(() => {
|
|
28108
28087
|
return xScale.range()[0] - this.rem * 1.75;
|
|
28109
28088
|
}).y(() => {
|
|
28110
28089
|
return yScale.range()[0] + this.rem * 1.75;
|
|
28111
28090
|
}).z(datum => {
|
|
28112
28091
|
return datum.id === 'min' ? datum.z - this.rem * 20 : datum.z + this.rem * 20;
|
|
28113
|
-
})(zAxis));
|
|
28114
|
-
const titleXUpdate = svgMerge.selectAll('.title-x').data(
|
|
28092
|
+
}).data(zAxis));
|
|
28093
|
+
const titleXUpdate = svgMerge.selectAll('.title-x').data(lineStrips3D.x(datum => {
|
|
28094
|
+
return datum.id === 'min' ? datum.x - this.rem * 20 : datum.x + this.rem * 20;
|
|
28095
|
+
}).y(() => {
|
|
28096
|
+
return yScale.range()[0] + this.rem * 1.75;
|
|
28097
|
+
}).z(() => {
|
|
28098
|
+
return zScale.range()[0] + this.rem * 1.75;
|
|
28099
|
+
}).data(xAxis), datum => {
|
|
28115
28100
|
return datum[0].title;
|
|
28116
28101
|
});
|
|
28117
|
-
const titleYUpdate = svgMerge.selectAll('.title-y').data(
|
|
28102
|
+
const titleYUpdate = svgMerge.selectAll('.title-y').data(lineStrips3D.x(() => {
|
|
28103
|
+
return xScale.range()[0] - this.rem * 1.75;
|
|
28104
|
+
}).y(datum => {
|
|
28105
|
+
return datum.id === 'min' ? datum.y + this.rem * 20 : datum.y - this.rem * 20;
|
|
28106
|
+
}).z(() => {
|
|
28107
|
+
return zScale.range()[1] - this.rem * 1.75;
|
|
28108
|
+
}).data(yAxis), datum => {
|
|
28118
28109
|
return datum[0].title;
|
|
28119
28110
|
});
|
|
28120
|
-
const titleZUpdate = svgMerge.selectAll('.title-z').data(
|
|
28111
|
+
const titleZUpdate = svgMerge.selectAll('.title-z').data(lineStrips3D.x(() => {
|
|
28112
|
+
return xScale.range()[0] - this.rem * 1.75;
|
|
28113
|
+
}).y(() => {
|
|
28114
|
+
return yScale.range()[0] + this.rem * 1.75;
|
|
28115
|
+
}).z(datum => {
|
|
28116
|
+
return datum.id === 'min' ? datum.z - this.rem * 20 : datum.z + this.rem * 20;
|
|
28117
|
+
}).data(zAxis), datum => {
|
|
28121
28118
|
return datum[0].title;
|
|
28122
28119
|
});
|
|
28123
28120
|
// ENTER
|
|
@@ -28131,9 +28128,9 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28131
28128
|
const titleZEnter = titleZUpdate.enter().append('text').attr('class', 'd3-3d title title-z');
|
|
28132
28129
|
titleZEnter.append('textPath').attr('href', '#title-z').attr('startOffset', '50%');
|
|
28133
28130
|
// 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
|
|
28131
|
+
const titlePathXMerge = titlePathXEnter.merge(titlePathXUpdate).attr('d', lineStrips3D.draw);
|
|
28132
|
+
const titlePathYMerge = titlePathYEnter.merge(titlePathYUpdate).attr('d', lineStrips3D.draw);
|
|
28133
|
+
const titlePathZMerge = titlePathZEnter.merge(titlePathZUpdate).attr('d', lineStrips3D.draw);
|
|
28137
28134
|
const titleXMerge = titleXEnter.merge(titleXUpdate).select('textPath').html(datum => {
|
|
28138
28135
|
return datum[0].title;
|
|
28139
28136
|
});
|
|
@@ -28186,35 +28183,35 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28186
28183
|
|
|
28187
28184
|
// Axis Ticks
|
|
28188
28185
|
// DATA-JOIN
|
|
28189
|
-
const ticksXUpdate = svgMerge.selectAll('.tick-x').data(lineStrips3D
|
|
28186
|
+
const ticksXUpdate = svgMerge.selectAll('.tick-x').data(lineStrips3D.x(datum => {
|
|
28190
28187
|
return datum.x;
|
|
28191
28188
|
}).y(datum => {
|
|
28192
28189
|
return datum.id === 'min' ? yScale.range()[0] : yScale.range()[0] + this.rem * 0.35;
|
|
28193
28190
|
}).z(datum => {
|
|
28194
28191
|
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
|
|
28192
|
+
}).data(xTicks));
|
|
28193
|
+
const ticksYUpdate = svgMerge.selectAll('.tick-y').data(lineStrips3D.x(datum => {
|
|
28197
28194
|
return datum.id === 'min' ? xScale.range()[0] : xScale.range()[0] - this.rem * 0.35;
|
|
28198
28195
|
}).y(datum => {
|
|
28199
28196
|
return datum.y;
|
|
28200
28197
|
}).z(datum => {
|
|
28201
28198
|
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
|
|
28199
|
+
}).data(yTicks));
|
|
28200
|
+
const ticksZUpdate = svgMerge.selectAll('.tick-z').data(lineStrips3D.x(datum => {
|
|
28204
28201
|
return datum.id === 'min' ? xScale.range()[0] : xScale.range()[0] - this.rem * 0.35;
|
|
28205
28202
|
}).y(datum => {
|
|
28206
28203
|
return datum.id === 'min' ? yScale.range()[0] : yScale.range()[0] + this.rem * 0.35;
|
|
28207
28204
|
}).z(datum => {
|
|
28208
28205
|
return datum.z;
|
|
28209
|
-
})(zTicks));
|
|
28206
|
+
}).data(zTicks));
|
|
28210
28207
|
// ENTER
|
|
28211
28208
|
const ticksXEnter = ticksXUpdate.enter().append('path').attr('class', 'd3-3d tick tick-x');
|
|
28212
28209
|
const ticksYEnter = ticksYUpdate.enter().append('path').attr('class', 'd3-3d tick tick-y');
|
|
28213
28210
|
const ticksZEnter = ticksZUpdate.enter().append('path').attr('class', 'd3-3d tick tick-z');
|
|
28214
28211
|
// 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
|
|
28212
|
+
const ticksXMerge = ticksXEnter.merge(ticksXUpdate).attr('d', lineStrips3D.draw);
|
|
28213
|
+
const ticksYMerge = ticksYEnter.merge(ticksYUpdate).attr('d', lineStrips3D.draw);
|
|
28214
|
+
const ticksZMerge = ticksZEnter.merge(ticksZUpdate).attr('d', lineStrips3D.draw);
|
|
28218
28215
|
// EXIT
|
|
28219
28216
|
ticksXMerge.exit().remove();
|
|
28220
28217
|
ticksYMerge.exit().remove();
|
|
@@ -28222,40 +28219,58 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28222
28219
|
|
|
28223
28220
|
// Axis Tick Labels
|
|
28224
28221
|
// DATA-JOIN
|
|
28225
|
-
const labelPathsXUpdate = svgMerge.selectAll('.label-path-x').data(lineStrips3D
|
|
28222
|
+
const labelPathsXUpdate = svgMerge.selectAll('.label-path-x').data(lineStrips3D.x(datum => {
|
|
28226
28223
|
return datum.x;
|
|
28227
28224
|
}).y(datum => {
|
|
28228
28225
|
return datum.id === 'min' ? yScale.range()[0] + this.rem * 4 : yScale.range()[0] + this.rem * 0.5;
|
|
28229
28226
|
}).z(datum => {
|
|
28230
28227
|
return datum.id === 'min' ? zScale.range()[0] + this.rem * 4 : zScale.range()[0] + this.rem * 0.5;
|
|
28231
|
-
})(xTicks), datum => {
|
|
28228
|
+
}).data(xTicks), datum => {
|
|
28232
28229
|
return datum[0].label;
|
|
28233
28230
|
});
|
|
28234
|
-
const labelPathsYUpdate = svgMerge.selectAll('.label-path-y').data(lineStrips3D
|
|
28231
|
+
const labelPathsYUpdate = svgMerge.selectAll('.label-path-y').data(lineStrips3D.x(datum => {
|
|
28235
28232
|
return datum.id === 'min' ? xScale.range()[0] - this.rem * 0.5 : xScale.range()[0] - this.rem * 4;
|
|
28236
28233
|
}).y(datum => {
|
|
28237
28234
|
return datum.y;
|
|
28238
28235
|
}).z(datum => {
|
|
28239
28236
|
return datum.id === 'min' ? zScale.range()[1] - this.rem * 0.5 : zScale.range()[1] - this.rem * 4;
|
|
28240
|
-
})(yTicks), datum => {
|
|
28237
|
+
}).data(yTicks), datum => {
|
|
28241
28238
|
return datum[0].label;
|
|
28242
28239
|
});
|
|
28243
|
-
const labelPathsZUpdate = svgMerge.selectAll('.label-path-z').data(lineStrips3D
|
|
28240
|
+
const labelPathsZUpdate = svgMerge.selectAll('.label-path-z').data(lineStrips3D.x(datum => {
|
|
28244
28241
|
return datum.id === 'min' ? xScale.range()[0] - this.rem * 4 : xScale.range()[0] - this.rem * 0.5;
|
|
28245
28242
|
}).y(datum => {
|
|
28246
28243
|
return datum.id === 'min' ? yScale.range()[0] + this.rem * 4 : yScale.range()[0] + this.rem * 0.5;
|
|
28247
28244
|
}).z(datum => {
|
|
28248
28245
|
return datum.z;
|
|
28249
|
-
})(zTicks), datum => {
|
|
28246
|
+
}).data(zTicks), datum => {
|
|
28250
28247
|
return datum[0].label;
|
|
28251
28248
|
});
|
|
28252
|
-
const labelsXUpdate = svgMerge.selectAll('.label-x').data(
|
|
28249
|
+
const labelsXUpdate = svgMerge.selectAll('.label-x').data(lineStrips3D.x(datum => {
|
|
28250
|
+
return datum.x;
|
|
28251
|
+
}).y(datum => {
|
|
28252
|
+
return datum.id === 'min' ? yScale.range()[0] + this.rem * 4 : yScale.range()[0] + this.rem * 0.5;
|
|
28253
|
+
}).z(datum => {
|
|
28254
|
+
return datum.id === 'min' ? zScale.range()[0] + this.rem * 4 : zScale.range()[0] + this.rem * 0.5;
|
|
28255
|
+
}).data(xTicks), datum => {
|
|
28253
28256
|
return datum[0].label;
|
|
28254
28257
|
});
|
|
28255
|
-
const labelsYUpdate = svgMerge.selectAll('.label-y').data(
|
|
28258
|
+
const labelsYUpdate = svgMerge.selectAll('.label-y').data(lineStrips3D.x(datum => {
|
|
28259
|
+
return datum.id === 'min' ? xScale.range()[0] - this.rem * 0.5 : xScale.range()[0] - this.rem * 4;
|
|
28260
|
+
}).y(datum => {
|
|
28261
|
+
return datum.y;
|
|
28262
|
+
}).z(datum => {
|
|
28263
|
+
return datum.id === 'min' ? zScale.range()[1] - this.rem * 0.5 : zScale.range()[1] - this.rem * 4;
|
|
28264
|
+
}).data(yTicks), datum => {
|
|
28256
28265
|
return datum[0].label;
|
|
28257
28266
|
});
|
|
28258
|
-
const labelsZUpdate = svgMerge.selectAll('.label-z').data(
|
|
28267
|
+
const labelsZUpdate = svgMerge.selectAll('.label-z').data(lineStrips3D.x(datum => {
|
|
28268
|
+
return datum.id === 'min' ? xScale.range()[0] - this.rem * 4 : xScale.range()[0] - this.rem * 0.5;
|
|
28269
|
+
}).y(datum => {
|
|
28270
|
+
return datum.id === 'min' ? yScale.range()[0] + this.rem * 4 : yScale.range()[0] + this.rem * 0.5;
|
|
28271
|
+
}).z(datum => {
|
|
28272
|
+
return datum.z;
|
|
28273
|
+
}).data(zTicks), datum => {
|
|
28259
28274
|
return datum[0].label;
|
|
28260
28275
|
});
|
|
28261
28276
|
// ENTER
|
|
@@ -28281,9 +28296,9 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28281
28296
|
return `#label-z-${index}`;
|
|
28282
28297
|
}).attr('startOffset', '100%');
|
|
28283
28298
|
// 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
|
|
28299
|
+
const labelPathsXMerge = labelPathsXEnter.merge(labelPathsXUpdate).attr('d', lineStrips3D.draw);
|
|
28300
|
+
const labelPathsYMerge = labelPathsYEnter.merge(labelPathsYUpdate).attr('d', lineStrips3D.draw);
|
|
28301
|
+
const labelPathsZMerge = labelPathsZEnter.merge(labelPathsZUpdate).attr('d', lineStrips3D.draw);
|
|
28287
28302
|
const labelsXMerge = labelsXEnter.merge(labelsXUpdate).select('textPath').text(datum => {
|
|
28288
28303
|
return datum[0].label;
|
|
28289
28304
|
});
|
|
@@ -28309,7 +28324,7 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28309
28324
|
return yScale(datum.pw);
|
|
28310
28325
|
}).z(datum => {
|
|
28311
28326
|
return zScale(datum.xw);
|
|
28312
|
-
})(this.choices.slice(this.point === 'rest' ? 1 : 0, this.point === 'first' ? 1 : undefined)), datum => {
|
|
28327
|
+
}).data(this.choices.slice(this.point === 'rest' ? 1 : 0, this.point === 'first' ? 1 : undefined)), datum => {
|
|
28313
28328
|
return datum.name;
|
|
28314
28329
|
});
|
|
28315
28330
|
// ENTER
|
|
@@ -28384,7 +28399,7 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28384
28399
|
return yScale(datum.pw);
|
|
28385
28400
|
}).z(datum => {
|
|
28386
28401
|
return zScale(datum.xw);
|
|
28387
|
-
})(this.boundary).filter(datum => {
|
|
28402
|
+
}).data(this.boundary).filter(datum => {
|
|
28388
28403
|
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
28404
|
}) : []);
|
|
28390
28405
|
// ENTER
|
|
@@ -28410,21 +28425,21 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28410
28425
|
return yScale(datum.pw);
|
|
28411
28426
|
}).z(datum => {
|
|
28412
28427
|
return zScale(datum.xw);
|
|
28413
|
-
})(this.mapXY));
|
|
28428
|
+
}).data(this.mapXY));
|
|
28414
28429
|
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
28430
|
return xScale(datum.xs);
|
|
28416
28431
|
}).y(datum => {
|
|
28417
28432
|
return yScale(datum.pw);
|
|
28418
28433
|
}).z(datum => {
|
|
28419
28434
|
return zScale(datum.xw);
|
|
28420
|
-
})(this.mapXZ));
|
|
28435
|
+
}).data(this.mapXZ));
|
|
28421
28436
|
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
28437
|
return xScale(datum.xs);
|
|
28423
28438
|
}).y(datum => {
|
|
28424
28439
|
return yScale(datum.pw);
|
|
28425
28440
|
}).z(datum => {
|
|
28426
28441
|
return zScale(datum.xw);
|
|
28427
|
-
})(this.mapYZ));
|
|
28442
|
+
}).data(this.mapYZ));
|
|
28428
28443
|
// ENTER
|
|
28429
28444
|
const mapXYEnter = mapXYUpdate.enter().append('path').attr('class', 'd3-3d map map-xy');
|
|
28430
28445
|
const mapXZEnter = mapXZUpdate.enter().append('path').attr('class', 'd3-3d map map-xz');
|
|
@@ -28463,7 +28478,7 @@ class DecisionSpace extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
28463
28478
|
mapYZUpdate.exit().remove();
|
|
28464
28479
|
|
|
28465
28480
|
// Depth sorting
|
|
28466
|
-
select(this.renderRoot).selectAll('.d3-3d').sort(
|
|
28481
|
+
select(this.renderRoot).selectAll('.d3-3d').sort(d33dExports.sort);
|
|
28467
28482
|
|
|
28468
28483
|
// Color Legend
|
|
28469
28484
|
// DATA-JOIN
|
|
@@ -28627,17 +28642,17 @@ class ProspectableControl extends ProspectableElement {
|
|
|
28627
28642
|
`];
|
|
28628
28643
|
}
|
|
28629
28644
|
render() {
|
|
28630
|
-
return x$
|
|
28645
|
+
return x$2`
|
|
28631
28646
|
<div class="holder">
|
|
28632
|
-
${this.trials != null ? x$
|
|
28633
|
-
${this.duration != null ? x$
|
|
28634
|
-
${this.run || this.pause || this.reset ? x$
|
|
28647
|
+
${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``}
|
|
28648
|
+
${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``}
|
|
28649
|
+
${this.run || this.pause || this.reset ? x$2`
|
|
28635
28650
|
<div class="buttons">
|
|
28636
|
-
${this.run ? x$
|
|
28637
|
-
${this.pause ? x$
|
|
28638
|
-
${this.reset ? x$
|
|
28651
|
+
${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``}
|
|
28652
|
+
${this.pause ? x$2`<decidables-button name="pause" ?disabled=${this.state !== 'running'} @click=${this.doPause.bind(this)}>Pause</decidables-button>` : x$2``}
|
|
28653
|
+
${this.reset ? x$2`<decidables-button name="reset" ?disabled=${this.state === 'resetted'} @click=${this.doReset.bind(this)}>Reset</decidables-button>` : x$2``}
|
|
28639
28654
|
</div>
|
|
28640
|
-
` : x$
|
|
28655
|
+
` : x$2``}
|
|
28641
28656
|
</div>`;
|
|
28642
28657
|
}
|
|
28643
28658
|
}
|
|
@@ -28925,31 +28940,31 @@ class ProspectableResponse extends ProspectableElement {
|
|
|
28925
28940
|
`];
|
|
28926
28941
|
}
|
|
28927
28942
|
render() {
|
|
28928
|
-
return x$
|
|
28943
|
+
return x$2`
|
|
28929
28944
|
<div class="holder">
|
|
28930
|
-
${this.trial ? x$
|
|
28945
|
+
${this.trial ? x$2`
|
|
28931
28946
|
<div class="trials">
|
|
28932
28947
|
<div class="trial">
|
|
28933
28948
|
<span class="label">Trial: </span><span class="count">${this.trialCount}</span><span class="of"> of </span><span class="total">${this.trialTotal}</span>
|
|
28934
28949
|
</div>
|
|
28935
|
-
</div>` : x$
|
|
28950
|
+
</div>` : x$2``}
|
|
28936
28951
|
<div class="responses">
|
|
28937
28952
|
<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
28953
|
<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
28954
|
</div>
|
|
28940
|
-
${this.feedback !== 'none' || this.payoff !== 'none' ? x$
|
|
28955
|
+
${this.feedback !== 'none' || this.payoff !== 'none' ? x$2`
|
|
28941
28956
|
<div class="feedbacks">
|
|
28942
28957
|
<div class="feedback gamble
|
|
28943
28958
|
${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$
|
|
28959
|
+
${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>` : ''}
|
|
28960
|
+
${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
28961
|
</div>
|
|
28947
28962
|
<div class="feedback sure
|
|
28948
28963
|
${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$
|
|
28964
|
+
${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>` : ''}
|
|
28965
|
+
${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
28966
|
</div>
|
|
28952
|
-
</div>` : x$
|
|
28967
|
+
</div>` : x$2``}
|
|
28953
28968
|
</div>`;
|
|
28954
28969
|
}
|
|
28955
28970
|
}
|
|
@@ -29061,7 +29076,7 @@ class RiskyOption extends DecidablesMixinResizeable(ProspectableElement) {
|
|
|
29061
29076
|
}
|
|
29062
29077
|
render() {
|
|
29063
29078
|
/* eslint-disable-line class-methods-use-this */
|
|
29064
|
-
return x$
|
|
29079
|
+
return x$2`
|
|
29065
29080
|
<slot></slot>
|
|
29066
29081
|
`;
|
|
29067
29082
|
}
|
|
@@ -29342,7 +29357,7 @@ class RiskyOutcome extends ProspectableElement {
|
|
|
29342
29357
|
}
|
|
29343
29358
|
render() {
|
|
29344
29359
|
/* eslint-disable-line class-methods-use-this */
|
|
29345
|
-
return x$
|
|
29360
|
+
return x$2``;
|
|
29346
29361
|
}
|
|
29347
29362
|
}
|
|
29348
29363
|
customElements.define('risky-outcome', RiskyOutcome);
|
|
@@ -29441,16 +29456,16 @@ class RiskyChoice extends ProspectableElement {
|
|
|
29441
29456
|
this.sendEvent();
|
|
29442
29457
|
}
|
|
29443
29458
|
render() {
|
|
29444
|
-
return x$
|
|
29459
|
+
return x$2`
|
|
29445
29460
|
<div class="holder">
|
|
29446
29461
|
<risky-option class="gamble" ?interactive=${this.interactive} @risky-outcome-change=${this.winChange.bind(this)}>
|
|
29447
|
-
${this.state === 'choice' ? x$
|
|
29462
|
+
${this.state === 'choice' ? x$2`
|
|
29448
29463
|
<risky-outcome probability="${1 - this.pw}" value="${this.xl}" name="loss"></risky-outcome>
|
|
29449
29464
|
<risky-outcome ?interactive=${this.interactive} probability="${this.pw}" value="${this.xw}" name="win"></risky-outcome>` : ''}
|
|
29450
29465
|
</risky-option><span class="query"
|
|
29451
|
-
>${this.state === 'choice' ? '?' : this.state === 'fixation' ? '+' : x$
|
|
29466
|
+
>${this.state === 'choice' ? '?' : this.state === 'fixation' ? '+' : x$2`∙`}</span
|
|
29452
29467
|
><risky-option class="sure" ?interactive=${this.interactive} @risky-outcome-change=${this.sureChange.bind(this)}>
|
|
29453
|
-
${this.state === 'choice' ? x$
|
|
29468
|
+
${this.state === 'choice' ? x$2`
|
|
29454
29469
|
<risky-outcome ?interactive=${this.interactive} probability="1" value="${this.xs}" name="sure"></risky-outcome>` : ''}
|
|
29455
29470
|
</risky-option>
|
|
29456
29471
|
</div>`;
|
|
@@ -29560,7 +29575,7 @@ class RiskyTask extends ProspectableElement {
|
|
|
29560
29575
|
`];
|
|
29561
29576
|
}
|
|
29562
29577
|
render() {
|
|
29563
|
-
return x$
|
|
29578
|
+
return x$2`
|
|
29564
29579
|
<div class="holder">
|
|
29565
29580
|
<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
29581
|
</div>`;
|
|
@@ -29754,7 +29769,7 @@ class CPTEquationPG2W extends CPTEquation {
|
|
|
29754
29769
|
let g;
|
|
29755
29770
|
let w;
|
|
29756
29771
|
if (this.numeric) {
|
|
29757
|
-
p = x$
|
|
29772
|
+
p = x$2`<decidables-spinner class="p bottom"
|
|
29758
29773
|
?disabled=${!this.interactive}
|
|
29759
29774
|
min="0"
|
|
29760
29775
|
max="1"
|
|
@@ -29764,7 +29779,7 @@ class CPTEquationPG2W extends CPTEquation {
|
|
|
29764
29779
|
>
|
|
29765
29780
|
<var class="math-var">p</var>
|
|
29766
29781
|
</decidables-spinner>`;
|
|
29767
|
-
g = x$
|
|
29782
|
+
g = x$2`<decidables-spinner class="g bottom"
|
|
29768
29783
|
?disabled=${!this.interactive}
|
|
29769
29784
|
min=${CPTMath.g.MIN}
|
|
29770
29785
|
max=${CPTMath.g.MAX}
|
|
@@ -29774,7 +29789,7 @@ class CPTEquationPG2W extends CPTEquation {
|
|
|
29774
29789
|
>
|
|
29775
29790
|
<var class="math-var">γ</var>
|
|
29776
29791
|
</decidables-spinner>`;
|
|
29777
|
-
w = x$
|
|
29792
|
+
w = x$2`<decidables-spinner class="w bottom"
|
|
29778
29793
|
disabled
|
|
29779
29794
|
min="0"
|
|
29780
29795
|
max="1"
|
|
@@ -29784,11 +29799,11 @@ class CPTEquationPG2W extends CPTEquation {
|
|
|
29784
29799
|
<var class="math-var">w</var>
|
|
29785
29800
|
</decidables-spinner>`;
|
|
29786
29801
|
} else {
|
|
29787
|
-
p = x$
|
|
29788
|
-
g = x$
|
|
29789
|
-
w = x$
|
|
29802
|
+
p = x$2`<var class="math-var p">p</var>`;
|
|
29803
|
+
g = x$2`<var class="math-var g">γ</var>`;
|
|
29804
|
+
w = x$2`<var class="math-var w">w</var>`;
|
|
29790
29805
|
}
|
|
29791
|
-
const equation = x$
|
|
29806
|
+
const equation = x$2`
|
|
29792
29807
|
<tr>
|
|
29793
29808
|
<td rowspan="2">
|
|
29794
29809
|
${w}<span class="equals">=</span>
|
|
@@ -29802,7 +29817,7 @@ class CPTEquationPG2W extends CPTEquation {
|
|
|
29802
29817
|
<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
29818
|
</td>
|
|
29804
29819
|
</tr>`;
|
|
29805
|
-
return x$
|
|
29820
|
+
return x$2`
|
|
29806
29821
|
<div class="holder">
|
|
29807
29822
|
<table class="equation">
|
|
29808
29823
|
<tbody>
|
|
@@ -29902,7 +29917,7 @@ class CPTEquationVW2U extends CPTEquation {
|
|
|
29902
29917
|
let v;
|
|
29903
29918
|
if (numeric) {
|
|
29904
29919
|
const index = Number.parseInt(subscript, 10) - 1;
|
|
29905
|
-
v = x$
|
|
29920
|
+
v = x$2`<decidables-spinner class="v"
|
|
29906
29921
|
?disabled=${!this.interactive}
|
|
29907
29922
|
.value=${this.v[index]}
|
|
29908
29923
|
@input=${this.vInput.bind(this, index)}
|
|
@@ -29910,7 +29925,7 @@ class CPTEquationVW2U extends CPTEquation {
|
|
|
29910
29925
|
<var class="math-var">v<sub class="subscript ${className}">${subscript}</sub></var>
|
|
29911
29926
|
</decidables-spinner>`;
|
|
29912
29927
|
} else {
|
|
29913
|
-
v = x$
|
|
29928
|
+
v = x$2`<var class="math-var v">v<sub class="subscript ${className}">${subscript}</sub></var>`;
|
|
29914
29929
|
}
|
|
29915
29930
|
return v;
|
|
29916
29931
|
}
|
|
@@ -29918,7 +29933,7 @@ class CPTEquationVW2U extends CPTEquation {
|
|
|
29918
29933
|
let w;
|
|
29919
29934
|
if (numeric) {
|
|
29920
29935
|
const index = Number.parseInt(subscript, 10) - 1;
|
|
29921
|
-
w = x$
|
|
29936
|
+
w = x$2`<decidables-spinner class="w"
|
|
29922
29937
|
?disabled=${!this.interactive}
|
|
29923
29938
|
min="0"
|
|
29924
29939
|
max="1"
|
|
@@ -29929,7 +29944,7 @@ class CPTEquationVW2U extends CPTEquation {
|
|
|
29929
29944
|
<var class="math-var">w<sub class="subscript ${className}">${subscript}</sub></var>
|
|
29930
29945
|
</decidables-spinner>`;
|
|
29931
29946
|
} else {
|
|
29932
|
-
w = x$
|
|
29947
|
+
w = x$2`<var class="math-var w">w<sub class="subscript ${className}">${subscript}</sub></var>`;
|
|
29933
29948
|
}
|
|
29934
29949
|
return w;
|
|
29935
29950
|
}
|
|
@@ -29940,13 +29955,13 @@ class CPTEquationVW2U extends CPTEquation {
|
|
|
29940
29955
|
let u;
|
|
29941
29956
|
let n;
|
|
29942
29957
|
if (this.numeric) {
|
|
29943
|
-
u = x$
|
|
29958
|
+
u = x$2`<decidables-spinner class="u"
|
|
29944
29959
|
disabled
|
|
29945
29960
|
.value=${+this.u.toFixed(3)}
|
|
29946
29961
|
>
|
|
29947
29962
|
<var class="math-var">U</var>
|
|
29948
29963
|
</decidables-spinner>`;
|
|
29949
|
-
n = x$
|
|
29964
|
+
n = x$2`<decidables-spinner class="n"
|
|
29950
29965
|
?disabled=${!this.interactive}
|
|
29951
29966
|
min="1"
|
|
29952
29967
|
max="4"
|
|
@@ -29957,10 +29972,10 @@ class CPTEquationVW2U extends CPTEquation {
|
|
|
29957
29972
|
<var class="math-var">n</var>
|
|
29958
29973
|
</decidables-spinner>`;
|
|
29959
29974
|
} else {
|
|
29960
|
-
u = x$
|
|
29961
|
-
n = x$
|
|
29975
|
+
u = x$2`<var class="math-var u">U</var>`;
|
|
29976
|
+
n = x$2`<var class="math-var subscript">n</var>`;
|
|
29962
29977
|
}
|
|
29963
|
-
const equation = x$
|
|
29978
|
+
const equation = x$2`
|
|
29964
29979
|
<tr>
|
|
29965
29980
|
<td>
|
|
29966
29981
|
${u}<span class="equals">=</span>
|
|
@@ -29977,14 +29992,14 @@ class CPTEquationVW2U extends CPTEquation {
|
|
|
29977
29992
|
</td>
|
|
29978
29993
|
<td>
|
|
29979
29994
|
${this.numeric ? Array(this.nMax).fill().map((_, index) => {
|
|
29980
|
-
return index < this.n ? x$
|
|
29995
|
+
return index < this.n ? x$2`<span class="addend tight" ${F({
|
|
29981
29996
|
in: d,
|
|
29982
29997
|
out: d
|
|
29983
|
-
})}>${index !== 0 ? x$
|
|
29984
|
-
}) : x$
|
|
29998
|
+
})}>${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;
|
|
29999
|
+
}) : 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
30000
|
</td>
|
|
29986
30001
|
</tr>`;
|
|
29987
|
-
return x$
|
|
30002
|
+
return x$2`
|
|
29988
30003
|
<div class="holder">
|
|
29989
30004
|
<table class="equation">
|
|
29990
30005
|
<tbody>
|
|
@@ -30073,7 +30088,7 @@ class CPTEquationXAL2V extends CPTEquation {
|
|
|
30073
30088
|
let l;
|
|
30074
30089
|
let v;
|
|
30075
30090
|
if (this.numeric) {
|
|
30076
|
-
x = x$
|
|
30091
|
+
x = x$2`<decidables-spinner class="x bottom"
|
|
30077
30092
|
?disabled=${!this.interactive}
|
|
30078
30093
|
step="1"
|
|
30079
30094
|
.value=${this.x}
|
|
@@ -30081,7 +30096,7 @@ class CPTEquationXAL2V extends CPTEquation {
|
|
|
30081
30096
|
>
|
|
30082
30097
|
<var class="math-var">x</var>
|
|
30083
30098
|
</decidables-spinner>`;
|
|
30084
|
-
a = x$
|
|
30099
|
+
a = x$2`<decidables-spinner class="a bottom"
|
|
30085
30100
|
?disabled=${!this.interactive}
|
|
30086
30101
|
min=${CPTMath.a.MIN}
|
|
30087
30102
|
max=${CPTMath.a.MAX}
|
|
@@ -30091,7 +30106,7 @@ class CPTEquationXAL2V extends CPTEquation {
|
|
|
30091
30106
|
>
|
|
30092
30107
|
<var class="math-var">α</var>
|
|
30093
30108
|
</decidables-spinner>`;
|
|
30094
|
-
l = x$
|
|
30109
|
+
l = x$2`<decidables-spinner class="l bottom"
|
|
30095
30110
|
?disabled=${!this.interactive}
|
|
30096
30111
|
min=${CPTMath.l.MIN}
|
|
30097
30112
|
step=${CPTMath.l.STEP}
|
|
@@ -30100,16 +30115,16 @@ class CPTEquationXAL2V extends CPTEquation {
|
|
|
30100
30115
|
>
|
|
30101
30116
|
<var class="math-var">λ</var>
|
|
30102
30117
|
</decidables-spinner>`;
|
|
30103
|
-
v = x$
|
|
30118
|
+
v = x$2`<decidables-spinner class="v bottom" disabled step=".001" .value="${+this.v.toFixed(3)}">
|
|
30104
30119
|
<var class="math-var">v</var>
|
|
30105
30120
|
</decidables-spinner>`;
|
|
30106
30121
|
} else {
|
|
30107
|
-
x = x$
|
|
30108
|
-
a = x$
|
|
30109
|
-
l = x$
|
|
30110
|
-
v = x$
|
|
30122
|
+
x = x$2`<var class="math-var x">x</var>`;
|
|
30123
|
+
a = x$2`<var class="math-var a">α</var>`;
|
|
30124
|
+
l = x$2`<var class="math-var l">λ</var>`;
|
|
30125
|
+
v = x$2`<var class="math-var v">v</var>`;
|
|
30111
30126
|
}
|
|
30112
|
-
const equation = x$
|
|
30127
|
+
const equation = x$2`
|
|
30113
30128
|
<tr>
|
|
30114
30129
|
<td rowspan="2">
|
|
30115
30130
|
${v}<span class="equals">=</span><span class="brace tight">{</span>
|
|
@@ -30123,7 +30138,7 @@ class CPTEquationXAL2V extends CPTEquation {
|
|
|
30123
30138
|
<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
30139
|
</td>
|
|
30125
30140
|
</tr>`;
|
|
30126
|
-
return x$
|
|
30141
|
+
return x$2`
|
|
30127
30142
|
<div class="holder">
|
|
30128
30143
|
<table class="equation">
|
|
30129
30144
|
<tbody>
|
|
@@ -30190,7 +30205,7 @@ class CPTExample extends ProspectableElement {
|
|
|
30190
30205
|
}
|
|
30191
30206
|
render() {
|
|
30192
30207
|
/* eslint-disable-line class-methods-use-this */
|
|
30193
|
-
return x$
|
|
30208
|
+
return x$2`
|
|
30194
30209
|
<div class="holder">
|
|
30195
30210
|
<div class="body">
|
|
30196
30211
|
<slot>Empty!</slot>
|