@ndmspc/ndmvr 0.1.2 → 0.20220401.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.
package/dist/index.js CHANGED
@@ -3,7 +3,9 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
3
3
  var React = require('react');
4
4
  var React__default = _interopDefault(React);
5
5
  var rxjs = require('rxjs');
6
- var AFRAME = _interopDefault(require('aframe'));
6
+ var AFRAME$1 = _interopDefault(require('aframe'));
7
+ var socket_ioClient = require('socket.io-client');
8
+ var THREE = require('three');
7
9
 
8
10
  function _defineProperties(target, props) {
9
11
  for (var i = 0; i < props.length; i++) {
@@ -85,7 +87,7 @@ var JsrootService = /*#__PURE__*/function () {
85
87
  var secondary = projectionTargetAxis ? axisArray[1] : axisArray[0];
86
88
  var primaryAxis = "f" + secondary + "axis";
87
89
  var secondaryAxis = "f" + primary + "axis";
88
- var binAxis = primary.toLowerCase() + "Max";
90
+ var binAxis = primary.toLowerCase() + "Pos";
89
91
 
90
92
  var h1 = _classPrivateFieldLooseBase(this, _jsroot)[_jsroot].createHistogram('TH1I', info.obj[primaryAxis].fNbins);
91
93
 
@@ -96,6 +98,7 @@ var JsrootService = /*#__PURE__*/function () {
96
98
  var currLabel = ((_info$obj$secondaryAx = info.obj[secondaryAxis].fLabels) === null || _info$obj$secondaryAx === void 0 ? void 0 : _info$obj$secondaryAx.arr.length) > 0 ? info.obj[secondaryAxis].fLabels.arr[info.bin[binAxis] - 1].fString : '';
97
99
 
98
100
  for (var n = 0; n < info.obj[primaryAxis].fNbins; n++) {
101
+ console.log(info.obj);
99
102
  h1.setBinContent(n + 1, projectionAxis === axisArray[0] ? info.obj.getBinContent(info.bin[binAxis], n + 1) : info.obj.getBinContent(n + 1, info.bin[binAxis]));
100
103
  }
101
104
 
@@ -108,10 +111,8 @@ var JsrootService = /*#__PURE__*/function () {
108
111
  _proto.openTH1Projection = function openTH1Projection(projectionAxis, info, idTargetElm, axisArray, projections, projIndex) {
109
112
  var _this = this;
110
113
 
111
- var xLength = info.obj.fXaxis.fXmax / info.obj.fXaxis.fNbins;
112
- var yLength = info.obj.fYaxis.fXmax / info.obj.fYaxis.fNbins;
113
- var xBin = info.bin.xMin / xLength;
114
- var yBin = info.bin.yMin / yLength;
114
+ var xBin = info.bin.xPos - 1;
115
+ var yBin = info.bin.yPos - 1;
115
116
 
116
117
  try {
117
118
  var projection = projections.fFolders.arr[xBin].fFolders.arr[yBin].fFolders.arr[projIndex || 0];
@@ -137,6 +138,8 @@ var JsrootService = /*#__PURE__*/function () {
137
138
  canvas.setAttribute('width', width);
138
139
  var svgString = new XMLSerializer().serializeToString(sourceSvgElement);
139
140
  var ctx = canvas.getContext('2d');
141
+ ctx.fillStyle = '#ffffff';
142
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
140
143
  var DOMURL = self.URL || self.webkitURL || self;
141
144
  var img = new Image();
142
145
  var svg = new Blob([svgString], {
@@ -177,13 +180,13 @@ var styles = {
177
180
  width: '90%',
178
181
  textAlign: 'center',
179
182
  align: 'center',
180
- paddingTop: 2
183
+ paddingTop: 4
181
184
  },
182
185
  projection: {
183
186
  display: 'block',
184
187
  margin: 'auto',
185
- width: '460px',
186
- height: '380px'
188
+ width: '420px',
189
+ height: '350px'
187
190
  },
188
191
  form: {
189
192
  display: 'block',
@@ -221,12 +224,15 @@ var JsrootHistogram = function JsrootHistogram(_ref) {
221
224
  setAxis = _useState[1];
222
225
 
223
226
  var _useState2 = React.useState(null),
224
- data = _useState2[0],
225
- setData = _useState2[1];
227
+ selectedBin = _useState2[0],
228
+ setSelectedBin = _useState2[1];
226
229
 
227
230
  var handleInputChange = function handleInputChange(event) {
228
- var axis = event.target.value;
229
- setAxis(axis);
231
+ setAxis(event.target.value);
232
+ };
233
+
234
+ var handleSubscription = function handleSubscription(data) {
235
+ setSelectedBin(data);
230
236
  };
231
237
 
232
238
  var renderForm = function renderForm() {
@@ -242,24 +248,22 @@ var JsrootHistogram = function JsrootHistogram(_ref) {
242
248
  id: "axisProjection",
243
249
  style: styles.input
244
250
  }, /*#__PURE__*/React__default.createElement("option", {
245
- defaultValue: projectionAxes[0]
251
+ value: projectionAxes[0]
246
252
  }, histogram["f" + projectionAxes[0] + "axis"].fTitle ? histogram["f" + projectionAxes[0] + "axis"].fTitle : projectionAxes[0]), /*#__PURE__*/React__default.createElement("option", {
247
253
  value: projectionAxes[1]
248
254
  }, histogram["f" + projectionAxes[1] + "axis"].fTitle ? histogram["f" + projectionAxes[1] + "axis"].fTitle : projectionAxes[1])));
249
255
  };
250
256
 
251
- var handleSubscription = function handleSubscription(data) {
252
- setData(data);
253
-
257
+ var createAndDisplayProjection = function createAndDisplayProjection() {
254
258
  if (projections !== null) {
255
259
  jsrootService.openTH1Projection(axis, {
256
260
  obj: histogram,
257
- bin: data
261
+ bin: selectedBin
258
262
  }, 'projectionContainer', projectionAxes, projections, projIndex);
259
263
  } else {
260
264
  jsrootService.createTH1Projection(axis, {
261
265
  obj: histogram,
262
- bin: data
266
+ bin: selectedBin
263
267
  }, 'projectionContainer', projectionAxes);
264
268
  setTimeout(function () {
265
269
  jsrootService.displayImageOfProjection('projectionContainer', 'th-mapping', '500px', '500px');
@@ -269,24 +273,21 @@ var JsrootHistogram = function JsrootHistogram(_ref) {
269
273
 
270
274
  React.useEffect(function () {
271
275
  jsrootService.jsrootLibrary = window.JSROOT;
276
+ setSelectedBin(null);
272
277
  subscription = jsrootSubject.getServiceEvent().subscribe(handleSubscription);
273
278
  return function () {
274
279
  return subscription.unsubscribe();
275
280
  };
276
- }, [axis, projections, histogram]);
277
-
278
- if (data !== null) {
279
- return /*#__PURE__*/React__default.createElement("div", {
280
- style: styles.box
281
- }, projections === null && renderForm(), /*#__PURE__*/React__default.createElement("div", {
282
- id: "projectionContainer",
283
- style: styles.projection
284
- }));
285
- } else {
286
- return /*#__PURE__*/React__default.createElement("div", {
287
- style: styles.box
288
- }, /*#__PURE__*/React__default.createElement("h3", null, "Empty"));
289
- }
281
+ }, [histogram]);
282
+ React.useEffect(function () {
283
+ if (selectedBin != null) createAndDisplayProjection();
284
+ }, [axis, selectedBin, projections]);
285
+ return /*#__PURE__*/React__default.createElement("div", {
286
+ style: styles.box
287
+ }, projections === null && selectedBin !== null && renderForm(), /*#__PURE__*/React__default.createElement("div", {
288
+ id: "projectionContainer",
289
+ style: styles.projection
290
+ }));
290
291
  };
291
292
 
292
293
  var _subject$1 = /*#__PURE__*/_classPrivateFieldLooseKey("subject");
@@ -325,1264 +326,1352 @@ var CameraSubject = /*#__PURE__*/function () {
325
326
 
326
327
  var cameraSubject = new CameraSubject();
327
328
 
328
- var NdmVrCamera = function NdmVrCamera() {
329
- var subscription;
330
- var offset = 30;
331
-
332
- var _useState = React.useState(0),
333
- rotation = _useState[0],
334
- setRotation = _useState[1];
329
+ var _cameraWrapper = /*#__PURE__*/_classPrivateFieldLooseKey("cameraWrapper");
335
330
 
336
- var _useState2 = React.useState(null),
337
- prevPosition = _useState2[0],
338
- setPrevPosition = _useState2[1];
331
+ var _setVerticalOffset = /*#__PURE__*/_classPrivateFieldLooseKey("setVerticalOffset");
339
332
 
340
- var _useState3 = React.useState('keyboard'),
341
- inputDevice = _useState3[0],
342
- setInputDevice = _useState3[1];
333
+ var CameraService = function CameraService() {
334
+ var _this = this;
343
335
 
344
- var _useState4 = React.useState(false),
345
- show = _useState4[0],
346
- setShow = _useState4[1];
336
+ Object.defineProperty(this, _cameraWrapper, {
337
+ writable: true,
338
+ value: void 0
339
+ });
347
340
 
348
- var _useState5 = React.useState(false),
349
- showProjection = _useState5[0],
350
- setShowProjection = _useState5[1];
341
+ this.verticalMoveCamera = function (moveUp, speed) {
342
+ if (_classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper] === null) _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper] = document.getElementById('cameraWrapper');
351
343
 
352
- var handleSubscription = function handleSubscription(data) {
353
- if (data.device) {
354
- if (inputDevice !== data.device) setInputDevice(data.device);
355
- setShow(!show);
356
- } else if (data === 'shift') {
357
- compileRotation();
358
- } else if (data === 'show') {
359
- setShowProjection(!showProjection);
344
+ if (_classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper] !== null) {
345
+ if (moveUp) {
346
+ _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].object3D.position.y += speed;
347
+ } else {
348
+ if (_classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].object3D.position.y > 0) _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].object3D.position.y -= speed;
349
+ }
360
350
  }
361
351
  };
362
352
 
363
- var compileRotation = function compileRotation() {
364
- var currentRotation = rotation + 90;
365
- if (currentRotation >= 360) currentRotation = 0;
366
- setRotation(currentRotation);
367
- };
353
+ this.horizontalMoveCamera = function (axis, increment, speed) {
354
+ if (_classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper] === null) _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper] = document.getElementById('cameraWrapper');
368
355
 
369
- var renderProjectionsBanners = function renderProjectionsBanners() {
370
- return /*#__PURE__*/React__default.createElement("a-entity", {
371
- position: prevPosition === null ? "0 " + offset + " 0" : prevPosition.x + " " + offset + " " + prevPosition.z,
372
- animation__rotation: "property: rotation; to: 0 " + rotation + " 0; dur: 1000; easing: linear;",
373
- material: "color: white"
374
- }, /*#__PURE__*/React__default.createElement("a-entity", {
375
- geometry: "primitive: box; width: 50; height: 10; depth: 0.1;",
376
- position: "-30 28 0",
377
- rotation: "45 90 0",
378
- material: "color:white;"
379
- }, /*#__PURE__*/React__default.createElement("a-text", {
380
- color: "black",
381
- width: 50,
382
- value: inputDevice === 'keyboard' ? 'Press C to show help panels' : 'Press Button X to show help panels',
383
- position: "-20 2.8 1"
384
- }), /*#__PURE__*/React__default.createElement("a-text", {
385
- color: "black",
386
- width: 50,
387
- value: inputDevice === 'keyboard' ? 'Press V to switch to histogram view' : 'Press Button Y to switch to histogram view',
388
- position: "-20 0 1"
389
- }), /*#__PURE__*/React__default.createElement("a-text", {
390
- color: "black",
391
- width: 50,
392
- value: inputDevice === 'keyboard' ? 'Press X to shift panels' : 'Press right Trigger to shift panels',
393
- position: "-20 -2.8 1"
394
- })), /*#__PURE__*/React__default.createElement("a-box", {
395
- id: "bannerId_1",
396
- scale: "80 50 2",
397
- animation__position: "property: position; from: 0 0 -60; to: 0 -1 -42; delay: 0; dur: 800; easing: linear;",
398
- material: "transparent:true"
399
- }), /*#__PURE__*/React__default.createElement("a-box", {
400
- scale: "80 52 2",
401
- animation__position: "property: position; from: 0 0 -60; to: 0 0 -42.5; delay: 0; dur: 800; easing: linear;",
402
- material: "color: white;"
403
- }), /*#__PURE__*/React__default.createElement("a-box", {
404
- id: "bannerId_2",
405
- scale: "80 50 2",
406
- animation__position: "property: position; from: 60 0 0; to: 42 -1 0; delay: 200; dur: 800; easing: linear;",
407
- rotation: "0 90 0",
408
- material: "transparent:true"
409
- }), /*#__PURE__*/React__default.createElement("a-box", {
410
- scale: "80 52 2",
411
- animation__position: "property: position; from: 60 0 0; to: 42.5 0 0; delay: 200; dur: 800; easing: linear;",
412
- rotation: "0 90 0",
413
- material: "color: white;"
414
- }), /*#__PURE__*/React__default.createElement("a-box", {
415
- id: "bannerId_3",
416
- scale: "80 50 2",
417
- animation__position: "property: position; from: 0 0 60; to: 0 -1 42; delay: 400; dur: 800; easing: linear;",
418
- material: "transparent:true"
419
- }), /*#__PURE__*/React__default.createElement("a-box", {
420
- scale: "80 52 2",
421
- animation__position: "property: position; from: 0 0 60; to: 0 0 42.5; delay: 400; dur: 800; easing: linear;",
422
- material: "color: white;"
423
- }), /*#__PURE__*/React__default.createElement("a-box", {
424
- id: "bannerId_4",
425
- scale: "80 50 2",
426
- animation__position: "property: position; from: -60 0 0; to: -42 -1 0; delay: 600; dur: 800; easing: linear;",
427
- rotation: "0 90 0",
428
- material: "transparent:true"
429
- }), /*#__PURE__*/React__default.createElement("a-box", {
430
- scale: "80 52 2",
431
- animation__position: "property: position; from: -60 0 0; to: -42.5 0 0; delay: 600; dur: 800; easing: linear;",
432
- rotation: "0 90 0",
433
- material: "color: white;"
434
- }));
356
+ if (_classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper] !== null) {
357
+ if (increment) {
358
+ _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].object3D.position[axis] += speed;
359
+ } else {
360
+ _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].object3D.position[axis] -= speed;
361
+ }
362
+ }
435
363
  };
436
364
 
437
- var renderBannersWithControls = function renderBannersWithControls() {
438
- if (inputDevice === 'keyboard') {
439
- return /*#__PURE__*/React__default.createElement("a-entity", {
440
- position: prevPosition === null ? "0 " + offset + " 0" : prevPosition.x + " " + offset + " " + prevPosition.z,
441
- animation__rotation: "property: rotation; to: 0 " + rotation + " 0; dur: 1000; easing: linear;",
442
- material: "color: white"
443
- }, /*#__PURE__*/React__default.createElement("a-entity", {
444
- geometry: "primitive: box; width: 50; height: 10; depth: 0.1;",
445
- position: "-30 28 0",
446
- rotation: "45 90 0",
447
- material: "color: white"
448
- }, /*#__PURE__*/React__default.createElement("a-text", {
449
- color: "black",
450
- width: "50",
451
- value: showProjection ? 'Press C to show help panels' : 'Press C to show projection panels',
452
- position: "-20 2.8 1"
453
- }), /*#__PURE__*/React__default.createElement("a-text", {
454
- color: "black",
455
- width: "50",
456
- value: "Press V to switch to histogram view",
457
- position: "-20 0 1"
458
- }), /*#__PURE__*/React__default.createElement("a-text", {
459
- color: "black",
460
- width: "50",
461
- value: "Press X to shift panels",
462
- position: "-20 -2.8 1"
463
- })), /*#__PURE__*/React__default.createElement("a-box", {
464
- scale: "80 50 2",
465
- animation__position: "property: position; from: -30 0 60; to: -30 0 30; delay: 0; dur: 800; easing: linear;",
466
- rotation: "0 -45 0",
467
- src: "./ndmvr/keyboardControls/keyboard.png"
468
- }), /*#__PURE__*/React__default.createElement("a-box", {
469
- scale: "80 50 2",
470
- animation__position: "property: position; from: -30 0 -60; to: -30 0 -30; delay: 200; dur: 800; easing: linear;",
471
- rotation: "0 45 0",
472
- src: "./ndmvr/keyboardControls/keyboard1.png"
473
- }), /*#__PURE__*/React__default.createElement("a-box", {
474
- scale: "80 50 2",
475
- animation__position: "property: position; from: 30 0 -60; to: 30 0 -30; delay: 400; dur: 800; easing: linear;",
476
- rotation: "0 -45 0",
477
- src: "./ndmvr/keyboardControls/keyboard2.png"
478
- }), /*#__PURE__*/React__default.createElement("a-box", {
479
- scale: "80 50 2",
480
- animation__position: "property: position; from: 30 0 60; to: 30 0 30; delay: 600; dur: 800; easing: linear;",
481
- rotation: " 0 45 0",
482
- src: "./ndmvr/keyboardControls/keyboard3.png"
483
- }));
484
- } else {
485
- return /*#__PURE__*/React__default.createElement("a-entity", {
486
- position: prevPosition === null ? "0 " + offset + " 0" : prevPosition.x + " " + offset + " " + prevPosition.z,
487
- animation__rotation: "property: rotation; to: 0 " + rotation + " 0; dur: 1000; easing: linear;"
488
- }, /*#__PURE__*/React__default.createElement("a-entity", {
489
- geometry: "primitive: box; width: 50; height: 10; depth: 0.1;",
490
- position: "-30 28 0",
491
- rotation: "45 90 0",
492
- material: "color: white"
493
- }, /*#__PURE__*/React__default.createElement("a-text", {
494
- color: "black",
495
- width: "50",
496
- value: showProjection ? 'Press Button X to show help panels' : 'Press Button X to show projection panels',
497
- position: "-20 2.8 1"
498
- }), /*#__PURE__*/React__default.createElement("a-text", {
499
- color: "black",
500
- width: "50",
501
- value: "Press Button Y to switch to histogram view",
502
- position: "-20 0 1"
503
- }), /*#__PURE__*/React__default.createElement("a-text", {
504
- color: "black",
505
- width: "50",
506
- value: "Press right Trigger to shift panels",
507
- position: "-20 -2.8 1"
508
- })), /*#__PURE__*/React__default.createElement("a-box", {
509
- scale: "80 50 2",
510
- animation__position: "property: position; from: -35 0 60; to: -32 0 32; delay: 0; dur: 800; easing: linear;",
511
- rotation: "-10 -45 0",
512
- src: "./ndmvr/oculusControls/oculus.png"
513
- }), /*#__PURE__*/React__default.createElement("a-box", {
514
- scale: "80 50 2",
515
- animation__position: "property: position; from: -35 0 -60; to: -32 0 -32; delay: 200; dur: 800; easing: linear;",
516
- rotation: "10 45 0",
517
- src: "./ndmvr/oculusControls/oculus2.png"
518
- }), /*#__PURE__*/React__default.createElement("a-box", {
519
- scale: "80 50 2",
520
- animation__position: "property: position; from: 35 0 -60; to: 32 0 -32; delay: 400; dur: 800; easing: linear;",
521
- rotation: "10 -45 0",
522
- src: "./ndmvr/oculusControls/oculus1.png"
523
- }), /*#__PURE__*/React__default.createElement("a-box", {
524
- scale: "80 50 2",
525
- animation__position: "property: position; from: 35 0 60; to: 32 0 32; delay: 600; dur: 800; easing: linear;",
526
- rotation: "-10 45 0",
527
- src: "./ndmvr/oculusControls/oculus3.png"
528
- }));
365
+ Object.defineProperty(this, _setVerticalOffset, {
366
+ writable: true,
367
+ value: function value(elm, offset, rotation) {
368
+ if (_classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper] !== null && elm !== null) {
369
+ var newXPos = elm.object3D.position.x + 1 * elm.object3D.position.x;
370
+ var newZPos = elm.object3D.position.z + 1 * elm.object3D.position.z;
371
+ var newYPos = offset;
372
+
373
+ _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].setAttribute('animation', "property: position; to: " + (newXPos + 1) + " " + newYPos + " " + (newZPos + 1) + "; dur: 100;");
374
+
375
+ _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].setAttribute('animation__1', "property: rotation; to: " + _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].object3D.rotation.x + " " + rotation + " " + _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].object3D.rotation.z + "; dur: 100;");
376
+ }
529
377
  }
530
- };
378
+ });
531
379
 
532
- var hideMappingBanner = function hideMappingBanner() {
533
- var banner = document.getElementById('th-mapping');
534
- var background = document.getElementById('th-background');
380
+ this.setCameraPosition = function (offsets) {
381
+ if (_classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper] !== null) {
382
+ var newZPos = _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].object3D.position.y;
535
383
 
536
- if (banner !== undefined && background !== undefined) {
537
- banner.setAttribute('material', 'opacity', 0);
538
- background.setAttribute('material', 'opacity', 0);
384
+ if (offsets.zOffset !== undefined) {
385
+ newZPos = offsets.zOffset * 2;
386
+ }
387
+
388
+ var newXPos = offsets.xOffset + offsets.xOffset;
389
+ var newYPos = offsets.yOffset + offsets.yOffset;
390
+ setTimeout(function () {
391
+ _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].setAttribute('animation', "property: position; to: " + (newXPos - 3) + " " + newZPos + " " + (newYPos - 3) + "; dur: 40;");
392
+ }, 1800);
539
393
  }
540
394
  };
541
395
 
542
- var showMappingBanner = function showMappingBanner() {
543
- var banner = document.getElementById('th-mapping');
544
- var background = document.getElementById('th-background');
396
+ this.setPredefinedDownPosition = function () {
397
+ var labelElement = document.getElementById('downLabel');
545
398
 
546
- if (banner !== undefined && background !== undefined) {
547
- banner.setAttribute('material', 'opacity', 1);
548
- background.setAttribute('material', 'opacity', 1);
399
+ if (labelElement !== undefined) {
400
+ _classPrivateFieldLooseBase(_this, _setVerticalOffset)[_setVerticalOffset](labelElement, 0, 180);
549
401
  }
550
402
  };
551
403
 
552
- React.useEffect(function () {
553
- subscription = cameraSubject.getCameraSubject().subscribe(handleSubscription);
554
- return function () {
555
- return subscription.unsubscribe();
556
- };
557
- }, [show, showProjection, rotation]);
558
- React.useEffect(function () {
559
- var camera = document.getElementById('camera');
404
+ this.setPredefinedUpPosition = function () {
405
+ var labelElement = document.getElementById('upLabel');
560
406
 
561
- if (!show) {
562
- camera.object3D.position.y = 1.6;
407
+ if (labelElement !== undefined) {
408
+ _classPrivateFieldLooseBase(_this, _setVerticalOffset)[_setVerticalOffset](labelElement, 0, 0);
409
+ }
410
+ };
563
411
 
564
- if (prevPosition !== null) {
565
- camera.object3D.position.x = prevPosition.x;
566
- camera.object3D.position.z = prevPosition.z;
567
- camera.object3D.position.y = prevPosition.y;
568
- }
412
+ this.setPredefinedRightPosition = function () {
413
+ var labelElement = document.getElementById('rightLabel');
569
414
 
570
- showMappingBanner();
571
- } else {
572
- setPrevPosition({
573
- x: camera.object3D.position.x,
574
- y: camera.object3D.position.y,
575
- z: camera.object3D.position.z
576
- });
577
- camera.object3D.position.y = camera.object3D.position.y + offset;
578
- hideMappingBanner();
415
+ if (labelElement !== undefined) {
416
+ _classPrivateFieldLooseBase(_this, _setVerticalOffset)[_setVerticalOffset](labelElement, 0, 90);
579
417
  }
580
- }, [show, inputDevice]);
581
- React.useEffect(function () {
582
- if (showProjection) {
583
- jsrootService.displayImageOfProjection('projectionContainer', 'bannerId_1', '500px', '400px');
418
+ };
419
+
420
+ this.setPredefinedLeftPosition = function () {
421
+ var labelElement = document.getElementById('leftLabel');
422
+
423
+ if (labelElement !== undefined) {
424
+ _classPrivateFieldLooseBase(_this, _setVerticalOffset)[_setVerticalOffset](labelElement, 0, 270);
584
425
  }
585
- }, [showProjection]);
586
- return /*#__PURE__*/React__default.createElement("a-entity", {
587
- id: "cameraWrapper",
588
- rotation: "0 180 0",
589
- position: "0 2 0"
590
- }, show && !showProjection && renderBannersWithControls(), show && showProjection && renderProjectionsBanners(), /*#__PURE__*/React__default.createElement("a-camera", {
591
- id: "camera",
592
- "look-control": true,
593
- "wasd-controls-enabled": "acceleration:=50"
594
- }, /*#__PURE__*/React__default.createElement("a-entity", {
595
- cursor: "fuse: false; fuseTimeout: 2000;",
596
- raycaster: "objects: .clickable; showLine: false; far: 100;",
597
- animation__click: "property: scale; startEvents: click; from: 0.1 0.1 0.1; to: 1.4 1.4 1.4; dur: 150",
598
- animation__mouseenter: "property: scale; startEvents: mouseenter; from: 1 1 1; to: 1.4 1.4 1.4; dur: 180",
599
- animation__mouseleave: "property: scale; startEvents: mouseleave; from: 1.4 1.4 1.4; to: 1 1 1; dur: 180",
600
- line: "color: orange; opacity: 0.5",
601
- far: "100",
602
- position: "0 0 -1",
603
- geometry: "primitive: ring; radiusInner: 0.02; radiusOuter: 0.03",
604
- material: "color: white; shader: flat"
605
- }), /*#__PURE__*/React__default.createElement("a-entity", {
606
- "oculus-touch-controls": "hand: left",
607
- "left-controller-logging": true
608
- }), /*#__PURE__*/React__default.createElement("a-entity", {
609
- "oculus-touch-controls": "hand: right",
610
- "right-controller-logging": true
611
- })));
612
- };
426
+ };
613
427
 
614
- var _storage = /*#__PURE__*/_classPrivateFieldLooseKey("storage");
428
+ this.setPredefinedDownPositionWithOffset = function () {
429
+ var labelElement = document.getElementById('downLabel');
615
430
 
616
- var _camera = /*#__PURE__*/_classPrivateFieldLooseKey("camera");
431
+ if (labelElement !== undefined) {
432
+ _classPrivateFieldLooseBase(_this, _setVerticalOffset)[_setVerticalOffset](labelElement, 10, 180);
433
+ }
434
+ };
617
435
 
618
- var _selectedBins = /*#__PURE__*/_classPrivateFieldLooseKey("selectedBins");
436
+ this.setPredefinedUpPositionWithOffset = function () {
437
+ var labelElement = document.getElementById('upLabel');
619
438
 
620
- var _deleteCurrentBin = /*#__PURE__*/_classPrivateFieldLooseKey("deleteCurrentBin");
439
+ if (labelElement !== undefined) {
440
+ _classPrivateFieldLooseBase(_this, _setVerticalOffset)[_setVerticalOffset](labelElement, 10, 0);
441
+ }
442
+ };
621
443
 
622
- var NdmVrStorageService = /*#__PURE__*/function () {
623
- function NdmVrStorageService() {
624
- var _this = this;
444
+ this.setPredefinedRightPositionWithOffset = function () {
445
+ var labelElement = document.getElementById('rightLabel');
625
446
 
626
- Object.defineProperty(this, _storage, {
627
- writable: true,
628
- value: void 0
629
- });
630
- Object.defineProperty(this, _camera, {
447
+ if (labelElement !== undefined) {
448
+ _classPrivateFieldLooseBase(_this, _setVerticalOffset)[_setVerticalOffset](labelElement, 10, 90);
449
+ }
450
+ };
451
+
452
+ this.setPredefinedLeftPositionWithOffset = function () {
453
+ var labelElement = document.getElementById('leftLabel');
454
+
455
+ if (labelElement !== undefined) {
456
+ _classPrivateFieldLooseBase(_this, _setVerticalOffset)[_setVerticalOffset](labelElement, 10, 270);
457
+ }
458
+ };
459
+
460
+ _classPrivateFieldLooseBase(this, _cameraWrapper)[_cameraWrapper] = document.getElementById('cameraWrapper');
461
+ };
462
+
463
+ var _subject$2 = /*#__PURE__*/_classPrivateFieldLooseKey("subject");
464
+
465
+ var HistogramSubject = /*#__PURE__*/function () {
466
+ function HistogramSubject() {
467
+ Object.defineProperty(this, _subject$2, {
631
468
  writable: true,
632
469
  value: void 0
633
470
  });
634
- Object.defineProperty(this, _selectedBins, {
635
- writable: true,
636
- value: []
637
- });
638
- Object.defineProperty(this, _deleteCurrentBin, {
639
- writable: true,
640
- value: function value(binData) {
641
- return _classPrivateFieldLooseBase(_this, _selectedBins)[_selectedBins].filter(function (item) {
642
- return item.id !== binData.id;
643
- });
644
- }
645
- });
471
+ _classPrivateFieldLooseBase(this, _subject$2)[_subject$2] = new rxjs.Subject();
472
+ }
646
473
 
647
- this.containThisBin = function (binData) {
648
- var updatedArray = _classPrivateFieldLooseBase(_this, _selectedBins)[_selectedBins].filter(function (item) {
649
- return item.id === binData.id;
650
- });
474
+ var _proto = HistogramSubject.prototype;
651
475
 
652
- return updatedArray.length !== 0;
653
- };
476
+ _proto.changeHistogramSectionByOffset = function changeHistogramSectionByOffset(axis, histogramType, increment, defaultRange) {
477
+ _classPrivateFieldLooseBase(this, _subject$2)[_subject$2].next({
478
+ name: histogramType,
479
+ axis: axis,
480
+ increment: increment,
481
+ defaultRange: defaultRange
482
+ });
483
+ };
654
484
 
655
- this.storeBinToLocalStorage = function (binData) {
656
- if (!_this.containThisBin(binData)) {
657
- _classPrivateFieldLooseBase(_this, _selectedBins)[_selectedBins].push(binData);
485
+ _proto.changeHistogramFunction = function changeHistogramFunction(typeFunction, histogramType) {
486
+ _classPrivateFieldLooseBase(this, _subject$2)[_subject$2].next({
487
+ fFunction: typeFunction,
488
+ name: histogramType
489
+ });
490
+ };
658
491
 
659
- _classPrivateFieldLooseBase(_this, _storage)[_storage].setItem('selectedBins', JSON.stringify(_classPrivateFieldLooseBase(_this, _selectedBins)[_selectedBins]));
660
- }
661
- };
492
+ _proto.changeTypeOfBinMark = function changeTypeOfBinMark(value, histogramType) {
493
+ _classPrivateFieldLooseBase(this, _subject$2)[_subject$2].next({
494
+ binMarkMode: value,
495
+ name: histogramType
496
+ });
497
+ };
662
498
 
663
- this.deleteBinFromLocalStorage = function (binData) {
664
- if (_this.containThisBin(binData)) {
665
- _classPrivateFieldLooseBase(_this, _selectedBins)[_selectedBins] = _classPrivateFieldLooseBase(_this, _deleteCurrentBin)[_deleteCurrentBin](binData);
499
+ _proto.getChangedSection = function getChangedSection() {
500
+ return _classPrivateFieldLooseBase(this, _subject$2)[_subject$2].asObservable();
501
+ };
666
502
 
667
- _classPrivateFieldLooseBase(_this, _storage)[_storage].setItem('selectedBins', JSON.stringify(_classPrivateFieldLooseBase(_this, _selectedBins)[_selectedBins]));
668
- }
669
- };
503
+ return HistogramSubject;
504
+ }();
670
505
 
671
- this.getBinsFromLocalStorage = function () {
672
- var selectedBins = JSON.parse(_classPrivateFieldLooseBase(_this, _storage)[_storage].getItem('selectedBins'));
506
+ var histogramTH2Service = new HistogramSubject();
507
+ var histogramTH3Service = new HistogramSubject();
673
508
 
674
- if (selectedBins === null) {
675
- return [];
676
- } else {
677
- return selectedBins;
678
- }
679
- };
509
+ var _subject$3 = /*#__PURE__*/_classPrivateFieldLooseKey("subject");
680
510
 
681
- _classPrivateFieldLooseBase(this, _storage)[_storage] = window.localStorage;
682
- _classPrivateFieldLooseBase(this, _camera)[_camera] = document.getElementById('cameraWrapper');
683
- _classPrivateFieldLooseBase(this, _selectedBins)[_selectedBins] = this.getBinsFromLocalStorage();
511
+ var BinSubject = /*#__PURE__*/function () {
512
+ function BinSubject() {
513
+ Object.defineProperty(this, _subject$3, {
514
+ writable: true,
515
+ value: void 0
516
+ });
517
+ _classPrivateFieldLooseBase(this, _subject$3)[_subject$3] = new rxjs.Subject();
684
518
  }
685
519
 
686
- var _proto = NdmVrStorageService.prototype;
520
+ var _proto = BinSubject.prototype;
687
521
 
688
- _proto.storeCurrentBinToLocalStorage = function storeCurrentBinToLocalStorage(binData) {
689
- _classPrivateFieldLooseBase(this, _storage)[_storage].setItem('currentBin', JSON.stringify(binData));
522
+ _proto.saveSelectedBinToLocalStorage = function saveSelectedBinToLocalStorage() {
523
+ _classPrivateFieldLooseBase(this, _subject$3)[_subject$3].next(true);
690
524
  };
691
525
 
692
- _proto.getCurrentBinFromLocalStorage = function getCurrentBinFromLocalStorage() {
693
- var currentBin = JSON.parse(_classPrivateFieldLooseBase(this, _storage)[_storage].getItem('currentBin'));
694
-
695
- if (currentBin === undefined || currentBin === '') {
696
- return null;
697
- }
698
-
699
- return currentBin;
526
+ _proto.deleteBinFromLocalStorage = function deleteBinFromLocalStorage() {
527
+ _classPrivateFieldLooseBase(this, _subject$3)[_subject$3].next(false);
700
528
  };
701
529
 
702
- _proto.loadProperty = function loadProperty(property) {
703
- return JSON.parse(_classPrivateFieldLooseBase(this, _storage)[_storage].getItem(property));
530
+ _proto.getKeyboardEvent = function getKeyboardEvent() {
531
+ return _classPrivateFieldLooseBase(this, _subject$3)[_subject$3].asObservable();
704
532
  };
705
533
 
706
- _proto.storeProperty = function storeProperty(property, object) {
707
- _classPrivateFieldLooseBase(this, _storage)[_storage].setItem(property, JSON.stringify(object));
708
- };
534
+ return BinSubject;
535
+ }();
709
536
 
710
- _proto.initHistogramData = function initHistogramData(histogram) {
711
- if (histogram._typename.includes('TH3')) {
712
- this.storeTH3HistogramLimits(histogram);
713
- } else if (histogram._typename.includes('TH2')) {
714
- this.storeTH2HistogramLimits(histogram);
715
- }
716
- };
537
+ var binSubject = new BinSubject();
717
538
 
718
- _proto.storeTH2Offsets = function storeTH2Offsets(xOffset, yOffset, range) {
719
- var object = this.loadProperty('TH2');
720
- var section;
539
+ var keyPressed = {};
540
+ var cameraService = new CameraService();
541
+ var aframeObj;
542
+ var geoAttributes;
543
+ var toolsSelector = new rxjs.Subject();
544
+ var activeTool;
721
545
 
722
- if (object === null) {
723
- object = {};
724
- section = {
725
- name: 'TH2',
726
- xOffset: 1,
727
- yOffset: 1,
728
- range: 8
729
- };
730
- } else {
731
- section = {
732
- name: 'TH2',
733
- xOffset: xOffset,
734
- yOffset: yOffset,
735
- range: range
736
- };
737
- }
546
+ var handlePositioning = function handlePositioning(property, event) {
547
+ var difference = 0.2;
548
+ if (property.name === 'scale') difference = 0.01;else if (property.name === 'rotation') difference = 2;
738
549
 
739
- object.section = section;
740
- this.storeProperty('TH2', object);
741
- };
550
+ if (event.key === 'ArrowDown') {
551
+ property.xValue = property.xValue + difference;
552
+ } else if (event.key === 'ArrowUp') {
553
+ property.xValue = property.xValue - difference;
554
+ } else if (event.key === '=') {
555
+ property.yValue = property.yValue + difference;
556
+ } else if (event.key === '-') {
557
+ property.yValue = property.yValue - difference;
558
+ } else if (event.key === 'ArrowRight') {
559
+ property.zValue = property.zValue + difference;
560
+ } else if (event.key === 'ArrowLeft') {
561
+ property.zValue = property.zValue - difference;
562
+ }
742
563
 
743
- _proto.storeTH3Offsets = function storeTH3Offsets(xOffset, yOffset, zOffset, range) {
744
- var object = this.loadProperty('TH3');
745
- var section;
564
+ aframeObj.setAttribute(property.name, property.xValue + " " + property.yValue + " " + property.zValue);
565
+ };
746
566
 
747
- if (object === null) {
748
- object = {};
749
- section = {
750
- name: 'TH3',
751
- xOffset: 1,
752
- yOffset: 1,
753
- zOffset: 1,
754
- range: 4
755
- };
756
- } else {
757
- section = {
758
- name: 'TH3',
759
- xOffset: xOffset,
760
- yOffset: yOffset,
761
- zOffset: zOffset,
762
- range: range
763
- };
764
- }
567
+ var handleChangeHistogramSectionByDefaultRange = function handleChangeHistogramSectionByDefaultRange(event) {
568
+ if (event.key === 'k' || event.key === 'K') {
569
+ histogramTH2Service.changeHistogramSectionByOffset('yOffset', 'TH2', false, true);
570
+ histogramTH3Service.changeHistogramSectionByOffset('yOffset', 'TH3', false, true);
571
+ } else if (event.key === 'i' || event.key === 'I') {
572
+ histogramTH2Service.changeHistogramSectionByOffset('yOffset', 'TH2', true, true);
573
+ histogramTH3Service.changeHistogramSectionByOffset('yOffset', 'TH3', true, true);
574
+ } else if (event.key === 'u' || event.key === 'U') {
575
+ histogramTH3Service.changeHistogramSectionByOffset('zOffset', 'TH3', true, true);
576
+ } else if (event.key === 'o' || event.key === 'O') {
577
+ histogramTH3Service.changeHistogramSectionByOffset('zOffset', 'TH3', false, true);
578
+ } else if (event.key === 'l' || event.key === 'L') {
579
+ histogramTH2Service.changeHistogramSectionByOffset('xOffset', 'TH2', false, true);
580
+ histogramTH3Service.changeHistogramSectionByOffset('xOffset', 'TH3', false, true);
581
+ } else if (event.key === 'j' || event.key === 'J') {
582
+ histogramTH2Service.changeHistogramSectionByOffset('xOffset', 'TH2', true, true);
583
+ histogramTH3Service.changeHistogramSectionByOffset('xOffset', 'TH3', true, true);
584
+ }
585
+ };
765
586
 
766
- object.section = section;
767
- this.storeProperty('TH3', object);
768
- };
587
+ var handleChangeHistogramSectionByOwnRange = function handleChangeHistogramSectionByOwnRange(event) {
588
+ if (event.key === 'k' || event.key === 'K') {
589
+ histogramTH2Service.changeHistogramSectionByOffset('yOffset', 'TH2', false, false);
590
+ histogramTH3Service.changeHistogramSectionByOffset('yOffset', 'TH3', false, false);
591
+ } else if (event.key === 'i' || event.key === 'I') {
592
+ histogramTH2Service.changeHistogramSectionByOffset('yOffset', 'TH2', true, false);
593
+ histogramTH3Service.changeHistogramSectionByOffset('yOffset', 'TH3', true, false);
594
+ } else if (event.key === 'u' || event.key === 'U') {
595
+ histogramTH3Service.changeHistogramSectionByOffset('zOffset', 'TH3', true, false);
596
+ } else if (event.key === 'o' || event.key === 'O') {
597
+ histogramTH3Service.changeHistogramSectionByOffset('zOffset', 'TH3', false, false);
598
+ } else if (event.key === 'l' || event.key === 'L') {
599
+ histogramTH2Service.changeHistogramSectionByOffset('xOffset', 'TH2', false, false);
600
+ histogramTH3Service.changeHistogramSectionByOffset('xOffset', 'TH3', false, false);
601
+ } else if (event.key === 'j' || event.key === 'J') {
602
+ histogramTH2Service.changeHistogramSectionByOffset('xOffset', 'TH2', true, false);
603
+ histogramTH3Service.changeHistogramSectionByOffset('xOffset', 'TH3', true, false);
604
+ }
605
+ };
769
606
 
770
- _proto.storeOffsets = function storeOffsets(section) {
771
- if (section.name.includes('TH3') || section.name.includes('th3')) {
772
- this.storeTH3Offsets(section.xOffset, section.yOffset, section.zOffset, section.range);
773
- } else if (section.name.includes('TH2') || section.name.includes('th2')) {
774
- this.storeTH2Offsets(section.xOffset, section.yOffset, section.range);
775
- }
776
- };
607
+ var keyPressHandlerFunction = function keyPressHandlerFunction(event) {
608
+ keyPressed[event.key] = true;
777
609
 
778
- _proto.storeFilePath = function storeFilePath(filePath) {
779
- _classPrivateFieldLooseBase(this, _storage)[_storage].setItem('rootFile', filePath);
780
- };
610
+ if (keyPressed.Z || keyPressed.z) {
611
+ handlePositioning(geoAttributes[0], event);
612
+ }
781
613
 
782
- _proto.loadFilePath = function loadFilePath() {
783
- var filename = _classPrivateFieldLooseBase(this, _storage)[_storage].getItem('rootFile');
614
+ if (keyPressed.X || keyPressed.x) {
615
+ handlePositioning(geoAttributes[1], event);
616
+ }
784
617
 
785
- if (filename === null || filename === undefined) {
786
- return 'defaultHistogram';
787
- }
618
+ if (keyPressed.C || keyPressed.c) {
619
+ handlePositioning(geoAttributes[2], event);
620
+ }
788
621
 
789
- return filename;
790
- };
622
+ if (keyPressed.Shift) {
623
+ handleChangeHistogramSectionByOwnRange(event);
624
+ }
791
625
 
792
- _proto.loadTH2Offsets = function loadTH2Offsets() {
793
- var object = this.loadProperty('TH2');
626
+ handleChangeHistogramSectionByDefaultRange(event);
794
627
 
795
- if (object !== null) {
796
- return object.section;
797
- } else {
798
- return null;
799
- }
800
- };
628
+ if (event.key === ' ') {
629
+ cameraService.verticalMoveCamera(true, 0.3);
630
+ }
801
631
 
802
- _proto.loadTH3Offsets = function loadTH3Offsets() {
803
- var object = this.loadProperty('TH3');
632
+ if (event.shiftKey) {
633
+ cameraService.verticalMoveCamera(false, 0.3);
634
+ }
804
635
 
805
- if (object !== null) {
806
- return object.section;
807
- } else {
808
- return null;
809
- }
810
- };
636
+ if (event.key === '1') {
637
+ toolsSelector.next(1);
638
+ activeTool = 1;
639
+ }
811
640
 
812
- _proto.loadOffsets = function loadOffsets(type) {
813
- if (type.includes('TH3') || type.includes('th3')) {
814
- return this.loadTH3Offsets();
815
- } else if (type.includes('TH2') || type.includes('th2')) {
816
- return this.loadTH2Offsets();
817
- }
818
- };
641
+ if (event.key === '2') {
642
+ toolsSelector.next(2);
643
+ activeTool = 2;
644
+ }
819
645
 
820
- return NdmVrStorageService;
821
- }();
822
- var localStorageService = new NdmVrStorageService();
646
+ if (event.key === '3') {
647
+ toolsSelector.next(3);
648
+ activeTool = 3;
649
+ }
823
650
 
824
- var _subject$2 = /*#__PURE__*/_classPrivateFieldLooseKey("subject");
651
+ if (event.key === '4') {
652
+ toolsSelector.next(4);
653
+ activeTool = 4;
654
+ }
825
655
 
826
- var BinSubject = /*#__PURE__*/function () {
827
- function BinSubject() {
828
- Object.defineProperty(this, _subject$2, {
829
- writable: true,
830
- value: void 0
831
- });
832
- _classPrivateFieldLooseBase(this, _subject$2)[_subject$2] = new rxjs.Subject();
656
+ if (event.key === '5') {
657
+ toolsSelector.next(5);
658
+ activeTool = 5;
833
659
  }
834
660
 
835
- var _proto = BinSubject.prototype;
661
+ if (event.key === '6') {
662
+ toolsSelector.next(6);
663
+ activeTool = 6;
664
+ }
836
665
 
837
- _proto.saveSelectedBinToLocalStorage = function saveSelectedBinToLocalStorage() {
838
- _classPrivateFieldLooseBase(this, _subject$2)[_subject$2].next(true);
839
- };
666
+ if (event.key === '7') {
667
+ toolsSelector.next(7);
668
+ activeTool = 7;
669
+ }
840
670
 
841
- _proto.deleteBinFromLocalStorage = function deleteBinFromLocalStorage() {
842
- _classPrivateFieldLooseBase(this, _subject$2)[_subject$2].next(false);
843
- };
671
+ if (event.key === '8') {
672
+ toolsSelector.next(8);
673
+ activeTool = 8;
674
+ }
844
675
 
845
- _proto.getKeyboardEvent = function getKeyboardEvent() {
846
- return _classPrivateFieldLooseBase(this, _subject$2)[_subject$2].asObservable();
847
- };
676
+ if (event.key === '9') {
677
+ toolsSelector.next(9);
678
+ activeTool = 9;
679
+ }
848
680
 
849
- return BinSubject;
850
- }();
681
+ if (event.key === '0') {
682
+ toolsSelector.next(0);
683
+ activeTool = 0;
684
+ }
851
685
 
852
- var binSubject = new BinSubject();
686
+ if (event.key === 'Enter') {
687
+ binSubject.saveSelectedBinToLocalStorage();
688
+ ['th-mapping', 'bannerId_1', 'bannerId_2', 'bannerId_3', 'bannerId_4'].forEach(function (targetId) {
689
+ if (document.getElementById(targetId) !== null) {
690
+ jsrootService.displayImageOfProjection('projectionContainer', targetId, '500px', '400px');
691
+ }
692
+ });
693
+ }
853
694
 
854
- AFRAME.registerComponent('mouseevent', {
855
- init: function init() {
856
- var subscription;
857
- var el = this.el;
858
- var clickCount = 0;
859
- var checked = false;
860
- el.addEventListener('mouseenter', function setHover(evt) {
861
- var _this = this;
695
+ if (event.key === 'r' || event.key === 'R') {
696
+ binSubject.deleteBinFromLocalStorage();
697
+ }
862
698
 
863
- checked = false;
864
- var intersection = evt.detail.intersection;
865
- subscription = binSubject.getKeyboardEvent().subscribe(function (save) {
866
- if (save) {
867
- localStorageService.storeBinToLocalStorage(_this.userData);
868
- localStorageService.storeCurrentBinToLocalStorage(_this.userData);
869
- _this.userData.markedColor = _this.userData.selectColor;
699
+ if (event.key === 'm' || event.key === 'M') {
700
+ histogramTH2Service.changeHistogramFunction('feet', 'TH2');
701
+ }
870
702
 
871
- _this.setAttribute('material', 'opacity', '1');
703
+ if (event.key === 'n' || event.key === 'N') {
704
+ histogramTH2Service.changeHistogramFunction('default', 'TH2');
705
+ }
872
706
 
873
- jsrootSubject.showBinProjection(_this.userData);
874
- } else {
875
- localStorageService.deleteBinFromLocalStorage(_this.userData);
876
- _this.userData.markedColor = _this.userData.color;
707
+ if (event.key === 'c' || event.key === 'C') {
708
+ cameraSubject.setUserState();
709
+ }
877
710
 
878
- _this.setAttribute('material', 'opacity', '0.75');
879
- }
880
- });
711
+ if (event.key === 'v' || event.key === 'V') {
712
+ cameraSubject.setVisibilityOfBanners('keyboard');
713
+ }
881
714
 
882
- if (intersection.face.normal.x !== 0) {
883
- this.setAttribute('material', 'color', this.userData.axisZ);
884
- } else if (intersection.face.normal.y !== 0) {
885
- this.setAttribute('material', 'color', this.userData.axisY);
886
- } else {
887
- this.setAttribute('material', 'color', this.userData.axisX);
888
- }
715
+ if (event.key === 'x' || event.key === 'X') {
716
+ cameraSubject.shiftBanners();
717
+ }
889
718
 
890
- this.setAttribute('material', 'opacity', '1');
891
- });
892
- el.addEventListener('mouseleave', function setPassive() {
893
- subscription.unsubscribe();
719
+ if (event.key === 'x' || event.key === 'X') {
720
+ cameraSubject.shiftBanners();
721
+ }
722
+ };
894
723
 
895
- if (checked === false) {
896
- this.setAttribute('material', 'color', this.userData.markedColor);
897
- this.setAttribute('material', 'opacity', '0.75');
898
- }
724
+ var switchDisplayModeOnBin = function switchDisplayModeOnBin(event) {
725
+ event.preventDefault();
726
+ var binDisplayMode;
899
727
 
900
- clickCount = 0;
901
- });
902
- el.addEventListener('click', function setActive(evt) {
903
- clickCount = clickCount + 1;
904
- checked = false;
905
- setTimeout(function () {
906
- clickCount = 0;
907
- }, 600);
728
+ if (event.deltaY > 0) {
729
+ binDisplayMode = 1;
730
+ } else {
731
+ binDisplayMode = -1;
732
+ }
908
733
 
909
- if (clickCount === 2) {
910
- clickCount = 0;
911
- checked = true;
912
- this.setAttribute('material', 'color', '#99ff00');
913
- this.setAttribute('material', 'opacity', '1');
914
- var camera = document.getElementById('cameraWrapper');
734
+ histogramTH2Service.changeTypeOfBinMark(binDisplayMode, 'TH2');
735
+ histogramTH3Service.changeTypeOfBinMark(binDisplayMode, 'TH3');
736
+ };
915
737
 
916
- if (camera !== null) {
917
- camera.object3D.position.y = this.object3D.position.y + 0.4;
738
+ var getActiveTool = function getActiveTool() {
739
+ return activeTool;
740
+ };
918
741
 
919
- if (this.userData.content > 0.5) {
920
- camera.setAttribute('animation', "property: position; to: " + (-0.5 + this.object3D.position.x) + " " + this.object3D.position.y + " " + this.object3D.position.z + "\n ; dur: 600; easing: linear;");
921
- } else if (this.userData.content > 0.2) {
922
- camera.setAttribute('animation', "property: position; to: " + (-0.5 + this.object3D.position.x) + " " + (this.object3D.position.y + 0.1) + " " + (this.object3D.position.z + 0.5) + "\n ; dur: 600; easing: linear;");
923
- } else {
924
- camera.setAttribute('animation', "property: position; to: " + (this.object3D.position.x + 2) + " " + (this.object3D.position.y + 0.1) + " " + (this.object3D.position.z + 8.5) + "\n ; dur: 600; easing: linear;");
925
- }
926
- }
927
- } else if (clickCount === 1) {
928
- this.setAttribute('material', 'color', '#99ff00');
929
- this.setAttribute('material', 'opacity', '1');
930
- localStorageService.storeCurrentBinToLocalStorage(this.userData);
931
- jsrootSubject.showBinProjection(this.userData);
932
- }
742
+ var keyReleaseHandlerFunction = function keyReleaseHandlerFunction(event) {
743
+ delete keyPressed[event.key];
744
+ };
933
745
 
934
- var infoBanner = document.getElementById('th2-banner');
746
+ var initialKeyboardController = function initialKeyboardController(data, object) {
747
+ aframeObj = object;
748
+ geoAttributes = [data.position, data.scale, data.rotation];
935
749
 
936
- if (infoBanner === null) {
937
- infoBanner = document.getElementById('th3-banner');
938
- }
750
+ for (var i = 0; i < 3; i++) {
751
+ aframeObj.setAttribute(geoAttributes[i].name, geoAttributes[i].xValue + " " + geoAttributes[i].yValue + " " + geoAttributes[i].zValue);
752
+ }
753
+ };
939
754
 
940
- if (infoBanner !== null) {
941
- var planes = infoBanner.childNodes;
755
+ var keyboardUpdateCameraReference = function keyboardUpdateCameraReference() {
756
+ cameraService = new CameraService();
757
+ };
942
758
 
943
- if (this.userData.typeName === 'TH3' && planes.length === 5) {
944
- var zCor = "[" + this.userData.zTitle + "] [" + this.userData.zMin + "," + this.userData.zMax + "] " + (this.userData.binName !== '' ? this.userData.binName + '\n' : '\n');
945
- var xCor = "[" + this.userData.xTitle + "] [" + this.userData.xMin + "," + this.userData.xMax + "] " + (this.userData.binName !== '' ? this.userData.binName + '\n' : '\n');
946
- var yCor = "[" + this.userData.yTitle + "] [" + this.userData.yMin + "," + this.userData.yMax + "] " + (this.userData.binName !== '' ? this.userData.binName + '\n' : '\n');
947
- var content = "Content: " + this.userData.absoluteContent + " [" + this.userData.content + "]\n";
948
- planes[0].setAttribute('text', "value: " + content + "; color: " + this.userData.color + "; align: center; width: 30; height: auto;");
949
- planes[1].setAttribute('text', "value: " + xCor + "; color: " + this.userData.axisX + "; align: center; width: 30; height: auto;");
950
- planes[2].setAttribute('text', "value: " + yCor + "; color: " + this.userData.axisY + "; align: center; width: 30; height: auto;");
951
- planes[3].setAttribute('text', "value: " + zCor + "; color: " + this.userData.axisZ + "; align: center; width: 30; height: auto;");
952
- } else {
953
- var _content = "Content: " + this.userData.absoluteContent + " [" + this.userData.content + "]\n";
759
+ var _storage = /*#__PURE__*/_classPrivateFieldLooseKey("storage");
954
760
 
955
- var _xCor = "[" + this.userData.xTitle + "] [" + this.userData.xMin + "," + this.userData.xMax + "] " + (this.userData.binName !== '' ? this.userData.binName + '\n' : '\n');
761
+ var _camera = /*#__PURE__*/_classPrivateFieldLooseKey("camera");
956
762
 
957
- var _yCor = "[" + this.userData.yTitle + "] [" + this.userData.yMin + "," + this.userData.yMax + "] " + (this.userData.binName !== '' ? this.userData.binName + '\n' : '\n');
763
+ var _selectedBins = /*#__PURE__*/_classPrivateFieldLooseKey("selectedBins");
958
764
 
959
- planes[0].setAttribute('text', "value: " + _content + "; color: " + this.userData.color + "; align: center; baseline: center; width: 30; height: auto;");
960
- planes[1].setAttribute('text', "value: " + _xCor + "; color: " + this.userData.axisX + "; align: center; width: 30; height: auto;");
961
- planes[2].setAttribute('text', "value: " + _yCor + "; color: " + this.userData.axisY + "; align: center; width: 30; height: auto;");
962
- }
963
- } else {
964
- console.log('You dont have any information banner!!!');
765
+ var _deleteCurrentBin = /*#__PURE__*/_classPrivateFieldLooseKey("deleteCurrentBin");
766
+
767
+ var NdmVrStorageService = /*#__PURE__*/function () {
768
+ function NdmVrStorageService() {
769
+ var _this = this;
770
+
771
+ Object.defineProperty(this, _storage, {
772
+ writable: true,
773
+ value: void 0
774
+ });
775
+ Object.defineProperty(this, _camera, {
776
+ writable: true,
777
+ value: void 0
778
+ });
779
+ Object.defineProperty(this, _selectedBins, {
780
+ writable: true,
781
+ value: []
782
+ });
783
+ Object.defineProperty(this, _deleteCurrentBin, {
784
+ writable: true,
785
+ value: function value(binData) {
786
+ return _classPrivateFieldLooseBase(_this, _selectedBins)[_selectedBins].filter(function (item) {
787
+ return item.id !== binData.id;
788
+ });
965
789
  }
966
790
  });
967
- },
968
- update: function update() {
969
- var el = this.el;
970
- el.setAttribute('material', 'color', el.userData.markedColor);
971
- el.setAttribute('material', 'opacity', '0.75');
972
- }
973
- });
974
791
 
975
- AFRAME.registerComponent('binth2', {
976
- schema: {
977
- id: {
978
- type: 'string'
979
- },
980
- content: {
981
- "default": 0
982
- },
983
- absoluteContent: {
984
- "default": 0
985
- },
986
- binName: {
987
- "default": ''
988
- },
989
- xTitle: {
990
- type: 'string'
991
- },
992
- yTitle: {
993
- type: 'string'
994
- },
995
- xMin: {
996
- type: 'number'
997
- },
998
- yMin: {
999
- type: 'number'
1000
- },
1001
- xMax: {
1002
- type: 'number'
1003
- },
1004
- yMax: {
1005
- type: 'number'
1006
- },
1007
- xCenter: {
1008
- type: 'number'
1009
- },
1010
- yCenter: {
1011
- type: 'number'
1012
- },
1013
- xWidth: {
1014
- type: 'number'
1015
- },
1016
- yWidth: {
1017
- type: 'number'
1018
- },
1019
- color: {
1020
- type: 'string'
1021
- },
1022
- axisX: {
1023
- type: 'string'
1024
- },
1025
- axisY: {
1026
- type: 'string'
1027
- },
1028
- axisZ: {
1029
- type: 'string'
1030
- },
1031
- selectColor: {
1032
- type: 'string'
1033
- },
1034
- markedColor: {
1035
- type: 'string'
1036
- }
1037
- },
1038
- init: function init() {
1039
- var el = this.el;
1040
- el.userData = {
1041
- typeName: 'TH2',
1042
- id: this.data.id,
1043
- content: this.data.content,
1044
- absoluteContent: this.data.absoluteContent,
1045
- binName: this.data.binName,
1046
- xTitle: this.data.xTitle,
1047
- yTitle: this.data.yTitle,
1048
- xMin: this.data.xMin,
1049
- yMin: this.data.yMin,
1050
- xMax: this.data.xMax,
1051
- yMax: this.data.yMax,
1052
- xCenter: this.data.xCenter,
1053
- yCenter: this.data.yCenter,
1054
- xWidth: this.data.xWidth,
1055
- yWidth: this.data.yWidth,
1056
- color: this.data.color,
1057
- axisX: this.data.axisX,
1058
- axisY: this.data.axisY,
1059
- axisZ: this.data.axisZ,
1060
- selectColor: this.data.selectColor,
1061
- markedColor: this.data.markedColor
792
+ this.containThisBin = function (binData) {
793
+ var updatedArray = _classPrivateFieldLooseBase(_this, _selectedBins)[_selectedBins].filter(function (item) {
794
+ return item.id === binData.id;
795
+ });
796
+
797
+ return updatedArray.length !== 0;
1062
798
  };
1063
- },
1064
- update: function update() {
1065
- var el = this.el;
1066
- el.userData = {
1067
- typeName: 'TH2',
1068
- id: this.data.id,
1069
- content: this.data.content,
1070
- absoluteContent: this.data.absoluteContent,
1071
- binName: this.data.binName,
1072
- xTitle: this.data.xTitle,
1073
- yTitle: this.data.yTitle,
1074
- xMin: this.data.xMin,
1075
- yMin: this.data.yMin,
1076
- xMax: this.data.xMax,
1077
- yMax: this.data.yMax,
1078
- xCenter: this.data.xCenter,
1079
- yCenter: this.data.yCenter,
1080
- xWidth: this.data.xWidth,
1081
- yWidth: this.data.yWidth,
1082
- color: this.data.color,
1083
- axisX: this.data.axisX,
1084
- axisY: this.data.axisY,
1085
- axisZ: this.data.axisZ,
1086
- selectColor: this.data.selectColor,
1087
- markedColor: this.data.markedColor
799
+
800
+ this.storeBinToLocalStorage = function (binData) {
801
+ if (!_this.containThisBin(binData)) {
802
+ _classPrivateFieldLooseBase(_this, _selectedBins)[_selectedBins].push(binData);
803
+
804
+ _classPrivateFieldLooseBase(_this, _storage)[_storage].setItem('selectedBins', JSON.stringify(_classPrivateFieldLooseBase(_this, _selectedBins)[_selectedBins]));
805
+ }
1088
806
  };
1089
- }
1090
- });
1091
807
 
1092
- AFRAME.registerComponent('binth3', {
1093
- schema: {
1094
- id: {
1095
- type: 'string'
1096
- },
1097
- content: {
1098
- "default": 0
1099
- },
1100
- absoluteContent: {
1101
- "default": 0
1102
- },
1103
- binName: {
1104
- "default": ''
1105
- },
1106
- xTitle: {
1107
- type: 'string'
1108
- },
1109
- yTitle: {
1110
- type: 'string'
1111
- },
1112
- zTitle: {
1113
- type: 'string'
1114
- },
1115
- xMin: {
1116
- type: 'number'
1117
- },
1118
- yMin: {
1119
- type: 'number'
1120
- },
1121
- zMin: {
1122
- type: 'number'
1123
- },
1124
- xMax: {
1125
- type: 'number'
1126
- },
1127
- yMax: {
1128
- type: 'number'
1129
- },
1130
- zMax: {
1131
- type: 'number'
1132
- },
1133
- xCenter: {
1134
- type: 'number'
1135
- },
1136
- yCenter: {
1137
- type: 'number'
1138
- },
1139
- zCenter: {
1140
- type: 'number'
1141
- },
1142
- xWidth: {
1143
- type: 'number'
1144
- },
1145
- yWidth: {
1146
- type: 'number'
1147
- },
1148
- zWidth: {
1149
- type: 'number'
1150
- },
1151
- color: {
1152
- type: 'string'
1153
- },
1154
- axisX: {
1155
- type: 'string'
1156
- },
1157
- axisY: {
1158
- type: 'string'
1159
- },
1160
- axisZ: {
1161
- type: 'string'
1162
- },
1163
- selectColor: {
1164
- type: 'string'
1165
- },
1166
- markedColor: {
1167
- type: 'string'
1168
- }
1169
- },
1170
- init: function init() {
1171
- var el = this.el;
1172
- el.userData = {
1173
- typeName: 'TH3',
1174
- id: this.data.id,
1175
- content: this.data.content,
1176
- absoluteContent: this.data.absoluteContent,
1177
- binName: this.data.binName,
1178
- xTitle: this.data.xTitle,
1179
- yTitle: this.data.yTitle,
1180
- zTitle: this.data.zTitle,
1181
- xMin: this.data.xMin,
1182
- yMin: this.data.yMin,
1183
- zMin: this.data.zMin,
1184
- xMax: this.data.xMax,
1185
- yMax: this.data.yMax,
1186
- zMax: this.data.zMax,
1187
- xCenter: this.data.xCenter,
1188
- yCenter: this.data.yCenter,
1189
- zCenter: this.data.zCenter,
1190
- xWidth: this.data.xWidth,
1191
- yWidth: this.data.yWidth,
1192
- zWidth: this.data.zWidth,
1193
- color: this.data.color,
1194
- axisX: this.data.axisX,
1195
- axisY: this.data.axisY,
1196
- axisZ: this.data.axisZ,
1197
- selectColor: this.data.selectColor,
1198
- markedColor: this.data.markedColor
808
+ this.deleteBinFromLocalStorage = function (binData) {
809
+ if (_this.containThisBin(binData)) {
810
+ _classPrivateFieldLooseBase(_this, _selectedBins)[_selectedBins] = _classPrivateFieldLooseBase(_this, _deleteCurrentBin)[_deleteCurrentBin](binData);
811
+
812
+ _classPrivateFieldLooseBase(_this, _storage)[_storage].setItem('selectedBins', JSON.stringify(_classPrivateFieldLooseBase(_this, _selectedBins)[_selectedBins]));
813
+ }
1199
814
  };
1200
- },
1201
- update: function update() {
1202
- var el = this.el;
1203
- el.userData = {
1204
- typeName: 'TH3',
1205
- id: this.data.id,
1206
- content: this.data.content,
1207
- absoluteContent: this.data.absoluteContent,
1208
- binName: this.data.binName,
1209
- xTitle: this.data.xTitle,
1210
- yTitle: this.data.yTitle,
1211
- zTitle: this.data.zTitle,
1212
- xMin: this.data.xMin,
1213
- yMin: this.data.yMin,
1214
- zMin: this.data.zMin,
1215
- xMax: this.data.xMax,
1216
- yMax: this.data.yMax,
1217
- zMax: this.data.zMax,
1218
- xCenter: this.data.xCenter,
1219
- yCenter: this.data.yCenter,
1220
- zCenter: this.data.zCenter,
1221
- xWidth: this.data.xWidth,
1222
- yWidth: this.data.yWidth,
1223
- zWidth: this.data.zWidth,
1224
- color: this.data.color,
1225
- axisX: this.data.axisX,
1226
- axisY: this.data.axisY,
1227
- axisZ: this.data.axisZ,
1228
- selectColor: this.data.selectColor,
1229
- markedColor: this.data.markedColor
815
+
816
+ this.getBinsFromLocalStorage = function () {
817
+ var selectedBins = JSON.parse(_classPrivateFieldLooseBase(_this, _storage)[_storage].getItem('selectedBins'));
818
+
819
+ if (selectedBins === null) {
820
+ return [];
821
+ } else {
822
+ return selectedBins;
823
+ }
1230
824
  };
825
+
826
+ _classPrivateFieldLooseBase(this, _storage)[_storage] = window.localStorage;
827
+ _classPrivateFieldLooseBase(this, _camera)[_camera] = document.getElementById('cameraWrapper');
828
+ _classPrivateFieldLooseBase(this, _selectedBins)[_selectedBins] = this.getBinsFromLocalStorage();
1231
829
  }
1232
- });
1233
830
 
1234
- var _cameraWrapper = /*#__PURE__*/_classPrivateFieldLooseKey("cameraWrapper");
831
+ var _proto = NdmVrStorageService.prototype;
1235
832
 
1236
- var _setVerticalOffset = /*#__PURE__*/_classPrivateFieldLooseKey("setVerticalOffset");
833
+ _proto.storeCurrentBinToLocalStorage = function storeCurrentBinToLocalStorage(binData) {
834
+ _classPrivateFieldLooseBase(this, _storage)[_storage].setItem('currentBin', JSON.stringify(binData));
835
+ };
1237
836
 
1238
- var CameraService = function CameraService() {
1239
- var _this = this;
837
+ _proto.getCurrentBinFromLocalStorage = function getCurrentBinFromLocalStorage() {
838
+ var currentBin = JSON.parse(_classPrivateFieldLooseBase(this, _storage)[_storage].getItem('currentBin'));
1240
839
 
1241
- Object.defineProperty(this, _cameraWrapper, {
1242
- writable: true,
1243
- value: void 0
1244
- });
840
+ if (currentBin === undefined || currentBin === '') {
841
+ return null;
842
+ }
843
+
844
+ return currentBin;
845
+ };
846
+
847
+ _proto.loadProperty = function loadProperty(property) {
848
+ return JSON.parse(_classPrivateFieldLooseBase(this, _storage)[_storage].getItem(property));
849
+ };
850
+
851
+ _proto.storeProperty = function storeProperty(property, object) {
852
+ _classPrivateFieldLooseBase(this, _storage)[_storage].setItem(property, JSON.stringify(object));
853
+ };
854
+
855
+ _proto.initHistogramData = function initHistogramData(histogram) {
856
+ if (histogram._typename.includes('TH3')) {
857
+ this.storeTH3HistogramLimits(histogram);
858
+ } else if (histogram._typename.includes('TH2')) {
859
+ this.storeTH2HistogramLimits(histogram);
860
+ }
861
+ };
862
+
863
+ _proto.storeTH2Offsets = function storeTH2Offsets(xOffset, yOffset, range) {
864
+ var object = this.loadProperty('TH2');
865
+ var section;
866
+
867
+ if (object === null) {
868
+ object = {};
869
+ section = {
870
+ name: 'TH2',
871
+ xOffset: 1,
872
+ yOffset: 1,
873
+ range: 8
874
+ };
875
+ } else {
876
+ section = {
877
+ name: 'TH2',
878
+ xOffset: xOffset,
879
+ yOffset: yOffset,
880
+ range: range
881
+ };
882
+ }
883
+
884
+ object.section = section;
885
+ this.storeProperty('TH2', object);
886
+ };
1245
887
 
1246
- this.verticalMoveCamera = function (moveUp, speed) {
1247
- if (_classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper] === null) _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper] = document.getElementById('cameraWrapper');
888
+ _proto.storeTH3Offsets = function storeTH3Offsets(xOffset, yOffset, zOffset, range) {
889
+ var object = this.loadProperty('TH3');
890
+ var section;
1248
891
 
1249
- if (_classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper] !== null) {
1250
- if (moveUp) {
1251
- _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].object3D.position.y += speed;
1252
- } else {
1253
- if (_classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].object3D.position.y > 0) _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].object3D.position.y -= speed;
1254
- }
892
+ if (object === null) {
893
+ object = {};
894
+ section = {
895
+ name: 'TH3',
896
+ xOffset: 1,
897
+ yOffset: 1,
898
+ zOffset: 1,
899
+ range: 4
900
+ };
901
+ } else {
902
+ section = {
903
+ name: 'TH3',
904
+ xOffset: xOffset,
905
+ yOffset: yOffset,
906
+ zOffset: zOffset,
907
+ range: range
908
+ };
1255
909
  }
1256
- };
1257
910
 
1258
- this.horizontalMoveCamera = function (axis, increment, speed) {
1259
- if (_classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper] === null) _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper] = document.getElementById('cameraWrapper');
911
+ object.section = section;
912
+ this.storeProperty('TH3', object);
913
+ };
1260
914
 
1261
- if (_classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper] !== null) {
1262
- if (increment) {
1263
- _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].object3D.position[axis] += speed;
1264
- } else {
1265
- _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].object3D.position[axis] -= speed;
1266
- }
915
+ _proto.storeOffsets = function storeOffsets(section) {
916
+ if (section.name.includes('TH3') || section.name.includes('th3')) {
917
+ this.storeTH3Offsets(section.xOffset, section.yOffset, section.zOffset, section.range);
918
+ } else if (section.name.includes('TH2') || section.name.includes('th2')) {
919
+ this.storeTH2Offsets(section.xOffset, section.yOffset, section.range);
1267
920
  }
1268
921
  };
1269
922
 
1270
- Object.defineProperty(this, _setVerticalOffset, {
1271
- writable: true,
1272
- value: function value(elm, offset, rotation) {
1273
- if (_classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper] !== null && elm !== null) {
1274
- var newXPos = elm.object3D.position.x + 1 * elm.object3D.position.x;
1275
- var newZPos = elm.object3D.position.z + 1 * elm.object3D.position.z;
1276
- var newYPos = offset;
923
+ _proto.storeFilePath = function storeFilePath(filePath) {
924
+ _classPrivateFieldLooseBase(this, _storage)[_storage].setItem('rootFile', filePath);
925
+ };
1277
926
 
1278
- _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].setAttribute('animation', "property: position; to: " + (newXPos + 1) + " " + newYPos + " " + (newZPos + 1) + "; dur: 100;");
927
+ _proto.loadFilePath = function loadFilePath() {
928
+ var filename = _classPrivateFieldLooseBase(this, _storage)[_storage].getItem('rootFile');
1279
929
 
1280
- _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].setAttribute('animation__1', "property: rotation; to: " + _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].object3D.rotation.x + " " + rotation + " " + _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].object3D.rotation.z + "; dur: 100;");
1281
- }
930
+ if (filename === null || filename === undefined) {
931
+ return 'defaultHistogram';
1282
932
  }
1283
- });
1284
933
 
1285
- this.setCameraPosition = function (offsets) {
1286
- if (_classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper] !== null) {
1287
- var newZPos = _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].object3D.position.y;
934
+ return filename;
935
+ };
1288
936
 
1289
- if (offsets.zOffset !== undefined) {
1290
- newZPos = offsets.zOffset * 2;
1291
- }
937
+ _proto.loadTH2Offsets = function loadTH2Offsets() {
938
+ var object = this.loadProperty('TH2');
1292
939
 
1293
- var newXPos = offsets.xOffset + offsets.xOffset;
1294
- var newYPos = offsets.yOffset + offsets.yOffset;
1295
- setTimeout(function () {
1296
- _classPrivateFieldLooseBase(_this, _cameraWrapper)[_cameraWrapper].setAttribute('animation', "property: position; to: " + (newXPos - 3) + " " + newZPos + " " + (newYPos - 3) + "; dur: 40;");
1297
- }, 1800);
940
+ if (object !== null) {
941
+ return object.section;
942
+ } else {
943
+ return null;
1298
944
  }
1299
945
  };
1300
946
 
1301
- this.setPredefinedDownPosition = function () {
1302
- var labelElement = document.getElementById('downLabel');
947
+ _proto.loadTH3Offsets = function loadTH3Offsets() {
948
+ var object = this.loadProperty('TH3');
1303
949
 
1304
- if (labelElement !== undefined) {
1305
- _classPrivateFieldLooseBase(_this, _setVerticalOffset)[_setVerticalOffset](labelElement, 0, 180);
950
+ if (object !== null) {
951
+ return object.section;
952
+ } else {
953
+ return null;
1306
954
  }
1307
955
  };
1308
956
 
1309
- this.setPredefinedUpPosition = function () {
1310
- var labelElement = document.getElementById('upLabel');
1311
-
1312
- if (labelElement !== undefined) {
1313
- _classPrivateFieldLooseBase(_this, _setVerticalOffset)[_setVerticalOffset](labelElement, 0, 0);
957
+ _proto.loadOffsets = function loadOffsets(type) {
958
+ if (type.includes('TH3') || type.includes('th3')) {
959
+ return this.loadTH3Offsets();
960
+ } else if (type.includes('TH2') || type.includes('th2')) {
961
+ return this.loadTH2Offsets();
1314
962
  }
1315
963
  };
1316
964
 
1317
- this.setPredefinedRightPosition = function () {
1318
- var labelElement = document.getElementById('rightLabel');
965
+ return NdmVrStorageService;
966
+ }();
967
+ var localStorageService = new NdmVrStorageService();
1319
968
 
1320
- if (labelElement !== undefined) {
1321
- _classPrivateFieldLooseBase(_this, _setVerticalOffset)[_setVerticalOffset](labelElement, 0, 90);
1322
- }
1323
- };
969
+ var _subject$4 = /*#__PURE__*/_classPrivateFieldLooseKey("subject");
1324
970
 
1325
- this.setPredefinedLeftPosition = function () {
1326
- var labelElement = document.getElementById('leftLabel');
971
+ var BinDataDistributor = /*#__PURE__*/function () {
972
+ function BinDataDistributor() {
973
+ Object.defineProperty(this, _subject$4, {
974
+ writable: true,
975
+ value: void 0
976
+ });
977
+ _classPrivateFieldLooseBase(this, _subject$4)[_subject$4] = new rxjs.Subject();
978
+ }
1327
979
 
1328
- if (labelElement !== undefined) {
1329
- _classPrivateFieldLooseBase(_this, _setVerticalOffset)[_setVerticalOffset](labelElement, 0, 270);
1330
- }
1331
- };
980
+ var _proto = BinDataDistributor.prototype;
1332
981
 
1333
- this.setPredefinedDownPositionWithOffset = function () {
1334
- var labelElement = document.getElementById('downLabel');
982
+ _proto.sendDataOfTheSelectedBin = function sendDataOfTheSelectedBin(binData) {
983
+ _classPrivateFieldLooseBase(this, _subject$4)[_subject$4].next(binData);
984
+ };
1335
985
 
1336
- if (labelElement !== undefined) {
1337
- _classPrivateFieldLooseBase(_this, _setVerticalOffset)[_setVerticalOffset](labelElement, 10, 180);
1338
- }
986
+ _proto.getBinDistributor = function getBinDistributor() {
987
+ return _classPrivateFieldLooseBase(this, _subject$4)[_subject$4].asObservable();
1339
988
  };
1340
989
 
1341
- this.setPredefinedUpPositionWithOffset = function () {
1342
- var labelElement = document.getElementById('upLabel');
990
+ return BinDataDistributor;
991
+ }();
1343
992
 
1344
- if (labelElement !== undefined) {
1345
- _classPrivateFieldLooseBase(_this, _setVerticalOffset)[_setVerticalOffset](labelElement, 10, 0);
1346
- }
1347
- };
993
+ var binDataDistributor = new BinDataDistributor();
1348
994
 
1349
- this.setPredefinedRightPositionWithOffset = function () {
1350
- var labelElement = document.getElementById('rightLabel');
995
+ var binData = new rxjs.Subject();
996
+ AFRAME$1.registerComponent('mouseevent', {
997
+ init: function init() {
998
+ var subscription;
999
+ var el = this.el;
1000
+ var clickCount = 0;
1001
+ var checked = false;
1002
+ el.addEventListener('mouseenter', function setHover(evt) {
1003
+ var _this = this;
1351
1004
 
1352
- if (labelElement !== undefined) {
1353
- _classPrivateFieldLooseBase(_this, _setVerticalOffset)[_setVerticalOffset](labelElement, 10, 90);
1354
- }
1355
- };
1005
+ checked = false;
1006
+ var intersection = evt.detail.intersection;
1007
+ subscription = binSubject.getKeyboardEvent().subscribe(function (save) {
1008
+ if (save) {
1009
+ localStorageService.storeBinToLocalStorage(_this.userData);
1010
+ localStorageService.storeCurrentBinToLocalStorage(_this.userData);
1011
+ binDataDistributor.sendDataOfTheSelectedBin(_this.userData);
1012
+ _this.userData.markedColor = _this.userData.selectColor;
1356
1013
 
1357
- this.setPredefinedLeftPositionWithOffset = function () {
1358
- var labelElement = document.getElementById('leftLabel');
1014
+ _this.setAttribute('material', 'opacity', '0.70');
1359
1015
 
1360
- if (labelElement !== undefined) {
1361
- _classPrivateFieldLooseBase(_this, _setVerticalOffset)[_setVerticalOffset](labelElement, 10, 270);
1362
- }
1363
- };
1016
+ jsrootSubject.showBinProjection(_this.userData);
1017
+ } else {
1018
+ localStorageService.deleteBinFromLocalStorage(_this.userData);
1019
+ _this.userData.markedColor = _this.userData.color;
1364
1020
 
1365
- _classPrivateFieldLooseBase(this, _cameraWrapper)[_cameraWrapper] = document.getElementById('cameraWrapper');
1366
- };
1021
+ _this.setAttribute('material', 'opacity', '0.50');
1022
+ }
1023
+ });
1367
1024
 
1368
- var _subject$3 = /*#__PURE__*/_classPrivateFieldLooseKey("subject");
1025
+ if (intersection.face.normal.x !== 0) {
1026
+ this.setAttribute('material', 'color', this.userData.axisZ);
1027
+ } else if (intersection.face.normal.y !== 0) {
1028
+ this.setAttribute('material', 'color', this.userData.axisY);
1029
+ } else {
1030
+ this.setAttribute('material', 'color', this.userData.axisX);
1031
+ }
1369
1032
 
1370
- var HistogramSubject = /*#__PURE__*/function () {
1371
- function HistogramSubject() {
1372
- Object.defineProperty(this, _subject$3, {
1373
- writable: true,
1374
- value: void 0
1033
+ this.setAttribute('material', 'opacity', '0.70');
1375
1034
  });
1376
- _classPrivateFieldLooseBase(this, _subject$3)[_subject$3] = new rxjs.Subject();
1035
+ el.addEventListener('mouseleave', function setPassive() {
1036
+ subscription.unsubscribe();
1037
+
1038
+ if (checked === false) {
1039
+ this.setAttribute('material', 'color', this.userData.markedColor);
1040
+ this.setAttribute('material', 'opacity', '0.50');
1041
+ }
1042
+
1043
+ clickCount = 0;
1044
+ });
1045
+ el.addEventListener('click', function setActive(evt) {
1046
+ clickCount = clickCount + 1;
1047
+ checked = false;
1048
+ setTimeout(function () {
1049
+ clickCount = 0;
1050
+ }, 600);
1051
+
1052
+ if (clickCount === 2) {
1053
+ clickCount = 0;
1054
+ checked = true;
1055
+ this.setAttribute('material', 'color', '#99ff00');
1056
+ this.setAttribute('material', 'opacity', '1');
1057
+ var camera = document.getElementById('cameraWrapper');
1058
+
1059
+ if (camera !== null) {
1060
+ camera.object3D.position.y = this.object3D.position.y + 0.4;
1061
+
1062
+ if (this.userData.content > 0.5) {
1063
+ camera.setAttribute('animation', "property: position; to: " + (-0.5 + this.object3D.position.x) + " " + this.object3D.position.y + " " + this.object3D.position.z + "\n ; dur: 600; easing: linear;");
1064
+ } else if (this.userData.content > 0.2) {
1065
+ camera.setAttribute('animation', "property: position; to: " + (-0.5 + this.object3D.position.x) + " " + (this.object3D.position.y + 0.1) + " " + (this.object3D.position.z + 0.5) + "\n ; dur: 600; easing: linear;");
1066
+ } else {
1067
+ camera.setAttribute('animation', "property: position; to: " + (this.object3D.position.x + 2) + " " + (this.object3D.position.y + 0.1) + " " + (this.object3D.position.z + 8.5) + "\n ; dur: 600; easing: linear;");
1068
+ }
1069
+ }
1070
+ } else if (clickCount === 1) {
1071
+ this.setAttribute('material', 'color', '#99ff00');
1072
+ this.setAttribute('material', 'opacity', '1');
1073
+ localStorageService.storeCurrentBinToLocalStorage(this.userData);
1074
+ jsrootSubject.showBinProjection(this.userData);
1075
+
1076
+ switch (getActiveTool()) {
1077
+ case 1:
1078
+ binData.next(this.userData);
1079
+ break;
1080
+ }
1081
+ }
1082
+
1083
+ var infoBanner = document.getElementById('th2-banner');
1084
+
1085
+ if (infoBanner === null) {
1086
+ infoBanner = document.getElementById('th3-banner');
1087
+ }
1088
+
1089
+ if (infoBanner !== null) {
1090
+ var planes = infoBanner.childNodes;
1091
+
1092
+ if (this.userData.typeName === 'TH3' && planes.length === 5) {
1093
+ var zCor = "[" + this.userData.zTitle + "] [" + this.userData.zMin + "," + this.userData.zMax + "] " + (this.userData.binName !== '' ? this.userData.binName + '\n' : '\n');
1094
+ var xCor = "[" + this.userData.xTitle + "] [" + this.userData.xMin + "," + this.userData.xMax + "] " + (this.userData.binName !== '' ? this.userData.binName + '\n' : '\n');
1095
+ var yCor = "[" + this.userData.yTitle + "] [" + this.userData.yMin + "," + this.userData.yMax + "] " + (this.userData.binName !== '' ? this.userData.binName + '\n' : '\n');
1096
+ var content = "Content: " + this.userData.absoluteContent + " [" + this.userData.content + "]\n";
1097
+ planes[0].setAttribute('text', "value: " + content + "; color: " + this.userData.color + "; align: center; width: 30; height: auto;");
1098
+ planes[1].setAttribute('text', "value: " + xCor + "; color: " + this.userData.axisX + "; align: center; width: 30; height: auto;");
1099
+ planes[2].setAttribute('text', "value: " + yCor + "; color: " + this.userData.axisY + "; align: center; width: 30; height: auto;");
1100
+ planes[3].setAttribute('text', "value: " + zCor + "; color: " + this.userData.axisZ + "; align: center; width: 30; height: auto;");
1101
+ } else {
1102
+ var _content = "Content: " + this.userData.absoluteContent + " [" + this.userData.content + "]\n";
1103
+
1104
+ var _xCor = "[" + this.userData.xTitle + "] [" + this.userData.xMin + "," + this.userData.xMax + "] " + (this.userData.binName !== '' ? this.userData.binName + '\n' : '\n');
1105
+
1106
+ var _yCor = "[" + this.userData.yTitle + "] [" + this.userData.yMin + "," + this.userData.yMax + "] " + (this.userData.binName !== '' ? this.userData.binName + '\n' : '\n');
1107
+
1108
+ planes[0].setAttribute('text', "value: " + _content + "; color: " + this.userData.color + "; align: center; baseline: center; width: 30; height: auto;");
1109
+ planes[1].setAttribute('text', "value: " + _xCor + "; color: " + this.userData.axisX + "; align: center; width: 30; height: auto;");
1110
+ planes[2].setAttribute('text', "value: " + _yCor + "; color: " + this.userData.axisY + "; align: center; width: 30; height: auto;");
1111
+ }
1112
+ }
1113
+ });
1114
+ },
1115
+ update: function update() {
1116
+ var el = this.el;
1117
+ el.setAttribute('material', 'color', el.userData.markedColor);
1118
+ el.setAttribute('material', 'opacity', '0.75');
1377
1119
  }
1120
+ });
1378
1121
 
1379
- var _proto = HistogramSubject.prototype;
1122
+ var AFRAME = window.AFRAME;
1380
1123
 
1381
- _proto.changeHistogramSectionByOffset = function changeHistogramSectionByOffset(axis, histogramType, increment, defaultRange) {
1382
- _classPrivateFieldLooseBase(this, _subject$3)[_subject$3].next({
1383
- name: histogramType,
1384
- axis: axis,
1385
- increment: increment,
1386
- defaultRange: defaultRange
1387
- });
1388
- };
1124
+ var NdmVrCamera = function NdmVrCamera() {
1125
+ var subscription;
1126
+ var activeToolHighlight = '0 -0.75 -1';
1127
+ var binDataSubscription;
1389
1128
 
1390
- _proto.changeHistogramFunction = function changeHistogramFunction(typeFunction, histogramType) {
1391
- _classPrivateFieldLooseBase(this, _subject$3)[_subject$3].next({
1392
- fFunction: typeFunction,
1393
- name: histogramType
1394
- });
1395
- };
1129
+ var _useState = React.useState('value: Bin data:\nX: null\nY: null\nZ: null;color: black;'),
1130
+ selectedBinData = _useState[0],
1131
+ setSelectedBinData = _useState[1];
1396
1132
 
1397
- _proto.getChangedSection = function getChangedSection() {
1398
- return _classPrivateFieldLooseBase(this, _subject$3)[_subject$3].asObservable();
1399
- };
1133
+ var offset = 30;
1400
1134
 
1401
- return HistogramSubject;
1402
- }();
1135
+ var _useState2 = React.useState(0),
1136
+ rotation = _useState2[0],
1137
+ setRotation = _useState2[1];
1403
1138
 
1404
- var histogramTH2Service = new HistogramSubject();
1405
- var histogramTH3Service = new HistogramSubject();
1139
+ var _useState3 = React.useState(null),
1140
+ prevPosition = _useState3[0],
1141
+ setPrevPosition = _useState3[1];
1406
1142
 
1407
- var keyPressed = {};
1408
- var cameraService = new CameraService();
1409
- var aframeObj;
1410
- var geoAttributes;
1143
+ var _useState4 = React.useState('keyboard'),
1144
+ inputDevice = _useState4[0],
1145
+ setInputDevice = _useState4[1];
1411
1146
 
1412
- var handlePositioning = function handlePositioning(property, event) {
1413
- var difference = 0.2;
1414
- if (property.name === 'scale') difference = 0.01;else if (property.name === 'rotation') difference = 2;
1147
+ var _useState5 = React.useState(false),
1148
+ show = _useState5[0],
1149
+ setShow = _useState5[1];
1415
1150
 
1416
- if (event.key === 'ArrowDown') {
1417
- property.xValue = property.xValue + difference;
1418
- } else if (event.key === 'ArrowUp') {
1419
- property.xValue = property.xValue - difference;
1420
- } else if (event.key === '=') {
1421
- property.yValue = property.yValue + difference;
1422
- } else if (event.key === '-') {
1423
- property.yValue = property.yValue - difference;
1424
- } else if (event.key === 'ArrowRight') {
1425
- property.zValue = property.zValue + difference;
1426
- } else if (event.key === 'ArrowLeft') {
1427
- property.zValue = property.zValue - difference;
1428
- }
1151
+ var _useState6 = React.useState(false),
1152
+ showProjection = _useState6[0],
1153
+ setShowProjection = _useState6[1];
1429
1154
 
1430
- aframeObj.setAttribute(property.name, property.xValue + " " + property.yValue + " " + property.zValue);
1431
- };
1155
+ var _useState7 = React.useState(3),
1156
+ activeTool = _useState7[0],
1157
+ setActiveTool = _useState7[1];
1432
1158
 
1433
- var handleChangeHistogramSectionByDefaultRange = function handleChangeHistogramSectionByDefaultRange(event) {
1434
- if (event.key === 'k' || event.key === 'K') {
1435
- histogramTH2Service.changeHistogramSectionByOffset('yOffset', 'TH2', false, true);
1436
- histogramTH3Service.changeHistogramSectionByOffset('yOffset', 'TH3', false, true);
1437
- } else if (event.key === 'i' || event.key === 'I') {
1438
- histogramTH2Service.changeHistogramSectionByOffset('yOffset', 'TH2', true, true);
1439
- histogramTH3Service.changeHistogramSectionByOffset('yOffset', 'TH3', true, true);
1440
- } else if (event.key === 'u' || event.key === 'U') {
1441
- histogramTH3Service.changeHistogramSectionByOffset('zOffset', 'TH3', true, true);
1442
- } else if (event.key === 'o' || event.key === 'O') {
1443
- histogramTH3Service.changeHistogramSectionByOffset('zOffset', 'TH3', false, true);
1444
- } else if (event.key === 'l' || event.key === 'L') {
1445
- histogramTH2Service.changeHistogramSectionByOffset('xOffset', 'TH2', false, true);
1446
- histogramTH3Service.changeHistogramSectionByOffset('xOffset', 'TH3', false, true);
1447
- } else if (event.key === 'j' || event.key === 'J') {
1448
- histogramTH2Service.changeHistogramSectionByOffset('xOffset', 'TH2', true, true);
1449
- histogramTH3Service.changeHistogramSectionByOffset('xOffset', 'TH3', true, true);
1450
- }
1451
- };
1159
+ toolsSelector.subscribe(function (value) {
1160
+ setActiveTool(value);
1452
1161
 
1453
- var handleChangeHistogramSectionByOwnRange = function handleChangeHistogramSectionByOwnRange(event) {
1454
- if (event.key === 'k' || event.key === 'K') {
1455
- histogramTH2Service.changeHistogramSectionByOffset('yOffset', 'TH2', false, false);
1456
- histogramTH3Service.changeHistogramSectionByOffset('yOffset', 'TH3', false, false);
1457
- } else if (event.key === 'i' || event.key === 'I') {
1458
- histogramTH2Service.changeHistogramSectionByOffset('yOffset', 'TH2', true, false);
1459
- histogramTH3Service.changeHistogramSectionByOffset('yOffset', 'TH3', true, false);
1460
- } else if (event.key === 'u' || event.key === 'U') {
1461
- histogramTH3Service.changeHistogramSectionByOffset('zOffset', 'TH3', true, false);
1462
- } else if (event.key === 'o' || event.key === 'O') {
1463
- histogramTH3Service.changeHistogramSectionByOffset('zOffset', 'TH3', false, false);
1464
- } else if (event.key === 'l' || event.key === 'L') {
1465
- histogramTH2Service.changeHistogramSectionByOffset('xOffset', 'TH2', false, false);
1466
- histogramTH3Service.changeHistogramSectionByOffset('xOffset', 'TH3', false, false);
1467
- } else if (event.key === 'j' || event.key === 'J') {
1468
- histogramTH2Service.changeHistogramSectionByOffset('xOffset', 'TH2', true, false);
1469
- histogramTH3Service.changeHistogramSectionByOffset('xOffset', 'TH3', true, false);
1470
- }
1471
- };
1162
+ if (value === 1) {
1163
+ binDataSubscription = binData.subscribe(function (value) {
1164
+ return setSelectedBinData(String('value: Bin data:\n' + 'X: ' + value.xPos + '\n' + 'Y: ' + value.yPos + '\n' + 'Z: ' + value.zPos + '; color: black;'));
1165
+ });
1166
+ } else {
1167
+ if (binDataSubscription) binDataSubscription.unsubscribe();
1168
+ }
1169
+ });
1472
1170
 
1473
- var keyPressHandlerFunction = function keyPressHandlerFunction(event) {
1474
- keyPressed[event.key] = true;
1171
+ var handleSubscription = function handleSubscription(data) {
1172
+ if (data.device) {
1173
+ if (inputDevice !== data.device) {
1174
+ setInputDevice(data.device);
1175
+ }
1475
1176
 
1476
- if (keyPressed.Z || keyPressed.z) {
1477
- handlePositioning(geoAttributes[0], event);
1478
- }
1177
+ setShow(!show);
1178
+ } else if (data === 'shift') {
1179
+ compileRotation();
1180
+ } else if (data === 'show') {
1181
+ setShowProjection(!showProjection);
1182
+ }
1183
+ };
1479
1184
 
1480
- if (keyPressed.X || keyPressed.x) {
1481
- handlePositioning(geoAttributes[1], event);
1482
- }
1185
+ var compileRotation = function compileRotation() {
1186
+ var currentRotation = rotation + 90;
1187
+ if (currentRotation >= 360) currentRotation = 0;
1188
+ setRotation(currentRotation);
1189
+ };
1190
+
1191
+ var renderProjectionsBanners = function renderProjectionsBanners() {
1192
+ return /*#__PURE__*/React__default.createElement("a-entity", {
1193
+ position: prevPosition === null ? "0 " + offset + " 0" : prevPosition.x + " " + offset + " " + prevPosition.z,
1194
+ animation__rotation: "property: rotation; to: 0 " + rotation + " 0; dur: 1000; easing: linear;",
1195
+ material: "color: white"
1196
+ }, /*#__PURE__*/React__default.createElement("a-entity", {
1197
+ geometry: "primitive: box; width: 50; height: 10; depth: 0.1;",
1198
+ position: "-30 28 0",
1199
+ rotation: "45 90 0",
1200
+ material: "color:white;"
1201
+ }, /*#__PURE__*/React__default.createElement("a-text", {
1202
+ color: "black",
1203
+ width: 50,
1204
+ value: inputDevice === 'keyboard' ? 'Press C to show help panels' : 'Press Button X to show help panels',
1205
+ position: "-20 2.8 1"
1206
+ }), /*#__PURE__*/React__default.createElement("a-text", {
1207
+ color: "black",
1208
+ width: 50,
1209
+ value: inputDevice === 'keyboard' ? 'Press V to switch to histogram view' : 'Press Button Y to switch to histogram view',
1210
+ position: "-20 0 1"
1211
+ }), /*#__PURE__*/React__default.createElement("a-text", {
1212
+ color: "black",
1213
+ width: 50,
1214
+ value: inputDevice === 'keyboard' ? 'Press X to shift panels' : 'Press right Trigger to shift panels',
1215
+ position: "-20 -2.8 1"
1216
+ })), /*#__PURE__*/React__default.createElement("a-box", {
1217
+ id: "bannerId_1",
1218
+ scale: "80 50 2",
1219
+ animation__position: "property: position; from: 0 0 -60; to: 0 -1 -42; delay: 0; dur: 800; easing: linear;",
1220
+ material: "transparent:true"
1221
+ }), /*#__PURE__*/React__default.createElement("a-box", {
1222
+ scale: "80 52 2",
1223
+ animation__position: "property: position; from: 0 0 -60; to: 0 0 -42.5; delay: 0; dur: 800; easing: linear;",
1224
+ material: "color: white;"
1225
+ }), /*#__PURE__*/React__default.createElement("a-box", {
1226
+ id: "bannerId_2",
1227
+ scale: "80 50 2",
1228
+ animation__position: "property: position; from: 60 0 0; to: 42 -1 0; delay: 200; dur: 800; easing: linear;",
1229
+ rotation: "0 90 0",
1230
+ material: "transparent:true"
1231
+ }), /*#__PURE__*/React__default.createElement("a-box", {
1232
+ scale: "80 52 2",
1233
+ animation__position: "property: position; from: 60 0 0; to: 42.5 0 0; delay: 200; dur: 800; easing: linear;",
1234
+ rotation: "0 90 0",
1235
+ material: "color: white;"
1236
+ }), /*#__PURE__*/React__default.createElement("a-box", {
1237
+ id: "bannerId_3",
1238
+ scale: "80 50 2",
1239
+ animation__position: "property: position; from: 0 0 60; to: 0 -1 42; delay: 400; dur: 800; easing: linear;",
1240
+ material: "transparent:true"
1241
+ }), /*#__PURE__*/React__default.createElement("a-box", {
1242
+ scale: "80 52 2",
1243
+ animation__position: "property: position; from: 0 0 60; to: 0 0 42.5; delay: 400; dur: 800; easing: linear;",
1244
+ material: "color: white;"
1245
+ }), /*#__PURE__*/React__default.createElement("a-box", {
1246
+ id: "bannerId_4",
1247
+ scale: "80 50 2",
1248
+ animation__position: "property: position; from: -60 0 0; to: -42 -1 0; delay: 600; dur: 800; easing: linear;",
1249
+ rotation: "0 90 0",
1250
+ material: "transparent:true"
1251
+ }), /*#__PURE__*/React__default.createElement("a-box", {
1252
+ scale: "80 52 2",
1253
+ animation__position: "property: position; from: -60 0 0; to: -42.5 0 0; delay: 600; dur: 800; easing: linear;",
1254
+ rotation: "0 90 0",
1255
+ material: "color: white;"
1256
+ }));
1257
+ };
1258
+
1259
+ var renderBannersWithControls = function renderBannersWithControls() {
1260
+ if (inputDevice === 'keyboard') {
1261
+ return /*#__PURE__*/React__default.createElement("a-entity", {
1262
+ position: prevPosition === null ? "0 " + offset + " 0" : prevPosition.x + " " + offset + " " + prevPosition.z,
1263
+ animation__rotation: "property: rotation; to: 0 " + rotation + " 0; dur: 1000; easing: linear;",
1264
+ material: "color: white"
1265
+ }, /*#__PURE__*/React__default.createElement("a-entity", {
1266
+ geometry: "primitive: box; width: 50; height: 10; depth: 0.1;",
1267
+ position: "-30 28 0",
1268
+ rotation: "45 90 0",
1269
+ material: "color: white"
1270
+ }, /*#__PURE__*/React__default.createElement("a-text", {
1271
+ color: "black",
1272
+ width: "50",
1273
+ value: showProjection ? 'Press C to show help panels' : 'Press C to show projection panels',
1274
+ position: "-20 2.8 1"
1275
+ }), /*#__PURE__*/React__default.createElement("a-text", {
1276
+ color: "black",
1277
+ width: "50",
1278
+ value: "Press V to switch to histogram view",
1279
+ position: "-20 0 1"
1280
+ }), /*#__PURE__*/React__default.createElement("a-text", {
1281
+ color: "black",
1282
+ width: "50",
1283
+ value: "Press X to shift panels",
1284
+ position: "-20 -2.8 1"
1285
+ })), /*#__PURE__*/React__default.createElement("a-box", {
1286
+ scale: "80 50 2",
1287
+ animation__position: "property: position; from: -30 0 60; to: -30 0 30; delay: 0; dur: 800; easing: linear;",
1288
+ rotation: "0 -45 0",
1289
+ src: "./ndmvr/keyboardControls/keyboard.png"
1290
+ }), /*#__PURE__*/React__default.createElement("a-box", {
1291
+ scale: "80 50 2",
1292
+ animation__position: "property: position; from: -30 0 -60; to: -30 0 -30; delay: 200; dur: 800; easing: linear;",
1293
+ rotation: "0 45 0",
1294
+ src: "./ndmvr/keyboardControls/keyboard1.png"
1295
+ }), /*#__PURE__*/React__default.createElement("a-box", {
1296
+ scale: "80 50 2",
1297
+ animation__position: "property: position; from: 30 0 -60; to: 30 0 -30; delay: 400; dur: 800; easing: linear;",
1298
+ rotation: "0 -45 0",
1299
+ src: "./ndmvr/keyboardControls/keyboard2.png"
1300
+ }), /*#__PURE__*/React__default.createElement("a-box", {
1301
+ scale: "80 50 2",
1302
+ animation__position: "property: position; from: 30 0 60; to: 30 0 30; delay: 600; dur: 800; easing: linear;",
1303
+ rotation: " 0 45 0",
1304
+ src: "./ndmvr/keyboardControls/keyboard3.png"
1305
+ }));
1306
+ } else {
1307
+ return /*#__PURE__*/React__default.createElement("a-entity", {
1308
+ position: prevPosition === null ? "0 " + offset + " 0" : prevPosition.x + " " + offset + " " + prevPosition.z,
1309
+ animation__rotation: "property: rotation; to: 0 " + rotation + " 0; dur: 1000; easing: linear;"
1310
+ }, /*#__PURE__*/React__default.createElement("a-entity", {
1311
+ geometry: "primitive: box; width: 50; height: 10; depth: 0.1;",
1312
+ position: "-30 28 0",
1313
+ rotation: "45 90 0",
1314
+ material: "color: white"
1315
+ }, /*#__PURE__*/React__default.createElement("a-text", {
1316
+ color: "black",
1317
+ width: "50",
1318
+ value: showProjection ? 'Press Button X to show help panels' : 'Press Button X to show projection panels',
1319
+ position: "-20 2.8 1"
1320
+ }), /*#__PURE__*/React__default.createElement("a-text", {
1321
+ color: "black",
1322
+ width: "50",
1323
+ value: "Press Button Y to switch to histogram view",
1324
+ position: "-20 0 1"
1325
+ }), /*#__PURE__*/React__default.createElement("a-text", {
1326
+ color: "black",
1327
+ width: "50",
1328
+ value: "Press right Trigger to shift panels",
1329
+ position: "-20 -2.8 1"
1330
+ })), /*#__PURE__*/React__default.createElement("a-box", {
1331
+ scale: "80 50 2",
1332
+ animation__position: "property: position; from: -35 0 60; to: -32 0 32; delay: 0; dur: 800; easing: linear;",
1333
+ rotation: "-10 -45 0",
1334
+ src: "./ndmvr/oculusControls/oculus.png"
1335
+ }), /*#__PURE__*/React__default.createElement("a-box", {
1336
+ scale: "80 50 2",
1337
+ animation__position: "property: position; from: -35 0 -60; to: -32 0 -32; delay: 200; dur: 800; easing: linear;",
1338
+ rotation: "10 45 0",
1339
+ src: "./ndmvr/oculusControls/oculus2.png"
1340
+ }), /*#__PURE__*/React__default.createElement("a-box", {
1341
+ scale: "80 50 2",
1342
+ animation__position: "property: position; from: 35 0 -60; to: 32 0 -32; delay: 400; dur: 800; easing: linear;",
1343
+ rotation: "10 -45 0",
1344
+ src: "./ndmvr/oculusControls/oculus1.png"
1345
+ }), /*#__PURE__*/React__default.createElement("a-box", {
1346
+ scale: "80 50 2",
1347
+ animation__position: "property: position; from: 35 0 60; to: 32 0 32; delay: 600; dur: 800; easing: linear;",
1348
+ rotation: "-10 45 0",
1349
+ src: "./ndmvr/oculusControls/oculus3.png"
1350
+ }));
1351
+ }
1352
+ };
1483
1353
 
1484
- if (keyPressed.C || keyPressed.c) {
1485
- handlePositioning(geoAttributes[2], event);
1486
- }
1354
+ var hideMappingBanner = function hideMappingBanner() {
1355
+ var banner = document.getElementById('th-mapping');
1487
1356
 
1488
- if (keyPressed.Shift) {
1489
- handleChangeHistogramSectionByOwnRange(event);
1490
- }
1357
+ if (banner !== undefined) {
1358
+ banner.setAttribute('material', 'opacity', 0);
1359
+ }
1360
+ };
1491
1361
 
1492
- handleChangeHistogramSectionByDefaultRange(event);
1362
+ var showMappingBanner = function showMappingBanner() {
1363
+ var banner = document.getElementById('th-mapping');
1493
1364
 
1494
- if (event.key === 'q' || event.key === 'Q') {
1495
- cameraService.verticalMoveCamera(true, 0.3);
1496
- }
1365
+ if (banner !== undefined) {
1366
+ banner.setAttribute('material', 'opacity', 1);
1367
+ }
1368
+ };
1497
1369
 
1498
- if (event.key === 'e' || event.key === 'E') {
1499
- cameraService.verticalMoveCamera(false, 0.3);
1500
- }
1370
+ React.useEffect(function () {
1371
+ subscription = cameraSubject.getCameraSubject().subscribe(handleSubscription);
1372
+ return function () {
1373
+ return subscription.unsubscribe();
1374
+ };
1375
+ }, [show, showProjection, rotation]);
1376
+ React.useEffect(function () {
1377
+ var camera = document.getElementById('camera');
1501
1378
 
1502
- if (event.key === '1') {
1503
- cameraService.setPredefinedDownPosition();
1504
- }
1379
+ if (!show) {
1380
+ camera.object3D.position.y = 1.6;
1505
1381
 
1506
- if (event.key === '2') {
1507
- cameraService.setPredefinedUpPosition();
1508
- }
1382
+ if (prevPosition !== null) {
1383
+ camera.object3D.position.x = prevPosition.x;
1384
+ camera.object3D.position.z = prevPosition.z;
1385
+ camera.object3D.position.y = prevPosition.y;
1386
+ }
1509
1387
 
1510
- if (event.key === '3') {
1511
- cameraService.setPredefinedRightPosition();
1512
- }
1388
+ showMappingBanner();
1389
+ } else {
1390
+ setPrevPosition({
1391
+ x: camera.object3D.position.x,
1392
+ y: camera.object3D.position.y,
1393
+ z: camera.object3D.position.z
1394
+ });
1395
+ camera.object3D.position.y = camera.object3D.position.y + offset;
1396
+ hideMappingBanner();
1397
+ }
1398
+ }, [show, inputDevice]);
1399
+ React.useEffect(function () {
1400
+ if (showProjection) {
1401
+ jsrootService.displayImageOfProjection('projectionContainer', 'bannerId_1', '500px', '400px');
1402
+ }
1403
+ }, [showProjection]);
1513
1404
 
1514
- if (event.key === '4') {
1515
- cameraService.setPredefinedLeftPosition();
1516
- }
1405
+ var renderActiveTool = function renderActiveTool() {
1406
+ switch (activeTool) {
1407
+ case 1:
1408
+ activeToolHighlight = '-0.675 -0.825 -1';
1409
+ break;
1517
1410
 
1518
- if (event.key === '5') {
1519
- cameraService.setPredefinedDownPositionWithOffset();
1520
- }
1411
+ case 2:
1412
+ activeToolHighlight = '-0.525 -0.825 -1';
1413
+ break;
1521
1414
 
1522
- if (event.key === '6') {
1523
- cameraService.setPredefinedUpPositionWithOffset();
1524
- }
1415
+ case 3:
1416
+ activeToolHighlight = '-0.375 -0.825 -1';
1417
+ break;
1525
1418
 
1526
- if (event.key === '7') {
1527
- cameraService.setPredefinedRightPositionWithOffset();
1528
- }
1419
+ case 4:
1420
+ activeToolHighlight = '-0.225 -0.825 -1';
1421
+ break;
1529
1422
 
1530
- if (event.key === '8') {
1531
- cameraService.setPredefinedLeftPositionWithOffset();
1532
- }
1423
+ case 5:
1424
+ activeToolHighlight = '-0.075 -0.825 -1';
1425
+ break;
1533
1426
 
1534
- if (event.key === 'Enter') {
1535
- binSubject.saveSelectedBinToLocalStorage();
1536
- ['th-mapping', 'bannerId_1', 'bannerId_2', 'bannerId_3', 'bannerId_4'].forEach(function (targetId) {
1537
- if (document.getElementById(targetId) !== null) {
1538
- jsrootService.displayImageOfProjection('projectionContainer', targetId, '500px', '400px');
1539
- }
1540
- });
1541
- }
1427
+ case 6:
1428
+ activeToolHighlight = '0.075 -0.825 -1';
1429
+ break;
1542
1430
 
1543
- if (event.key === 'r' || event.key === 'R') {
1544
- binSubject.deleteBinFromLocalStorage();
1545
- }
1431
+ case 7:
1432
+ activeToolHighlight = '0.225 -0.825 -1';
1433
+ break;
1546
1434
 
1547
- if (event.key === 'm' || event.key === 'M') {
1548
- histogramTH2Service.changeHistogramFunction('feet', 'TH2');
1549
- }
1435
+ case 8:
1436
+ activeToolHighlight = '0.375 -0.825 -1';
1437
+ break;
1550
1438
 
1551
- if (event.key === 'n' || event.key === 'N') {
1552
- histogramTH2Service.changeHistogramFunction('default', 'TH2');
1553
- }
1439
+ case 9:
1440
+ activeToolHighlight = '0.525 -0.825 -1';
1441
+ break;
1554
1442
 
1555
- if (event.key === 'c' || event.key === 'C') {
1556
- cameraSubject.setUserState();
1557
- }
1443
+ case 0:
1444
+ activeToolHighlight = '0.675 -0.825 -1';
1445
+ break;
1446
+ }
1558
1447
 
1559
- if (event.key === 'v' || event.key === 'V') {
1560
- cameraSubject.setVisibilityOfBanners('keyboard');
1561
- }
1448
+ var tools = ['info', 2, 3, 4, 5, 6, 7, 8, 9, 0];
1449
+ var toolNumXPos = -0.825;
1450
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, tools.map(function (tool) {
1451
+ var txt;
1452
+ toolNumXPos = toolNumXPos + 0.15;
1453
+ var txtPos = String(toolNumXPos + ' -0.78' + ' -1');
1454
+ if (tools.indexOf(tool) + 1 === activeTool) txt = String('value: ' + tool + '; color: #0F52BA;width:1.4;align:center');else txt = String('value: ' + tool + '; color: black;width:1;align:center');
1455
+ return /*#__PURE__*/React__default.createElement("a-entity", {
1456
+ key: tools.indexOf(tool),
1457
+ text: txt,
1458
+ position: txtPos,
1459
+ material: "shader: flat;"
1460
+ });
1461
+ }), /*#__PURE__*/React__default.createElement("a-entity", {
1462
+ geometry: "primitive: plane; height: 0.007; width: 0.17",
1463
+ position: activeToolHighlight,
1464
+ material: "color: #0F52BA;"
1465
+ }));
1466
+ };
1562
1467
 
1563
- if (event.key === 'x' || event.key === 'X') {
1564
- cameraSubject.shiftBanners();
1565
- }
1566
- };
1468
+ var renderOculusControls = function renderOculusControls() {
1469
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("a-entity", {
1470
+ "laser-controls": "hand: right",
1471
+ raycaster: "objects: .clickable; lineOpacity: 0.5; far: 20;"
1472
+ }), /*#__PURE__*/React__default.createElement("a-entity", {
1473
+ "oculus-touch-controls": "hand: left",
1474
+ "left-controller-logging": true
1475
+ }), /*#__PURE__*/React__default.createElement("a-entity", {
1476
+ "oculus-touch-controls": "hand: right",
1477
+ "right-controller-logging": true
1478
+ }));
1479
+ };
1567
1480
 
1568
- var keyReleaseHandlerFunction = function keyReleaseHandlerFunction(event) {
1569
- delete keyPressed[event.key];
1481
+ return /*#__PURE__*/React__default.createElement("a-entity", {
1482
+ id: "cameraWrapper",
1483
+ rotation: "0 -135 0",
1484
+ position: "-7 2 -7"
1485
+ }, show && !showProjection && renderBannersWithControls(), show && showProjection && renderProjectionsBanners(), /*#__PURE__*/React__default.createElement("a-camera", {
1486
+ id: "camera",
1487
+ "look-control": true,
1488
+ "wasd-controls-enabled": "acceleration:=50"
1489
+ }, /*#__PURE__*/React__default.createElement("a-entity", {
1490
+ geometry: "primitive: plane; height: 0.2; width: 2",
1491
+ position: "0 -0.825 -1",
1492
+ material: "color: #eee;shader: flat;"
1493
+ }), /*#__PURE__*/React__default.createElement("a-entity", {
1494
+ geometry: "primitive: plane; height: 0.001; width: 1.75",
1495
+ position: "0 -0.825 -1",
1496
+ material: "color: #aaa;shader: flat;"
1497
+ }), activeTool === 1 && /*#__PURE__*/React__default.createElement("a-entity", {
1498
+ text: selectedBinData,
1499
+ position: "-0.8 0.7 -1"
1500
+ }), renderActiveTool(), !AFRAME.utils.device.checkHeadsetConnected() && /*#__PURE__*/React__default.createElement("a-entity", {
1501
+ cursor: "fuse: false; fuseTimeout: 2000;",
1502
+ raycaster: "objects: .clickable; showLine: false; far: 100;",
1503
+ animation__click: "property: scale; startEvents: click; from: 0.1 0.1 0.1; to: 1.4 1.4 1.4; dur: 150",
1504
+ animation__mouseenter: "property: scale; startEvents: mouseenter; from: 1 1 1; to: 1.4 1.4 1.4; dur: 180",
1505
+ animation__mouseleave: "property: scale; startEvents: mouseleave; from: 1.4 1.4 1.4; to: 1 1 1; dur: 180",
1506
+ line: "color: orange; opacity: 0.5",
1507
+ far: "100",
1508
+ position: "0 0 -1",
1509
+ geometry: "primitive: ring; radiusInner: 0.02; radiusOuter: 0.03",
1510
+ material: "color: white; shader: flat"
1511
+ })), AFRAME.utils.device.checkHeadsetConnected() && renderOculusControls());
1570
1512
  };
1571
1513
 
1572
- var initialKeyboardController = function initialKeyboardController(data, object) {
1573
- aframeObj = object;
1574
- geoAttributes = [data.position, data.scale, data.rotation];
1575
-
1576
- for (var i = 0; i < 3; i++) {
1577
- aframeObj.setAttribute(geoAttributes[i].name, geoAttributes[i].xValue + " " + geoAttributes[i].yValue + " " + geoAttributes[i].zValue);
1514
+ AFRAME$1.registerComponent('binth', {
1515
+ schema: {
1516
+ id: {
1517
+ type: 'string'
1518
+ },
1519
+ typeName: {
1520
+ type: 'string'
1521
+ },
1522
+ content: {
1523
+ "default": 0
1524
+ },
1525
+ absoluteContent: {
1526
+ "default": 0
1527
+ },
1528
+ binName: {
1529
+ "default": ''
1530
+ },
1531
+ xTitle: {
1532
+ type: 'string'
1533
+ },
1534
+ yTitle: {
1535
+ type: 'string'
1536
+ },
1537
+ zTitle: {
1538
+ type: 'string'
1539
+ },
1540
+ xMin: {
1541
+ type: 'number'
1542
+ },
1543
+ yMin: {
1544
+ type: 'number'
1545
+ },
1546
+ zMin: {
1547
+ type: 'number'
1548
+ },
1549
+ xMax: {
1550
+ type: 'number'
1551
+ },
1552
+ yMax: {
1553
+ type: 'number'
1554
+ },
1555
+ zMax: {
1556
+ type: 'number'
1557
+ },
1558
+ xPos: {
1559
+ type: 'number'
1560
+ },
1561
+ yPos: {
1562
+ type: 'number'
1563
+ },
1564
+ zPos: {
1565
+ type: 'number'
1566
+ },
1567
+ xCenter: {
1568
+ type: 'number'
1569
+ },
1570
+ yCenter: {
1571
+ type: 'number'
1572
+ },
1573
+ zCenter: {
1574
+ type: 'number'
1575
+ },
1576
+ xWidth: {
1577
+ type: 'number'
1578
+ },
1579
+ yWidth: {
1580
+ type: 'number'
1581
+ },
1582
+ zWidth: {
1583
+ type: 'number'
1584
+ },
1585
+ color: {
1586
+ type: 'string'
1587
+ },
1588
+ axisX: {
1589
+ type: 'string'
1590
+ },
1591
+ axisY: {
1592
+ type: 'string'
1593
+ },
1594
+ axisZ: {
1595
+ type: 'string'
1596
+ },
1597
+ selectColor: {
1598
+ type: 'string'
1599
+ },
1600
+ markedColor: {
1601
+ type: 'string'
1602
+ }
1603
+ },
1604
+ init: function init() {
1605
+ var el = this.el;
1606
+ el.userData = {
1607
+ typeName: this.data.typeName,
1608
+ id: this.data.id,
1609
+ content: this.data.content,
1610
+ absoluteContent: this.data.absoluteContent,
1611
+ binName: this.data.binName,
1612
+ xTitle: this.data.xTitle,
1613
+ yTitle: this.data.yTitle,
1614
+ zTitle: this.data.zTitle,
1615
+ xMin: this.data.xMin,
1616
+ yMin: this.data.yMin,
1617
+ zMin: this.data.zMin,
1618
+ xMax: this.data.xMax,
1619
+ yMax: this.data.yMax,
1620
+ zMax: this.data.zMax,
1621
+ xPos: this.data.xPos,
1622
+ yPos: this.data.yPos,
1623
+ zPos: this.data.zPos,
1624
+ xCenter: this.data.xCenter,
1625
+ yCenter: this.data.yCenter,
1626
+ zCenter: this.data.zCenter,
1627
+ xWidth: this.data.xWidth,
1628
+ yWidth: this.data.yWidth,
1629
+ zWidth: this.data.zWidth,
1630
+ color: this.data.color,
1631
+ axisX: this.data.axisX,
1632
+ axisY: this.data.axisY,
1633
+ axisZ: this.data.axisZ,
1634
+ selectColor: this.data.selectColor,
1635
+ markedColor: this.data.markedColor
1636
+ };
1637
+ },
1638
+ update: function update() {
1639
+ var el = this.el;
1640
+ el.userData = {
1641
+ typeName: this.data.typeName,
1642
+ id: this.data.id,
1643
+ content: this.data.content,
1644
+ absoluteContent: this.data.absoluteContent,
1645
+ binName: this.data.binName,
1646
+ xTitle: this.data.xTitle,
1647
+ yTitle: this.data.yTitle,
1648
+ zTitle: this.data.zTitle,
1649
+ xMin: this.data.xMin,
1650
+ yMin: this.data.yMin,
1651
+ zMin: this.data.zMin,
1652
+ xMax: this.data.xMax,
1653
+ yMax: this.data.yMax,
1654
+ zMax: this.data.zMax,
1655
+ xPos: this.data.xPos,
1656
+ yPos: this.data.yPos,
1657
+ zPos: this.data.zPos,
1658
+ xCenter: this.data.xCenter,
1659
+ yCenter: this.data.yCenter,
1660
+ zCenter: this.data.zCenter,
1661
+ xWidth: this.data.xWidth,
1662
+ yWidth: this.data.yWidth,
1663
+ zWidth: this.data.zWidth,
1664
+ color: this.data.color,
1665
+ axisX: this.data.axisX,
1666
+ axisY: this.data.axisY,
1667
+ axisZ: this.data.axisZ,
1668
+ selectColor: this.data.selectColor,
1669
+ markedColor: this.data.markedColor
1670
+ };
1578
1671
  }
1579
- };
1580
-
1581
- var keyboardUpdateCameraReference = function keyboardUpdateCameraReference() {
1582
- cameraService = new CameraService();
1583
- };
1672
+ });
1584
1673
 
1585
- AFRAME.registerComponent('histogram-control', {
1674
+ AFRAME$1.registerComponent('histogram-control', {
1586
1675
  schema: {
1587
1676
  position: {
1588
1677
  name: 'position',
@@ -1608,13 +1697,14 @@ AFRAME.registerComponent('histogram-control', {
1608
1697
  initialKeyboardController(this.schema, el);
1609
1698
  document.addEventListener('keydown', keyPressHandlerFunction);
1610
1699
  document.addEventListener('keyup', keyReleaseHandlerFunction);
1700
+ document.addEventListener('wheel', switchDisplayModeOnBin);
1611
1701
  },
1612
1702
  update: function update() {
1613
1703
  keyboardUpdateCameraReference();
1614
1704
  }
1615
1705
  });
1616
1706
 
1617
- AFRAME.registerComponent('label-handler', {
1707
+ AFRAME$1.registerComponent('label-handler', {
1618
1708
  schema: {
1619
1709
  value: {
1620
1710
  type: 'string'
@@ -1927,6 +2017,14 @@ var _zWidth = /*#__PURE__*/_classPrivateFieldLooseKey("zWidth");
1927
2017
 
1928
2018
  var _range = /*#__PURE__*/_classPrivateFieldLooseKey("range");
1929
2019
 
2020
+ var _labels = /*#__PURE__*/_classPrivateFieldLooseKey("labels");
2021
+
2022
+ var _contentScale = /*#__PURE__*/_classPrivateFieldLooseKey("contentScale");
2023
+
2024
+ var _minDisplayedContent = /*#__PURE__*/_classPrivateFieldLooseKey("minDisplayedContent");
2025
+
2026
+ var _binScaleCoef = /*#__PURE__*/_classPrivateFieldLooseKey("binScaleCoef");
2027
+
1930
2028
  var _shift = /*#__PURE__*/_classPrivateFieldLooseKey("shift");
1931
2029
 
1932
2030
  var _previousBins = /*#__PURE__*/_classPrivateFieldLooseKey("previousBins");
@@ -1937,6 +2035,10 @@ var _checkBinState = /*#__PURE__*/_classPrivateFieldLooseKey("checkBinState");
1937
2035
 
1938
2036
  var _createAxisEntity = /*#__PURE__*/_classPrivateFieldLooseKey("createAxisEntity");
1939
2037
 
2038
+ var _createTH3Histogram = /*#__PURE__*/_classPrivateFieldLooseKey("createTH3Histogram");
2039
+
2040
+ var _createTH2Histogram = /*#__PURE__*/_classPrivateFieldLooseKey("createTH2Histogram");
2041
+
1940
2042
  var _optimizeBinContent = /*#__PURE__*/_classPrivateFieldLooseKey("optimizeBinContent");
1941
2043
 
1942
2044
  var _getValidOffset = /*#__PURE__*/_classPrivateFieldLooseKey("getValidOffset");
@@ -2017,7 +2119,27 @@ var HistogramReactFactory = /*#__PURE__*/function () {
2017
2119
  });
2018
2120
  Object.defineProperty(this, _range, {
2019
2121
  writable: true,
2020
- value: 4
2122
+ value: 8
2123
+ });
2124
+ Object.defineProperty(this, _labels, {
2125
+ writable: true,
2126
+ value: {
2127
+ xInitial: 0,
2128
+ yInitial: 0,
2129
+ zInitial: 0
2130
+ }
2131
+ });
2132
+ Object.defineProperty(this, _contentScale, {
2133
+ writable: true,
2134
+ value: 1
2135
+ });
2136
+ Object.defineProperty(this, _minDisplayedContent, {
2137
+ writable: true,
2138
+ value: 0
2139
+ });
2140
+ Object.defineProperty(this, _binScaleCoef, {
2141
+ writable: true,
2142
+ value: 2
2021
2143
  });
2022
2144
  Object.defineProperty(this, _shift, {
2023
2145
  writable: true,
@@ -2073,17 +2195,656 @@ var HistogramReactFactory = /*#__PURE__*/function () {
2073
2195
  Object.defineProperty(this, _createAxisEntity, {
2074
2196
  writable: true,
2075
2197
  value: function value(id, positionX, positionY, positionZ, rotationX, rotationY, rotationZ, width, height, _value, color, fontColor) {
2076
- return /*#__PURE__*/React__default.createElement("a-entity", {
2198
+ return {
2077
2199
  key: id + _classPrivateFieldLooseBase(_this, _id)[_id],
2078
- geometry: "primitive: plane; width:" + width + "; height:" + height + ";",
2079
- text: "color: " + fontColor + "; width: 4; height:auto; align:center;",
2080
- "label-handler": "value: " + _value + "; delay:" + 500,
2081
- rotation: rotationX + " " + rotationY + " " + rotationZ,
2082
- material: "color: " + color + ";",
2083
- animation: "property: text.width; from: 0; to: 4; dur: 1000;",
2084
- animation__1: "property: material.opacity; from: 0; to: 0.8; dur: 1500;",
2085
- animation__2: "property: position; from: " + (positionX + _classPrivateFieldLooseBase(_this, _shift)[_shift].xOffset) + " " + (positionY + _classPrivateFieldLooseBase(_this, _shift)[_shift].zOffset) + " " + (positionZ + _classPrivateFieldLooseBase(_this, _shift)[_shift].yOffset) + "; to: " + positionX + " " + positionY + " " + positionZ + "; dur: 1005;"
2086
- });
2200
+ geometry: {
2201
+ primitive: 'plane',
2202
+ width: width,
2203
+ height: height
2204
+ },
2205
+ text: {
2206
+ color: fontColor,
2207
+ width: 4,
2208
+ height: 'auto'
2209
+ },
2210
+ labelHandler: {
2211
+ value: _value,
2212
+ delay: 500
2213
+ },
2214
+ rotation: {
2215
+ x: rotationX,
2216
+ y: rotationY,
2217
+ z: rotationZ
2218
+ },
2219
+ material: {
2220
+ color: color
2221
+ },
2222
+ animation: {
2223
+ fromX: positionX + _classPrivateFieldLooseBase(_this, _shift)[_shift].xOffset,
2224
+ fromY: positionY + _classPrivateFieldLooseBase(_this, _shift)[_shift].zOffset,
2225
+ fromZ: positionZ + _classPrivateFieldLooseBase(_this, _shift)[_shift].yOffset,
2226
+ toX: positionX,
2227
+ toY: positionY,
2228
+ toZ: positionZ
2229
+ }
2230
+ };
2231
+ }
2232
+ });
2233
+ Object.defineProperty(this, _createTH3Histogram, {
2234
+ writable: true,
2235
+ value: function value() {
2236
+ _classPrivateFieldLooseBase(_this, _selectedBins$1)[_selectedBins$1] = localStorageService.getBinsFromLocalStorage();
2237
+ var elements = {
2238
+ type: 'TH3',
2239
+ bins: [],
2240
+ labels: [],
2241
+ banners: [],
2242
+ ground: {},
2243
+ titles: [],
2244
+ axisLabels: []
2245
+ };
2246
+ var xcenter, xmin, xmax, xwidth;
2247
+ var ycenter, ymin, ymax, ywidth;
2248
+ var zcenter, zmin, zmax, zwidth;
2249
+ var binName = '';
2250
+ var absoluteContent;
2251
+ var c;
2252
+ var count = 0;
2253
+ var maxXLength = _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] + _classPrivateFieldLooseBase(_this, _range)[_range] > _classPrivateFieldLooseBase(_this, _xLimit)[_xLimit] ? _classPrivateFieldLooseBase(_this, _xLimit)[_xLimit] : _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] + _classPrivateFieldLooseBase(_this, _range)[_range];
2254
+ var maxYLength = _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] + _classPrivateFieldLooseBase(_this, _range)[_range] > _classPrivateFieldLooseBase(_this, _yLimit)[_yLimit] ? _classPrivateFieldLooseBase(_this, _yLimit)[_yLimit] : _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] + _classPrivateFieldLooseBase(_this, _range)[_range];
2255
+ var maxZLength = _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] + _classPrivateFieldLooseBase(_this, _range)[_range] > _classPrivateFieldLooseBase(_this, _zLimit)[_zLimit] ? _classPrivateFieldLooseBase(_this, _zLimit)[_zLimit] : _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] + _classPrivateFieldLooseBase(_this, _range)[_range];
2256
+
2257
+ var xTitle = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fXaxis.fTitle;
2258
+
2259
+ var yTitle = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fYaxis.fTitle;
2260
+
2261
+ var zTitle = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fZaxis.fTitle;
2262
+
2263
+ var xLabels = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fXaxis.fLabels ? _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fXaxis.fLabels.arr : [];
2264
+ var yLabels = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fYaxis.fLabels ? _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fYaxis.fLabels.arr : [];
2265
+ var zLabels = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fZaxis.fLabels ? _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fZaxis.fLabels.arr : [];
2266
+ var currentBinScales = [];
2267
+
2268
+ for (var iz = _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset]; iz <= maxZLength; iz++) {
2269
+ for (var iy = _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset]; iy <= maxYLength; iy++) {
2270
+ for (var ix = _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset]; ix <= maxXLength; ix++) {
2271
+ xcenter = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fXaxis.GetBinCenter(ix);
2272
+ xmin = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fXaxis.GetBinLowEdge(ix);
2273
+ xmax = xcenter + (xcenter - xmin);
2274
+ xwidth = xmax - xmin;
2275
+ ycenter = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fYaxis.GetBinCenter(iy);
2276
+ ymin = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fYaxis.GetBinLowEdge(iy);
2277
+ ymax = ycenter + (ycenter - ymin);
2278
+ ywidth = ymax - ymin;
2279
+ zcenter = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fZaxis.GetBinCenter(iz);
2280
+ zmin = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fZaxis.GetBinLowEdge(iz);
2281
+ zmax = zcenter + (zcenter - zmin);
2282
+ zwidth = zmax - zmin;
2283
+ absoluteContent = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].getBinContent(ix, iy, iz);
2284
+ c = _classPrivateFieldLooseBase(_this, _optimizeBinContent)[_optimizeBinContent](absoluteContent, _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fMaximum);
2285
+
2286
+ if (c > _classPrivateFieldLooseBase(_this, _minDisplayedContent)[_minDisplayedContent]) {
2287
+ var size = c;
2288
+ if (c < 0.15) size = 0.15;
2289
+
2290
+ var color = _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getBinColor(c);
2291
+
2292
+ var id = _classPrivateFieldLooseBase(_this, _id)[_id] + xmin + 'th3' + xmax + 'th3' + zmin + 'th3' + zmax + 'th3' + ymin + 'th3' + ymax;
2293
+ var markedColor = void 0;
2294
+
2295
+ if (_classPrivateFieldLooseBase(_this, _checkBinState)[_checkBinState](id)) {
2296
+ markedColor = _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryAccentColor();
2297
+ } else {
2298
+ markedColor = color;
2299
+ }
2300
+
2301
+ var binData = "id: " + id + ";\n typeName: 'TH2'\n content: " + c + ";\n color: " + color + ";\n yTitle: " + yTitle + ";\n xTitle: " + xTitle + ";\n zTitle: " + zTitle + ";\n absoluteContent: " + absoluteContent + ";\n binName: " + binName + ";\n xMin: " + xmin + ";\n yMin: " + ymin + ";\n zMin: " + zmin + ";\n xMax: " + xmax + ";\n yMax: " + ymax + ";\n zMax: " + zmax + ";\n xPos: " + ix + ";\n yPos: " + iy + ";\n zPos: " + iz + ";\n xCenter: " + xcenter + ";\n yCenter: " + ycenter + ";\n zCenter: " + zcenter + ";\n xWidth: " + xwidth + ";\n yWidth: " + ywidth + ";\n zWidth: " + zwidth + ";\n markedColor: " + markedColor + ";\n selectColor: " + _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryAccentColor() + ";\n axisX: " + _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('x') + ";\n axisY: " + _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('y') + ";\n axisZ: " + _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('z');
2302
+
2303
+ var width = size * 0.8;
2304
+ var posX = ix - 1;
2305
+ var posY = iz - 1;
2306
+ var posZ = iy - 1;
2307
+ elements.bins[count] = {
2308
+ id: id,
2309
+ color: color,
2310
+ binData: binData,
2311
+ content: absoluteContent,
2312
+ animation: {
2313
+ fromWidth: _classPrivateFieldLooseBase(_this, _getPreviousBinScales)[_getPreviousBinScales](id),
2314
+ fromHeight: _classPrivateFieldLooseBase(_this, _getPreviousBinScales)[_getPreviousBinScales](id),
2315
+ fromDepth: _classPrivateFieldLooseBase(_this, _getPreviousBinScales)[_getPreviousBinScales](id),
2316
+ toWidth: width,
2317
+ toHeight: width,
2318
+ toDepth: width
2319
+ },
2320
+ animation2: {
2321
+ fromX: posX + _classPrivateFieldLooseBase(_this, _shift)[_shift].xOffset,
2322
+ fromY: posY + _classPrivateFieldLooseBase(_this, _shift)[_shift].zOffset,
2323
+ fromZ: posZ + _classPrivateFieldLooseBase(_this, _shift)[_shift].yOffset,
2324
+ toX: posX,
2325
+ toY: posY,
2326
+ toZ: posZ
2327
+ },
2328
+ animation3: {
2329
+ fromColor: _classPrivateFieldLooseBase(_this, _getPreviousBinColor)[_getPreviousBinColor](id),
2330
+ toColor: markedColor
2331
+ }
2332
+ };
2333
+ currentBinScales[count] = {
2334
+ key: id,
2335
+ scale: width,
2336
+ color: markedColor
2337
+ };
2338
+ }
2339
+
2340
+ count++;
2341
+ }
2342
+ }
2343
+ }
2344
+
2345
+ _classPrivateFieldLooseBase(_this, _previousBins)[_previousBins] = currentBinScales;
2346
+ var normalAxis = [];
2347
+ var reversedAxis = [];
2348
+ count = 0;
2349
+
2350
+ for (var _iz = _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset]; _iz <= maxYLength; _iz++) {
2351
+ normalAxis[count] = _classPrivateFieldLooseBase(_this, _createAxisEntity)[_createAxisEntity](50000 + count, -2.5 + _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset], _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1, _iz - 1, 270, 180, 0, 2, 1, "" + (yLabels[_iz - 1] ? yLabels[_iz - 1].fString : Math.round((_classPrivateFieldLooseBase(_this, _labels)[_labels].yInitial + _iz - 1 + Number.EPSILON) * 100) / 100), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('z'), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2352
+ reversedAxis[count] = _classPrivateFieldLooseBase(_this, _createAxisEntity)[_createAxisEntity](55000 + count, maxXLength + 0.5, _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1, _iz - 1, 270, 360, 0, 2, 1, "" + (yLabels[_iz - 1] ? yLabels[_iz - 1].fString : Math.round((_classPrivateFieldLooseBase(_this, _labels)[_labels].yInitial + _iz - 1 + Number.EPSILON) * 100) / 100), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('z'), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2353
+ count++;
2354
+ }
2355
+
2356
+ elements.axisLabels[0] = {
2357
+ id: 'leftLabel',
2358
+ key: 6000 + _classPrivateFieldLooseBase(_this, _id)[_id],
2359
+ text: {
2360
+ value: yTitle,
2361
+ color: _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('z')
2362
+ },
2363
+ rotation: {
2364
+ x: 270,
2365
+ y: 270,
2366
+ z: 0
2367
+ },
2368
+ animation: {
2369
+ fromX: _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] - 4 + _classPrivateFieldLooseBase(_this, _shift)[_shift].xOffset,
2370
+ fromY: _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1 + _classPrivateFieldLooseBase(_this, _shift)[_shift].zOffset,
2371
+ fromZ: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] + 0.5 + _classPrivateFieldLooseBase(_this, _shift)[_shift].yOffset,
2372
+ toX: _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] - 4,
2373
+ toY: _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1,
2374
+ toZ: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] + 0.5
2375
+ }
2376
+ };
2377
+ elements.axisLabels[1] = {
2378
+ id: 'rightLabel',
2379
+ key: 64001 + _classPrivateFieldLooseBase(_this, _id)[_id],
2380
+ text: {
2381
+ value: yTitle,
2382
+ color: _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('z')
2383
+ },
2384
+ rotation: {
2385
+ x: 270,
2386
+ y: 90,
2387
+ z: 0
2388
+ },
2389
+ animation: {
2390
+ fromX: maxXLength + 2 + _classPrivateFieldLooseBase(_this, _shift)[_shift].xOffset,
2391
+ fromY: _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1 + _classPrivateFieldLooseBase(_this, _shift)[_shift].zOffset,
2392
+ fromZ: maxYLength - 2.5 + _classPrivateFieldLooseBase(_this, _shift)[_shift].yOffset,
2393
+ toX: maxXLength + 2,
2394
+ toY: _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1,
2395
+ toZ: maxYLength - 2.5
2396
+ }
2397
+ };
2398
+
2399
+ for (var _ix = _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset]; _ix <= maxXLength; _ix++) {
2400
+ normalAxis[count] = _classPrivateFieldLooseBase(_this, _createAxisEntity)[_createAxisEntity](70000 + count, _ix - 1, _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1, _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] - 2.5, 270, 270, 0, 2, 1, "" + (xLabels[_ix - 1] ? xLabels[_ix - 1].fString : Math.round((_classPrivateFieldLooseBase(_this, _labels)[_labels].xInitial + _ix - 1 + Number.EPSILON) * 100) / 100), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('x'), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2401
+ reversedAxis[count] = _classPrivateFieldLooseBase(_this, _createAxisEntity)[_createAxisEntity](75000 + count, _ix - 1, _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1, maxYLength + 0.5, 270, 90, 0, 2, 1, "" + (xLabels[_ix - 1] ? xLabels[_ix - 1].fString : Math.round((_classPrivateFieldLooseBase(_this, _labels)[_labels].xInitial + _ix - 1 + Number.EPSILON) * 100) / 100), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('x'), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2402
+ count++;
2403
+ }
2404
+
2405
+ elements.axisLabels[2] = {
2406
+ id: 'downLabel',
2407
+ key: 84002 + _classPrivateFieldLooseBase(_this, _id)[_id],
2408
+ text: {
2409
+ value: xTitle,
2410
+ color: _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('x')
2411
+ },
2412
+ rotation: {
2413
+ x: 270,
2414
+ y: 180,
2415
+ z: 0
2416
+ },
2417
+ animation: {
2418
+ fromX: _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] + _classPrivateFieldLooseBase(_this, _shift)[_shift].xOffset,
2419
+ fromY: _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1 + _classPrivateFieldLooseBase(_this, _shift)[_shift].zOffset,
2420
+ fromZ: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] - 4 + _classPrivateFieldLooseBase(_this, _shift)[_shift].yOffset,
2421
+ toX: _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset],
2422
+ toY: _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1,
2423
+ toZ: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] - 4
2424
+ }
2425
+ };
2426
+ elements.axisLabels[3] = {
2427
+ id: 'upLabel',
2428
+ key: 85003 + _classPrivateFieldLooseBase(_this, _id)[_id],
2429
+ text: {
2430
+ value: xTitle,
2431
+ color: _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('x')
2432
+ },
2433
+ rotation: {
2434
+ x: 270,
2435
+ y: 0,
2436
+ z: 0
2437
+ },
2438
+ animation: {
2439
+ fromX: maxXLength - 2.5 + _classPrivateFieldLooseBase(_this, _shift)[_shift].xOffset,
2440
+ fromY: _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1 + _classPrivateFieldLooseBase(_this, _shift)[_shift].zOffset,
2441
+ fromZ: maxYLength + 2 + _classPrivateFieldLooseBase(_this, _shift)[_shift].yOffset,
2442
+ toX: maxXLength - 2.5,
2443
+ toY: _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1,
2444
+ toZ: maxYLength + 2
2445
+ }
2446
+ };
2447
+ normalAxis[count] = _classPrivateFieldLooseBase(_this, _createAxisEntity)[_createAxisEntity](90000 + count, maxXLength + 0.5, _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1, maxYLength + 0.5, 270, 360, 0, 2, 2, "" + (zLabels[_classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1] ? zLabels[_classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1].fString : Math.round((_classPrivateFieldLooseBase(_this, _labels)[_labels].zInitial + _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1 + Number.EPSILON) * 100) / 100), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('y'), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2448
+ reversedAxis[count] = _classPrivateFieldLooseBase(_this, _createAxisEntity)[_createAxisEntity](91000 + count, maxXLength + 0.5, _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1, _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] - 2.5, 270, 90, 0, 2, 2, "" + (zLabels[_classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1] ? zLabels[_classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1].fString : Math.round((_classPrivateFieldLooseBase(_this, _labels)[_labels].zInitial + _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1 + Number.EPSILON) * 100) / 100), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('y'), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2449
+ count++;
2450
+ normalAxis[count] = _classPrivateFieldLooseBase(_this, _createAxisEntity)[_createAxisEntity](92000 + count, _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] - 2.5, _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1, maxYLength + 0.5, 270, 270, 0, 2, 2, "" + (zLabels[_classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1] ? zLabels[_classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1].fString : Math.round((_classPrivateFieldLooseBase(_this, _labels)[_labels].zInitial + _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1 + Number.EPSILON) * 100) / 100), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('y'), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2451
+ reversedAxis[count] = _classPrivateFieldLooseBase(_this, _createAxisEntity)[_createAxisEntity](93000 + count, _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] - 2.5, _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1, _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] - 2.5, 270, 180, 0, 2, 2, "" + (zLabels[_classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1] ? zLabels[_classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1].fString : Math.round((_classPrivateFieldLooseBase(_this, _labels)[_labels].zInitial + _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1 + Number.EPSILON) * 100) / 100), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('y'), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2452
+ count++;
2453
+ elements.axisLabels[4] = {
2454
+ id: 'upLabel1',
2455
+ key: 95004 + _classPrivateFieldLooseBase(_this, _id)[_id],
2456
+ text: {
2457
+ value: zTitle,
2458
+ color: _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('y')
2459
+ },
2460
+ rotation: {
2461
+ x: 0,
2462
+ y: 270,
2463
+ z: 90
2464
+ },
2465
+ animation: {
2466
+ fromX: _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] - 1.5 + _classPrivateFieldLooseBase(_this, _shift)[_shift].xOffset,
2467
+ fromY: maxZLength - 1 + _classPrivateFieldLooseBase(_this, _shift)[_shift].zOffset,
2468
+ fromZ: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] - 2 + _classPrivateFieldLooseBase(_this, _shift)[_shift].yOffset,
2469
+ toX: _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] - 1.5,
2470
+ toY: maxZLength - 1,
2471
+ toZ: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] - 2
2472
+ }
2473
+ };
2474
+ elements.axisLabels[5] = {
2475
+ id: 'upLabel2',
2476
+ key: 100005 + _classPrivateFieldLooseBase(_this, _id)[_id],
2477
+ text: {
2478
+ value: zTitle,
2479
+ color: _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('y')
2480
+ },
2481
+ rotation: {
2482
+ x: 0,
2483
+ y: 90,
2484
+ z: 90
2485
+ },
2486
+ animation: {
2487
+ fromX: maxXLength - 0.5 + _classPrivateFieldLooseBase(_this, _shift)[_shift].xOffset,
2488
+ fromY: maxZLength - 1 + _classPrivateFieldLooseBase(_this, _shift)[_shift].zOffset,
2489
+ fromZ: maxYLength + _classPrivateFieldLooseBase(_this, _shift)[_shift].yOffset,
2490
+ toX: maxXLength - 0.5,
2491
+ toY: maxZLength - 1,
2492
+ toZ: maxYLength
2493
+ }
2494
+ };
2495
+ elements.axisLabels[6] = {
2496
+ id: 'upLabel3',
2497
+ key: 105006 + _classPrivateFieldLooseBase(_this, _id)[_id],
2498
+ text: {
2499
+ value: zTitle,
2500
+ color: _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('y')
2501
+ },
2502
+ rotation: {
2503
+ x: 0,
2504
+ y: 360,
2505
+ z: 90
2506
+ },
2507
+ animation: {
2508
+ fromX: _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] - 2 + _classPrivateFieldLooseBase(_this, _shift)[_shift].xOffset,
2509
+ fromY: maxZLength - 1 + _classPrivateFieldLooseBase(_this, _shift)[_shift].zOffset,
2510
+ fromZ: maxYLength - 0.5 + _classPrivateFieldLooseBase(_this, _shift)[_shift].yOffset,
2511
+ toX: _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] - 2,
2512
+ toY: maxZLength - 1,
2513
+ toZ: maxYLength - 0.5
2514
+ }
2515
+ };
2516
+ elements.axisLabels[7] = {
2517
+ id: 'upLabel4',
2518
+ key: 105007 + _classPrivateFieldLooseBase(_this, _id)[_id],
2519
+ text: {
2520
+ value: zTitle,
2521
+ color: _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('y')
2522
+ },
2523
+ rotation: {
2524
+ x: 0,
2525
+ y: 180,
2526
+ z: 90
2527
+ },
2528
+ animation: {
2529
+ fromX: maxXLength - 0.5 + _classPrivateFieldLooseBase(_this, _shift)[_shift].xOffset,
2530
+ fromY: maxZLength - 1 + _classPrivateFieldLooseBase(_this, _shift)[_shift].zOffset,
2531
+ fromZ: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] - 1.5 + _classPrivateFieldLooseBase(_this, _shift)[_shift].yOffset,
2532
+ toX: maxXLength - 0.5,
2533
+ toY: maxZLength - 1,
2534
+ toZ: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] - 1.5
2535
+ }
2536
+ };
2537
+ count++;
2538
+ var bannerWidthX = _classPrivateFieldLooseBase(_this, _range)[_range] > _classPrivateFieldLooseBase(_this, _xLimit)[_xLimit] ? _classPrivateFieldLooseBase(_this, _xLimit)[_xLimit] + 1 : _classPrivateFieldLooseBase(_this, _range)[_range];
2539
+ var bannerWidthY = _classPrivateFieldLooseBase(_this, _range)[_range] > _classPrivateFieldLooseBase(_this, _yLimit)[_yLimit] ? _classPrivateFieldLooseBase(_this, _yLimit)[_yLimit] + 1 : _classPrivateFieldLooseBase(_this, _range)[_range];
2540
+ elements.ground = {
2541
+ key: 125000 + count + _classPrivateFieldLooseBase(_this, _id)[_id],
2542
+ scale: {
2543
+ width: bannerWidthX + 8,
2544
+ height: 0.2,
2545
+ depth: bannerWidthY + 8
2546
+ },
2547
+ animation: {
2548
+ fromX: _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] + bannerWidthX * 0.5 - 1 + _classPrivateFieldLooseBase(_this, _shift)[_shift].xOffset,
2549
+ fromY: _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1.5 + _classPrivateFieldLooseBase(_this, _shift)[_shift].zOffset,
2550
+ fromZ: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] + bannerWidthY * 0.5 - 0.5 + _classPrivateFieldLooseBase(_this, _shift)[_shift].yOffset,
2551
+ toX: _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] + bannerWidthX * 0.5 - 1,
2552
+ toY: _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] - 1.5,
2553
+ toZ: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] + bannerWidthY * 0.5 - 0.5
2554
+ }
2555
+ };
2556
+ count++;
2557
+ elements.banners[1] = {
2558
+ key: 130000 + count + _classPrivateFieldLooseBase(_this, _id)[_id],
2559
+ id: 'th-mapping',
2560
+ geometry: {
2561
+ width: 1,
2562
+ height: 15,
2563
+ depth: 22
2564
+ },
2565
+ position: {
2566
+ x: maxXLength + 8,
2567
+ y: _classPrivateFieldLooseBase(_this, _zOffset)[_zOffset] + _classPrivateFieldLooseBase(_this, _range)[_range] / 2 + 0.5,
2568
+ z: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] + _classPrivateFieldLooseBase(_this, _range)[_range] / 2 + 2.5
2569
+ },
2570
+ material: {
2571
+ color: '#ffffff',
2572
+ transparent: true
2573
+ }
2574
+ };
2575
+ elements.labels = [].concat(normalAxis, reversedAxis);
2576
+ return elements;
2577
+ }
2578
+ });
2579
+ Object.defineProperty(this, _createTH2Histogram, {
2580
+ writable: true,
2581
+ value: function value(projectionFunction) {
2582
+ _classPrivateFieldLooseBase(_this, _selectedBins$1)[_selectedBins$1] = localStorageService.getBinsFromLocalStorage();
2583
+ var elements = {
2584
+ type: 'TH2',
2585
+ bins: [],
2586
+ labels: [],
2587
+ banners: [],
2588
+ ground: {},
2589
+ titles: [],
2590
+ axisLabels: []
2591
+ };
2592
+ var centeredYPosition;
2593
+ var xcenter, xmin, xmax, xwidth;
2594
+ var ycenter, ymin, ymax, ywidth;
2595
+ var c;
2596
+ var binName = '';
2597
+ var absoluteContent;
2598
+ var count = 0;
2599
+ var maxXLength = _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] + _classPrivateFieldLooseBase(_this, _range)[_range] > _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fXaxis.fNbins ? _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fXaxis.fNbins : _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] + _classPrivateFieldLooseBase(_this, _range)[_range];
2600
+ var maxYLength = _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] + _classPrivateFieldLooseBase(_this, _range)[_range] > _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fYaxis.fNbins ? _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fYaxis.fNbins : _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] + _classPrivateFieldLooseBase(_this, _range)[_range];
2601
+ var xTitle = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fXaxis.fTitle !== '' ? _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fXaxis.fTitle : 'x';
2602
+ var yTitle = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fYaxis.fTitle !== '' ? _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fYaxis.fTitle : 'y';
2603
+ var xLabels = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fXaxis.fLabels ? _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fXaxis.fLabels.arr : [];
2604
+ var yLabels = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fYaxis.fLabels ? _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fYaxis.fLabels.arr : [];
2605
+ var currentBinScales = [];
2606
+
2607
+ for (var iy = _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset]; iy <= maxYLength; iy++) {
2608
+ for (var ix = _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset]; ix <= maxXLength; ix++) {
2609
+ xcenter = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fXaxis.GetBinCenter(ix);
2610
+ xmin = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fXaxis.GetBinLowEdge(ix);
2611
+ xmax = xcenter + (xcenter - xmin);
2612
+ xwidth = xmax - xmin;
2613
+ ycenter = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fYaxis.GetBinCenter(iy);
2614
+ ymin = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fYaxis.GetBinLowEdge(iy);
2615
+ ymax = ycenter + (ycenter - ymin);
2616
+ ywidth = ymax - ymin;
2617
+ absoluteContent = _classPrivateFieldLooseBase(_this, _histogram)[_histogram].getBinContent(ix, iy);
2618
+ c = _classPrivateFieldLooseBase(_this, _optimizeBinContent)[_optimizeBinContent](absoluteContent, _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fMaximum);
2619
+ centeredYPosition = c * _classPrivateFieldLooseBase(_this, _range)[_range] * _classPrivateFieldLooseBase(_this, _contentScale)[_contentScale] / 16;
2620
+
2621
+ if (c > _classPrivateFieldLooseBase(_this, _minDisplayedContent)[_minDisplayedContent]) {
2622
+ var projectionColor = _classPrivateFieldLooseBase(_this, _projectionFunction)[_projectionFunction](projectionFunction, xmin, ymin);
2623
+
2624
+ var color = projectionColor === '' ? _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getBinColor(c) : projectionColor;
2625
+ var id = _classPrivateFieldLooseBase(_this, _id)[_id] + xmin + 'th2' + xmax + 'th2' + ymin + 'th2' + ymax;
2626
+ var markedColor = void 0;
2627
+
2628
+ if (_classPrivateFieldLooseBase(_this, _checkBinState)[_checkBinState](id)) {
2629
+ markedColor = _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryAccentColor();
2630
+ } else {
2631
+ markedColor = color;
2632
+ }
2633
+
2634
+ var binData = "id: " + id + ";\n typeName: 'TH2'\n content: " + c + ";\n color: " + color + ";\n yTitle: " + yTitle + ";\n xTitle: " + xTitle + ";\n zTitle: 'none';\n absoluteContent: " + absoluteContent + ";\n binName: " + binName + ";\n xMin: " + xmin + ";\n yMin: " + ymin + ";\n zMin: " + 0 + ";\n xMax: " + xmax + ";\n yMax: " + ymax + ";\n zMax: " + 0 + ";\n xPos: " + ix + ";\n yPos: " + iy + ";\n zPos: " + 0 + ";\n xCenter: " + xcenter + ";\n yCenter: " + ycenter + ";\n yCenter: " + 0 + ";\n xWidth: " + xwidth + ";\n yWidth: " + ywidth + ";\n zWidth: " + 0 + ";\n markedColor: " + markedColor + ";\n selectColor: " + _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryAccentColor() + ";\n axisX: " + _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('x') + ";\n axisY: " + _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('y') + ";\n axisZ: " + _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('z');
2635
+
2636
+ var width = xwidth / _classPrivateFieldLooseBase(_this, _xWidth)[_xWidth] / _classPrivateFieldLooseBase(_this, _binScaleCoef)[_binScaleCoef];
2637
+
2638
+ var depth = ywidth / _classPrivateFieldLooseBase(_this, _yWidth)[_yWidth] / _classPrivateFieldLooseBase(_this, _binScaleCoef)[_binScaleCoef];
2639
+
2640
+ var posX = ix - 1;
2641
+ var posY = iy - 1;
2642
+ elements.bins[count] = {
2643
+ id: id,
2644
+ color: color,
2645
+ binData: binData,
2646
+ content: absoluteContent,
2647
+ animation: {
2648
+ fromWidth: width,
2649
+ fromHeight: _classPrivateFieldLooseBase(_this, _getPreviousBinScales)[_getPreviousBinScales](id),
2650
+ fromDepth: depth,
2651
+ toWidth: width,
2652
+ toHeight: c * _classPrivateFieldLooseBase(_this, _range)[_range] * _classPrivateFieldLooseBase(_this, _contentScale)[_contentScale] / 8,
2653
+ toDepth: depth
2654
+ },
2655
+ animation2: {
2656
+ fromX: posX + _classPrivateFieldLooseBase(_this, _shift)[_shift].xOffset,
2657
+ fromY: centeredYPosition,
2658
+ fromZ: posY + _classPrivateFieldLooseBase(_this, _shift)[_shift].yOffset,
2659
+ toX: posX,
2660
+ toY: centeredYPosition,
2661
+ toZ: posY
2662
+ },
2663
+ animation3: {
2664
+ fromColor: _classPrivateFieldLooseBase(_this, _getPreviousBinColor)[_getPreviousBinColor](id),
2665
+ toColor: markedColor
2666
+ }
2667
+ };
2668
+ currentBinScales[count] = {
2669
+ key: id,
2670
+ scale: c,
2671
+ color: markedColor
2672
+ };
2673
+ }
2674
+
2675
+ count++;
2676
+ }
2677
+ }
2678
+
2679
+ _classPrivateFieldLooseBase(_this, _previousBins)[_previousBins] = currentBinScales;
2680
+ var normalAxis = [];
2681
+ var reversedAxis = [];
2682
+ count = 0;
2683
+
2684
+ for (var _iy = _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset]; _iy <= maxYLength; _iy++) {
2685
+ normalAxis[count] = _classPrivateFieldLooseBase(_this, _createAxisEntity)[_createAxisEntity](1500 + count, _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] - 2.5, 0, _iy - 1, 270, 180, 0, 2, 1, "" + (yLabels[_iy - 1] ? yLabels[_iy - 1].fString : Math.round((_classPrivateFieldLooseBase(_this, _labels)[_labels].yInitial + (_iy - 1) * _classPrivateFieldLooseBase(_this, _yWidth)[_yWidth] + Number.EPSILON) * 100) / 100), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('z'), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2686
+ reversedAxis[count] = _classPrivateFieldLooseBase(_this, _createAxisEntity)[_createAxisEntity](3000 + count, maxXLength + 0.5, 0, _iy - 1, 270, 360, 0, 2, 1, "" + (yLabels[_iy - 1] ? yLabels[_iy - 1].fString : Math.round((_classPrivateFieldLooseBase(_this, _labels)[_labels].yInitial + (_iy - 1) * _classPrivateFieldLooseBase(_this, _yWidth)[_yWidth] + Number.EPSILON) * 100) / 100), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('z'), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2687
+ count++;
2688
+ }
2689
+
2690
+ elements.axisLabels[0] = {
2691
+ id: 'leftLabel',
2692
+ key: 4500 + _classPrivateFieldLooseBase(_this, _id)[_id],
2693
+ text: {
2694
+ value: yTitle,
2695
+ color: _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('z')
2696
+ },
2697
+ rotation: {
2698
+ x: 270,
2699
+ y: 270,
2700
+ z: 0
2701
+ },
2702
+ animation: {
2703
+ fromX: _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] - 4 + _classPrivateFieldLooseBase(_this, _shift)[_shift].xOffset,
2704
+ fromY: _classPrivateFieldLooseBase(_this, _shift)[_shift].zOffset,
2705
+ fromZ: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] + 0.5 + _classPrivateFieldLooseBase(_this, _shift)[_shift].yOffset,
2706
+ toX: _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] - 4,
2707
+ toY: 0,
2708
+ toZ: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] + 0.5
2709
+ }
2710
+ };
2711
+ elements.axisLabels[1] = {
2712
+ id: 'rightLabel',
2713
+ key: 6001 + _classPrivateFieldLooseBase(_this, _id)[_id],
2714
+ text: {
2715
+ value: yTitle,
2716
+ color: _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('z')
2717
+ },
2718
+ rotation: {
2719
+ x: 270,
2720
+ y: 90,
2721
+ z: 0
2722
+ },
2723
+ animation: {
2724
+ fromX: maxXLength + 2 + _classPrivateFieldLooseBase(_this, _shift)[_shift].xOffset,
2725
+ fromY: _classPrivateFieldLooseBase(_this, _shift)[_shift].zOffset,
2726
+ fromZ: maxYLength - 2.5 + _classPrivateFieldLooseBase(_this, _shift)[_shift].yOffset,
2727
+ toX: maxXLength + 2,
2728
+ toY: 0,
2729
+ toZ: maxYLength - 2.5
2730
+ }
2731
+ };
2732
+
2733
+ for (var _ix2 = _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset]; _ix2 <= maxXLength; _ix2++) {
2734
+ normalAxis[count] = _classPrivateFieldLooseBase(_this, _createAxisEntity)[_createAxisEntity](7500 + count, _ix2 - 1, 0, _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] - 2.5, 270, 270, 0, 2, 1, "" + (xLabels[_ix2 - 1] ? xLabels[_ix2 - 1].fString : Math.round((_classPrivateFieldLooseBase(_this, _labels)[_labels].xInitial + (_ix2 - 1) * _classPrivateFieldLooseBase(_this, _xWidth)[_xWidth] + Number.EPSILON) * 100) / 100), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('x'), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2735
+ reversedAxis[count] = _classPrivateFieldLooseBase(_this, _createAxisEntity)[_createAxisEntity](9000 + count, _ix2 - 1, 0, maxYLength + 0.5, 270, 90, 0, 2, 1, "" + (xLabels[_ix2 - 1] ? xLabels[_ix2 - 1].fString : Math.round((_classPrivateFieldLooseBase(_this, _labels)[_labels].xInitial + (_ix2 - 1) * _classPrivateFieldLooseBase(_this, _xWidth)[_xWidth] + Number.EPSILON) * 100) / 100), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('x'), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2736
+ count++;
2737
+ }
2738
+
2739
+ elements.axisLabels[2] = {
2740
+ id: 'downLabel',
2741
+ key: 10502 + _classPrivateFieldLooseBase(_this, _id)[_id],
2742
+ text: {
2743
+ value: xTitle,
2744
+ color: _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('x')
2745
+ },
2746
+ rotation: {
2747
+ x: 270,
2748
+ y: 180,
2749
+ z: 0
2750
+ },
2751
+ animation: {
2752
+ fromX: _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] + _classPrivateFieldLooseBase(_this, _shift)[_shift].xOffset,
2753
+ fromY: _classPrivateFieldLooseBase(_this, _shift)[_shift].zOffset,
2754
+ fromZ: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] - 4 + _classPrivateFieldLooseBase(_this, _shift)[_shift].yOffset,
2755
+ toX: _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset],
2756
+ toY: 0,
2757
+ toZ: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] - 4
2758
+ }
2759
+ };
2760
+ elements.axisLabels[3] = {
2761
+ id: 'upLabel',
2762
+ key: 12003 + _classPrivateFieldLooseBase(_this, _id)[_id],
2763
+ text: {
2764
+ value: xTitle,
2765
+ color: _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('x')
2766
+ },
2767
+ rotation: {
2768
+ x: 270,
2769
+ y: 0,
2770
+ z: 0
2771
+ },
2772
+ animation: {
2773
+ fromX: maxXLength - 2.5 + _classPrivateFieldLooseBase(_this, _shift)[_shift].xOffset,
2774
+ fromY: _classPrivateFieldLooseBase(_this, _shift)[_shift].zOffset,
2775
+ fromZ: maxYLength + 2 + _classPrivateFieldLooseBase(_this, _shift)[_shift].yOffset,
2776
+ toX: maxXLength - 2.5,
2777
+ toY: 0,
2778
+ toZ: maxYLength + 2
2779
+ }
2780
+ };
2781
+ normalAxis[count] = _classPrivateFieldLooseBase(_this, _createAxisEntity)[_createAxisEntity](13500 + count, maxXLength + 0.5, 0, maxYLength + 0.5, 270, 360, 0, 2, 2, "0", _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('y'), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2782
+ reversedAxis[count] = _classPrivateFieldLooseBase(_this, _createAxisEntity)[_createAxisEntity](15000 + count, maxXLength + 0.5, 0, _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] - 2.5, 270, 180, 0, 2, 2, "0", _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('y'), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2783
+ count++;
2784
+ normalAxis[count] = _classPrivateFieldLooseBase(_this, _createAxisEntity)[_createAxisEntity](16500 + count, _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] - 2.5, 0, maxYLength + 0.5, 270, 180, 0, 2, 2, "0", _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('y'), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2785
+ reversedAxis[count] = _classPrivateFieldLooseBase(_this, _createAxisEntity)[_createAxisEntity](18000 + count, _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] - 2.5, 0, _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] - 2.5, 270, 180, 0, 2, 2, "0", _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getAxisColor('y'), _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2786
+ count++;
2787
+ elements.titles[0] = {
2788
+ key: 195000 + _classPrivateFieldLooseBase(_this, _id)[_id],
2789
+ text: {
2790
+ value: _classPrivateFieldLooseBase(_this, _histogram)[_histogram].fTitle,
2791
+ color: _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getPrimaryFontColor()
2792
+ },
2793
+ rotation: {
2794
+ x: 0,
2795
+ y: 123,
2796
+ z: 0
2797
+ },
2798
+ position: {
2799
+ x: _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] - 90,
2800
+ y: 16.5,
2801
+ z: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] + 90
2802
+ },
2803
+ innerText: {
2804
+ value: 'Press V to show projections or controls',
2805
+ color: _classPrivateFieldLooseBase(_this, _themeProvider)[_themeProvider].getPrimaryFontColor()
2806
+ }
2807
+ };
2808
+ count++;
2809
+ var bannerWidthX = _classPrivateFieldLooseBase(_this, _range)[_range] > _classPrivateFieldLooseBase(_this, _xLimit)[_xLimit] ? _classPrivateFieldLooseBase(_this, _xLimit)[_xLimit] + 1 : _classPrivateFieldLooseBase(_this, _range)[_range];
2810
+ var bannerWidthY = _classPrivateFieldLooseBase(_this, _range)[_range] > _classPrivateFieldLooseBase(_this, _yLimit)[_yLimit] ? _classPrivateFieldLooseBase(_this, _yLimit)[_yLimit] + 1 : _classPrivateFieldLooseBase(_this, _range)[_range];
2811
+ elements.ground = {
2812
+ key: 22500 + count + _classPrivateFieldLooseBase(_this, _id)[_id],
2813
+ scale: {
2814
+ width: bannerWidthX + 8,
2815
+ height: 0.2,
2816
+ depth: bannerWidthY + 8
2817
+ },
2818
+ animation: {
2819
+ fromX: _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] + bannerWidthX * 0.5 - 1 + _classPrivateFieldLooseBase(_this, _shift)[_shift].xOffset,
2820
+ fromY: -0.5,
2821
+ fromZ: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] + bannerWidthY * 0.5 - 0.5 + _classPrivateFieldLooseBase(_this, _shift)[_shift].yOffset,
2822
+ toX: _classPrivateFieldLooseBase(_this, _xOffset)[_xOffset] + bannerWidthX * 0.5 - 1,
2823
+ toY: -0.5,
2824
+ toZ: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] + bannerWidthY * 0.5 - 0.5
2825
+ }
2826
+ };
2827
+ count++;
2828
+ elements.banners[1] = {
2829
+ key: 240000 + count + _classPrivateFieldLooseBase(_this, _id)[_id],
2830
+ id: 'th-mapping',
2831
+ geometry: {
2832
+ width: 0.1,
2833
+ height: 15,
2834
+ depth: 22
2835
+ },
2836
+ position: {
2837
+ x: maxXLength + 8,
2838
+ y: 7,
2839
+ z: _classPrivateFieldLooseBase(_this, _yOffset)[_yOffset] + _classPrivateFieldLooseBase(_this, _range)[_range] / 2 + 2.5
2840
+ },
2841
+ material: {
2842
+ color: '#ffffff',
2843
+ transparent: true
2844
+ }
2845
+ };
2846
+ elements.labels = [].concat(normalAxis, reversedAxis);
2847
+ return elements;
2087
2848
  }
