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