aframe-babia-components 1.2.0 → 1.2.3

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.
Files changed (127) hide show
  1. package/components/filters/babia-selector.js +256 -79
  2. package/components/filters/babia-treebuilder.js +4 -5
  3. package/components/geometries/babia-cyl.js +180 -0
  4. package/components/others/assets/tooltip.png +0 -0
  5. package/components/others/babia-camera.js +195 -0
  6. package/components/others/babia-controls.js +62 -37
  7. package/components/others/babia-navigator.js +55 -49
  8. package/components/others/babia-range-selector.js +208 -0
  9. package/components/others/babia-slider.js +36 -8
  10. package/components/others/babia-ui.js +246 -73
  11. package/components/others/common.js +60 -73
  12. package/components/queriers/babia-querycsv.js +96 -0
  13. package/components/queriers/babia-queryes.js +203 -132
  14. package/components/visualizers/babia-bars.js +4 -35
  15. package/components/visualizers/babia-barsmap.js +2 -30
  16. package/components/visualizers/babia-boats.js +291 -279
  17. package/components/visualizers/babia-bubbles.js +9 -26
  18. package/components/visualizers/babia-city.js +19 -9
  19. package/components/visualizers/babia-cyls.js +197 -201
  20. package/components/visualizers/babia-cylsmap.js +171 -241
  21. package/components/visualizers/babia-doughnut.js +2 -28
  22. package/components/visualizers/babia-network.js +191 -124
  23. package/components/visualizers/babia-pie.js +2 -30
  24. package/dist/aframe-babia-components.js +6785 -5626
  25. package/dist/aframe-babia-components.min.js +7 -1
  26. package/dist/aframe-babia-components.min.js.map +1 -0
  27. package/docs/APIs/CHARTS.md +11 -4
  28. package/docs/APIs/DATAMANAGEMENT.md +7 -0
  29. package/docs/APIs/OTHERS.md +27 -0
  30. package/docs/APIs/QUERIERS.md +16 -0
  31. package/docs/RELEASE_NOTES.md +44 -23
  32. package/docs/Tutorials/multiuser.md +47 -2
  33. package/docs/Tutorials/temporal_evol_with_boats.md +4 -4
  34. package/examples/assets/door/New Bitmap Image.jpg +0 -0
  35. package/examples/assets/door/door.mtl +26 -0
  36. package/examples/assets/door/door.obj +6927 -0
  37. package/examples/assets/popups/0.png +0 -0
  38. package/examples/assets/popups/1.png +0 -0
  39. package/examples/assets/popups/10.png +0 -0
  40. package/examples/assets/popups/2.png +0 -0
  41. package/examples/assets/popups/3.png +0 -0
  42. package/examples/assets/popups/4.png +0 -0
  43. package/examples/assets/popups/5.png +0 -0
  44. package/examples/assets/popups/6.png +0 -0
  45. package/examples/assets/popups/7.png +0 -0
  46. package/examples/assets/popups/8.png +0 -0
  47. package/examples/assets/popups/9.png +0 -0
  48. package/examples/assets/popups/close.jpg +0 -0
  49. package/examples/assets/popups/info.jpg +0 -0
  50. package/examples/assets/textures/brownwall.png +0 -0
  51. package/examples/assets/textures/concrete.png +0 -0
  52. package/examples/assets/textures/white-wall-texture.jpg +0 -0
  53. package/examples/boats/boats_new_element/data1.json +18 -18
  54. package/examples/boats/boats_new_element/data2.json +19 -19
  55. package/examples/boats/boats_new_element/index.html +1 -1
  56. package/examples/charts/cyls/index.html +13 -4
  57. package/examples/charts/cyls/primitive.html +76 -0
  58. package/examples/charts/cylsmap/index.html +14 -5
  59. package/examples/charts_querier/bars_querier/data.csv +10 -0
  60. package/examples/charts_querier/bars_querier/index_csv.html +80 -0
  61. package/examples/dashboard/chaoss-dashboards.html +259 -0
  62. package/examples/dashboard/chaoss-issues.html +248 -0
  63. package/examples/dashboard/chaoss-pr.html +248 -0
  64. package/examples/dashboard/index.html +247 -0
  65. package/examples/dashboard/issues_queries/80-percent-open-time.json +123 -0
  66. package/examples/dashboard/issues_queries/issues-by-organization.json +107 -0
  67. package/examples/dashboard/issues_queries/issues.json +117 -0
  68. package/examples/dashboard/issues_queries/median-open-time.json +123 -0
  69. package/examples/dashboard/issues_queries/organizations.json +130 -0
  70. package/examples/dashboard/issues_queries/projects.json +130 -0
  71. package/examples/dashboard/issues_queries/repositories.json +130 -0
  72. package/examples/dashboard/issues_queries/status.json +107 -0
  73. package/examples/dashboard/issues_queries/submitter.json +125 -0
  74. package/examples/dashboard/issues_queries/submitters.json +113 -0
  75. package/examples/dashboard/pullrequests_queries/80-percent-open-time.json +123 -0
  76. package/examples/dashboard/pullrequests_queries/median-open-time.json +123 -0
  77. package/examples/dashboard/pullrequests_queries/organizations.json +130 -0
  78. package/examples/dashboard/pullrequests_queries/projects.json +130 -0
  79. package/examples/dashboard/pullrequests_queries/pull-requests-by-organization.json +107 -0
  80. package/examples/dashboard/pullrequests_queries/pull-requests.json +117 -0
  81. package/examples/dashboard/pullrequests_queries/repositories.json +130 -0
  82. package/examples/dashboard/pullrequests_queries/status.json +107 -0
  83. package/examples/dashboard/pullrequests_queries/submitter.json +125 -0
  84. package/examples/dashboard/pullrequests_queries/submitters.json +113 -0
  85. package/examples/dashboard/range.html +88 -0
  86. package/examples/dashboard/template.html +136 -0
  87. package/examples/demos/1.0.11/index_multiuser_ui.html +1 -1
  88. package/examples/multi_bars/data.json +14 -0
  89. package/examples/multi_bars/data2.json +15 -0
  90. package/examples/multi_bars/data3.json +23 -0
  91. package/examples/multi_bars/easyrtc.js +11984 -0
  92. package/examples/multi_bars/index.html +97 -0
  93. package/examples/multi_bars/index1.html +111 -0
  94. package/examples/multi_bars/index2.html +102 -0
  95. package/examples/multi_bars/index3.html +104 -0
  96. package/examples/multi_boats/data3.json +174 -0
  97. package/examples/multi_boats/data4.json +192 -0
  98. package/examples/multi_boats/easyrtc.js +11984 -0
  99. package/examples/multi_boats/index_multi_boats.html +223 -0
  100. package/examples/multi_boats/jetuml.html +256 -0
  101. package/examples/multi_boats/jetuml_code_data.json +1 -0
  102. package/examples/multi_boats/jetuml_evolution_experiment.html +419 -0
  103. package/examples/multi_boats/only_queryjson.html +132 -0
  104. package/examples/multi_boats/only_queryjson2.html +167 -0
  105. package/examples/multi_boats/only_queryjson3.html +165 -0
  106. package/examples/multi_boats/queryjson_treebuilder.html +132 -0
  107. package/examples/multi_boats/with_selector.html +255 -0
  108. package/examples/multiuser/choose_avatar/index.html +18 -8
  109. package/examples/selector_boats/jetuml.html +74 -0
  110. package/examples/selector_boats/jetuml_evol_data.json +1 -0
  111. package/examples/selector_boats/jetuml_from_3_2_to_1_0.json +62382 -0
  112. package/examples/selector_boats/jetumltest.html +80 -0
  113. package/examples/ui/link/index.html +12 -11
  114. package/examples/ui/network/data.json +123 -0
  115. package/examples/ui/network/links.json +13 -0
  116. package/examples/ui/network/network.html +75 -0
  117. package/examples/ui/network/network_nodes_links.html +82 -0
  118. package/examples/ui/network/nodes.json +12 -0
  119. package/index.html +73 -2
  120. package/index.js +12 -1
  121. package/package.json +6 -3
  122. package/tests/screenshots/other_snapshots.js/chaoss-issues.png +0 -0
  123. package/tests/screenshots/other_snapshots.js/chaoss-pr.png +0 -0
  124. package/tests/screenshots/other_snapshots.js/template.png +0 -0
  125. package/tests/ui.js +7 -0
  126. package/webpack.common.js +10 -1
  127. package/webpack.devnossl.js +16 -0
