@ndmspc/ndmvr 0.1.1 → 0.20220401.0

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