2088
2849
  });
2089
2850
  Object.defineProperty(this, _optimizeBinContent, {
@@ -2222,534 +2983,100 @@ var HistogramReactFactory = /*#__PURE__*/function () {
2222
2983
  value: function value(id) {
2223
2984
  var previousBin = _classPrivateFieldLooseBase(_this, _previousBins)[_previousBins].filter(function (prevBin) {
2224
2985
  return prevBin.key === id;
2225
- });
2226
-
2227
- if (previousBin[0] && previousBin[0].scale) {
2228
- return previousBin[0].scale;
2229
- }
2230
-
2231
- return 0;
2232
- }
2233
- });
2234
- Object.defineProperty(this, _getPreviousBinColor, {
2235
- writable: true,
2236
- value: function value(id) {
2237
- var previousBin = _classPrivateFieldLooseBase(_this, _previousBins)[_previousBins].filter(function (prevBin) {
2238
- return prevBin.key === id;
2239
- });
2240
-
2241
- if (previousBin[0] && previousBin[0].scale) {
2242
- return previousBin[0].color;
2243
- }
2244
-
2245
- return '#ffffff';
2246
- }
2247
- });
2248
- this.initializeFactory(uniqueName, histogram, section, range, projections, theme);
2249
- }
2250
-
2251
- var _proto = HistogramReactFactory.prototype;
2252
-
2253
- _proto.initializeFactory = function initializeFactory(uniqueName, histogram, section, range, projections, theme) {
2254
- _classPrivateFieldLooseBase(this, _id)[_id] = uniqueName;
2255
- _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider] = new ThemeProvider(theme);
2256
- _classPrivateFieldLooseBase(this, _projections)[_projections] = projections;
2257
- _classPrivateFieldLooseBase(this, _histogram)[_histogram] = histogram;
2258
- _classPrivateFieldLooseBase(this, _type)[_type] = histogram._typename;
2259
- _classPrivateFieldLooseBase(this, _range)[_range] = 8;
2260
- _classPrivateFieldLooseBase(this, _xLimit)[_xLimit] = histogram.fXaxis.fNbins;
2261
- _classPrivateFieldLooseBase(this, _yLimit)[_yLimit] = histogram.fYaxis.fNbins;
2262
- _classPrivateFieldLooseBase(this, _xWidth)[_xWidth] = histogram.fXaxis.fXmax / histogram.fXaxis.fNbins;
2263
- _classPrivateFieldLooseBase(this, _yWidth)[_yWidth] = histogram.fYaxis.fXmax / histogram.fYaxis.fNbins;
2264
-
2265
- if (section !== null && section !== undefined) {
2266
- _classPrivateFieldLooseBase(this, _range)[_range] = section.range;
2267
- if (section.xOffset) _classPrivateFieldLooseBase(this, _xOffset)[_xOffset] = _classPrivateFieldLooseBase(this, _checkOffsetValue)[_checkOffsetValue](section.xOffset, _classPrivateFieldLooseBase(this, _xLimit)[_xLimit]);
2268
- if (section.yOffset) _classPrivateFieldLooseBase(this, _yOffset)[_yOffset] = _classPrivateFieldLooseBase(this, _checkOffsetValue)[_checkOffsetValue](section.yOffset, _classPrivateFieldLooseBase(this, _yLimit)[_yLimit]);
2269
- } else {
2270
- if (range) _classPrivateFieldLooseBase(this, _range)[_range] = range;
2271
- }
2272
-
2273
- if (histogram._typename.includes('TH3')) {
2274
- _classPrivateFieldLooseBase(this, _range)[_range] = 4;
2275
- _classPrivateFieldLooseBase(this, _zLimit)[_zLimit] = histogram.fZaxis.fNbins;
2276
- _classPrivateFieldLooseBase(this, _zWidth)[_zWidth] = histogram.fZaxis.fXmax / histogram.fZaxis.fNbins;
2277
-
2278
- if (section !== null && section !== undefined) {
2279
- if (section.zOffset) _classPrivateFieldLooseBase(this, _zOffset)[_zOffset] = _classPrivateFieldLooseBase(this, _checkOffsetValue)[_checkOffsetValue](section.zOffset, _classPrivateFieldLooseBase(this, _zLimit)[_zLimit]);
2280
- } else {
2281
- if (range) _classPrivateFieldLooseBase(this, _range)[_range] = range;
2282
- }
2283
- }
2284
- };
2285
-
2286
- _proto.createTH3Histogram = function createTH3Histogram() {
2287
- _classPrivateFieldLooseBase(this, _selectedBins$1)[_selectedBins$1] = localStorageService.getBinsFromLocalStorage();
2288
- var elements = {
2289
- bins: [],
2290
- normalAxis: [],
2291
- reversedAxis: [],
2292
- banners: []
2293
- };
2294
- var xcenter, xmin, xmax, xwidth;
2295
- var ycenter, ymin, ymax, ywidth;
2296
- var zcenter, zmin, zmax, zwidth;
2297
- var binName = '';
2298
- var absoluteContent;
2299
- var c;
2300
- var count = 0;
2301
- var maxXLength = _classPrivateFieldLooseBase(this, _xOffset)[_xOffset] + _classPrivateFieldLooseBase(this, _range)[_range] > _classPrivateFieldLooseBase(this, _xLimit)[_xLimit] ? _classPrivateFieldLooseBase(this, _xLimit)[_xLimit] : _classPrivateFieldLooseBase(this, _xOffset)[_xOffset] + _classPrivateFieldLooseBase(this, _range)[_range];
2302
- var maxYLength = _classPrivateFieldLooseBase(this, _yOffset)[_yOffset] + _classPrivateFieldLooseBase(this, _range)[_range] > _classPrivateFieldLooseBase(this, _yLimit)[_yLimit] ? _classPrivateFieldLooseBase(this, _yLimit)[_yLimit] : _classPrivateFieldLooseBase(this, _yOffset)[_yOffset] + _classPrivateFieldLooseBase(this, _range)[_range];
2303
- var maxZLength = _classPrivateFieldLooseBase(this, _zOffset)[_zOffset] + _classPrivateFieldLooseBase(this, _range)[_range] > _classPrivateFieldLooseBase(this, _zLimit)[_zLimit] ? _classPrivateFieldLooseBase(this, _zLimit)[_zLimit] : _classPrivateFieldLooseBase(this, _zOffset)[_zOffset] + _classPrivateFieldLooseBase(this, _range)[_range];
2304
-
2305
- var xTitle = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fXaxis.fTitle;
2306
-
2307
- var yTitle = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fYaxis.fTitle;
2308
-
2309
- var zTitle = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fZaxis.fTitle;
2310
-
2311
- var xLabels = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fXaxis.fLabels ? _classPrivateFieldLooseBase(this, _histogram)[_histogram].fXaxis.fLabels.arr : [];
2312
- var yLabels = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fYaxis.fLabels ? _classPrivateFieldLooseBase(this, _histogram)[_histogram].fYaxis.fLabels.arr : [];
2313
- var zLabels = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fZaxis.fLabels ? _classPrivateFieldLooseBase(this, _histogram)[_histogram].fZaxis.fLabels.arr : [];
2314
- var currentBinScales = [];
2315
-
2316
- for (var iz = _classPrivateFieldLooseBase(this, _zOffset)[_zOffset]; iz <= maxZLength; iz++) {
2317
- for (var iy = _classPrivateFieldLooseBase(this, _yOffset)[_yOffset]; iy <= maxYLength; iy++) {
2318
- for (var ix = _classPrivateFieldLooseBase(this, _xOffset)[_xOffset]; ix <= maxXLength; ix++) {
2319
- xcenter = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fXaxis.GetBinCenter(ix);
2320
- xmin = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fXaxis.GetBinLowEdge(ix);
2321
- xmax = xcenter + (xcenter - xmin);
2322
- xwidth = xmax - xmin;
2323
- ycenter = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fYaxis.GetBinCenter(iy);
2324
- ymin = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fYaxis.GetBinLowEdge(iy);
2325
- ymax = ycenter + (ycenter - ymin);
2326
- ywidth = ymax - ymin;
2327
- zcenter = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fZaxis.GetBinCenter(iz);
2328
- zmin = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fZaxis.GetBinLowEdge(iz);
2329
- zmax = zcenter + (zcenter - zmin);
2330
- zwidth = zmax - zmin;
2331
- absoluteContent = _classPrivateFieldLooseBase(this, _histogram)[_histogram].getBinContent(ix, iy, iz);
2332
- c = _classPrivateFieldLooseBase(this, _optimizeBinContent)[_optimizeBinContent](absoluteContent, _classPrivateFieldLooseBase(this, _histogram)[_histogram].fMaximum);
2333
-
2334
- if (c > 0) {
2335
- var size = c;
2336
- if (c < 0.15) size = 0.15;
2337
-
2338
- var color = _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getBinColor(c);
2339
-
2340
- var id = _classPrivateFieldLooseBase(this, _id)[_id] + xmin + 'th3' + xmax + 'th3' + zmin + 'th3' + zmax + 'th3' + ymin + 'th3' + ymax;
2341
- var markedColor = void 0;
2342
-
2343
- if (_classPrivateFieldLooseBase(this, _checkBinState)[_checkBinState](id)) {
2344
- markedColor = _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryAccentColor();
2345
- } else {
2346
- markedColor = color;
2347
- }
2348
-
2349
- var binData = "id: " + id + ";\n content: " + c + ";\n color: " + color + ";\n yTitle: " + yTitle + ";\n xTitle: " + xTitle + ";\n zTitle: " + zTitle + ";\n absoluteContent: " + absoluteContent + ";\n binName: " + binName + ";\n xMin: " + xmin + ";\n yMin: " + ymin + ";\n zMin: " + zmin + ";\n xMax: " + xmax + ";\n yMax: " + ymax + ";\n zMax: " + zmax + ";\n xCenter: " + xcenter + ";\n yCenter: " + ycenter + ";\n zCenter: " + zcenter + ";\n xWidth: " + xwidth + ";\n yWidth: " + ywidth + ";\n zWidth: " + zwidth + ";\n markedColor: " + markedColor + ";\n selectColor: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryAccentColor() + ";\n axisX: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('x') + ";\n axisY: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('y') + ";\n axisZ: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('z');
2350
-
2351
- var width = size * 0.9;
2352
-
2353
- var posX = xmin / _classPrivateFieldLooseBase(this, _xWidth)[_xWidth];
2354
-
2355
- var posY = zmin / _classPrivateFieldLooseBase(this, _zWidth)[_zWidth] + 0.2;
2356
-
2357
- var posZ = ymin / _classPrivateFieldLooseBase(this, _yWidth)[_yWidth];
2358
-
2359
- elements.bins[count] = /*#__PURE__*/React__default.createElement("a-box", {
2360
- key: count,
2361
- "class": "clickable",
2362
- material: "color: " + markedColor + ";",
2363
- binth3: binData,
2364
- mouseevent: true,
2365
- animation: "property: scale; from: " + _classPrivateFieldLooseBase(this, _getPreviousBinScales)[_getPreviousBinScales](id) + " " + _classPrivateFieldLooseBase(this, _getPreviousBinScales)[_getPreviousBinScales](id) + " " + _classPrivateFieldLooseBase(this, _getPreviousBinScales)[_getPreviousBinScales](id) + "; to: " + width + " " + width + " " + width + "; dur: 1500; easing: linear;",
2366
- animation__1: "property: material.opacity; from: 0; to: 0.75; dur: 2600;",
2367
- animation__2: "property: position; from: " + (posX + _classPrivateFieldLooseBase(this, _shift)[_shift].xOffset) + " " + (posY + _classPrivateFieldLooseBase(this, _shift)[_shift].zOffset) + " " + (posZ + _classPrivateFieldLooseBase(this, _shift)[_shift].yOffset) + "; to: " + posX + " " + posY + " " + posZ + "; dur: 1000;",
2368
- animation__3: "property: material.color; from: " + _classPrivateFieldLooseBase(this, _getPreviousBinColor)[_getPreviousBinColor](id) + "; to: " + markedColor + "; dur: 2600;"
2369
- });
2370
- currentBinScales[count] = {
2371
- key: id,
2372
- scale: width,
2373
- color: markedColor
2374
- };
2375
- }
2376
-
2377
- count++;
2378
- }
2379
- }
2380
- }
2381
-
2382
- _classPrivateFieldLooseBase(this, _previousBins)[_previousBins] = currentBinScales;
2383
- count = 0;
2384
-
2385
- for (var _iz = _classPrivateFieldLooseBase(this, _yOffset)[_yOffset]; _iz <= maxYLength; _iz++) {
2386
- var normalAxis = _classPrivateFieldLooseBase(this, _createAxisEntity)[_createAxisEntity](50000 + count, -2.5 + _classPrivateFieldLooseBase(this, _xOffset)[_xOffset], _classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1, _iz - 1, 270, 180, 0, 2, 1, "" + (yLabels[_iz - 1] ? yLabels[_iz - 1].fString : _iz - 1), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('z'), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2387
-
2388
- var reversedAxis = _classPrivateFieldLooseBase(this, _createAxisEntity)[_createAxisEntity](55000 + count, maxXLength + 0.5, _classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1, _iz - 1, 270, 360, 0, 2, 1, "" + (yLabels[_iz - 1] ? yLabels[_iz - 1].fString : _iz - 1), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('z'), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2389
-
2390
- elements.normalAxis[count] = normalAxis;
2391
- elements.reversedAxis[count] = reversedAxis;
2392
- count++;
2393
- }
2394
-
2395
- elements.normalAxis[count] = /*#__PURE__*/React__default.createElement("a-entity", {
2396
- id: "leftLabel",
2397
- key: 60000 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2398
- geometry: "primitive: plane; width:4; height:1;",
2399
- text: "value: " + yTitle + "; color: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('z') + "; width: 10; height:auto; align:center;",
2400
- rotation: 270 + " " + 270 + " " + 0,
2401
- animation: "property: position; from: " + (_classPrivateFieldLooseBase(this, _xOffset)[_xOffset] - 4 + _classPrivateFieldLooseBase(this, _shift)[_shift].xOffset) + " " + (_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1 + _classPrivateFieldLooseBase(this, _shift)[_shift].zOffset) + " " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] + 0.5 + _classPrivateFieldLooseBase(this, _shift)[_shift].yOffset) + "; to: " + (_classPrivateFieldLooseBase(this, _xOffset)[_xOffset] - 4) + " " + (_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1) + " " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] + 0.5) + "; dur: 1000;",
2402
- material: "opacity: 0;"
2403
- });
2404
- elements.reversedAxis[count] = /*#__PURE__*/React__default.createElement("a-entity", {
2405
- id: "rightLabel",
2406
- key: 65000 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2407
- geometry: "primitive: plane; width:4; height:1;",
2408
- text: "value: " + yTitle + "; color: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('z') + "; width: 10; height:auto; align:center;",
2409
- rotation: 270 + " " + 90 + " " + 0,
2410
- animation: "property: position; from: " + (maxXLength + 2 + _classPrivateFieldLooseBase(this, _shift)[_shift].xOffset) + " " + (_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1 + _classPrivateFieldLooseBase(this, _shift)[_shift].zOffset) + " " + (maxYLength - 2.5 + _classPrivateFieldLooseBase(this, _shift)[_shift].yOffset) + "; to: " + (maxXLength + 2) + " " + (_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1) + " " + (maxYLength - 2.5) + "; dur: 1000;",
2411
- material: "opacity: 0;"
2412
- });
2413
- count++;
2414
-
2415
- for (var _ix = _classPrivateFieldLooseBase(this, _xOffset)[_xOffset]; _ix <= maxXLength; _ix++) {
2416
- var _normalAxis = _classPrivateFieldLooseBase(this, _createAxisEntity)[_createAxisEntity](70000 + count, _ix - 1, _classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1, _classPrivateFieldLooseBase(this, _yOffset)[_yOffset] - 2.5, 270, 270, 0, 2, 1, "" + (xLabels[_ix - 1] ? xLabels[_ix - 1].fString : _ix - 1), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('x'), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2417
-
2418
- var _reversedAxis = _classPrivateFieldLooseBase(this, _createAxisEntity)[_createAxisEntity](75000 + count, _ix - 1, _classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1, maxYLength + 0.5, 270, 90, 0, 2, 1, "" + (xLabels[_ix - 1] ? xLabels[_ix - 1].fString : _ix - 1), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('x'), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2419
-
2420
- elements.normalAxis[count] = _normalAxis;
2421
- elements.reversedAxis[count] = _reversedAxis;
2422
- count++;
2423
- }
2424
-
2425
- elements.normalAxis[count] = /*#__PURE__*/React__default.createElement("a-entity", {
2426
- id: "downLabel",
2427
- key: 80000 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2428
- geometry: "primitive: plane; width:4; height:1;",
2429
- text: "value: " + xTitle + "; color: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('x') + "; width: 10; height:auto; align:center;",
2430
- rotation: 270 + " " + 180 + " " + 0,
2431
- animation: "property: position; from: " + (_classPrivateFieldLooseBase(this, _xOffset)[_xOffset] + _classPrivateFieldLooseBase(this, _shift)[_shift].xOffset) + " " + (_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1 + _classPrivateFieldLooseBase(this, _shift)[_shift].zOffset) + " " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] - 4 + _classPrivateFieldLooseBase(this, _shift)[_shift].yOffset) + "; to: " + _classPrivateFieldLooseBase(this, _xOffset)[_xOffset] + " " + (_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1) + " " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] - 4) + "; dur: 1000;",
2432
- material: "opacity: 0;"
2433
- });
2434
- elements.reversedAxis[count] = /*#__PURE__*/React__default.createElement("a-entity", {
2435
- id: "upLabel",
2436
- key: 85000 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2437
- geometry: "primitive: plane; width:4; height:1;",
2438
- text: "value: " + xTitle + "; color: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('x') + "; width: 10; height:auto; align:center;",
2439
- rotation: 270 + " " + 0 + " " + 0,
2440
- animation: "property: position; from: " + (maxXLength - 2.5 + _classPrivateFieldLooseBase(this, _shift)[_shift].xOffset) + " " + (_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1 + _classPrivateFieldLooseBase(this, _shift)[_shift].zOffset) + " " + (maxYLength + 2 + _classPrivateFieldLooseBase(this, _shift)[_shift].yOffset) + "; to: " + (maxXLength - 2.5) + " " + (_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1) + " " + (maxYLength + 2) + "; dur: 1000;",
2441
- material: "opacity: 0;"
2442
- });
2443
- count++;
2444
- elements.normalAxis[count] = _classPrivateFieldLooseBase(this, _createAxisEntity)[_createAxisEntity](90000 + count, maxXLength + 0.5, _classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1, maxYLength + 0.5, 270, 360, 0, 2, 2, "" + (zLabels[_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1] ? zLabels[_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1].fString : _classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('y'), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2445
- elements.reversedAxis[count] = _classPrivateFieldLooseBase(this, _createAxisEntity)[_createAxisEntity](91000 + count, maxXLength + 0.5, _classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1, _classPrivateFieldLooseBase(this, _yOffset)[_yOffset] - 2.5, 270, 90, 0, 2, 2, "" + (zLabels[_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1] ? zLabels[_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1].fString : _classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('y'), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2446
- count++;
2447
- elements.normalAxis[count] = _classPrivateFieldLooseBase(this, _createAxisEntity)[_createAxisEntity](92000 + count, _classPrivateFieldLooseBase(this, _xOffset)[_xOffset] - 2.5, _classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1, maxYLength + 0.5, 270, 270, 0, 2, 2, "" + (zLabels[_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1] ? zLabels[_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1].fString : _classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('y'), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2448
- elements.reversedAxis[count] = _classPrivateFieldLooseBase(this, _createAxisEntity)[_createAxisEntity](93000 + count, _classPrivateFieldLooseBase(this, _xOffset)[_xOffset] - 2.5, _classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1, _classPrivateFieldLooseBase(this, _yOffset)[_yOffset] - 2.5, 270, 180, 0, 2, 2, "" + (zLabels[_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1] ? zLabels[_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1].fString : _classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('y'), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2449
- count++;
2450
- elements.normalAxis[count] = /*#__PURE__*/React__default.createElement("a-entity", {
2451
- key: 95000 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2452
- text: "value: " + zTitle + "; color: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('y') + "; width: 10; height:auto; align:center;",
2453
- rotation: 0 + " " + 270 + " " + 90,
2454
- animation: "property: position; from: " + (_classPrivateFieldLooseBase(this, _xOffset)[_xOffset] - 1.5 + _classPrivateFieldLooseBase(this, _shift)[_shift].xOffset) + " " + (maxZLength - 1 + _classPrivateFieldLooseBase(this, _shift)[_shift].zOffset) + " " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] - 2 + _classPrivateFieldLooseBase(this, _shift)[_shift].yOffset) + "; to: " + (_classPrivateFieldLooseBase(this, _xOffset)[_xOffset] - 1.5) + " " + (maxZLength - 1) + " " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] - 2) + "; dur: 1000;",
2455
- material: "opacity: 0;"
2456
- });
2457
- elements.reversedAxis[count] = /*#__PURE__*/React__default.createElement("a-entity", {
2458
- key: 100000 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2459
- text: "value: " + zTitle + "; color: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('y') + "; width: 10; height:auto; align:center;",
2460
- rotation: 0 + " " + 90 + " " + 90,
2461
- animation: "property: position; from: " + (maxXLength - 0.5 + _classPrivateFieldLooseBase(this, _shift)[_shift].xOffset) + " " + (maxZLength - 1 + _classPrivateFieldLooseBase(this, _shift)[_shift].zOffset) + " " + (maxYLength + _classPrivateFieldLooseBase(this, _shift)[_shift].yOffset) + "; to: " + (maxXLength - 0.5) + " " + (maxZLength - 1) + " " + maxYLength + "; dur: 1000;",
2462
- material: "opacity: 0;"
2463
- });
2464
- count++;
2465
- elements.normalAxis[count] = /*#__PURE__*/React__default.createElement("a-entity", {
2466
- key: 105000 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2467
- text: "value: " + zTitle + "; color: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('y') + "; width: 10; height:auto; align:center;",
2468
- rotation: 0 + " " + 360 + " " + 90,
2469
- animation: "property: position; from: " + (_classPrivateFieldLooseBase(this, _xOffset)[_xOffset] - 2 + _classPrivateFieldLooseBase(this, _shift)[_shift].xOffset) + " " + (maxZLength - 1 + _classPrivateFieldLooseBase(this, _shift)[_shift].zOffset) + " " + (maxYLength - 0.5 + _classPrivateFieldLooseBase(this, _shift)[_shift].yOffset) + "; to: " + (_classPrivateFieldLooseBase(this, _xOffset)[_xOffset] - 2) + " " + (maxZLength - 1) + " " + (maxYLength - 0.5) + "; dur: 1000;",
2470
- material: "opacity: 0;"
2471
- });
2472
- elements.reversedAxis[count] = /*#__PURE__*/React__default.createElement("a-entity", {
2473
- key: 110000 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2474
- text: "value: " + zTitle + "; color: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('y') + "; width: 10; height:auto; align:center;",
2475
- rotation: 0 + " " + 180 + " " + 90,
2476
- animation: "property: position; from: " + (maxXLength - 0.5 + _classPrivateFieldLooseBase(this, _shift)[_shift].xOffset) + " " + (maxZLength - 1 + _classPrivateFieldLooseBase(this, _shift)[_shift].zOffset) + " " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] - 1.5 + _classPrivateFieldLooseBase(this, _shift)[_shift].yOffset) + "; to: " + (maxXLength - 0.5) + " " + (maxZLength - 1) + " " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] - 1.5) + "; dur: 1000;",
2477
- material: "opacity: 0;"
2478
- });
2479
- count++;
2480
- elements.normalAxis[count] = /*#__PURE__*/React__default.createElement("a-entity", {
2481
- key: 115000 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2482
- text: "value: " + _classPrivateFieldLooseBase(this, _histogram)[_histogram].fTitle + "; color: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getPrimaryFontColor() + "; width: 270; height:auto; align:center;",
2483
- rotation: 0 + " " + 123 + " " + 0,
2484
- position: _classPrivateFieldLooseBase(this, _xOffset)[_xOffset] - 90 + " " + (maxZLength + 16.5) + " " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] + 90)
2485
- }, /*#__PURE__*/React__default.createElement("a-text", {
2486
- value: "Press V to show projections or controls",
2487
- position: "0 10 0",
2488
- width: "150",
2489
- height: "auto",
2490
- align: "center",
2491
- color: _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getPrimaryFontColor()
2492
- }), /*#__PURE__*/React__default.createElement("a-entity", {
2493
- geometry: "primitive: plane; width:170; height:30;",
2494
- position: "0 0 -1",
2495
- material: "opacity: 0.9; color: white;"
2496
- }));
2497
- elements.reversedAxis[count] = /*#__PURE__*/React__default.createElement("a-entity", {
2498
- key: 120000 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2499
- text: "value: " + _classPrivateFieldLooseBase(this, _histogram)[_histogram].fName + "; color: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getPrimaryFontColor() + "; width: 230; height:auto; align:center;",
2500
- rotation: 0 + " " + 330 + " " + 0,
2501
- position: _classPrivateFieldLooseBase(this, _xOffset)[_xOffset] + 120 + " " + (maxZLength + 16.5) + " " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] - 70)
2502
- }, /*#__PURE__*/React__default.createElement("a-text", {
2503
- value: "Press buttonY to show projections or controls",
2504
- position: "0 10 0",
2505
- width: "150",
2506
- height: "auto",
2507
- align: "center",
2508
- color: _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getPrimaryFontColor()
2509
- }), /*#__PURE__*/React__default.createElement("a-entity", {
2510
- geometry: "primitive: plane; width:170; height:30;",
2511
- position: "0 0 -1",
2512
- material: "opacity: 0.9; color: white;"
2513
- }));
2514
- count++;
2515
- var bannerWidthX = _classPrivateFieldLooseBase(this, _range)[_range] > _classPrivateFieldLooseBase(this, _xLimit)[_xLimit] ? _classPrivateFieldLooseBase(this, _xLimit)[_xLimit] + 1 : _classPrivateFieldLooseBase(this, _range)[_range];
2516
- var bannerWidthY = _classPrivateFieldLooseBase(this, _range)[_range] > _classPrivateFieldLooseBase(this, _yLimit)[_yLimit] ? _classPrivateFieldLooseBase(this, _yLimit)[_yLimit] + 1 : _classPrivateFieldLooseBase(this, _range)[_range];
2517
- elements.banners[0] = /*#__PURE__*/React__default.createElement("a-box", {
2518
- key: 125000 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2519
- width: bannerWidthX + 8,
2520
- material: "color: #171717",
2521
- height: 0.2,
2522
- depth: bannerWidthY + 8,
2523
- animation: "property: position; from: " + (_classPrivateFieldLooseBase(this, _xOffset)[_xOffset] + bannerWidthX * 0.5 - 1 + _classPrivateFieldLooseBase(this, _shift)[_shift].xOffset) + " " + (_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1.5 + _classPrivateFieldLooseBase(this, _shift)[_shift].zOffset) + "\n " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] + bannerWidthY * 0.5 - 0.5 + _classPrivateFieldLooseBase(this, _shift)[_shift].yOffset) + ";\n to: " + (_classPrivateFieldLooseBase(this, _xOffset)[_xOffset] + bannerWidthX * 0.5 - 1) + " " + (_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] - 1.5) + " " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] + bannerWidthY * 0.5 - 0.5) + "dur: 1100;"
2524
- });
2525
- count++;
2526
- elements.banners[1] = /*#__PURE__*/React__default.createElement("a-box", {
2527
- key: 130000 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2528
- id: "th-mapping",
2529
- geometry: "width:1; height:15; depth:22;",
2530
- position: maxXLength + 8 + " " + (_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] + _classPrivateFieldLooseBase(this, _range)[_range] / 2 + 0.5) + "\n " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] + _classPrivateFieldLooseBase(this, _range)[_range] / 2 + 2.5),
2531
- material: "transparent:true"
2986
+ });
2987
+
2988
+ if (previousBin[0] && previousBin[0].scale) {
2989
+ return previousBin[0].scale;
2990
+ }
2991
+
2992
+ return 0;
2993
+ }
2532
2994
  });