@@ -0,0 +1,208 @@
1
+ let findTargetComponent = require('./common').findTargetComponent;
2
+
3
+ /* global AFRAME */
4
+ if (typeof AFRAME === 'undefined') {
5
+ throw new Error('Component attempted to register before AFRAME was available.');
6
+ }
7
+
8
+ const NotiBuffer = require("../../common/noti-buffer").NotiBuffer;
9
+
10
+ /**
11
+ * A-Charts component for A-Frame.
12
+ */
13
+ AFRAME.registerComponent('babia-range-selector', {
14
+ schema: {
15
+ from: { type: 'string' },
16
+ to: { type: 'string' },
17
+ },
18
+
19
+ /**
20
+ * Set if component needs multiple instancing.
21
+ */
22
+ multiple: false,
23
+
24
+ /**
25
+ * Called once when component is attached. Generally for initial setup.
26
+ */
27
+ init: function () {
28
+ this.notiBuffer = new NotiBuffer();
29
+
30
+ this.options = [{label:'Last 15 minutes', time: 15*60000},
31
+ {label:'Last 30 minutes', time: 15*60000},
32
+ {label:'Last 1 hour', time: 60*60000},
33
+ {label:'Last 4 hours', time: 4*60*60000},
34
+ {label:'Last 12 hours', time: 12*60*60000},
35
+ {label:'Last 24 hours', time: 24*60*60000},
36
+ {label:'Last 7 days', time: 7*24*60*60000},
37
+ {label:'Last 30 days', time: 30*24*60*60000},
38
+ {label:'Last 60 days', time: 60*24*60*60000},
39
+ {label:'Last 90 days', time: 90*24*60*60000},
40
+ {label:'Last 6 months', time: 6*30*24*60*60000},
41
+ {label:'Last 1 year', time: 1*365*24*60*60000},
42
+ {label:'Last 2 years', time: 2*365*24*60*60000},
43
+ {label:'Last 5 years', time: 5*365*24*60*60000}];
44
+ this.label_select = 'babia-button-' + this.options[0].label.replaceAll(' ', '-');
45
+ },
46
+
47
+ /**
48
+ * Called when component is attached and when component data changes.
49
+ * Generally modifies the entity based on the data.
50
+ */
51
+
52
+ update: function (oldData) {
53
+ let data = this.data
54
+ this.updateInterface(data);
55
+ },
56
+
57
+ interface: undefined,
58
+ options: undefined,
59
+ handController: undefined,
60
+ label_select: undefined,
61
+
62
+ updateInterface: function(data) {
63
+ let self = this;
64
+
65
+ while (self.el.firstChild)
66
+ self.el.firstChild.remove();
67
+
68
+ // Generate interface
69
+ console.log('Generating interface...')
70
+ if (document.querySelector('#babia-menu-hand')) {
71
+ let hand_ui = document.querySelector('#babia-menu-hand')
72
+ hand_ui.parentNode.removeChild(hand_ui)
73
+ insertInterfaceOnHand(self, self.handController)
74
+ } else {
75
+ self.interface = generateInterface(self)
76
+ self.el.appendChild(self.interface)
77
+ }
78
+
79
+ document.addEventListener('controllerconnected', (event) => {
80
+ while (self.el.firstChild)
81
+ self.el.firstChild.remove();
82
+ // event.detail.name ----> which VR controller
83
+ let controller = event.detail.name;
84
+ let hand = event.target.getAttribute(controller).hand
85
+ if (hand === 'left' && !document.querySelector('#babia-menu-hand')){
86
+ self.handController = event.target.id
87
+ self.interface = generateInterface(self)
88
+ insertInterfaceOnHand(self, self.handController)
89
+ }
90
+ });
91
+ },
92
+ })
93
+
94
+ let insertInterfaceOnHand = (self, hand) => {
95
+ let hand_entity = document.getElementById(hand)
96
+ let scale = 0.03
97
+ self.interface.id = 'babia-menu-hand'
98
+ self.interface.setAttribute('scale', {x: scale, y: scale, z: scale})
99
+ self.interface.setAttribute('position', {x: -0.05, y: -0.05, z: -0.1})
100
+ self.interface.setAttribute('rotation', {x: -60, y: 0, z: 0})
101
+ self.interface.setAttribute('visible', false)
102
+ hand_entity.appendChild(self.interface);
103
+ openCloseMenu(hand, self.interface)
104
+ }
105
+
106
+
107
+ let generateInterface = (self) =>{
108
+ self.interface = document.createElement('a-entity');
109
+ self.interface.id = "babia-menu";
110
+
111
+ let posY = 7;
112
+ let posX = 0;
113
+
114
+ self.options.forEach(option => {
115
+ let button = createButton(self, option.label, posX, posY);
116
+ self.interface.appendChild(button);
117
+ if (posY > 1) {
118
+ --posY;
119
+ } else {
120
+ posX += 3.75;
121
+ posY = 7;
122
+ }
123
+ });
124
+ return self.interface
125
+ }
126
+
127
+ let createButton = (self, option, positionX, positionY) =>{
128
+ let entity = document.createElement('a-box')
129
+ entity.id = 'babia-button-' + option.replaceAll(' ', '-');
130
+ entity.classList.add("babiaxraycasterclass")
131
+ entity.setAttribute('position', { x: positionX, y: positionY, z: 0})
132
+ entity.setAttribute('rotation', { x: 0, y: 0, z: 0 })
133
+ entity.setAttribute('height', 0.8)
134
+ entity.setAttribute('width', 3.5)
135
+ entity.setAttribute('depth', 0.01)
136
+
137
+ let text = document.createElement('a-entity')
138
+ text.setAttribute('text', {
139
+ 'value': option,
140
+ 'align': 'center',
141
+ 'width': '10',
142
+ 'color': 'black'
143
+ })
144
+ text.setAttribute('position', "0 0 0.01")
145
+ entity.appendChild(text)
146
+
147
+ selection_events(self, entity)
148
+
149
+ if (self.label_select == entity.id){
150
+ entity.emit('click')
151
+ }
152
+
153
+ return entity
154
+ }
155
+
156
+ let selection_events = (self, entity) =>{
157
+ entity.addEventListener('mouseenter', function(){
158
+ entity.children[0].setAttribute('text', {color: '#FFFFFF'})
159
+ entity.setAttribute('color', '#333333')
160
+ });
161
+
162
+ entity.addEventListener('mouseleave', function(){
163
+ entity.children[0].setAttribute('text', {color: 'black'})
164
+ if (self.label_select == entity.id) {
165
+ entity.setAttribute('color', '#555555')
166
+ } else {
167
+ entity.setAttribute('color', '#FFFFFF')
168
+ }
169
+ });
170
+
171
+ entity.addEventListener('click', function(){
172
+ let aux = document.getElementById(self.label_select);
173
+ if (aux != null){
174
+ aux.children[0].setAttribute('text', {color: 'black'})
175
+ aux.setAttribute('color', '#FFFFFF');
176
+ }
177
+ self.label_select = entity.id;
178
+ entity.children[0].setAttribute('text', {color: 'black'})
179
+ entity.setAttribute('color', '#555555')
180
+
181
+ // Send new date to registered components
182
+ let label = self.label_select.slice(13).replaceAll('-', ' ');
183
+ self.options.forEach(option => {
184
+ if (option.label == label) {
185
+ let now = Date.now();
186
+ let to_send = {
187
+ from : now - option.time,
188
+ to: now
189
+ }
190
+ self.notiBuffer.set(to_send);
191
+ }
192
+ });
193
+ });
194
+ }
195
+
196
+ let openCloseMenu = (hand_id, entity_menu) =>{
197
+ let menu_opened = false;
198
+ let entity_hand = document.getElementById(hand_id)
199
+ entity_hand.addEventListener('gripdown', function(){
200
+ if (menu_opened){
201
+ menu_opened = false
202
+ entity_menu.setAttribute('visible', false)
203
+ } else {
204
+ menu_opened = true
205
+ entity_menu.setAttribute('visible', true)
206
+ }
207
+ })
208
+ }
@@ -12,7 +12,8 @@ AFRAME.registerComponent('babia-slider', {
12
12
  value: { type: 'number', default: -5 },
13
13
  innerSize: { type: 'number', default: 0.8 },
14
14
  precision: { type: 'number', default: 2 },
15
- vertical: {type: 'boolean', default: false}
15
+ vertical: {type: 'boolean', default: false},
16
+ label: {type: 'string'}
16
17
  },
17
18
 
18
19
  multiple: true,
@@ -141,7 +142,12 @@ AFRAME.registerComponent('babia-slider', {
141
142
  this.value = value;
142
143
 
143
144
  lever.position.x = this.valueToLeverPosition(value);
144
- this.setTextGeometry(value)
145
+ if (!this.data.label){
146
+ this.setTextGeometry(value)
147
+ } else {
148
+ this.setTextGeometry(this.data.label)
149
+ }
150
+
145
151
  },
146
152
 
147
153
  valueToLeverPosition: function(value) {
@@ -171,8 +177,7 @@ AFRAME.registerComponent('babia-slider', {
171
177
 
172
178
  var handWorld = new THREE.Vector3().setFromMatrixPosition(hand.matrixWorld);
173
179
  lever.parent.worldToLocal(handWorld);
174
-
175
-
180
+
176
181
  if (Math.abs(handWorld.x) > sliderRange / 2) {
177
182
  lever.position.x = sliderRange / 2 * Math.sign(lever.position.x);
178
183
  } else {
@@ -184,7 +189,14 @@ AFRAME.registerComponent('babia-slider', {
184
189
  value = Math.round(value)
185
190
  this.value = value;
186
191
  this.setTextGeometry(value)
187
- this.el.parentEl.components['babia-navigator'].controlNavigator('babiaSetPosition', this.value)
192
+ // this.el.parentEl.components['babia-navigator'].controlNavigator('babiaSetPosition', this.value)
193
+ if (this.el.parentEl.components['babia-navigator']){
194
+ this.el.parentEl.components['babia-navigator'].controlNavigator('babiaSetPosition', Math.round(value))
195
+ } else if (this.el.parentEl.components['babia-step-controller']){
196
+ this.el.parentEl.components['babia-step-controller'].controlStep(Math.round(value))
197
+ } else if (this.el.parentEl.components['babia-speed-controller']){
198
+ this.el.parentEl.components['babia-speed-controller'].controlSpeed(Math.round(value))
199
+ }
188
200
  }
189
201
  }
190
202
  },
@@ -233,7 +245,7 @@ AFRAME.registerComponent('babia-slider', {
233
245
  } else {
234
246
  value = this.mouseyPositionToValue(mouse.y);
235
247
  }
236
- this.setValue(Math.round(value));
248
+ //this.setValue(Math.round(value));
237
249
 
238
250
  if (this.el.parentEl.components['babia-navigator']){
239
251
  this.el.parentEl.components['babia-navigator'].controlNavigator('babiaSetPosition', Math.round(value))
@@ -247,7 +259,9 @@ AFRAME.registerComponent('babia-slider', {
247
259
  })
248
260
 
249
261
  AFRAME.registerComponent('babia-step-controller', {
250
- schema: {},
262
+ schema: {
263
+ value: { type: 'number', default: -5 },
264
+ },
251
265
 
252
266
  multiple: true,
253
267
 
@@ -257,6 +271,11 @@ AFRAME.registerComponent('babia-step-controller', {
257
271
  init: function () {
258
272
  this.createSlider()
259
273
  },
274
+ update: function(old) {
275
+ if(this.data.value !== old.value) {
276
+ this.sliderEl.setAttribute('babia-slider','value', this.data.value);
277
+ }
278
+ },
260
279
 
261
280
  createSlider: function(){
262
281
  this.sliderEl = document.createElement('a-entity');
@@ -280,7 +299,9 @@ AFRAME.registerComponent('babia-step-controller', {
280
299
 
281
300
 
282
301
  AFRAME.registerComponent('babia-speed-controller', {
283
- schema: {},
302
+ schema: {
303
+ value: { type: 'number', default: -5 },
304
+ },
284
305
 
285
306
  multiple: true,
286
307
 
@@ -290,6 +311,12 @@ AFRAME.registerComponent('babia-speed-controller', {
290
311
  init: function () {
291
312
  this.createSlider()
292
313
  },
314
+
315
+ update: function(old) {
316
+ if(this.data.value !== old.value) {
317
+ this.sliderEl.setAttribute('babia-slider','value', this.data.value);
318
+ }
319
+ },
293
320
 
294
321
  createSlider: function(){
295
322
  this.sliderEl = document.createElement('a-entity');
@@ -304,6 +331,7 @@ AFRAME.registerComponent('babia-speed-controller', {
304
331
  this.sliderEl.id = "speed-controller"
305
332
  this.el.appendChild(this.sliderEl);
306
333
  },
334
+
307
335
  controlSpeed: function(value){
308
336
  this.speed = value
309
337
  this.el.parentEl.components['babia-navigator'].controlNavigator('babiaSetSpeed', this.speed)