three-render-objects 1.33.0 → 1.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// Version 1.33.
|
|
1
|
+
// Version 1.33.1 three-render-objects - https://github.com/vasturiano/three-render-objects
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('three')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['three'], factory) :
|
|
5
5
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.ThreeRenderObjects = factory(global.THREE));
|
|
6
6
|
})(this, (function (three$1) { 'use strict';
|
|
7
7
|
|
|
8
|
-
function styleInject(css, ref) {
|
|
8
|
+
function styleInject$1(css, ref) {
|
|
9
9
|
if ( ref === undefined ) ref = {};
|
|
10
10
|
var insertAt = ref.insertAt;
|
|
11
11
|
|
|
@@ -32,19 +32,19 @@
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
var css_248z = ".scene-nav-info {\n bottom: 5px;\n width: 100%;\n text-align: center;\n color: slategrey;\n opacity: 0.7;\n font-size: 10px;\n}\n\n.scene-tooltip {\n top: 0;\n color: lavender;\n font-size: 15px;\n background: rgba(0,0,0,0.5);\n padding: 2px 5px;\n border-radius: 3px;\n}\n\n.scene-nav-info, .scene-tooltip {\n position: absolute;\n font-family: sans-serif;\n pointer-events: none;\n user-select: none;\n}\n\n.scene-container canvas:focus {\n outline: none;\n}";
|
|
36
|
-
styleInject(css_248z);
|
|
35
|
+
var css_248z$1 = ".scene-nav-info {\n bottom: 5px;\n width: 100%;\n text-align: center;\n color: slategrey;\n opacity: 0.7;\n font-size: 10px;\n}\n\n.scene-tooltip {\n top: 0;\n color: lavender;\n font-size: 15px;\n background: rgba(0,0,0,0.5);\n padding: 2px 5px;\n border-radius: 3px;\n}\n\n.scene-nav-info, .scene-tooltip {\n position: absolute;\n font-family: sans-serif;\n pointer-events: none;\n user-select: none;\n}\n\n.scene-container canvas:focus {\n outline: none;\n}";
|
|
36
|
+
styleInject$1(css_248z$1);
|
|
37
37
|
|
|
38
|
-
function _arrayLikeToArray$
|
|
38
|
+
function _arrayLikeToArray$2(r, a) {
|
|
39
39
|
(null == a || a > r.length) && (a = r.length);
|
|
40
40
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
41
41
|
return n;
|
|
42
42
|
}
|
|
43
|
-
function _arrayWithHoles$
|
|
43
|
+
function _arrayWithHoles$2(r) {
|
|
44
44
|
if (Array.isArray(r)) return r;
|
|
45
45
|
}
|
|
46
46
|
function _arrayWithoutHoles(r) {
|
|
47
|
-
if (Array.isArray(r)) return _arrayLikeToArray$
|
|
47
|
+
if (Array.isArray(r)) return _arrayLikeToArray$2(r);
|
|
48
48
|
}
|
|
49
49
|
function _defineProperty(e, r, t) {
|
|
50
50
|
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
function _iterableToArray(r) {
|
|
58
58
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
59
59
|
}
|
|
60
|
-
function _iterableToArrayLimit$
|
|
60
|
+
function _iterableToArrayLimit$2(r, l) {
|
|
61
61
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
62
62
|
if (null != t) {
|
|
63
63
|
var e,
|
|
@@ -81,17 +81,17 @@
|
|
|
81
81
|
return a;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
function _nonIterableRest$
|
|
84
|
+
function _nonIterableRest$2() {
|
|
85
85
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
86
86
|
}
|
|
87
87
|
function _nonIterableSpread() {
|
|
88
88
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
89
89
|
}
|
|
90
|
-
function _slicedToArray$
|
|
91
|
-
return _arrayWithHoles$
|
|
90
|
+
function _slicedToArray$2(r, e) {
|
|
91
|
+
return _arrayWithHoles$2(r) || _iterableToArrayLimit$2(r, e) || _unsupportedIterableToArray$2(r, e) || _nonIterableRest$2();
|
|
92
92
|
}
|
|
93
93
|
function _toConsumableArray(r) {
|
|
94
|
-
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray$
|
|
94
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray$2(r) || _nonIterableSpread();
|
|
95
95
|
}
|
|
96
96
|
function _toPrimitive(t, r) {
|
|
97
97
|
if ("object" != typeof t || !t) return t;
|
|
@@ -107,11 +107,11 @@
|
|
|
107
107
|
var i = _toPrimitive(t, "string");
|
|
108
108
|
return "symbol" == typeof i ? i : i + "";
|
|
109
109
|
}
|
|
110
|
-
function _unsupportedIterableToArray$
|
|
110
|
+
function _unsupportedIterableToArray$2(r, a) {
|
|
111
111
|
if (r) {
|
|
112
|
-
if ("string" == typeof r) return _arrayLikeToArray$
|
|
112
|
+
if ("string" == typeof r) return _arrayLikeToArray$2(r, a);
|
|
113
113
|
var t = {}.toString.call(r).slice(8, -1);
|
|
114
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$
|
|
114
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : undefined;
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -22363,16 +22363,16 @@
|
|
|
22363
22363
|
* @param {Node?} [elseNode=null] - The node that is evaluate when the condition ends up `false`.
|
|
22364
22364
|
* @returns {ConditionalNode}
|
|
22365
22365
|
*/
|
|
22366
|
-
const select = /*@__PURE__*/ nodeProxy( ConditionalNode );
|
|
22366
|
+
const select$1 = /*@__PURE__*/ nodeProxy( ConditionalNode );
|
|
22367
22367
|
|
|
22368
|
-
addMethodChaining( 'select', select );
|
|
22368
|
+
addMethodChaining( 'select', select$1 );
|
|
22369
22369
|
|
|
22370
22370
|
//
|
|
22371
22371
|
|
|
22372
22372
|
const cond = ( ...params ) => { // @deprecated, r168
|
|
22373
22373
|
|
|
22374
22374
|
console.warn( 'TSL.ConditionalNode: cond() has been renamed to select().' );
|
|
22375
|
-
return select( ...params );
|
|
22375
|
+
return select$1( ...params );
|
|
22376
22376
|
|
|
22377
22377
|
};
|
|
22378
22378
|
|
|
@@ -24468,7 +24468,7 @@
|
|
|
24468
24468
|
* @param {ConditionalNode?} conditional - An optional conditional node. It allows to decide whether the discard should be executed or not.
|
|
24469
24469
|
* @return {Node} The `discard` expression.
|
|
24470
24470
|
*/
|
|
24471
|
-
const Discard = ( conditional ) => ( conditional ? select( conditional, expression( 'discard' ) ) : expression( 'discard' ) ).append();
|
|
24471
|
+
const Discard = ( conditional ) => ( conditional ? select$1( conditional, expression( 'discard' ) ) : expression( 'discard' ) ).append();
|
|
24472
24472
|
|
|
24473
24473
|
addMethodChaining( 'discard', Discard );
|
|
24474
24474
|
|
|
@@ -34284,19 +34284,19 @@
|
|
|
34284
34284
|
|
|
34285
34285
|
const r2 = roughness.pow2();
|
|
34286
34286
|
|
|
34287
|
-
const a = select(
|
|
34287
|
+
const a = select$1(
|
|
34288
34288
|
roughness.lessThan( 0.25 ),
|
|
34289
34289
|
float( -339.2 ).mul( r2 ).add( float( 161.4 ).mul( roughness ) ).sub( 25.9 ),
|
|
34290
34290
|
float( -8.48 ).mul( r2 ).add( float( 14.3 ).mul( roughness ) ).sub( 9.95 )
|
|
34291
34291
|
);
|
|
34292
34292
|
|
|
34293
|
-
const b = select(
|
|
34293
|
+
const b = select$1(
|
|
34294
34294
|
roughness.lessThan( 0.25 ),
|
|
34295
34295
|
float( 44.0 ).mul( r2 ).sub( float( 23.7 ).mul( roughness ) ).add( 3.26 ),
|
|
34296
34296
|
float( 1.97 ).mul( r2 ).sub( float( 3.27 ).mul( roughness ) ).add( 0.72 )
|
|
34297
34297
|
);
|
|
34298
34298
|
|
|
34299
|
-
const DG = select( roughness.lessThan( 0.25 ), 0.0, float( 0.1 ).mul( roughness ).sub( 0.025 ) ).add( a.mul( dotNV ).add( b ).exp() );
|
|
34299
|
+
const DG = select$1( roughness.lessThan( 0.25 ), 0.0, float( 0.1 ).mul( roughness ).sub( 0.025 ) ).add( a.mul( dotNV ).add( b ).exp() );
|
|
34300
34300
|
|
|
34301
34301
|
return DG.mul( 1.0 / Math.PI ).saturate();
|
|
34302
34302
|
|
|
@@ -34788,11 +34788,11 @@
|
|
|
34788
34788
|
|
|
34789
34789
|
If( absDirection.x.greaterThan( absDirection.y ), () => {
|
|
34790
34790
|
|
|
34791
|
-
face.assign( select( direction.x.greaterThan( 0.0 ), 0.0, 3.0 ) );
|
|
34791
|
+
face.assign( select$1( direction.x.greaterThan( 0.0 ), 0.0, 3.0 ) );
|
|
34792
34792
|
|
|
34793
34793
|
} ).Else( () => {
|
|
34794
34794
|
|
|
34795
|
-
face.assign( select( direction.y.greaterThan( 0.0 ), 1.0, 4.0 ) );
|
|
34795
|
+
face.assign( select$1( direction.y.greaterThan( 0.0 ), 1.0, 4.0 ) );
|
|
34796
34796
|
|
|
34797
34797
|
} );
|
|
34798
34798
|
|
|
@@ -34800,11 +34800,11 @@
|
|
|
34800
34800
|
|
|
34801
34801
|
If( absDirection.z.greaterThan( absDirection.y ), () => {
|
|
34802
34802
|
|
|
34803
|
-
face.assign( select( direction.z.greaterThan( 0.0 ), 2.0, 5.0 ) );
|
|
34803
|
+
face.assign( select$1( direction.z.greaterThan( 0.0 ), 2.0, 5.0 ) );
|
|
34804
34804
|
|
|
34805
34805
|
} ).Else( () => {
|
|
34806
34806
|
|
|
34807
|
-
face.assign( select( direction.y.greaterThan( 0.0 ), 1.0, 4.0 ) );
|
|
34807
|
+
face.assign( select$1( direction.y.greaterThan( 0.0 ), 1.0, 4.0 ) );
|
|
34808
34808
|
|
|
34809
34809
|
} );
|
|
34810
34810
|
|
|
@@ -35011,7 +35011,7 @@
|
|
|
35011
35011
|
|
|
35012
35012
|
const blur = /*@__PURE__*/ Fn( ( { n, latitudinal, poleAxis, outputDirection, weights, samples, dTheta, mipInt, envMap, CUBEUV_TEXEL_WIDTH, CUBEUV_TEXEL_HEIGHT, CUBEUV_MAX_MIP } ) => {
|
|
35013
35013
|
|
|
35014
|
-
const axis = vec3( select( latitudinal, poleAxis, cross( poleAxis, outputDirection ) ) ).toVar();
|
|
35014
|
+
const axis = vec3( select$1( latitudinal, poleAxis, cross( poleAxis, outputDirection ) ) ).toVar();
|
|
35015
35015
|
|
|
35016
35016
|
If( all( axis.equals( vec3( 0.0 ) ) ), () => {
|
|
35017
35017
|
|
|
@@ -41306,7 +41306,7 @@
|
|
|
41306
41306
|
If( boolNode, method ) {
|
|
41307
41307
|
|
|
41308
41308
|
const methodNode = new ShaderNode( method );
|
|
41309
|
-
this._currentCond = select( boolNode, methodNode );
|
|
41309
|
+
this._currentCond = select$1( boolNode, methodNode );
|
|
41310
41310
|
|
|
41311
41311
|
return this.add( this._currentCond );
|
|
41312
41312
|
|
|
@@ -41322,7 +41322,7 @@
|
|
|
41322
41322
|
ElseIf( boolNode, method ) {
|
|
41323
41323
|
|
|
41324
41324
|
const methodNode = new ShaderNode( method );
|
|
41325
|
-
const ifNode = select( boolNode, methodNode );
|
|
41325
|
+
const ifNode = select$1( boolNode, methodNode );
|
|
41326
41326
|
|
|
41327
41327
|
this._currentCond.elseNode = ifNode;
|
|
41328
41328
|
this._currentCond = ifNode;
|
|
@@ -42475,7 +42475,7 @@
|
|
|
42475
42475
|
color = color.mul( exposure );
|
|
42476
42476
|
|
|
42477
42477
|
const x = min$1( color.r, min$1( color.g, color.b ) );
|
|
42478
|
-
const offset = select( x.lessThan( 0.08 ), x.sub( mul( 6.25, x.mul( x ) ) ), 0.04 );
|
|
42478
|
+
const offset = select$1( x.lessThan( 0.08 ), x.sub( mul( 6.25, x.mul( x ) ) ), 0.04 );
|
|
42479
42479
|
|
|
42480
42480
|
color.subAssign( offset );
|
|
42481
42481
|
|
|
@@ -75803,7 +75803,7 @@ var<${access}> ${name} : ${structName};`;
|
|
|
75803
75803
|
*/
|
|
75804
75804
|
TWEEN.update.bind(TWEEN);
|
|
75805
75805
|
|
|
75806
|
-
var index$
|
|
75806
|
+
var index$2 = (function (p) {
|
|
75807
75807
|
return typeof p === 'function' ? p // fn
|
|
75808
75808
|
: typeof p === 'string' ? function (obj) {
|
|
75809
75809
|
return obj[p];
|
|
@@ -75850,7 +75850,7 @@ var<${access}> ${name} : ${structName};`;
|
|
|
75850
75850
|
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
75851
75851
|
|
|
75852
75852
|
/** Used as a reference to the global object. */
|
|
75853
|
-
var root = freeGlobal || freeSelf || Function('return this')();
|
|
75853
|
+
var root$1 = freeGlobal || freeSelf || Function('return this')();
|
|
75854
75854
|
|
|
75855
75855
|
/**
|
|
75856
75856
|
* Gets the timestamp of the number of milliseconds that have elapsed since
|
|
@@ -75869,7 +75869,7 @@ var<${access}> ${name} : ${structName};`;
|
|
|
75869
75869
|
* // => Logs the number of milliseconds it took for the deferred invocation.
|
|
75870
75870
|
*/
|
|
75871
75871
|
var now = function() {
|
|
75872
|
-
return root.Date.now();
|
|
75872
|
+
return root$1.Date.now();
|
|
75873
75873
|
};
|
|
75874
75874
|
|
|
75875
75875
|
/** Used to match a single whitespace character. */
|
|
@@ -75907,7 +75907,7 @@ var<${access}> ${name} : ${structName};`;
|
|
|
75907
75907
|
}
|
|
75908
75908
|
|
|
75909
75909
|
/** Built-in value references. */
|
|
75910
|
-
var Symbol$1 = root.Symbol;
|
|
75910
|
+
var Symbol$1 = root$1.Symbol;
|
|
75911
75911
|
|
|
75912
75912
|
/** Used for built-in method references. */
|
|
75913
75913
|
var objectProto$1 = Object.prototype;
|
|
@@ -76294,12 +76294,12 @@ var<${access}> ${name} : ${structName};`;
|
|
|
76294
76294
|
return debounced;
|
|
76295
76295
|
}
|
|
76296
76296
|
|
|
76297
|
-
function _arrayLikeToArray(r, a) {
|
|
76297
|
+
function _arrayLikeToArray$1(r, a) {
|
|
76298
76298
|
(null == a || a > r.length) && (a = r.length);
|
|
76299
76299
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
76300
76300
|
return n;
|
|
76301
76301
|
}
|
|
76302
|
-
function _arrayWithHoles(r) {
|
|
76302
|
+
function _arrayWithHoles$1(r) {
|
|
76303
76303
|
if (Array.isArray(r)) return r;
|
|
76304
76304
|
}
|
|
76305
76305
|
function _classCallCheck(a, n) {
|
|
@@ -76310,7 +76310,7 @@ var<${access}> ${name} : ${structName};`;
|
|
|
76310
76310
|
writable: false
|
|
76311
76311
|
}), e;
|
|
76312
76312
|
}
|
|
76313
|
-
function _iterableToArrayLimit(r, l) {
|
|
76313
|
+
function _iterableToArrayLimit$1(r, l) {
|
|
76314
76314
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
76315
76315
|
if (null != t) {
|
|
76316
76316
|
var e,
|
|
@@ -76334,17 +76334,17 @@ var<${access}> ${name} : ${structName};`;
|
|
|
76334
76334
|
return a;
|
|
76335
76335
|
}
|
|
76336
76336
|
}
|
|
76337
|
-
function _nonIterableRest() {
|
|
76337
|
+
function _nonIterableRest$1() {
|
|
76338
76338
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
76339
76339
|
}
|
|
76340
|
-
function _slicedToArray(r, e) {
|
|
76341
|
-
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
76340
|
+
function _slicedToArray$1(r, e) {
|
|
76341
|
+
return _arrayWithHoles$1(r) || _iterableToArrayLimit$1(r, e) || _unsupportedIterableToArray$1(r, e) || _nonIterableRest$1();
|
|
76342
76342
|
}
|
|
76343
|
-
function _unsupportedIterableToArray(r, a) {
|
|
76343
|
+
function _unsupportedIterableToArray$1(r, a) {
|
|
76344
76344
|
if (r) {
|
|
76345
|
-
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
76345
|
+
if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
|
|
76346
76346
|
var t = {}.toString.call(r).slice(8, -1);
|
|
76347
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : undefined;
|
|
76347
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : undefined;
|
|
76348
76348
|
}
|
|
76349
76349
|
}
|
|
76350
76350
|
|
|
@@ -76361,7 +76361,7 @@ var<${access}> ${name} : ${structName};`;
|
|
|
76361
76361
|
this.triggerUpdate = triggerUpdate;
|
|
76362
76362
|
this.onChange = onChange;
|
|
76363
76363
|
});
|
|
76364
|
-
function index (_ref2) {
|
|
76364
|
+
function index$1 (_ref2) {
|
|
76365
76365
|
var _ref2$stateInit = _ref2.stateInit,
|
|
76366
76366
|
stateInit = _ref2$stateInit === undefined ? function () {
|
|
76367
76367
|
return {};
|
|
@@ -76461,7 +76461,7 @@ var<${access}> ${name} : ${structName};`;
|
|
|
76461
76461
|
|
|
76462
76462
|
// Link aliases
|
|
76463
76463
|
Object.entries(aliases).forEach(function (_ref4) {
|
|
76464
|
-
var _ref5 = _slicedToArray(_ref4, 2),
|
|
76464
|
+
var _ref5 = _slicedToArray$1(_ref4, 2),
|
|
76465
76465
|
alias = _ref5[0],
|
|
76466
76466
|
target = _ref5[1];
|
|
76467
76467
|
return comp[alias] = comp[target];
|
|
@@ -76485,6 +76485,1083 @@ var<${access}> ${name} : ${structName};`;
|
|
|
76485
76485
|
};
|
|
76486
76486
|
}
|
|
76487
76487
|
|
|
76488
|
+
var xhtml = "http://www.w3.org/1999/xhtml";
|
|
76489
|
+
|
|
76490
|
+
var namespaces = {
|
|
76491
|
+
svg: "http://www.w3.org/2000/svg",
|
|
76492
|
+
xhtml: xhtml,
|
|
76493
|
+
xlink: "http://www.w3.org/1999/xlink",
|
|
76494
|
+
xml: "http://www.w3.org/XML/1998/namespace",
|
|
76495
|
+
xmlns: "http://www.w3.org/2000/xmlns/"
|
|
76496
|
+
};
|
|
76497
|
+
|
|
76498
|
+
function namespace(name) {
|
|
76499
|
+
var prefix = name += "", i = prefix.indexOf(":");
|
|
76500
|
+
if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1);
|
|
76501
|
+
return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins
|
|
76502
|
+
}
|
|
76503
|
+
|
|
76504
|
+
function creatorInherit(name) {
|
|
76505
|
+
return function() {
|
|
76506
|
+
var document = this.ownerDocument,
|
|
76507
|
+
uri = this.namespaceURI;
|
|
76508
|
+
return uri === xhtml && document.documentElement.namespaceURI === xhtml
|
|
76509
|
+
? document.createElement(name)
|
|
76510
|
+
: document.createElementNS(uri, name);
|
|
76511
|
+
};
|
|
76512
|
+
}
|
|
76513
|
+
|
|
76514
|
+
function creatorFixed(fullname) {
|
|
76515
|
+
return function() {
|
|
76516
|
+
return this.ownerDocument.createElementNS(fullname.space, fullname.local);
|
|
76517
|
+
};
|
|
76518
|
+
}
|
|
76519
|
+
|
|
76520
|
+
function creator(name) {
|
|
76521
|
+
var fullname = namespace(name);
|
|
76522
|
+
return (fullname.local
|
|
76523
|
+
? creatorFixed
|
|
76524
|
+
: creatorInherit)(fullname);
|
|
76525
|
+
}
|
|
76526
|
+
|
|
76527
|
+
function none() {}
|
|
76528
|
+
|
|
76529
|
+
function selector(selector) {
|
|
76530
|
+
return selector == null ? none : function() {
|
|
76531
|
+
return this.querySelector(selector);
|
|
76532
|
+
};
|
|
76533
|
+
}
|
|
76534
|
+
|
|
76535
|
+
function selection_select(select) {
|
|
76536
|
+
if (typeof select !== "function") select = selector(select);
|
|
76537
|
+
|
|
76538
|
+
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
|
|
76539
|
+
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
|
|
76540
|
+
if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {
|
|
76541
|
+
if ("__data__" in node) subnode.__data__ = node.__data__;
|
|
76542
|
+
subgroup[i] = subnode;
|
|
76543
|
+
}
|
|
76544
|
+
}
|
|
76545
|
+
}
|
|
76546
|
+
|
|
76547
|
+
return new Selection(subgroups, this._parents);
|
|
76548
|
+
}
|
|
76549
|
+
|
|
76550
|
+
// Given something array like (or null), returns something that is strictly an
|
|
76551
|
+
// array. This is used to ensure that array-like objects passed to d3.selectAll
|
|
76552
|
+
// or selection.selectAll are converted into proper arrays when creating a
|
|
76553
|
+
// selection; we don’t ever want to create a selection backed by a live
|
|
76554
|
+
// HTMLCollection or NodeList. However, note that selection.selectAll will use a
|
|
76555
|
+
// static NodeList as a group, since it safely derived from querySelectorAll.
|
|
76556
|
+
function array(x) {
|
|
76557
|
+
return x == null ? [] : Array.isArray(x) ? x : Array.from(x);
|
|
76558
|
+
}
|
|
76559
|
+
|
|
76560
|
+
function empty() {
|
|
76561
|
+
return [];
|
|
76562
|
+
}
|
|
76563
|
+
|
|
76564
|
+
function selectorAll(selector) {
|
|
76565
|
+
return selector == null ? empty : function() {
|
|
76566
|
+
return this.querySelectorAll(selector);
|
|
76567
|
+
};
|
|
76568
|
+
}
|
|
76569
|
+
|
|
76570
|
+
function arrayAll(select) {
|
|
76571
|
+
return function() {
|
|
76572
|
+
return array(select.apply(this, arguments));
|
|
76573
|
+
};
|
|
76574
|
+
}
|
|
76575
|
+
|
|
76576
|
+
function selection_selectAll(select) {
|
|
76577
|
+
if (typeof select === "function") select = arrayAll(select);
|
|
76578
|
+
else select = selectorAll(select);
|
|
76579
|
+
|
|
76580
|
+
for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
|
|
76581
|
+
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
|
|
76582
|
+
if (node = group[i]) {
|
|
76583
|
+
subgroups.push(select.call(node, node.__data__, i, group));
|
|
76584
|
+
parents.push(node);
|
|
76585
|
+
}
|
|
76586
|
+
}
|
|
76587
|
+
}
|
|
76588
|
+
|
|
76589
|
+
return new Selection(subgroups, parents);
|
|
76590
|
+
}
|
|
76591
|
+
|
|
76592
|
+
function matcher(selector) {
|
|
76593
|
+
return function() {
|
|
76594
|
+
return this.matches(selector);
|
|
76595
|
+
};
|
|
76596
|
+
}
|
|
76597
|
+
|
|
76598
|
+
function childMatcher(selector) {
|
|
76599
|
+
return function(node) {
|
|
76600
|
+
return node.matches(selector);
|
|
76601
|
+
};
|
|
76602
|
+
}
|
|
76603
|
+
|
|
76604
|
+
var find = Array.prototype.find;
|
|
76605
|
+
|
|
76606
|
+
function childFind(match) {
|
|
76607
|
+
return function() {
|
|
76608
|
+
return find.call(this.children, match);
|
|
76609
|
+
};
|
|
76610
|
+
}
|
|
76611
|
+
|
|
76612
|
+
function childFirst() {
|
|
76613
|
+
return this.firstElementChild;
|
|
76614
|
+
}
|
|
76615
|
+
|
|
76616
|
+
function selection_selectChild(match) {
|
|
76617
|
+
return this.select(match == null ? childFirst
|
|
76618
|
+
: childFind(typeof match === "function" ? match : childMatcher(match)));
|
|
76619
|
+
}
|
|
76620
|
+
|
|
76621
|
+
var filter = Array.prototype.filter;
|
|
76622
|
+
|
|
76623
|
+
function children() {
|
|
76624
|
+
return Array.from(this.children);
|
|
76625
|
+
}
|
|
76626
|
+
|
|
76627
|
+
function childrenFilter(match) {
|
|
76628
|
+
return function() {
|
|
76629
|
+
return filter.call(this.children, match);
|
|
76630
|
+
};
|
|
76631
|
+
}
|
|
76632
|
+
|
|
76633
|
+
function selection_selectChildren(match) {
|
|
76634
|
+
return this.selectAll(match == null ? children
|
|
76635
|
+
: childrenFilter(typeof match === "function" ? match : childMatcher(match)));
|
|
76636
|
+
}
|
|
76637
|
+
|
|
76638
|
+
function selection_filter(match) {
|
|
76639
|
+
if (typeof match !== "function") match = matcher(match);
|
|
76640
|
+
|
|
76641
|
+
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
|
|
76642
|
+
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
|
|
76643
|
+
if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
|
|
76644
|
+
subgroup.push(node);
|
|
76645
|
+
}
|
|
76646
|
+
}
|
|
76647
|
+
}
|
|
76648
|
+
|
|
76649
|
+
return new Selection(subgroups, this._parents);
|
|
76650
|
+
}
|
|
76651
|
+
|
|
76652
|
+
function sparse(update) {
|
|
76653
|
+
return new Array(update.length);
|
|
76654
|
+
}
|
|
76655
|
+
|
|
76656
|
+
function selection_enter() {
|
|
76657
|
+
return new Selection(this._enter || this._groups.map(sparse), this._parents);
|
|
76658
|
+
}
|
|
76659
|
+
|
|
76660
|
+
function EnterNode(parent, datum) {
|
|
76661
|
+
this.ownerDocument = parent.ownerDocument;
|
|
76662
|
+
this.namespaceURI = parent.namespaceURI;
|
|
76663
|
+
this._next = null;
|
|
76664
|
+
this._parent = parent;
|
|
76665
|
+
this.__data__ = datum;
|
|
76666
|
+
}
|
|
76667
|
+
|
|
76668
|
+
EnterNode.prototype = {
|
|
76669
|
+
constructor: EnterNode,
|
|
76670
|
+
appendChild: function(child) { return this._parent.insertBefore(child, this._next); },
|
|
76671
|
+
insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },
|
|
76672
|
+
querySelector: function(selector) { return this._parent.querySelector(selector); },
|
|
76673
|
+
querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }
|
|
76674
|
+
};
|
|
76675
|
+
|
|
76676
|
+
function constant(x) {
|
|
76677
|
+
return function() {
|
|
76678
|
+
return x;
|
|
76679
|
+
};
|
|
76680
|
+
}
|
|
76681
|
+
|
|
76682
|
+
function bindIndex(parent, group, enter, update, exit, data) {
|
|
76683
|
+
var i = 0,
|
|
76684
|
+
node,
|
|
76685
|
+
groupLength = group.length,
|
|
76686
|
+
dataLength = data.length;
|
|
76687
|
+
|
|
76688
|
+
// Put any non-null nodes that fit into update.
|
|
76689
|
+
// Put any null nodes into enter.
|
|
76690
|
+
// Put any remaining data into enter.
|
|
76691
|
+
for (; i < dataLength; ++i) {
|
|
76692
|
+
if (node = group[i]) {
|
|
76693
|
+
node.__data__ = data[i];
|
|
76694
|
+
update[i] = node;
|
|
76695
|
+
} else {
|
|
76696
|
+
enter[i] = new EnterNode(parent, data[i]);
|
|
76697
|
+
}
|
|
76698
|
+
}
|
|
76699
|
+
|
|
76700
|
+
// Put any non-null nodes that don’t fit into exit.
|
|
76701
|
+
for (; i < groupLength; ++i) {
|
|
76702
|
+
if (node = group[i]) {
|
|
76703
|
+
exit[i] = node;
|
|
76704
|
+
}
|
|
76705
|
+
}
|
|
76706
|
+
}
|
|
76707
|
+
|
|
76708
|
+
function bindKey(parent, group, enter, update, exit, data, key) {
|
|
76709
|
+
var i,
|
|
76710
|
+
node,
|
|
76711
|
+
nodeByKeyValue = new Map,
|
|
76712
|
+
groupLength = group.length,
|
|
76713
|
+
dataLength = data.length,
|
|
76714
|
+
keyValues = new Array(groupLength),
|
|
76715
|
+
keyValue;
|
|
76716
|
+
|
|
76717
|
+
// Compute the key for each node.
|
|
76718
|
+
// If multiple nodes have the same key, the duplicates are added to exit.
|
|
76719
|
+
for (i = 0; i < groupLength; ++i) {
|
|
76720
|
+
if (node = group[i]) {
|
|
76721
|
+
keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + "";
|
|
76722
|
+
if (nodeByKeyValue.has(keyValue)) {
|
|
76723
|
+
exit[i] = node;
|
|
76724
|
+
} else {
|
|
76725
|
+
nodeByKeyValue.set(keyValue, node);
|
|
76726
|
+
}
|
|
76727
|
+
}
|
|
76728
|
+
}
|
|
76729
|
+
|
|
76730
|
+
// Compute the key for each datum.
|
|
76731
|
+
// If there a node associated with this key, join and add it to update.
|
|
76732
|
+
// If there is not (or the key is a duplicate), add it to enter.
|
|
76733
|
+
for (i = 0; i < dataLength; ++i) {
|
|
76734
|
+
keyValue = key.call(parent, data[i], i, data) + "";
|
|
76735
|
+
if (node = nodeByKeyValue.get(keyValue)) {
|
|
76736
|
+
update[i] = node;
|
|
76737
|
+
node.__data__ = data[i];
|
|
76738
|
+
nodeByKeyValue.delete(keyValue);
|
|
76739
|
+
} else {
|
|
76740
|
+
enter[i] = new EnterNode(parent, data[i]);
|
|
76741
|
+
}
|
|
76742
|
+
}
|
|
76743
|
+
|
|
76744
|
+
// Add any remaining nodes that were not bound to data to exit.
|
|
76745
|
+
for (i = 0; i < groupLength; ++i) {
|
|
76746
|
+
if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) {
|
|
76747
|
+
exit[i] = node;
|
|
76748
|
+
}
|
|
76749
|
+
}
|
|
76750
|
+
}
|
|
76751
|
+
|
|
76752
|
+
function datum(node) {
|
|
76753
|
+
return node.__data__;
|
|
76754
|
+
}
|
|
76755
|
+
|
|
76756
|
+
function selection_data(value, key) {
|
|
76757
|
+
if (!arguments.length) return Array.from(this, datum);
|
|
76758
|
+
|
|
76759
|
+
var bind = key ? bindKey : bindIndex,
|
|
76760
|
+
parents = this._parents,
|
|
76761
|
+
groups = this._groups;
|
|
76762
|
+
|
|
76763
|
+
if (typeof value !== "function") value = constant(value);
|
|
76764
|
+
|
|
76765
|
+
for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {
|
|
76766
|
+
var parent = parents[j],
|
|
76767
|
+
group = groups[j],
|
|
76768
|
+
groupLength = group.length,
|
|
76769
|
+
data = arraylike(value.call(parent, parent && parent.__data__, j, parents)),
|
|
76770
|
+
dataLength = data.length,
|
|
76771
|
+
enterGroup = enter[j] = new Array(dataLength),
|
|
76772
|
+
updateGroup = update[j] = new Array(dataLength),
|
|
76773
|
+
exitGroup = exit[j] = new Array(groupLength);
|
|
76774
|
+
|
|
76775
|
+
bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);
|
|
76776
|
+
|
|
76777
|
+
// Now connect the enter nodes to their following update node, such that
|
|
76778
|
+
// appendChild can insert the materialized enter node before this node,
|
|
76779
|
+
// rather than at the end of the parent node.
|
|
76780
|
+
for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {
|
|
76781
|
+
if (previous = enterGroup[i0]) {
|
|
76782
|
+
if (i0 >= i1) i1 = i0 + 1;
|
|
76783
|
+
while (!(next = updateGroup[i1]) && ++i1 < dataLength);
|
|
76784
|
+
previous._next = next || null;
|
|
76785
|
+
}
|
|
76786
|
+
}
|
|
76787
|
+
}
|
|
76788
|
+
|
|
76789
|
+
update = new Selection(update, parents);
|
|
76790
|
+
update._enter = enter;
|
|
76791
|
+
update._exit = exit;
|
|
76792
|
+
return update;
|
|
76793
|
+
}
|
|
76794
|
+
|
|
76795
|
+
// Given some data, this returns an array-like view of it: an object that
|
|
76796
|
+
// exposes a length property and allows numeric indexing. Note that unlike
|
|
76797
|
+
// selectAll, this isn’t worried about “live” collections because the resulting
|
|
76798
|
+
// array will only be used briefly while data is being bound. (It is possible to
|
|
76799
|
+
// cause the data to change while iterating by using a key function, but please
|
|
76800
|
+
// don’t; we’d rather avoid a gratuitous copy.)
|
|
76801
|
+
function arraylike(data) {
|
|
76802
|
+
return typeof data === "object" && "length" in data
|
|
76803
|
+
? data // Array, TypedArray, NodeList, array-like
|
|
76804
|
+
: Array.from(data); // Map, Set, iterable, string, or anything else
|
|
76805
|
+
}
|
|
76806
|
+
|
|
76807
|
+
function selection_exit() {
|
|
76808
|
+
return new Selection(this._exit || this._groups.map(sparse), this._parents);
|
|
76809
|
+
}
|
|
76810
|
+
|
|
76811
|
+
function selection_join(onenter, onupdate, onexit) {
|
|
76812
|
+
var enter = this.enter(), update = this, exit = this.exit();
|
|
76813
|
+
if (typeof onenter === "function") {
|
|
76814
|
+
enter = onenter(enter);
|
|
76815
|
+
if (enter) enter = enter.selection();
|
|
76816
|
+
} else {
|
|
76817
|
+
enter = enter.append(onenter + "");
|
|
76818
|
+
}
|
|
76819
|
+
if (onupdate != null) {
|
|
76820
|
+
update = onupdate(update);
|
|
76821
|
+
if (update) update = update.selection();
|
|
76822
|
+
}
|
|
76823
|
+
if (onexit == null) exit.remove(); else onexit(exit);
|
|
76824
|
+
return enter && update ? enter.merge(update).order() : update;
|
|
76825
|
+
}
|
|
76826
|
+
|
|
76827
|
+
function selection_merge(context) {
|
|
76828
|
+
var selection = context.selection ? context.selection() : context;
|
|
76829
|
+
|
|
76830
|
+
for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
|
|
76831
|
+
for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
|
|
76832
|
+
if (node = group0[i] || group1[i]) {
|
|
76833
|
+
merge[i] = node;
|
|
76834
|
+
}
|
|
76835
|
+
}
|
|
76836
|
+
}
|
|
76837
|
+
|
|
76838
|
+
for (; j < m0; ++j) {
|
|
76839
|
+
merges[j] = groups0[j];
|
|
76840
|
+
}
|
|
76841
|
+
|
|
76842
|
+
return new Selection(merges, this._parents);
|
|
76843
|
+
}
|
|
76844
|
+
|
|
76845
|
+
function selection_order() {
|
|
76846
|
+
|
|
76847
|
+
for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {
|
|
76848
|
+
for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {
|
|
76849
|
+
if (node = group[i]) {
|
|
76850
|
+
if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);
|
|
76851
|
+
next = node;
|
|
76852
|
+
}
|
|
76853
|
+
}
|
|
76854
|
+
}
|
|
76855
|
+
|
|
76856
|
+
return this;
|
|
76857
|
+
}
|
|
76858
|
+
|
|
76859
|
+
function selection_sort(compare) {
|
|
76860
|
+
if (!compare) compare = ascending;
|
|
76861
|
+
|
|
76862
|
+
function compareNode(a, b) {
|
|
76863
|
+
return a && b ? compare(a.__data__, b.__data__) : !a - !b;
|
|
76864
|
+
}
|
|
76865
|
+
|
|
76866
|
+
for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {
|
|
76867
|
+
for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {
|
|
76868
|
+
if (node = group[i]) {
|
|
76869
|
+
sortgroup[i] = node;
|
|
76870
|
+
}
|
|
76871
|
+
}
|
|
76872
|
+
sortgroup.sort(compareNode);
|
|
76873
|
+
}
|
|
76874
|
+
|
|
76875
|
+
return new Selection(sortgroups, this._parents).order();
|
|
76876
|
+
}
|
|
76877
|
+
|
|
76878
|
+
function ascending(a, b) {
|
|
76879
|
+
return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
|
|
76880
|
+
}
|
|
76881
|
+
|
|
76882
|
+
function selection_call() {
|
|
76883
|
+
var callback = arguments[0];
|
|
76884
|
+
arguments[0] = this;
|
|
76885
|
+
callback.apply(null, arguments);
|
|
76886
|
+
return this;
|
|
76887
|
+
}
|
|
76888
|
+
|
|
76889
|
+
function selection_nodes() {
|
|
76890
|
+
return Array.from(this);
|
|
76891
|
+
}
|
|
76892
|
+
|
|
76893
|
+
function selection_node() {
|
|
76894
|
+
|
|
76895
|
+
for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
|
|
76896
|
+
for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {
|
|
76897
|
+
var node = group[i];
|
|
76898
|
+
if (node) return node;
|
|
76899
|
+
}
|
|
76900
|
+
}
|
|
76901
|
+
|
|
76902
|
+
return null;
|
|
76903
|
+
}
|
|
76904
|
+
|
|
76905
|
+
function selection_size() {
|
|
76906
|
+
let size = 0;
|
|
76907
|
+
for (const node of this) ++size; // eslint-disable-line no-unused-vars
|
|
76908
|
+
return size;
|
|
76909
|
+
}
|
|
76910
|
+
|
|
76911
|
+
function selection_empty() {
|
|
76912
|
+
return !this.node();
|
|
76913
|
+
}
|
|
76914
|
+
|
|
76915
|
+
function selection_each(callback) {
|
|
76916
|
+
|
|
76917
|
+
for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
|
|
76918
|
+
for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {
|
|
76919
|
+
if (node = group[i]) callback.call(node, node.__data__, i, group);
|
|
76920
|
+
}
|
|
76921
|
+
}
|
|
76922
|
+
|
|
76923
|
+
return this;
|
|
76924
|
+
}
|
|
76925
|
+
|
|
76926
|
+
function attrRemove(name) {
|
|
76927
|
+
return function() {
|
|
76928
|
+
this.removeAttribute(name);
|
|
76929
|
+
};
|
|
76930
|
+
}
|
|
76931
|
+
|
|
76932
|
+
function attrRemoveNS(fullname) {
|
|
76933
|
+
return function() {
|
|
76934
|
+
this.removeAttributeNS(fullname.space, fullname.local);
|
|
76935
|
+
};
|
|
76936
|
+
}
|
|
76937
|
+
|
|
76938
|
+
function attrConstant(name, value) {
|
|
76939
|
+
return function() {
|
|
76940
|
+
this.setAttribute(name, value);
|
|
76941
|
+
};
|
|
76942
|
+
}
|
|
76943
|
+
|
|
76944
|
+
function attrConstantNS(fullname, value) {
|
|
76945
|
+
return function() {
|
|
76946
|
+
this.setAttributeNS(fullname.space, fullname.local, value);
|
|
76947
|
+
};
|
|
76948
|
+
}
|
|
76949
|
+
|
|
76950
|
+
function attrFunction(name, value) {
|
|
76951
|
+
return function() {
|
|
76952
|
+
var v = value.apply(this, arguments);
|
|
76953
|
+
if (v == null) this.removeAttribute(name);
|
|
76954
|
+
else this.setAttribute(name, v);
|
|
76955
|
+
};
|
|
76956
|
+
}
|
|
76957
|
+
|
|
76958
|
+
function attrFunctionNS(fullname, value) {
|
|
76959
|
+
return function() {
|
|
76960
|
+
var v = value.apply(this, arguments);
|
|
76961
|
+
if (v == null) this.removeAttributeNS(fullname.space, fullname.local);
|
|
76962
|
+
else this.setAttributeNS(fullname.space, fullname.local, v);
|
|
76963
|
+
};
|
|
76964
|
+
}
|
|
76965
|
+
|
|
76966
|
+
function selection_attr(name, value) {
|
|
76967
|
+
var fullname = namespace(name);
|
|
76968
|
+
|
|
76969
|
+
if (arguments.length < 2) {
|
|
76970
|
+
var node = this.node();
|
|
76971
|
+
return fullname.local
|
|
76972
|
+
? node.getAttributeNS(fullname.space, fullname.local)
|
|
76973
|
+
: node.getAttribute(fullname);
|
|
76974
|
+
}
|
|
76975
|
+
|
|
76976
|
+
return this.each((value == null
|
|
76977
|
+
? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === "function"
|
|
76978
|
+
? (fullname.local ? attrFunctionNS : attrFunction)
|
|
76979
|
+
: (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));
|
|
76980
|
+
}
|
|
76981
|
+
|
|
76982
|
+
function defaultView(node) {
|
|
76983
|
+
return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node
|
|
76984
|
+
|| (node.document && node) // node is a Window
|
|
76985
|
+
|| node.defaultView; // node is a Document
|
|
76986
|
+
}
|
|
76987
|
+
|
|
76988
|
+
function styleRemove(name) {
|
|
76989
|
+
return function() {
|
|
76990
|
+
this.style.removeProperty(name);
|
|
76991
|
+
};
|
|
76992
|
+
}
|
|
76993
|
+
|
|
76994
|
+
function styleConstant(name, value, priority) {
|
|
76995
|
+
return function() {
|
|
76996
|
+
this.style.setProperty(name, value, priority);
|
|
76997
|
+
};
|
|
76998
|
+
}
|
|
76999
|
+
|
|
77000
|
+
function styleFunction(name, value, priority) {
|
|
77001
|
+
return function() {
|
|
77002
|
+
var v = value.apply(this, arguments);
|
|
77003
|
+
if (v == null) this.style.removeProperty(name);
|
|
77004
|
+
else this.style.setProperty(name, v, priority);
|
|
77005
|
+
};
|
|
77006
|
+
}
|
|
77007
|
+
|
|
77008
|
+
function selection_style(name, value, priority) {
|
|
77009
|
+
return arguments.length > 1
|
|
77010
|
+
? this.each((value == null
|
|
77011
|
+
? styleRemove : typeof value === "function"
|
|
77012
|
+
? styleFunction
|
|
77013
|
+
: styleConstant)(name, value, priority == null ? "" : priority))
|
|
77014
|
+
: styleValue(this.node(), name);
|
|
77015
|
+
}
|
|
77016
|
+
|
|
77017
|
+
function styleValue(node, name) {
|
|
77018
|
+
return node.style.getPropertyValue(name)
|
|
77019
|
+
|| defaultView(node).getComputedStyle(node, null).getPropertyValue(name);
|
|
77020
|
+
}
|
|
77021
|
+
|
|
77022
|
+
function propertyRemove(name) {
|
|
77023
|
+
return function() {
|
|
77024
|
+
delete this[name];
|
|
77025
|
+
};
|
|
77026
|
+
}
|
|
77027
|
+
|
|
77028
|
+
function propertyConstant(name, value) {
|
|
77029
|
+
return function() {
|
|
77030
|
+
this[name] = value;
|
|
77031
|
+
};
|
|
77032
|
+
}
|
|
77033
|
+
|
|
77034
|
+
function propertyFunction(name, value) {
|
|
77035
|
+
return function() {
|
|
77036
|
+
var v = value.apply(this, arguments);
|
|
77037
|
+
if (v == null) delete this[name];
|
|
77038
|
+
else this[name] = v;
|
|
77039
|
+
};
|
|
77040
|
+
}
|
|
77041
|
+
|
|
77042
|
+
function selection_property(name, value) {
|
|
77043
|
+
return arguments.length > 1
|
|
77044
|
+
? this.each((value == null
|
|
77045
|
+
? propertyRemove : typeof value === "function"
|
|
77046
|
+
? propertyFunction
|
|
77047
|
+
: propertyConstant)(name, value))
|
|
77048
|
+
: this.node()[name];
|
|
77049
|
+
}
|
|
77050
|
+
|
|
77051
|
+
function classArray(string) {
|
|
77052
|
+
return string.trim().split(/^|\s+/);
|
|
77053
|
+
}
|
|
77054
|
+
|
|
77055
|
+
function classList(node) {
|
|
77056
|
+
return node.classList || new ClassList(node);
|
|
77057
|
+
}
|
|
77058
|
+
|
|
77059
|
+
function ClassList(node) {
|
|
77060
|
+
this._node = node;
|
|
77061
|
+
this._names = classArray(node.getAttribute("class") || "");
|
|
77062
|
+
}
|
|
77063
|
+
|
|
77064
|
+
ClassList.prototype = {
|
|
77065
|
+
add: function(name) {
|
|
77066
|
+
var i = this._names.indexOf(name);
|
|
77067
|
+
if (i < 0) {
|
|
77068
|
+
this._names.push(name);
|
|
77069
|
+
this._node.setAttribute("class", this._names.join(" "));
|
|
77070
|
+
}
|
|
77071
|
+
},
|
|
77072
|
+
remove: function(name) {
|
|
77073
|
+
var i = this._names.indexOf(name);
|
|
77074
|
+
if (i >= 0) {
|
|
77075
|
+
this._names.splice(i, 1);
|
|
77076
|
+
this._node.setAttribute("class", this._names.join(" "));
|
|
77077
|
+
}
|
|
77078
|
+
},
|
|
77079
|
+
contains: function(name) {
|
|
77080
|
+
return this._names.indexOf(name) >= 0;
|
|
77081
|
+
}
|
|
77082
|
+
};
|
|
77083
|
+
|
|
77084
|
+
function classedAdd(node, names) {
|
|
77085
|
+
var list = classList(node), i = -1, n = names.length;
|
|
77086
|
+
while (++i < n) list.add(names[i]);
|
|
77087
|
+
}
|
|
77088
|
+
|
|
77089
|
+
function classedRemove(node, names) {
|
|
77090
|
+
var list = classList(node), i = -1, n = names.length;
|
|
77091
|
+
while (++i < n) list.remove(names[i]);
|
|
77092
|
+
}
|
|
77093
|
+
|
|
77094
|
+
function classedTrue(names) {
|
|
77095
|
+
return function() {
|
|
77096
|
+
classedAdd(this, names);
|
|
77097
|
+
};
|
|
77098
|
+
}
|
|
77099
|
+
|
|
77100
|
+
function classedFalse(names) {
|
|
77101
|
+
return function() {
|
|
77102
|
+
classedRemove(this, names);
|
|
77103
|
+
};
|
|
77104
|
+
}
|
|
77105
|
+
|
|
77106
|
+
function classedFunction(names, value) {
|
|
77107
|
+
return function() {
|
|
77108
|
+
(value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);
|
|
77109
|
+
};
|
|
77110
|
+
}
|
|
77111
|
+
|
|
77112
|
+
function selection_classed(name, value) {
|
|
77113
|
+
var names = classArray(name + "");
|
|
77114
|
+
|
|
77115
|
+
if (arguments.length < 2) {
|
|
77116
|
+
var list = classList(this.node()), i = -1, n = names.length;
|
|
77117
|
+
while (++i < n) if (!list.contains(names[i])) return false;
|
|
77118
|
+
return true;
|
|
77119
|
+
}
|
|
77120
|
+
|
|
77121
|
+
return this.each((typeof value === "function"
|
|
77122
|
+
? classedFunction : value
|
|
77123
|
+
? classedTrue
|
|
77124
|
+
: classedFalse)(names, value));
|
|
77125
|
+
}
|
|
77126
|
+
|
|
77127
|
+
function textRemove() {
|
|
77128
|
+
this.textContent = "";
|
|
77129
|
+
}
|
|
77130
|
+
|
|
77131
|
+
function textConstant(value) {
|
|
77132
|
+
return function() {
|
|
77133
|
+
this.textContent = value;
|
|
77134
|
+
};
|
|
77135
|
+
}
|
|
77136
|
+
|
|
77137
|
+
function textFunction(value) {
|
|
77138
|
+
return function() {
|
|
77139
|
+
var v = value.apply(this, arguments);
|
|
77140
|
+
this.textContent = v == null ? "" : v;
|
|
77141
|
+
};
|
|
77142
|
+
}
|
|
77143
|
+
|
|
77144
|
+
function selection_text(value) {
|
|
77145
|
+
return arguments.length
|
|
77146
|
+
? this.each(value == null
|
|
77147
|
+
? textRemove : (typeof value === "function"
|
|
77148
|
+
? textFunction
|
|
77149
|
+
: textConstant)(value))
|
|
77150
|
+
: this.node().textContent;
|
|
77151
|
+
}
|
|
77152
|
+
|
|
77153
|
+
function htmlRemove() {
|
|
77154
|
+
this.innerHTML = "";
|
|
77155
|
+
}
|
|
77156
|
+
|
|
77157
|
+
function htmlConstant(value) {
|
|
77158
|
+
return function() {
|
|
77159
|
+
this.innerHTML = value;
|
|
77160
|
+
};
|
|
77161
|
+
}
|
|
77162
|
+
|
|
77163
|
+
function htmlFunction(value) {
|
|
77164
|
+
return function() {
|
|
77165
|
+
var v = value.apply(this, arguments);
|
|
77166
|
+
this.innerHTML = v == null ? "" : v;
|
|
77167
|
+
};
|
|
77168
|
+
}
|
|
77169
|
+
|
|
77170
|
+
function selection_html(value) {
|
|
77171
|
+
return arguments.length
|
|
77172
|
+
? this.each(value == null
|
|
77173
|
+
? htmlRemove : (typeof value === "function"
|
|
77174
|
+
? htmlFunction
|
|
77175
|
+
: htmlConstant)(value))
|
|
77176
|
+
: this.node().innerHTML;
|
|
77177
|
+
}
|
|
77178
|
+
|
|
77179
|
+
function raise() {
|
|
77180
|
+
if (this.nextSibling) this.parentNode.appendChild(this);
|
|
77181
|
+
}
|
|
77182
|
+
|
|
77183
|
+
function selection_raise() {
|
|
77184
|
+
return this.each(raise);
|
|
77185
|
+
}
|
|
77186
|
+
|
|
77187
|
+
function lower() {
|
|
77188
|
+
if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);
|
|
77189
|
+
}
|
|
77190
|
+
|
|
77191
|
+
function selection_lower() {
|
|
77192
|
+
return this.each(lower);
|
|
77193
|
+
}
|
|
77194
|
+
|
|
77195
|
+
function selection_append(name) {
|
|
77196
|
+
var create = typeof name === "function" ? name : creator(name);
|
|
77197
|
+
return this.select(function() {
|
|
77198
|
+
return this.appendChild(create.apply(this, arguments));
|
|
77199
|
+
});
|
|
77200
|
+
}
|
|
77201
|
+
|
|
77202
|
+
function constantNull() {
|
|
77203
|
+
return null;
|
|
77204
|
+
}
|
|
77205
|
+
|
|
77206
|
+
function selection_insert(name, before) {
|
|
77207
|
+
var create = typeof name === "function" ? name : creator(name),
|
|
77208
|
+
select = before == null ? constantNull : typeof before === "function" ? before : selector(before);
|
|
77209
|
+
return this.select(function() {
|
|
77210
|
+
return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);
|
|
77211
|
+
});
|
|
77212
|
+
}
|
|
77213
|
+
|
|
77214
|
+
function remove() {
|
|
77215
|
+
var parent = this.parentNode;
|
|
77216
|
+
if (parent) parent.removeChild(this);
|
|
77217
|
+
}
|
|
77218
|
+
|
|
77219
|
+
function selection_remove() {
|
|
77220
|
+
return this.each(remove);
|
|
77221
|
+
}
|
|
77222
|
+
|
|
77223
|
+
function selection_cloneShallow() {
|
|
77224
|
+
var clone = this.cloneNode(false), parent = this.parentNode;
|
|
77225
|
+
return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
|
|
77226
|
+
}
|
|
77227
|
+
|
|
77228
|
+
function selection_cloneDeep() {
|
|
77229
|
+
var clone = this.cloneNode(true), parent = this.parentNode;
|
|
77230
|
+
return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
|
|
77231
|
+
}
|
|
77232
|
+
|
|
77233
|
+
function selection_clone(deep) {
|
|
77234
|
+
return this.select(deep ? selection_cloneDeep : selection_cloneShallow);
|
|
77235
|
+
}
|
|
77236
|
+
|
|
77237
|
+
function selection_datum(value) {
|
|
77238
|
+
return arguments.length
|
|
77239
|
+
? this.property("__data__", value)
|
|
77240
|
+
: this.node().__data__;
|
|
77241
|
+
}
|
|
77242
|
+
|
|
77243
|
+
function contextListener(listener) {
|
|
77244
|
+
return function(event) {
|
|
77245
|
+
listener.call(this, event, this.__data__);
|
|
77246
|
+
};
|
|
77247
|
+
}
|
|
77248
|
+
|
|
77249
|
+
function parseTypenames(typenames) {
|
|
77250
|
+
return typenames.trim().split(/^|\s+/).map(function(t) {
|
|
77251
|
+
var name = "", i = t.indexOf(".");
|
|
77252
|
+
if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);
|
|
77253
|
+
return {type: t, name: name};
|
|
77254
|
+
});
|
|
77255
|
+
}
|
|
77256
|
+
|
|
77257
|
+
function onRemove(typename) {
|
|
77258
|
+
return function() {
|
|
77259
|
+
var on = this.__on;
|
|
77260
|
+
if (!on) return;
|
|
77261
|
+
for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {
|
|
77262
|
+
if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {
|
|
77263
|
+
this.removeEventListener(o.type, o.listener, o.options);
|
|
77264
|
+
} else {
|
|
77265
|
+
on[++i] = o;
|
|
77266
|
+
}
|
|
77267
|
+
}
|
|
77268
|
+
if (++i) on.length = i;
|
|
77269
|
+
else delete this.__on;
|
|
77270
|
+
};
|
|
77271
|
+
}
|
|
77272
|
+
|
|
77273
|
+
function onAdd(typename, value, options) {
|
|
77274
|
+
return function() {
|
|
77275
|
+
var on = this.__on, o, listener = contextListener(value);
|
|
77276
|
+
if (on) for (var j = 0, m = on.length; j < m; ++j) {
|
|
77277
|
+
if ((o = on[j]).type === typename.type && o.name === typename.name) {
|
|
77278
|
+
this.removeEventListener(o.type, o.listener, o.options);
|
|
77279
|
+
this.addEventListener(o.type, o.listener = listener, o.options = options);
|
|
77280
|
+
o.value = value;
|
|
77281
|
+
return;
|
|
77282
|
+
}
|
|
77283
|
+
}
|
|
77284
|
+
this.addEventListener(typename.type, listener, options);
|
|
77285
|
+
o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options};
|
|
77286
|
+
if (!on) this.__on = [o];
|
|
77287
|
+
else on.push(o);
|
|
77288
|
+
};
|
|
77289
|
+
}
|
|
77290
|
+
|
|
77291
|
+
function selection_on(typename, value, options) {
|
|
77292
|
+
var typenames = parseTypenames(typename + ""), i, n = typenames.length, t;
|
|
77293
|
+
|
|
77294
|
+
if (arguments.length < 2) {
|
|
77295
|
+
var on = this.node().__on;
|
|
77296
|
+
if (on) for (var j = 0, m = on.length, o; j < m; ++j) {
|
|
77297
|
+
for (i = 0, o = on[j]; i < n; ++i) {
|
|
77298
|
+
if ((t = typenames[i]).type === o.type && t.name === o.name) {
|
|
77299
|
+
return o.value;
|
|
77300
|
+
}
|
|
77301
|
+
}
|
|
77302
|
+
}
|
|
77303
|
+
return;
|
|
77304
|
+
}
|
|
77305
|
+
|
|
77306
|
+
on = value ? onAdd : onRemove;
|
|
77307
|
+
for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options));
|
|
77308
|
+
return this;
|
|
77309
|
+
}
|
|
77310
|
+
|
|
77311
|
+
function dispatchEvent(node, type, params) {
|
|
77312
|
+
var window = defaultView(node),
|
|
77313
|
+
event = window.CustomEvent;
|
|
77314
|
+
|
|
77315
|
+
if (typeof event === "function") {
|
|
77316
|
+
event = new event(type, params);
|
|
77317
|
+
} else {
|
|
77318
|
+
event = window.document.createEvent("Event");
|
|
77319
|
+
if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;
|
|
77320
|
+
else event.initEvent(type, false, false);
|
|
77321
|
+
}
|
|
77322
|
+
|
|
77323
|
+
node.dispatchEvent(event);
|
|
77324
|
+
}
|
|
77325
|
+
|
|
77326
|
+
function dispatchConstant(type, params) {
|
|
77327
|
+
return function() {
|
|
77328
|
+
return dispatchEvent(this, type, params);
|
|
77329
|
+
};
|
|
77330
|
+
}
|
|
77331
|
+
|
|
77332
|
+
function dispatchFunction(type, params) {
|
|
77333
|
+
return function() {
|
|
77334
|
+
return dispatchEvent(this, type, params.apply(this, arguments));
|
|
77335
|
+
};
|
|
77336
|
+
}
|
|
77337
|
+
|
|
77338
|
+
function selection_dispatch(type, params) {
|
|
77339
|
+
return this.each((typeof params === "function"
|
|
77340
|
+
? dispatchFunction
|
|
77341
|
+
: dispatchConstant)(type, params));
|
|
77342
|
+
}
|
|
77343
|
+
|
|
77344
|
+
function* selection_iterator() {
|
|
77345
|
+
for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
|
|
77346
|
+
for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {
|
|
77347
|
+
if (node = group[i]) yield node;
|
|
77348
|
+
}
|
|
77349
|
+
}
|
|
77350
|
+
}
|
|
77351
|
+
|
|
77352
|
+
var root = [null];
|
|
77353
|
+
|
|
77354
|
+
function Selection(groups, parents) {
|
|
77355
|
+
this._groups = groups;
|
|
77356
|
+
this._parents = parents;
|
|
77357
|
+
}
|
|
77358
|
+
|
|
77359
|
+
function selection_selection() {
|
|
77360
|
+
return this;
|
|
77361
|
+
}
|
|
77362
|
+
|
|
77363
|
+
Selection.prototype = {
|
|
77364
|
+
constructor: Selection,
|
|
77365
|
+
select: selection_select,
|
|
77366
|
+
selectAll: selection_selectAll,
|
|
77367
|
+
selectChild: selection_selectChild,
|
|
77368
|
+
selectChildren: selection_selectChildren,
|
|
77369
|
+
filter: selection_filter,
|
|
77370
|
+
data: selection_data,
|
|
77371
|
+
enter: selection_enter,
|
|
77372
|
+
exit: selection_exit,
|
|
77373
|
+
join: selection_join,
|
|
77374
|
+
merge: selection_merge,
|
|
77375
|
+
selection: selection_selection,
|
|
77376
|
+
order: selection_order,
|
|
77377
|
+
sort: selection_sort,
|
|
77378
|
+
call: selection_call,
|
|
77379
|
+
nodes: selection_nodes,
|
|
77380
|
+
node: selection_node,
|
|
77381
|
+
size: selection_size,
|
|
77382
|
+
empty: selection_empty,
|
|
77383
|
+
each: selection_each,
|
|
77384
|
+
attr: selection_attr,
|
|
77385
|
+
style: selection_style,
|
|
77386
|
+
property: selection_property,
|
|
77387
|
+
classed: selection_classed,
|
|
77388
|
+
text: selection_text,
|
|
77389
|
+
html: selection_html,
|
|
77390
|
+
raise: selection_raise,
|
|
77391
|
+
lower: selection_lower,
|
|
77392
|
+
append: selection_append,
|
|
77393
|
+
insert: selection_insert,
|
|
77394
|
+
remove: selection_remove,
|
|
77395
|
+
clone: selection_clone,
|
|
77396
|
+
datum: selection_datum,
|
|
77397
|
+
on: selection_on,
|
|
77398
|
+
dispatch: selection_dispatch,
|
|
77399
|
+
[Symbol.iterator]: selection_iterator
|
|
77400
|
+
};
|
|
77401
|
+
|
|
77402
|
+
function select(selector) {
|
|
77403
|
+
return typeof selector === "string"
|
|
77404
|
+
? new Selection([[document.querySelector(selector)]], [document.documentElement])
|
|
77405
|
+
: new Selection([[selector]], root);
|
|
77406
|
+
}
|
|
77407
|
+
|
|
77408
|
+
function sourceEvent(event) {
|
|
77409
|
+
let sourceEvent;
|
|
77410
|
+
while (sourceEvent = event.sourceEvent) event = sourceEvent;
|
|
77411
|
+
return event;
|
|
77412
|
+
}
|
|
77413
|
+
|
|
77414
|
+
function pointer(event, node) {
|
|
77415
|
+
event = sourceEvent(event);
|
|
77416
|
+
if (node === undefined) node = event.currentTarget;
|
|
77417
|
+
if (node) {
|
|
77418
|
+
var svg = node.ownerSVGElement || node;
|
|
77419
|
+
if (svg.createSVGPoint) {
|
|
77420
|
+
var point = svg.createSVGPoint();
|
|
77421
|
+
point.x = event.clientX, point.y = event.clientY;
|
|
77422
|
+
point = point.matrixTransform(node.getScreenCTM().inverse());
|
|
77423
|
+
return [point.x, point.y];
|
|
77424
|
+
}
|
|
77425
|
+
if (node.getBoundingClientRect) {
|
|
77426
|
+
var rect = node.getBoundingClientRect();
|
|
77427
|
+
return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
|
|
77428
|
+
}
|
|
77429
|
+
}
|
|
77430
|
+
return [event.pageX, event.pageY];
|
|
77431
|
+
}
|
|
77432
|
+
|
|
77433
|
+
function _arrayLikeToArray(r, a) {
|
|
77434
|
+
(null == a || a > r.length) && (a = r.length);
|
|
77435
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
77436
|
+
return n;
|
|
77437
|
+
}
|
|
77438
|
+
function _arrayWithHoles(r) {
|
|
77439
|
+
if (Array.isArray(r)) return r;
|
|
77440
|
+
}
|
|
77441
|
+
function _iterableToArrayLimit(r, l) {
|
|
77442
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
77443
|
+
if (null != t) {
|
|
77444
|
+
var e,
|
|
77445
|
+
n,
|
|
77446
|
+
i,
|
|
77447
|
+
u,
|
|
77448
|
+
a = [],
|
|
77449
|
+
f = true,
|
|
77450
|
+
o = false;
|
|
77451
|
+
try {
|
|
77452
|
+
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
77453
|
+
} catch (r) {
|
|
77454
|
+
o = true, n = r;
|
|
77455
|
+
} finally {
|
|
77456
|
+
try {
|
|
77457
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
77458
|
+
} finally {
|
|
77459
|
+
if (o) throw n;
|
|
77460
|
+
}
|
|
77461
|
+
}
|
|
77462
|
+
return a;
|
|
77463
|
+
}
|
|
77464
|
+
}
|
|
77465
|
+
function _nonIterableRest() {
|
|
77466
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
77467
|
+
}
|
|
77468
|
+
function _slicedToArray(r, e) {
|
|
77469
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
77470
|
+
}
|
|
77471
|
+
function _typeof(o) {
|
|
77472
|
+
"@babel/helpers - typeof";
|
|
77473
|
+
|
|
77474
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
77475
|
+
return typeof o;
|
|
77476
|
+
} : function (o) {
|
|
77477
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
77478
|
+
}, _typeof(o);
|
|
77479
|
+
}
|
|
77480
|
+
function _unsupportedIterableToArray(r, a) {
|
|
77481
|
+
if (r) {
|
|
77482
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
77483
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
77484
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : undefined;
|
|
77485
|
+
}
|
|
77486
|
+
}
|
|
77487
|
+
|
|
77488
|
+
function styleInject(css, ref) {
|
|
77489
|
+
if (ref === undefined) ref = {};
|
|
77490
|
+
var insertAt = ref.insertAt;
|
|
77491
|
+
if (typeof document === 'undefined') {
|
|
77492
|
+
return;
|
|
77493
|
+
}
|
|
77494
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
77495
|
+
var style = document.createElement('style');
|
|
77496
|
+
style.type = 'text/css';
|
|
77497
|
+
if (insertAt === 'top') {
|
|
77498
|
+
if (head.firstChild) {
|
|
77499
|
+
head.insertBefore(style, head.firstChild);
|
|
77500
|
+
} else {
|
|
77501
|
+
head.appendChild(style);
|
|
77502
|
+
}
|
|
77503
|
+
} else {
|
|
77504
|
+
head.appendChild(style);
|
|
77505
|
+
}
|
|
77506
|
+
if (style.styleSheet) {
|
|
77507
|
+
style.styleSheet.cssText = css;
|
|
77508
|
+
} else {
|
|
77509
|
+
style.appendChild(document.createTextNode(css));
|
|
77510
|
+
}
|
|
77511
|
+
}
|
|
77512
|
+
|
|
77513
|
+
var css_248z = ".float-tooltip-kap {\n position: absolute;\n padding: 2px 4px;\n border-radius: 3px;\n font: 12px sans-serif;\n color: #eee;\n background: rgba(0,0,0,0.6);\n pointer-events: none;\n}\n";
|
|
77514
|
+
styleInject(css_248z);
|
|
77515
|
+
|
|
77516
|
+
var index = index$1({
|
|
77517
|
+
props: {
|
|
77518
|
+
content: {
|
|
77519
|
+
"default": false
|
|
77520
|
+
}
|
|
77521
|
+
},
|
|
77522
|
+
init: function init(domNode, state) {
|
|
77523
|
+
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
77524
|
+
_ref$style = _ref.style,
|
|
77525
|
+
style = _ref$style === undefined ? {} : _ref$style;
|
|
77526
|
+
var isD3Selection = !!domNode && _typeof(domNode) === 'object' && !!domNode.node && typeof domNode.node === 'function';
|
|
77527
|
+
var el = select(isD3Selection ? domNode.node() : domNode);
|
|
77528
|
+
state.tooltipEl = el.append('div').attr('class', 'float-tooltip-kap');
|
|
77529
|
+
Object.entries(style).forEach(function (_ref2) {
|
|
77530
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
77531
|
+
k = _ref3[0],
|
|
77532
|
+
v = _ref3[1];
|
|
77533
|
+
return state.tooltipEl.style(k, v);
|
|
77534
|
+
});
|
|
77535
|
+
state.tooltipEl // start off-screen
|
|
77536
|
+
.style('left', '-100000px').style('display', 'none');
|
|
77537
|
+
state.mouseInside = false;
|
|
77538
|
+
el.on('mousemove.tooltip', function (ev) {
|
|
77539
|
+
state.mouseInside = true;
|
|
77540
|
+
var mousePos = pointer(ev);
|
|
77541
|
+
var domNode = el.node();
|
|
77542
|
+
var canvasWidth = domNode.offsetWidth;
|
|
77543
|
+
var canvasHeight = domNode.offsetHeight;
|
|
77544
|
+
state.tooltipEl.style('left', mousePos[0] + 'px').style('top', mousePos[1] + 'px')
|
|
77545
|
+
// adjust horizontal position to not exceed canvas boundaries
|
|
77546
|
+
.style('transform', "translate(-".concat(mousePos[0] / canvasWidth * 100, "%, ").concat(
|
|
77547
|
+
// flip to above if near bottom
|
|
77548
|
+
canvasHeight - mousePos[1] < 100 ? 'calc(-100% - 6px)' : '21px', ")"));
|
|
77549
|
+
});
|
|
77550
|
+
el.on('mouseover.tooltip', function () {
|
|
77551
|
+
state.mouseInside = true;
|
|
77552
|
+
state.content && state.tooltipEl.style('display', 'inline');
|
|
77553
|
+
});
|
|
77554
|
+
el.on('mouseout.tooltip', function () {
|
|
77555
|
+
state.mouseInside = false;
|
|
77556
|
+
state.tooltipEl.style('display', 'none');
|
|
77557
|
+
});
|
|
77558
|
+
},
|
|
77559
|
+
update: function update(state) {
|
|
77560
|
+
state.tooltipEl.style('display', !!state.content && state.mouseInside ? 'inline' : 'none');
|
|
77561
|
+
state.tooltipEl.html(state.content || '');
|
|
77562
|
+
}
|
|
77563
|
+
});
|
|
77564
|
+
|
|
76488
77565
|
var three = window.THREE ? window.THREE // Prefer consumption from global THREE, if exists
|
|
76489
77566
|
: {
|
|
76490
77567
|
WebGLRenderer: three$1.WebGLRenderer,
|
|
@@ -76507,7 +77584,7 @@ var<${access}> ${name} : ${structName};`;
|
|
|
76507
77584
|
Spherical: three$1.Spherical,
|
|
76508
77585
|
Clock: three$1.Clock
|
|
76509
77586
|
};
|
|
76510
|
-
var threeRenderObjects = index({
|
|
77587
|
+
var threeRenderObjects = index$1({
|
|
76511
77588
|
props: {
|
|
76512
77589
|
width: {
|
|
76513
77590
|
"default": window.innerWidth,
|
|
@@ -76543,10 +77620,7 @@ var<${access}> ${name} : ${structName};`;
|
|
|
76543
77620
|
onChange: function onChange(_, state) {
|
|
76544
77621
|
// Reset hover state
|
|
76545
77622
|
state.hoverObj = null;
|
|
76546
|
-
|
|
76547
|
-
state.toolTipElem.style.display = 'none';
|
|
76548
|
-
state.toolTipElem.innerHTML = '';
|
|
76549
|
-
}
|
|
77623
|
+
state.tooltip && state.tooltip.content(null);
|
|
76550
77624
|
},
|
|
76551
77625
|
triggerUpdate: false
|
|
76552
77626
|
},
|
|
@@ -76616,7 +77690,7 @@ var<${access}> ${name} : ${structName};`;
|
|
|
76616
77690
|
}
|
|
76617
77691
|
if (topObject !== state.hoverObj) {
|
|
76618
77692
|
state.onHover(topObject, state.hoverObj);
|
|
76619
|
-
state.
|
|
77693
|
+
state.tooltip.content(topObject ? index$2(state.tooltipContent)(topObject) || null : null);
|
|
76620
77694
|
state.hoverObj = topObject;
|
|
76621
77695
|
}
|
|
76622
77696
|
}
|
|
@@ -76703,7 +77777,7 @@ var<${access}> ${name} : ${structName};`;
|
|
|
76703
77777
|
if (bbox) {
|
|
76704
77778
|
var center = new three.Vector3(0, 0, 0); // reset camera aim to center
|
|
76705
77779
|
var maxBoxSide = Math.max.apply(Math, _toConsumableArray(Object.entries(bbox).map(function (_ref) {
|
|
76706
|
-
var _ref2 = _slicedToArray$
|
|
77780
|
+
var _ref2 = _slicedToArray$2(_ref, 2),
|
|
76707
77781
|
coordType = _ref2[0],
|
|
76708
77782
|
coords = _ref2[1];
|
|
76709
77783
|
return Math.max.apply(Math, _toConsumableArray(coords.map(function (c) {
|
|
@@ -76820,9 +77894,7 @@ var<${access}> ${name} : ${structName};`;
|
|
|
76820
77894
|
state.navInfo.style.display = state.showNavInfo ? null : 'none';
|
|
76821
77895
|
|
|
76822
77896
|
// Setup tooltip
|
|
76823
|
-
state.
|
|
76824
|
-
state.toolTipElem.classList.add('scene-tooltip');
|
|
76825
|
-
state.container.appendChild(state.toolTipElem);
|
|
77897
|
+
state.tooltip = new index(state.container);
|
|
76826
77898
|
|
|
76827
77899
|
// Capture pointer coords on move or touchstart
|
|
76828
77900
|
state.pointerPos = new three.Vector2();
|
|
@@ -76844,14 +77916,6 @@ var<${access}> ${name} : ${structName};`;
|
|
|
76844
77916
|
var offset = getOffset(state.container);
|
|
76845
77917
|
state.pointerPos.x = ev.pageX - offset.left;
|
|
76846
77918
|
state.pointerPos.y = ev.pageY - offset.top;
|
|
76847
|
-
|
|
76848
|
-
// Move tooltip
|
|
76849
|
-
state.toolTipElem.style.top = "".concat(state.pointerPos.y, "px");
|
|
76850
|
-
state.toolTipElem.style.left = "".concat(state.pointerPos.x, "px");
|
|
76851
|
-
// adjust horizontal position to not exceed canvas boundaries
|
|
76852
|
-
state.toolTipElem.style.transform = "translate(-".concat(state.pointerPos.x / state.width * 100, "%, ").concat(
|
|
76853
|
-
// flip to above if near bottom
|
|
76854
|
-
state.height - state.pointerPos.y < 100 ? 'calc(-100% - 8px)' : '21px', ")");
|
|
76855
77919
|
}
|
|
76856
77920
|
function getOffset(el) {
|
|
76857
77921
|
var rect = el.getBoundingClientRect(),
|