2533
- count++;
2534
- elements.banners[2] = /*#__PURE__*/React__default.createElement("a-box", {
2535
- key: 135000 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2536
- id: "th-background",
2537
- geometry: "width:0.2; height:15; depth:24;",
2538
- position: maxXLength + 8.2 + " " + (_classPrivateFieldLooseBase(this, _zOffset)[_zOffset] + _classPrivateFieldLooseBase(this, _range)[_range] / 2 + 0.5) + "\n " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] + 1 + _classPrivateFieldLooseBase(this, _range)[_range] / 2 + 1.5),
2539
- material: "color: white, transparent:false"
2995
+ Object.defineProperty(this, _getPreviousBinColor, {
2996
+ writable: true,
2997
+ value: function value(id) {
2998
+ var previousBin = _classPrivateFieldLooseBase(_this, _previousBins)[_previousBins].filter(function (prevBin) {
2999
+ return prevBin.key === id;
3000
+ });
3001
+
3002
+ if (previousBin[0] && previousBin[0].scale) {
3003
+ return previousBin[0].color;
3004
+ }
3005
+
3006
+ return '#ffffff';
3007
+ }
2540
3008
  });
2541
- return elements;
3009
+ this.initializeFactory(uniqueName, histogram, section, range, projections, theme);
3010
+ }
3011
+
3012
+ var _proto = HistogramReactFactory.prototype;
3013
+
3014
+ _proto.initializeFactory = function initializeFactory(uniqueName, histogram, section, range, projections, theme) {
3015
+ this.setUniqueName(uniqueName);
3016
+ this.setTheme(theme);
3017
+ this.setHistogram(histogram, projections);
3018
+ this.setSection(section);
3019
+ this.setRange(range);
2542
3020
  };
2543
3021
 
2544
- _proto.createTH2Histogram = function createTH2Histogram(projectionFunction) {
2545
- _classPrivateFieldLooseBase(this, _selectedBins$1)[_selectedBins$1] = localStorageService.getBinsFromLocalStorage();
2546
- var elements = {
2547
- bins: [],
2548
- normalAxis: [],
2549
- reversedAxis: [],
2550
- banners: []
2551
- };
2552
- var centeredYPosition;
2553
- var xcenter, xmin, xmax, xwidth;
2554
- var ycenter, ymin, ymax, ywidth;
2555
- var c;
2556
- var binName = '';
2557
- var absoluteContent;
2558
- var count = 0;
2559
- var maxXLength = _classPrivateFieldLooseBase(this, _xOffset)[_xOffset] + _classPrivateFieldLooseBase(this, _range)[_range] > _classPrivateFieldLooseBase(this, _histogram)[_histogram].fXaxis.fNbins ? _classPrivateFieldLooseBase(this, _histogram)[_histogram].fXaxis.fNbins : _classPrivateFieldLooseBase(this, _xOffset)[_xOffset] + _classPrivateFieldLooseBase(this, _range)[_range];
2560
- var maxYLength = _classPrivateFieldLooseBase(this, _yOffset)[_yOffset] + _classPrivateFieldLooseBase(this, _range)[_range] > _classPrivateFieldLooseBase(this, _histogram)[_histogram].fYaxis.fNbins ? _classPrivateFieldLooseBase(this, _histogram)[_histogram].fYaxis.fNbins : _classPrivateFieldLooseBase(this, _yOffset)[_yOffset] + _classPrivateFieldLooseBase(this, _range)[_range];
2561
- var xTitle = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fXaxis.fTitle !== '' ? _classPrivateFieldLooseBase(this, _histogram)[_histogram].fXaxis.fTitle : 'x';
2562
- var yTitle = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fYaxis.fTitle !== '' ? _classPrivateFieldLooseBase(this, _histogram)[_histogram].fYaxis.fTitle : 'y';
2563
- var xLabels = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fXaxis.fLabels ? _classPrivateFieldLooseBase(this, _histogram)[_histogram].fXaxis.fLabels.arr : [];
2564
- var yLabels = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fYaxis.fLabels ? _classPrivateFieldLooseBase(this, _histogram)[_histogram].fYaxis.fLabels.arr : [];
2565
- var currentBinScales = [];
2566
-
2567
- for (var iy = _classPrivateFieldLooseBase(this, _yOffset)[_yOffset]; iy <= maxYLength; iy++) {
2568
- for (var ix = _classPrivateFieldLooseBase(this, _xOffset)[_xOffset]; ix <= maxXLength; ix++) {
2569
- xcenter = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fXaxis.GetBinCenter(ix);
2570
- xmin = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fXaxis.GetBinLowEdge(ix);
2571
- xmax = xcenter + (xcenter - xmin);
2572
- xwidth = xmax - xmin;
2573
- ycenter = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fYaxis.GetBinCenter(iy);
2574
- ymin = _classPrivateFieldLooseBase(this, _histogram)[_histogram].fYaxis.GetBinLowEdge(iy);
2575
- ymax = ycenter + (ycenter - ymin);
2576
- ywidth = ymax - ymin;
2577
- absoluteContent = _classPrivateFieldLooseBase(this, _histogram)[_histogram].getBinContent(ix, iy);
2578
- c = _classPrivateFieldLooseBase(this, _optimizeBinContent)[_optimizeBinContent](absoluteContent, _classPrivateFieldLooseBase(this, _histogram)[_histogram].fMaximum);
2579
- centeredYPosition = c / 2;
2580
-
2581
- if (c > 0) {
2582
- var projectionColor = _classPrivateFieldLooseBase(this, _projectionFunction)[_projectionFunction](projectionFunction, xmin, ymin);
2583
-
2584
- var color = projectionColor === '' ? _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getBinColor(c) : projectionColor;
2585
- var id = _classPrivateFieldLooseBase(this, _id)[_id] + xmin + 'th2' + xmax + 'th2' + ymin + 'th2' + ymax;
2586
- var markedColor = void 0;
2587
-
2588
- if (_classPrivateFieldLooseBase(this, _checkBinState)[_checkBinState](id)) {
2589
- markedColor = _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryAccentColor();
2590
- } else {
2591
- markedColor = color;
2592
- }
3022
+ _proto.setUniqueName = function setUniqueName(uniqueName) {
3023
+ _classPrivateFieldLooseBase(this, _id)[_id] = uniqueName;
3024
+ };
2593
3025
 
2594
- var binData = "id: " + id + ";\n content: " + c + ";\n color: " + color + ";\n yTitle: " + yTitle + ";\n xTitle: " + xTitle + ";\n absoluteContent: " + absoluteContent + ";\n binName: " + binName + ";\n xMin: " + xmin + ";\n yMin: " + ymin + ";\n xMax: " + xmax + ";\n yMax: " + ymax + ";\n xCenter: " + xcenter + ";\n yCenter: " + ycenter + ";\n xWidth: " + xwidth + ";\n yWidth: " + ywidth + ";\n markedColor: " + markedColor + ";\n selectColor: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryAccentColor() + ";\n axisX: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('x') + ";\n axisY: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('y') + ";\n axisZ: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('z');
2595
-
2596
- var width = xwidth / _classPrivateFieldLooseBase(this, _xWidth)[_xWidth] / 4;
2597
- var depth = ywidth / _classPrivateFieldLooseBase(this, _yWidth)[_yWidth] / 4;
2598
-
2599
- var posX = xmin / _classPrivateFieldLooseBase(this, _xWidth)[_xWidth];
2600
-
2601
- var posY = ymin / _classPrivateFieldLooseBase(this, _yWidth)[_yWidth];
2602
-
2603
- elements.bins[count] = /*#__PURE__*/React__default.createElement("a-box", {
2604
- key: id,
2605
- "class": "clickable",
2606
- material: "color: " + markedColor + "; opacity: 0.75;",
2607
- binth2: binData,
2608
- mouseevent: true,
2609
- animation: "property: scale; from: " + width + " " + _classPrivateFieldLooseBase(this, _getPreviousBinScales)[_getPreviousBinScales](id) + " " + depth + "; to: " + width + " " + c + " " + depth + "; delay:100; dur: 1500; easing: linear;",
2610
- animation__1: "property: material.opacity; from: 0; to: 0.75; dur: 2000;",
2611
- animation__2: "property: position; from: " + (posX + _classPrivateFieldLooseBase(this, _shift)[_shift].xOffset) + " " + centeredYPosition + " " + (posY + _classPrivateFieldLooseBase(this, _shift)[_shift].yOffset) + "; to: " + posX + " " + centeredYPosition + " " + posY + "; dur: 1000;"
2612
- });
2613
- currentBinScales[count] = {
2614
- key: id,
2615
- scale: c,
2616
- color: markedColor
2617
- };
2618
- }
3026
+ _proto.setSection = function setSection(section) {
3027
+ if (section !== null && section !== undefined) {
3028
+ if (section.xOffset) _classPrivateFieldLooseBase(this, _xOffset)[_xOffset] = _classPrivateFieldLooseBase(this, _checkOffsetValue)[_checkOffsetValue](section.xOffset, _classPrivateFieldLooseBase(this, _xLimit)[_xLimit]);
3029
+ if (section.yOffset) _classPrivateFieldLooseBase(this, _yOffset)[_yOffset] = _classPrivateFieldLooseBase(this, _checkOffsetValue)[_checkOffsetValue](section.yOffset, _classPrivateFieldLooseBase(this, _yLimit)[_yLimit]);
3030
+ }
2619
3031
 
2620
- count++;
3032
+ if (_classPrivateFieldLooseBase(this, _histogram)[_histogram]._typename.includes('TH3')) {
3033
+ if (section !== null && section !== undefined) {
3034
+ if (section.zOffset) _classPrivateFieldLooseBase(this, _zOffset)[_zOffset] = _classPrivateFieldLooseBase(this, _checkOffsetValue)[_checkOffsetValue](section.zOffset, _classPrivateFieldLooseBase(this, _zLimit)[_zLimit]);
2621
3035
  }
2622
3036
  }
3037
+ };
2623
3038
 
2624
- _classPrivateFieldLooseBase(this, _previousBins)[_previousBins] = currentBinScales;
2625
- count = 0;
2626
-
2627
- for (var _iy = _classPrivateFieldLooseBase(this, _yOffset)[_yOffset]; _iy <= maxYLength; _iy++) {
2628
- var normalAxis = _classPrivateFieldLooseBase(this, _createAxisEntity)[_createAxisEntity](1500 + count, _classPrivateFieldLooseBase(this, _xOffset)[_xOffset] - 2.5, 0, _iy - 1, 270, 180, 0, 2, 1, "" + (yLabels[_iy - 1] ? yLabels[_iy - 1].fString : (_iy - 1) * _classPrivateFieldLooseBase(this, _yWidth)[_yWidth]), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('z'), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2629
-
2630
- var reversedAxis = _classPrivateFieldLooseBase(this, _createAxisEntity)[_createAxisEntity](3000 + count, maxXLength + 0.5, 0, _iy - 1, 270, 360, 0, 2, 1, "" + (yLabels[_iy - 1] ? yLabels[_iy - 1].fString : (_iy - 1) * _classPrivateFieldLooseBase(this, _yWidth)[_yWidth]), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('z'), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryFontColor());
3039
+ _proto.setHistogram = function setHistogram(histogram, projections) {
3040
+ _classPrivateFieldLooseBase(this, _projections)[_projections] = projections;
3041
+ _classPrivateFieldLooseBase(this, _histogram)[_histogram] = histogram;
3042
+ _classPrivateFieldLooseBase(this, _type)[_type] = histogram._typename;
3043
+ _classPrivateFieldLooseBase(this, _xLimit)[_xLimit] = histogram.fXaxis.fNbins;
3044
+ _classPrivateFieldLooseBase(this, _yLimit)[_yLimit] = histogram.fYaxis.fNbins;
3045
+ _classPrivateFieldLooseBase(this, _xWidth)[_xWidth] = (histogram.fXaxis.fXmax - histogram.fXaxis.fXmin) / histogram.fXaxis.fNbins;
3046
+ _classPrivateFieldLooseBase(this, _yWidth)[_yWidth] = (histogram.fYaxis.fXmax - histogram.fYaxis.fXmin) / histogram.fYaxis.fNbins;
3047
+ _classPrivateFieldLooseBase(this, _labels)[_labels].xInitial = histogram.fXaxis.fXmin;
3048
+ _classPrivateFieldLooseBase(this, _labels)[_labels].yInitial = histogram.fYaxis.fXmin;
3049
+ _classPrivateFieldLooseBase(this, _xOffset)[_xOffset] = _classPrivateFieldLooseBase(this, _checkOffsetValue)[_checkOffsetValue](_classPrivateFieldLooseBase(this, _xOffset)[_xOffset], _classPrivateFieldLooseBase(this, _xLimit)[_xLimit]);
3050
+ _classPrivateFieldLooseBase(this, _yOffset)[_yOffset] = _classPrivateFieldLooseBase(this, _checkOffsetValue)[_checkOffsetValue](_classPrivateFieldLooseBase(this, _yOffset)[_yOffset], _classPrivateFieldLooseBase(this, _yLimit)[_yLimit]);
2631
3051
 
2632
- elements.normalAxis[count] = normalAxis;
2633
- elements.reversedAxis[count] = reversedAxis;
2634
- count++;
3052
+ if (histogram._typename.includes('TH3')) {
3053
+ _classPrivateFieldLooseBase(this, _zLimit)[_zLimit] = histogram.fZaxis.fNbins;
3054
+ _classPrivateFieldLooseBase(this, _zWidth)[_zWidth] = histogram.fZaxis.fXmax / histogram.fZaxis.fNbins;
3055
+ _classPrivateFieldLooseBase(this, _labels)[_labels].zInitial = histogram.fZaxis.fXmin;
3056
+ _classPrivateFieldLooseBase(this, _zOffset)[_zOffset] = _classPrivateFieldLooseBase(this, _checkOffsetValue)[_checkOffsetValue](_classPrivateFieldLooseBase(this, _zOffset)[_zOffset], _classPrivateFieldLooseBase(this, _zLimit)[_zLimit]);
2635
3057
  }
3058
+ };
2636
3059
 
2637
- elements.normalAxis[count] = /*#__PURE__*/React__default.createElement("a-entity", {
2638
- id: "leftLabel",
2639
- key: 4500 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2640
- geometry: "primitive: plane; width:4; height:1;",
2641
- text: "value: " + yTitle + "; color: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('z') + "; width: 10; height:auto; align:center;",
2642
- rotation: 270 + " " + 270 + " " + 0,
2643
- animation: "property: position; from: " + (_classPrivateFieldLooseBase(this, _xOffset)[_xOffset] - 4 + _classPrivateFieldLooseBase(this, _shift)[_shift].xOffset) + " " + _classPrivateFieldLooseBase(this, _shift)[_shift].zOffset + " " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] + 0.5 + _classPrivateFieldLooseBase(this, _shift)[_shift].yOffset) + "; to: " + (_classPrivateFieldLooseBase(this, _xOffset)[_xOffset] - 4) + " " + 0 + " " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] + 0.5) + "; dur: 1000;",
2644
- material: "opacity: 0;"
2645
- });
2646
- elements.reversedAxis[count] = /*#__PURE__*/React__default.createElement("a-entity", {
2647
- id: "rightLabel",
2648
- key: 6000 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2649
- geometry: "primitive: plane; width:4; height:1;",
2650
- text: "value: " + yTitle + "; color: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('z') + "; width: 10; height:auto; align:center;",
2651
- rotation: 270 + " " + 90 + " " + 0,
2652
- animation: "property: position; from: " + (maxXLength + 2 + _classPrivateFieldLooseBase(this, _shift)[_shift].xOffset) + " " + _classPrivateFieldLooseBase(this, _shift)[_shift].zOffset + " " + (maxYLength - 2.5 + _classPrivateFieldLooseBase(this, _shift)[_shift].yOffset) + "; to: " + (maxXLength + 2) + " " + 0 + " " + (maxYLength - 2.5) + "; dur: 1000;",
2653
- material: "opacity: 0;"
2654
- });
2655
- count++;
3060
+ _proto.setRange = function setRange(range) {
3061
+ if (range) {
3062
+ if (range < 4) _classPrivateFieldLooseBase(this, _range)[_range] = 4;
3063
+ _classPrivateFieldLooseBase(this, _range)[_range] = range;
3064
+ }
3065
+ };
2656
3066
 
2657
- for (var _ix2 = _classPrivateFieldLooseBase(this, _xOffset)[_xOffset]; _ix2 <= maxXLength; _ix2++) {
2658
- var _normalAxis2 = _classPrivateFieldLooseBase(this, _createAxisEntity)[_createAxisEntity](7500 + count, _ix2 - 1, 0, _classPrivateFieldLooseBase(this, _yOffset)[_yOffset] - 2.5, 270, 270, 0, 2, 1, "" + (xLabels[_ix2 - 1] ? xLabels[_ix2 - 1].fString : (_ix2 - 1) * _classPrivateFieldLooseBase(this, _xWidth)[_xWidth]), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('x'), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryFontColor());
3067
+ _proto.setTheme = function setTheme(theme) {
3068
+ _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider] = new ThemeProvider(theme);
3069
+ };
2659
3070
 
2660
- var _reversedAxis2 = _classPrivateFieldLooseBase(this, _createAxisEntity)[_createAxisEntity](9000 + count, _ix2 - 1, 0, maxYLength + 0.5, 270, 90, 0, 2, 1, "" + (xLabels[_ix2 - 1] ? xLabels[_ix2 - 1].fString : (_ix2 - 1) * _classPrivateFieldLooseBase(this, _xWidth)[_xWidth]), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('x'), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryFontColor());
3071
+ _proto.getElements = function getElements(projectionFunction) {
3072
+ var elements = {};
2661
3073
 
2662
- elements.normalAxis[count] = _normalAxis2;
2663
- elements.reversedAxis[count] = _reversedAxis2;
2664
- count++;
3074
+ if (_classPrivateFieldLooseBase(this, _type)[_type].includes('TH2')) {
3075
+ elements = _classPrivateFieldLooseBase(this, _createTH2Histogram)[_createTH2Histogram](projectionFunction);
3076
+ } else if (_classPrivateFieldLooseBase(this, _type)[_type].includes('TH3')) {
3077
+ elements = _classPrivateFieldLooseBase(this, _createTH3Histogram)[_createTH3Histogram]();
2665
3078
  }
2666
3079
 
2667
- elements.normalAxis[count] = /*#__PURE__*/React__default.createElement("a-entity", {
2668
- id: "downLabel",
2669
- key: 10500 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2670
- geometry: "primitive: plane; width:4; height:1;",
2671
- text: "value: " + xTitle + "; color: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('x') + "; width: 10; height:auto; align:center;",
2672
- rotation: 270 + " " + 180 + " " + 0,
2673
- animation: "property: position; from: " + (_classPrivateFieldLooseBase(this, _xOffset)[_xOffset] + _classPrivateFieldLooseBase(this, _shift)[_shift].xOffset) + " " + _classPrivateFieldLooseBase(this, _shift)[_shift].zOffset + " " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] - 4 + _classPrivateFieldLooseBase(this, _shift)[_shift].yOffset) + "; to: " + _classPrivateFieldLooseBase(this, _xOffset)[_xOffset] + " " + 0 + " " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] - 4) + "; dur: 1000;",
2674
- material: "opacity: 0;"
2675
- });
2676
- elements.reversedAxis[count] = /*#__PURE__*/React__default.createElement("a-entity", {
2677
- id: "upLabel",
2678
- key: 12000 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2679
- geometry: "primitive: plane; width:4; height:1;",
2680
- text: "value: " + xTitle + "; color: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('x') + "; width: 10; height:auto; align:center;",
2681
- rotation: 270 + " " + 0 + " " + 0,
2682
- animation: "property: position; from: " + (maxXLength - 2.5 + _classPrivateFieldLooseBase(this, _shift)[_shift].xOffset) + " " + _classPrivateFieldLooseBase(this, _shift)[_shift].zOffset + " " + (maxYLength + 2 + _classPrivateFieldLooseBase(this, _shift)[_shift].yOffset) + "; to: " + (maxXLength - 2.5) + " " + 0 + " " + (maxYLength + 2) + "; dur: 1000;",
2683
- material: "opacity: 0;"
2684
- });
2685
- count++;
2686
- elements.normalAxis[count] = _classPrivateFieldLooseBase(this, _createAxisEntity)[_createAxisEntity](13500 + count, maxXLength + 0.5, 0, maxYLength + 0.5, 270, 360, 0, 2, 2, "0", _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('y'), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2687
- elements.reversedAxis[count] = _classPrivateFieldLooseBase(this, _createAxisEntity)[_createAxisEntity](15000 + count, maxXLength + 0.5, 0, _classPrivateFieldLooseBase(this, _yOffset)[_yOffset] - 2.5, 270, 180, 0, 2, 2, "0", _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('y'), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2688
- count++;
2689
- elements.normalAxis[count] = _classPrivateFieldLooseBase(this, _createAxisEntity)[_createAxisEntity](16500 + count, _classPrivateFieldLooseBase(this, _xOffset)[_xOffset] - 2.5, 0, maxYLength + 0.5, 270, 180, 0, 2, 2, "0", _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('y'), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2690
- elements.reversedAxis[count] = _classPrivateFieldLooseBase(this, _createAxisEntity)[_createAxisEntity](18000 + count, _classPrivateFieldLooseBase(this, _xOffset)[_xOffset] - 2.5, 0, _classPrivateFieldLooseBase(this, _yOffset)[_yOffset] - 2.5, 270, 180, 0, 2, 2, "0", _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getAxisColor('y'), _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getSecondaryFontColor());
2691
- count++;
2692
- elements.normalAxis[count] = /*#__PURE__*/React__default.createElement("a-entity", {
2693
- key: 19500 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2694
- text: "value: " + _classPrivateFieldLooseBase(this, _histogram)[_histogram].fTitle + "; color: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getPrimaryFontColor() + "; width: 270; height:auto; align:center;",
2695
- rotation: 0 + " " + 123 + " " + 0,
2696
- position: _classPrivateFieldLooseBase(this, _xOffset)[_xOffset] - 90 + " " + 16.5 + " " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] + 90)
2697
- }, /*#__PURE__*/React__default.createElement("a-text", {
2698
- value: "Press V to show projections or controls",
2699
- position: "0 10 0",
2700
- width: "150",
2701
- height: "auto",
2702
- align: "center",
2703
- color: _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getPrimaryFontColor()
2704
- }), /*#__PURE__*/React__default.createElement("a-entity", {
2705
- geometry: "primitive: plane; width:170; height:30;",
2706
- position: "0 0 -1",
2707
- material: "opacity: 0.9; color: white;"
2708
- }));
2709
- elements.reversedAxis[count] = /*#__PURE__*/React__default.createElement("a-entity", {
2710
- key: 21000 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2711
- text: "value: " + _classPrivateFieldLooseBase(this, _histogram)[_histogram].fName + "; color: " + _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getPrimaryFontColor() + "; width: 230; height:auto; align:center;",
2712
- rotation: 0 + " " + 330 + " " + 0,
2713
- position: _classPrivateFieldLooseBase(this, _xOffset)[_xOffset] + 120 + " " + 16.5 + " " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] - 70)
2714
- }, /*#__PURE__*/React__default.createElement("a-text", {
2715
- value: "Press buttonY to show projections or controls",
2716
- position: "0 10 0",
2717
- width: "150",
2718
- height: "auto",
2719
- align: "center",
2720
- color: _classPrivateFieldLooseBase(this, _themeProvider)[_themeProvider].getPrimaryFontColor()
2721
- }), /*#__PURE__*/React__default.createElement("a-entity", {
2722
- geometry: "primitive: plane; width:170; height:30;",
2723
- position: "0 0 -1",
2724
- material: "opacity: 0.9; color: white;"
2725
- }));
2726
- count++;
2727
- var bannerWidthX = _classPrivateFieldLooseBase(this, _range)[_range] > _classPrivateFieldLooseBase(this, _xLimit)[_xLimit] ? _classPrivateFieldLooseBase(this, _xLimit)[_xLimit] + 1 : _classPrivateFieldLooseBase(this, _range)[_range];
2728
- var bannerWidthY = _classPrivateFieldLooseBase(this, _range)[_range] > _classPrivateFieldLooseBase(this, _yLimit)[_yLimit] ? _classPrivateFieldLooseBase(this, _yLimit)[_yLimit] + 1 : _classPrivateFieldLooseBase(this, _range)[_range];
2729
- elements.banners[0] = /*#__PURE__*/React__default.createElement("a-box", {
2730
- key: 22500 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2731
- width: bannerWidthX + 8,
2732
- material: "color: #171717",
2733
- height: 0.2,
2734
- depth: bannerWidthY + 8,
2735
- animation: "property: position; from: " + (_classPrivateFieldLooseBase(this, _xOffset)[_xOffset] + bannerWidthX * 0.5 - 1 + _classPrivateFieldLooseBase(this, _shift)[_shift].xOffset) + "\n -0.5\n " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] + bannerWidthY * 0.5 - 0.5 + _classPrivateFieldLooseBase(this, _shift)[_shift].yOffset) + ";\n to:\n " + (_classPrivateFieldLooseBase(this, _xOffset)[_xOffset] + bannerWidthX * 0.5 - 1) + " -0.5 " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] + bannerWidthY * 0.5 - 0.5) + "; dur: 1000;"
2736
- });
2737
- count++;
2738
- elements.banners[1] = /*#__PURE__*/React__default.createElement("a-box", {
2739
- key: 24000 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2740
- id: "th-mapping",
2741
- geometry: "width:0.1; height:15; depth:22;",
2742
- position: maxXLength + 8 + " 7\n " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] + _classPrivateFieldLooseBase(this, _range)[_range] / 2 + 2.5),
2743
- material: "transparent:true"
2744
- });
2745
- count++;
2746
- elements.banners[2] = /*#__PURE__*/React__default.createElement("a-box", {
2747
- key: 25500 + count + _classPrivateFieldLooseBase(this, _id)[_id],
2748
- id: "th-background",
2749
- geometry: "width:0.2; height:16; depth:24;",
2750
- position: maxXLength + 8.2 + " 7\n " + (_classPrivateFieldLooseBase(this, _yOffset)[_yOffset] + 1 + _classPrivateFieldLooseBase(this, _range)[_range] / 2 + 1.5),
2751
- material: "color: white, transparent:false"
2752
- });
2753
3080
  return elements;
2754
3081
  };
2755
3082
 
@@ -2772,83 +3099,64 @@ var NdmVrHistogram3D = function NdmVrHistogram3D(_ref) {
2772
3099
  var _useState = React.useState(new HistogramReactFactory(name, histogram, histoSection || null, range, projections, theme || 'def')),
2773
3100
  factory = _useState[0];
2774
3101
 
2775
- var _useState2 = React.useState({
2776
- uniqueName: name,
2777
- histogram: histogram,
2778
- projections: projections || null,
2779
- typeName: histogram._typename,
2780
- xOffset: factory.getXOffset(),
2781
- zOffset: factory.getZOffset(),
2782
- yOffset: factory.getYOffset(),
2783
- range: factory.getRange()
2784
- }),
2785
- histo = _useState2[0],
2786
- setHisto = _useState2[1];
2787
-
2788
- var _useState3 = React.useState('default'),
2789
- mode = _useState3[0],
2790
- setMode = _useState3[1];
2791
-
2792
- var createElements = function createElements() {
2793
- var elements = {};
2794
-
2795
- if (histo.typeName.includes('TH2')) {
2796
- elements = factory.createTH2Histogram(mode);
2797
- } else if (histo.typeName.includes('TH3')) {
2798
- elements = factory.createTH3Histogram();
2799
- }
2800
-
2801
- return elements;
2802
- };
3102
+ var _useState2 = React.useState('default'),
3103
+ mode = _useState2[0],
3104
+ setMode = _useState2[1];
2803
3105
 
2804
- var _useState4 = React.useState(createElements),
2805
- elements = _useState4[0],
2806
- setElements = _useState4[1];
3106
+ var _useState3 = React.useState(factory.getElements(mode)),
3107
+ elements = _useState3[0],
3108
+ setElements = _useState3[1];
2807
3109
 
2808
- var updateHistogramSection = function updateHistogramSection(newSection) {
2809
- var object = histo;
2810
- object.xOffset = newSection.xOffset;
2811
- object.yOffset = newSection.yOffset;
2812
- object.zOffset = newSection.zOffset;
2813
- object.range = newSection.range;
2814
- setHisto(object);
2815
- setElements(createElements);
2816
- };
3110
+ var _useState4 = React.useState(1),
3111
+ binMarkState = _useState4[0],
3112
+ setBinMarkState = _useState4[1];
2817
3113
 
2818
3114
  var handleSubscription = function handleSubscription(data) {
2819
- if (histo.typeName.includes(data.name)) {
3115
+ if (histogram._typename.includes(data.name)) {
2820
3116
  if (data.axis) {
2821
- var section = factory.updateSection(data.axis, data.increment, data.defaultRange);
2822
- updateHistogramSection(section);
3117
+ factory.updateSection(data.axis, data.increment, data.defaultRange);
3118
+ setElements(factory.getElements(mode));
3119
+ } else if (data.binMarkMode) {
3120
+ setBinMarkState(function (prevState) {
3121
+ if (prevState + data.binMarkMode > 2) return 2;
3122
+ if (prevState + data.binMarkMode < 1) return 1;
3123
+ return prevState + data.binMarkMode;
3124
+ });
2823
3125
  } else {
2824
- setMode(data.fFunction);
3126
+ setMode(function (prevState) {
3127
+ return prevState !== data.fFunction ? data.fFunction : prevState;
3128
+ });
2825
3129
  }
2826
3130
  }
2827
3131
  };
2828
3132
 
2829
3133
  React.useEffect(function () {
2830
- setHisto({
2831
- uniqueName: name,
2832
- histogram: histogram,
2833
- typeName: histogram._typename,
2834
- projections: projections || null,
2835
- xOffset: factory.getXOffset(),
2836
- zOffset: factory.getZOffset(),
2837
- yOffset: factory.getYOffset(),
2838
- range: factory.getRange()
2839
- });
2840
- }, [histogram, histoSection, projections, name]);
3134
+ factory.setUniqueName(name);
3135
+ setElements(factory.getElements(mode));
3136
+ }, [name]);
3137
+ React.useEffect(function () {
3138
+ factory.setHistogram(histogram, projections);
3139
+ setElements(factory.getElements(mode));
3140
+ }, [histogram, projections]);
3141
+ React.useEffect(function () {
3142
+ factory.setSection(histoSection);
3143
+ setElements(factory.getElements(mode));
3144
+ }, [histoSection]);
3145
+ React.useEffect(function () {
3146
+ factory.setRange(range);
3147
+ setElements(factory.getElements(mode));
3148
+ }, [range]);
2841
3149
  React.useEffect(function () {
2842
- factory.initializeFactory(name, histogram, histoSection, range, projections, theme);
2843
- setElements(createElements);
2844
- }, [histo, theme]);
3150
+ factory.setTheme(theme);
3151
+ setElements(factory.getElements(mode));
3152
+ }, [theme]);
2845
3153
  React.useEffect(function () {
2846
- setElements(createElements);
3154
+ setElements(factory.getElements(mode));
2847
3155
  }, [mode]);
2848
3156
  React.useEffect(function () {
2849
- if (histo.typeName.includes('TH2')) {
3157
+ if (histogram._typename.includes('TH2')) {
2850
3158
  subscription = histogramTH2Service.getChangedSection().subscribe(handleSubscription);
2851
- } else if (histo.typeName.includes('TH3')) {
3159
+ } else if (histogram._typename.includes('TH3')) {
2852
3160
  subscription = histogramTH3Service.getChangedSection().subscribe(handleSubscription);
2853
3161
  }
2854
3162
 
@@ -2861,13 +3169,81 @@ var NdmVrHistogram3D = function NdmVrHistogram3D(_ref) {
2861
3169
  return /*#__PURE__*/React__default.createElement("a-entity", {
2862
3170
  "histogram-control": true
2863
3171
  }, elements.bins.map(function (bin) {
2864
- return bin;
2865
- }), elements.normalAxis.map(function (axis) {
2866
- return axis;
2867
- }), elements.reversedAxis.map(function (axis) {
2868
- return axis;
3172
+ return /*#__PURE__*/React__default.createElement("a-box", {
3173
+ key: bin.id,
3174
+ "class": "clickable",
3175
+ material: "color: " + bin.color + "; transparent: true",
3176
+ binth: bin.binData,
3177
+ mouseevent: true,
3178
+ animation: "property: scale; from: " + bin.animation.fromWidth + " " + bin.animation.fromHeight + " " + bin.animation.fromDepth + "; to: " + bin.animation.toWidth + " " + bin.animation.toHeight + " " + bin.animation.toDepth + "; delay:100; dur: 1500; easing: linear;",
3179
+ animation__1: "property: material.opacity; from: 0; to: 0.50; dur: 2000;",
3180
+ animation__2: "property: position; from: " + bin.animation2.fromX + " " + bin.animation2.fromY + " " + bin.animation2.fromZ + "; to: " + bin.animation2.toX + " " + bin.animation2.toY + " " + bin.animation2.toZ + "; dur: 1000;",
3181
+ animation__3: "property: material.color; from: " + bin.animation3.fromColor + "; to: " + bin.animation3.toColor + "; dur: 1600;"
3182
+ }, /*#__PURE__*/React__default.createElement("a-text", {
3183
+ value: bin.content,
3184
+ align: "center",
3185
+ width: "10",
3186
+ color: "black",
3187
+ geometry: "primitive:plane; width: 1; height: 1",
3188
+ material: "color: " + bin.animation3.toColor + "; opacity: 0.50; transparent: true",
3189
+ rotation: "270 180 0",
3190
+ position: "0 " + (binMarkState === 1 ? -0.5 : 0.501) + " 0"
3191
+ }));
3192
+ }), elements.labels.map(function (label) {
3193
+ return /*#__PURE__*/React__default.createElement("a-entity", {
3194
+ key: label.key,
3195
+ geometry: "primitive: " + label.geometry.primitive + "; width:" + label.geometry.width + "; height:" + label.geometry.height + ";",
3196
+ text: "color: " + label.text.color + "; width: " + label.text.width + "; height: " + label.text.height + "; align:center;",
3197
+ "label-handler": "value: " + label.labelHandler.value + "; delay:" + label.labelHandler.delay,
3198
+ rotation: label.rotation.x + " " + label.rotation.y + " " + label.rotation.z,
3199
+ material: "color: " + label.material.color + "; transparent: true",
3200
+ animation: "property: text.width; from: 0; to: 4; dur: 1000;",
3201
+ animation__1: "property: material.opacity; from: 0; to: 0.8; dur: 1500;",
3202
+ animation__2: "property: position; from: " + label.animation.fromX + " " + label.animation.fromY + " " + label.animation.fromZ + "; to: " + label.animation.toX + " " + label.animation.toY + " " + label.animation.toZ + "; dur: 1005;"
3203
+ });
3204
+ }), elements.titles.map(function (title) {
3205
+ return /*#__PURE__*/React__default.createElement("a-entity", {
3206
+ key: title.key,
3207
+ text: "value: " + title.text.value + "; color: " + title.text.color + "; width: 230; height:auto; align:center;",
3208
+ rotation: title.rotation.x + " " + title.rotation.y + " " + title.rotation.z,
3209
+ position: title.position.x + " " + title.position.y + " " + title.position.z,
3210
+ material: "transparent: true"
3211
+ }, /*#__PURE__*/React__default.createElement("a-text", {
3212
+ value: title.innerText.value,
3213
+ position: "0 10 0",
3214
+ width: "150",
3215
+ height: "auto",
3216
+ align: "center",
3217
+ color: title.innerText.color
3218
+ }), /*#__PURE__*/React__default.createElement("a-entity", {
3219
+ geometry: "primitive: plane; width:170; height:30;",
3220
+ position: "0 0 -1",
3221
+ material: "opacity: 0.9; color: white; transparent: true"
3222
+ }));
3223
+ }), elements.axisLabels.map(function (axisLabel) {
3224
+ return /*#__PURE__*/React__default.createElement("a-entity", {
3225
+ id: axisLabel.id,
3226
+ key: axisLabel.key,
3227
+ text: "value: " + axisLabel.text.value + "; color: " + axisLabel.text.color + "; width: 10; height:auto; align:center;",
3228
+ rotation: axisLabel.rotation.x + " " + axisLabel.rotation.y + " " + axisLabel.rotation.z,
3229
+ animation: "property: position; from: " + axisLabel.animation.fromX + " " + axisLabel.animation.fromY + " " + axisLabel.animation.fromZ + "; to: " + axisLabel.animation.toX + " " + axisLabel.animation.toY + " " + axisLabel.animation.toZ + "; dur: 1000;",
3230
+ material: "opacity: 0; transparent: true"
3231
+ });
3232
+ }), elements.ground && /*#__PURE__*/React__default.createElement("a-box", {
3233
+ key: elements.ground.key,
3234
+ width: elements.ground.scale.width,
3235
+ material: "color: #fafafa",
3236
+ height: elements.ground.scale.height,
3237
+ depth: elements.ground.scale.depth,
3238
+ animation: "property: position; from: " + elements.ground.animation.fromX + " " + elements.ground.animation.fromY + " " + elements.ground.animation.fromZ + ";\n to:\n " + elements.ground.animation.toX + " " + elements.ground.animation.toY + " " + elements.ground.animation.toZ + "; dur: 1000;"
2869
3239
  }), elements.banners.map(function (banner) {
2870
- return banner;
3240
+ return /*#__PURE__*/React__default.createElement("a-box", {
3241
+ key: banner.key,
3242
+ id: banner.id,
3243
+ geometry: "width:" + banner.geometry.width + "; height:" + banner.geometry.height + "; depth:" + banner.geometry.depth + ";",
3244
+ position: banner.position.x + " " + banner.position.y + " " + banner.position.z,
3245
+ material: "color: " + banner.material.color + ", transparent: " + banner.material.transparent
3246
+ });
2871
3247
  }));
2872
3248
  } else {
2873
3249
  return /*#__PURE__*/React__default.createElement("a-box", {
@@ -2879,18 +3255,119 @@ var NdmVrHistogram3D = function NdmVrHistogram3D(_ref) {
2879
3255
  }
2880
3256
  };
2881
3257
 
3258
+ function NdmVrLaboratory() {
3259
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("a-sky", {
3260
+ color: "#dbf0fe"
3261
+ }), /*#__PURE__*/React__default.createElement("a-plane", {
3262
+ rotation: "-90 0 0",
3263
+ position: "0 -0.5 0",
3264
+ width: "1000",
3265
+ height: "1000",
3266
+ color: "#aaa",
3267
+ material: "shader:flat;"
3268
+ }));
3269
+ }
3270
+
3271
+ var Controller = function Controller(_ref) {
3272
+ var socket = _ref.socket;
3273
+
3274
+ var _useState = React.useState(0),
3275
+ time = _useState[0],
3276
+ setTime = _useState[1];
3277
+
3278
+ React.useEffect(function () {
3279
+ var camera = document.getElementById('camera');
3280
+ var absolutePosition = new THREE.Vector3();
3281
+ var rotationQuaternion = new THREE.Quaternion();
3282
+ camera.object3D.getWorldPosition(absolutePosition);
3283
+ var id = socket.id;
3284
+ var interval = setInterval(function () {
3285
+ camera.object3D.getWorldPosition(absolutePosition);
3286
+ camera.object3D.getWorldQuaternion(rotationQuaternion);
3287
+ socket.emit('move', {
3288
+ id: id,
3289
+ position: absolutePosition.toArray(),
3290
+ rotation: rotationQuaternion.toArray()
3291
+ });
3292
+ setTime(function (prevTime) {
3293
+ return prevTime + 1;
3294
+ });
3295
+ }, 10);
3296
+ return function () {
3297
+ return clearInterval(interval);
3298
+ };
3299
+ }, [time]);
3300
+ return /*#__PURE__*/React__default.createElement("a-entity", null);
3301
+ };
3302
+
3303
+ var UserWrapper = function UserWrapper(_ref) {
3304
+ var position = _ref.position,
3305
+ rotation = _ref.rotation,
3306
+ id = _ref.id;
3307
+ React.useEffect(function () {
3308
+ var quaternionToApply = new THREE.Quaternion().fromArray(rotation);
3309
+ var user = document.getElementById(id).object3D;
3310
+ user.setRotationFromQuaternion(quaternionToApply);
3311
+ }, [rotation]);
3312
+ return /*#__PURE__*/React__default.createElement("a-box", {
3313
+ position: position,
3314
+ id: id,
3315
+ color: "#4CC3D9"
3316
+ });
3317
+ };
3318
+
3319
+ var NetworkingComponent = function NetworkingComponent(_ref) {
3320
+ var socketClient = _ref.socketClient,
3321
+ clients = _ref.clients;
3322
+ return /*#__PURE__*/React__default.createElement("a-entity", null, /*#__PURE__*/React__default.createElement(Controller, {
3323
+ socket: socketClient
3324
+ }), Object.keys(clients).filter(function (clientKey) {
3325
+ return clientKey !== socketClient.id;
3326
+ }).map(function (client) {
3327
+ var _clients$client = clients[client],
3328
+ position = _clients$client.position,
3329
+ rotation = _clients$client.rotation;
3330
+ var positionParse = position.join(' ');
3331
+ return /*#__PURE__*/React__default.createElement(UserWrapper, {
3332
+ key: client,
3333
+ id: client,
3334
+ position: positionParse,
3335
+ rotation: rotation
3336
+ });
3337
+ }));
3338
+ };
3339
+
3340
+ var NdmVrShared = function NdmVrShared() {
3341
+ var _useState = React.useState(0),
3342
+ socketClient = _useState[0],
3343
+ setSocketClient = _useState[1];
3344
+
3345
+ var _useState2 = React.useState({}),
3346
+ clients = _useState2[0],
3347
+ setClients = _useState2[1];
3348
+
3349
+ React.useEffect(function () {
3350
+ setSocketClient(socket_ioClient.io.connect('http://localhost:3001'));
3351
+ return function () {
3352
+ if (socketClient) socketClient.disconnect();
3353
+ };
3354
+ }, []);
3355
+ React.useEffect(function () {
3356
+ if (socketClient) {
3357
+ socketClient.on('move', function (clients) {
3358
+ setClients(clients);
3359
+ });
3360
+ }
3361
+ }, [socketClient]);
3362
+ return socketClient && /*#__PURE__*/React__default.createElement(NetworkingComponent, {
3363
+ socketClient: socketClient,
3364
+ clients: clients
3365
+ });
3366
+ };
3367
+
2882
3368
  var NdmVrScene = function NdmVrScene(_ref) {
2883
3369
  var data = _ref.data,
2884
3370
  info = _ref.info;
2885
-
2886
- var _useState = React.useState({
2887
- url: info.background.url ? info.background.url : './ndmvr/backgrounds/background1.jpg',
2888
- radius: info.background.radius ? info.background.radius : '3000',
2889
- height: info.background.height ? info.background.height : '2048',
2890
- width: info.background.width ? info.background.width : '2048'
2891
- }),
2892
- background = _useState[0];
2893
-
2894
3371
  return /*#__PURE__*/React__default.createElement("a-scene", {
2895
3372
  embedded: true,
2896
3373
  style: {
@@ -2900,22 +3377,16 @@ var NdmVrScene = function NdmVrScene(_ref) {
2900
3377
  }
2901
3378
  }, /*#__PURE__*/React__default.createElement("a-assets", null, /*#__PURE__*/React__default.createElement("img", {
2902
3379
  id: "skyTexture",
2903
- src: background.url,
3380
+ src: info.background.url,
2904
3381
  alt: "background"
2905
- })), /*#__PURE__*/React__default.createElement(NdmVrCamera, null), /*#__PURE__*/React__default.createElement(NdmVrHistogram3D, {
3382
+ })), /*#__PURE__*/React__default.createElement(NdmVrLaboratory, null), /*#__PURE__*/React__default.createElement(NdmVrCamera, null), /*#__PURE__*/React__default.createElement(NdmVrHistogram3D, {
2906
3383
  name: info.name,
2907
3384
  histogram: data.histogram,
2908
3385
  histoSection: data.section,
2909
3386
  projections: data.projections,
2910
3387
  range: data.range,
2911
3388
  theme: info.theme
2912
- }), /*#__PURE__*/React__default.createElement("a-sky", {
2913
- height: background.height,
2914
- radius: background.radius,
2915
- width: background.width,
2916
- src: "#skyTexture",
2917
- position: "0 1000 0"
2918
- }));
3389
+ }), /*#__PURE__*/React__default.createElement(NdmVrShared, null));
2919
3390
  };
2920
3391
 
2921
3392
  var EntityBuilder = /*#__PURE__*/function () {
@@ -3499,6 +3970,123 @@ var optimizeBinContent = function optimizeBinContent(binContent, maxContent) {
3499
3970
  return binContent;
3500
3971
  };
3501
3972
 
3973
+ AFRAME$1.registerComponent('binth2', {
3974
+ schema: {
3975
+ id: {
3976
+ type: 'string'
3977
+ },
3978
+ content: {
3979
+ "default": 0
3980
+ },
3981
+ absoluteContent: {
3982
+ "default": 0
3983
+ },
3984
+ binName: {
3985
+ "default": ''
3986
+ },
3987
+ xTitle: {
3988
+ type: 'string'
3989
+ },
3990
+ yTitle: {
3991
+ type: 'string'
3992
+ },
3993
+ xMin: {
3994
+ type: 'number'
3995
+ },
3996
+ yMin: {
3997
+ type: 'number'
3998
+ },
3999
+ xMax: {
4000
+ type: 'number'
4001
+ },
4002
+ yMax: {
4003
+ type: 'number'
4004
+ },
4005
+ xCenter: {
4006
+ type: 'number'
4007
+ },
4008
+ yCenter: {
4009
+ type: 'number'
4010
+ },
4011
+ xWidth: {
4012
+ type: 'number'
4013
+ },
4014
+ yWidth: {
4015
+ type: 'number'
4016
+ },
4017
+ color: {
4018
+ type: 'string'
4019
+ },
4020
+ axisX: {
4021
+ type: 'string'
4022
+ },
4023
+ axisY: {
4024
+ type: 'string'
4025
+ },
4026
+ axisZ: {
4027
+ type: 'string'
4028
+ },
4029
+ selectColor: {
4030
+ type: 'string'
4031
+ },
4032
+ markedColor: {
4033
+ type: 'string'
4034
+ }
4035
+ },
4036
+ init: function init() {
4037
+ var el = this.el;
4038
+ el.userData = {
4039
+ typeName: 'TH2',
4040
+ id: this.data.id,
4041
+ content: this.data.content,
4042
+ absoluteContent: this.data.absoluteContent,
4043
+ binName: this.data.binName,
4044
+ xTitle: this.data.xTitle,
4045
+ yTitle: this.data.yTitle,
4046
+ xMin: this.data.xMin,
4047
+ yMin: this.data.yMin,
4048
+ xMax: this.data.xMax,
4049
+ yMax: this.data.yMax,
4050
+ xCenter: this.data.xCenter,
4051
+ yCenter: this.data.yCenter,
4052
+ xWidth: this.data.xWidth,
4053
+ yWidth: this.data.yWidth,
4054
+ color: this.data.color,
4055
+ axisX: this.data.axisX,
4056
+ axisY: this.data.axisY,
4057
+ axisZ: this.data.axisZ,
4058
+ selectColor: this.data.selectColor,
4059
+ markedColor: this.data.markedColor
4060
+ };
4061
+ },
4062
+ update: function update() {
4063
+ var el = this.el;
4064
+ el.userData = {
4065
+ typeName: 'TH2',
4066
+ id: this.data.id,
4067
+ content: this.data.content,
4068
+ absoluteContent: this.data.absoluteContent,
4069
+ binName: this.data.binName,
4070
+ xTitle: this.data.xTitle,
4071
+ yTitle: this.data.yTitle,
4072
+ xMin: this.data.xMin,
4073
+ yMin: this.data.yMin,
4074
+ xMax: this.data.xMax,
4075
+ yMax: this.data.yMax,
4076
+ xCenter: this.data.xCenter,
4077
+ yCenter: this.data.yCenter,
4078
+ xWidth: this.data.xWidth,
4079
+ yWidth: this.data.yWidth,
4080
+ color: this.data.color,
4081
+ axisX: this.data.axisX,
4082
+ axisY: this.data.axisY,
4083
+ axisZ: this.data.axisZ,
4084
+ selectColor: this.data.selectColor,
4085
+ markedColor: this.data.markedColor
4086
+ };
4087
+ }
4088
+ });
4089
+
3502
4090
  var _jsroot$1 = /*#__PURE__*/_classPrivateFieldLooseKey("jsroot");
3503
4091
 
3504
4092
  var HistogramDemoFactory = /*#__PURE__*/function () {
@@ -3564,7 +4152,7 @@ var HistogramDemoFactory = /*#__PURE__*/function () {
3564
4152
  return HistogramDemoFactory;
3565
4153
  }();
3566
4154
 
3567
- var index = AFRAME.registerComponent('th2-histogram', {
4155
+ var index = AFRAME$1.registerComponent('th2-histogram', {
3568
4156
  schema: {
3569
4157
  section: {
3570
4158
  type: 'string'
@@ -3703,7 +4291,7 @@ var index = AFRAME.registerComponent('th2-histogram', {
3703
4291
  }
3704
4292
  });
3705
4293
 
3706
- var infoBannerAframeComponent = AFRAME.registerComponent('banner-control', {
4294
+ var infoBannerAframeComponent = AFRAME$1.registerComponent('banner-control', {
3707
4295
  schema: {
3708
4296
  position: {
3709
4297
  name: 'position',
@@ -3881,7 +4469,7 @@ var oculusRedrawHistogramBanners = function oculusRedrawHistogramBanners() {
3881
4469
  });
3882
4470
  };
3883
4471
 
3884
- var leftOculusController = AFRAME.registerComponent('left-controller-logging', {
4472
+ var leftOculusController = AFRAME$1.registerComponent('left-controller-logging', {
3885
4473
  init: function init() {
3886
4474
  var gripActive = false;
3887
4475
  var speed = 1;
@@ -3928,7 +4516,7 @@ var leftOculusController = AFRAME.registerComponent('left-controller-logging', {
3928
4516
  }
3929
4517
  });
3930
4518
 
3931
- var rightOculusController = AFRAME.registerComponent('right-controller-logging', {
4519
+ var rightOculusController = AFRAME$1.registerComponent('right-controller-logging', {
3932
4520
  init: function init() {
3933
4521
  var gripActive = false;
3934
4522
  var el = this.el;
@@ -3989,5 +4577,6 @@ exports.JSrootHistogram = JsrootHistogram;
3989
4577
  exports.LeftController = leftOculusController;
3990
4578
  exports.NdmVrScene = NdmVrScene;
3991
4579
  exports.RightController = rightOculusController;
4580
+ exports.binDataDistributor = binDataDistributor;
3992
4581
  exports.ndmVrStorage = ndmVrStorage;
3993
4582
  //# sourceMappingURL=index.js.map