aframe-babia-components 1.2.2 → 1.2.5

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 (120) hide show
  1. package/components/filters/babia-selector.js +256 -79
  2. package/components/filters/babia-treebuilder.js +1 -2
  3. package/components/geometries/babia-bar.js +13 -1
  4. package/components/geometries/babia-cyl.js +189 -0
  5. package/components/others/assets/tooltip.png +0 -0
  6. package/components/others/babia-camera.js +195 -0
  7. package/components/others/babia-controls.js +56 -31
  8. package/components/others/babia-navigator.js +55 -49
  9. package/components/others/babia-range-selector.js +218 -0
  10. package/components/others/babia-slider.js +36 -8
  11. package/components/others/babia-ui.js +246 -73
  12. package/components/others/common.js +91 -83
  13. package/components/queriers/babia-querycsv.js +96 -0
  14. package/components/queriers/babia-queryes.js +209 -131
  15. package/components/visualizers/babia-bars.js +15 -38
  16. package/components/visualizers/babia-barsmap.js +19 -34
  17. package/components/visualizers/babia-boats.js +221 -134
  18. package/components/visualizers/babia-bubbles.js +13 -26
  19. package/components/visualizers/babia-cyls.js +203 -201
  20. package/components/visualizers/babia-cylsmap.js +173 -241
  21. package/components/visualizers/babia-doughnut.js +6 -28
  22. package/components/visualizers/babia-network.js +191 -124
  23. package/components/visualizers/babia-pie.js +6 -30
  24. package/dist/aframe-babia-components.js +21913 -19571
  25. package/dist/aframe-babia-components.min.js +7 -1
  26. package/dist/aframe-babia-components.min.js.map +1 -1
  27. package/docs/APIs/CHARTS.md +33 -14
  28. package/docs/APIs/DATAMANAGEMENT.md +7 -0
  29. package/docs/APIs/OTHERS.md +42 -0
  30. package/docs/APIs/QUERIERS.md +18 -0
  31. package/docs/RELEASE_NOTES.md +58 -21
  32. package/docs/Tutorials/multiuser.md +47 -2
  33. package/examples/assets/door/New Bitmap Image.jpg +0 -0
  34. package/examples/assets/door/door.mtl +26 -0
  35. package/examples/assets/door/door.obj +6927 -0
  36. package/examples/assets/popups/0.png +0 -0
  37. package/examples/assets/popups/1.png +0 -0
  38. package/examples/assets/popups/10.png +0 -0
  39. package/examples/assets/popups/2.png +0 -0
  40. package/examples/assets/popups/3.png +0 -0
  41. package/examples/assets/popups/4.png +0 -0
  42. package/examples/assets/popups/5.png +0 -0
  43. package/examples/assets/popups/6.png +0 -0
  44. package/examples/assets/popups/7.png +0 -0
  45. package/examples/assets/popups/8.png +0 -0
  46. package/examples/assets/popups/9.png +0 -0
  47. package/examples/assets/popups/close.jpg +0 -0
  48. package/examples/assets/popups/info.jpg +0 -0
  49. package/examples/assets/textures/brownwall.png +0 -0
  50. package/examples/assets/textures/concrete.png +0 -0
  51. package/examples/assets/textures/white-wall-texture.jpg +0 -0
  52. package/examples/charts/cyls/index.html +13 -4
  53. package/examples/charts/cyls/primitive.html +76 -0
  54. package/examples/charts/cylsmap/index.html +14 -5
  55. package/examples/charts_querier/bars_querier/data.csv +10 -0
  56. package/examples/charts_querier/bars_querier/index_csv.html +80 -0
  57. package/examples/charts_querier/multichart_querier/manual_colors.html +81 -0
  58. package/examples/dashboard/chaoss-dashboards.html +259 -0
  59. package/examples/dashboard/chaoss-issues.html +248 -0
  60. package/examples/dashboard/chaoss-pr.html +248 -0
  61. package/examples/dashboard/index.html +247 -0
  62. package/examples/dashboard/issues_queries/80-percent-open-time.json +123 -0
  63. package/examples/dashboard/issues_queries/issues-by-organization.json +107 -0
  64. package/examples/dashboard/issues_queries/issues.json +117 -0
  65. package/examples/dashboard/issues_queries/median-open-time.json +123 -0
  66. package/examples/dashboard/issues_queries/organizations.json +130 -0
  67. package/examples/dashboard/issues_queries/projects.json +130 -0
  68. package/examples/dashboard/issues_queries/repositories.json +130 -0
  69. package/examples/dashboard/issues_queries/status.json +107 -0
  70. package/examples/dashboard/issues_queries/submitter.json +125 -0
  71. package/examples/dashboard/issues_queries/submitters.json +113 -0
  72. package/examples/dashboard/pullrequests_queries/80-percent-open-time.json +123 -0
  73. package/examples/dashboard/pullrequests_queries/median-open-time.json +123 -0
  74. package/examples/dashboard/pullrequests_queries/organizations.json +130 -0
  75. package/examples/dashboard/pullrequests_queries/projects.json +130 -0
  76. package/examples/dashboard/pullrequests_queries/pull-requests-by-organization.json +107 -0
  77. package/examples/dashboard/pullrequests_queries/pull-requests.json +117 -0
  78. package/examples/dashboard/pullrequests_queries/repositories.json +130 -0
  79. package/examples/dashboard/pullrequests_queries/status.json +107 -0
  80. package/examples/dashboard/pullrequests_queries/submitter.json +125 -0
  81. package/examples/dashboard/pullrequests_queries/submitters.json +113 -0
  82. package/examples/dashboard/range.html +88 -0
  83. package/examples/dashboard/template.html +136 -0
  84. package/examples/demos/1.0.11/index_multiuser_ui.html +1 -1
  85. package/examples/multi_bars/data.json +14 -0
  86. package/examples/multi_bars/data2.json +15 -0
  87. package/examples/multi_bars/data3.json +23 -0
  88. package/examples/multi_bars/easyrtc.js +11984 -0
  89. package/examples/multi_bars/index.html +97 -0
  90. package/examples/multi_bars/index1.html +111 -0
  91. package/examples/multi_bars/index2.html +102 -0
  92. package/examples/multi_bars/index3.html +104 -0
  93. package/examples/multi_boats/data3.json +174 -0
  94. package/examples/multi_boats/data4.json +192 -0
  95. package/examples/multi_boats/{index.html → index_multi_boats.html} +50 -55
  96. package/examples/multi_boats/jetuml.html +124 -115
  97. package/examples/multi_boats/jetuml_evolution_experiment.html +419 -0
  98. package/examples/multi_boats/only_queryjson.html +132 -0
  99. package/examples/multi_boats/only_queryjson2.html +167 -0
  100. package/examples/multi_boats/only_queryjson3.html +165 -0
  101. package/examples/multi_boats/queryjson_treebuilder.html +132 -0
  102. package/examples/multi_boats/with_selector.html +121 -111
  103. package/examples/multiuser/choose_avatar/index.html +18 -8
  104. package/examples/selector_boats/jetuml_from_3_2_to_1_0.json +62382 -0
  105. package/examples/ui/network/data.json +123 -0
  106. package/examples/ui/network/links.json +13 -0
  107. package/examples/ui/network/network.html +75 -0
  108. package/examples/ui/network/network_nodes_links.html +82 -0
  109. package/examples/ui/network/nodes.json +12 -0
  110. package/index.html +69 -3
  111. package/index.js +6 -1
  112. package/package.json +4 -3
  113. package/tests/screenshots/other_snapshots.js/chaoss-issues.png +0 -0
  114. package/tests/screenshots/other_snapshots.js/chaoss-pr.png +0 -0
  115. package/tests/screenshots/other_snapshots.js/template.png +0 -0
  116. package/tests/ui.js +7 -0
  117. package/webpack.common.js +1 -1
  118. package/webpack.devnossl.js +16 -0
  119. package/.idea/vcs.xml +0 -6
  120. package/.idea/workspace.xml +0 -79
@@ -7,24 +7,24 @@ const NotiBuffer = require("../../common/noti-buffer").NotiBuffer;
7
7
 
8
8
 
9
9
  AFRAME.registerComponent('babia-navigator', {
10
- schema: {},
10
+ schema: {
11
+ // Current direction
12
+ direction: { type: 'string', default: ''},
13
+ // Current state
14
+ state: { type: 'string', default: ''},
15
+ },
11
16
 
12
17
  /**
13
18
  * Set if component needs multiple instancing.
14
19
  */
15
20
  multiple: false,
16
- isPaused: undefined,
17
21
  sliderEl: undefined,
18
- toPresent: undefined,
19
22
 
20
23
  /**
21
24
  * Initial creation and setting of the mesh.
22
25
  */
23
26
  init: function () {
24
27
  this.notiBuffer = new NotiBuffer(this.registerBack.bind(this), this.unregisterBack.bind(this));
25
-
26
- this.toPresent = true
27
- this.isPaused = false
28
28
  },
29
29
 
30
30
  /**
@@ -32,7 +32,15 @@ AFRAME.registerComponent('babia-navigator', {
32
32
  * Generally modifies the entity based on the data.
33
33
  */
34
34
 
35
- update: function (oldData) {},
35
+ update: function (oldData) {
36
+ let data = this.data;
37
+ if ((data.state) && (data.state != oldData.state)) {
38
+ this.controlNavigator(data.state)
39
+ }
40
+ if ((data.direction) && (data.direction != oldData.direction)) {
41
+ this.controlNavigator(data.direction)
42
+ }
43
+ },
36
44
 
37
45
  initializeControls: function(){
38
46
  // Initialize Slider
@@ -77,19 +85,19 @@ AFRAME.registerComponent('babia-navigator', {
77
85
 
78
86
  updateSlider: function(evt){
79
87
  let value = this.sliderEl.getAttribute('babia-slider').value
80
- if (evt ==='babiaSkipNext'){
88
+ if (evt ==='skipNext'){
81
89
  value++
82
- } else if (evt === 'babiaSkipPrev'){
90
+ } else if (evt === 'skipPrev'){
83
91
  value--
84
92
  }
85
93
  // Out of range
86
- if ((value >= 0) && (value <= this.sliderEl.max)){
87
- this.sliderEl.setAttribute('babia-slider', 'value', value)
88
- this.notiBuffer.set('babiaSetPosition' + value)
94
+ if (((evt === 'skipPrev') && (value >= 0)) || ((evt === 'skipNext') && (value <= this.sliderEl.max))){
95
+ this.current = value
96
+ this.notiBuffer.set('babiaSetPosition' + this.current)
89
97
  } else {
90
98
  if (this.controlsEl.querySelector('.babiaPause')){
91
- this.notiBuffer.set('babiaSetPosition' + value)
92
- this.el.querySelector('.babiaPause').emit('click')
99
+ this.current = value
100
+ processData('pause')
93
101
  }
94
102
  }
95
103
 
@@ -109,25 +117,39 @@ AFRAME.registerComponent('babia-navigator', {
109
117
  },
110
118
 
111
119
  processData: function(data){
112
- if (data == 'babiaStop'){
113
- this.isPaused = true
114
- if (this.controlsEl.querySelector('.babiaPause')){
115
- this.controlsEl.querySelector('.babiaPause').emit('click')
116
- }
117
- }else {
118
- if (!this.sliderEl){
119
- this.initializeControls()
120
- }
121
- if (this.toPresent){
122
- this.current = data - 1
123
- } else {
124
- this.current = data + 1
125
- }
126
-
127
- if ((this.current >= this.sliderEl.min) && (this.current <= this.sliderEl.max)){
128
- this.sliderEl.setAttribute('babia-slider', 'value', this.current)
120
+ if (data == 'pause'){
121
+ this.controlsEl.setAttribute('babia-controls', 'state', 'pause')
122
+ } else if (data == 'rewind'){
123
+ this.el.setAttribute('babia-navigator', 'direction', 'rewind')
124
+ } else if (data == 'forward'){
125
+ this.el.setAttribute('babia-navigator', 'direction', 'forward')
126
+ } else if (data.type){
127
+ if (data.type === 'position'){
128
+ if (!this.sliderEl){
129
+ this.initializeControls()
130
+ }
131
+ if (this.data.direction != 'rewind'){
132
+ this.current = data.value - 1
133
+ } else {
134
+ this.current = data.value + 1
135
+ }
136
+
137
+ if ((this.current >= this.sliderEl.min) && (this.current <= this.sliderEl.max)){
138
+ if (data.label){
139
+ this.sliderEl.setAttribute('babia-slider', {
140
+ label: data.label,
141
+ value: this.current
142
+ })
143
+ } else {
144
+ this.sliderEl.setAttribute('babia-slider', 'value', this.current)
145
+ }
146
+ }
147
+ } else if (data.type === 'step'){
148
+ this.stepControllerEl.setAttribute('babia-step-controller', 'value', data.value)
149
+ } else if (data.type === 'speed'){
150
+ this.speedControllerEl.setAttribute('babia-speed-controller', 'value', data.value)
129
151
  }
130
- }
152
+ }
131
153
  },
132
154
 
133
155
  /**
@@ -149,26 +171,10 @@ AFRAME.registerComponent('babia-navigator', {
149
171
  speedComp: undefined,
150
172
 
151
173
  controlNavigator: function (evt, value) {
152
- console.log ('Navigator control: ', evt)
153
- if (evt == 'babiaSkipNext' || evt == 'babiaSkipPrev') {
154
- // Update Slider
155
- this.isPaused = true
174
+ if (evt == 'skipNext' || evt == 'skipPrev') {
156
175
  this.updateSlider(evt)
157
176
  } else {
158
177
  this.notiBuffer.set(evt + value)
159
- if(evt === 'babiaContinue'){
160
- this.isPaused = false
161
- } else if (evt === 'babiaStop'){
162
- this.isPaused = true
163
- if (this.controlsEl.querySelector('.babiaPause')){
164
- this.controlsEl.querySelector('.babiaPause').emit('click')
165
- }
166
- } else if (evt === 'babiaToPresent'){
167
- this.toPresent = true
168
- } else if (evt === 'babiaToPast'){
169
- this.toPresent = false
170
- }
171
178
  }
172
179
  },
173
-
174
180
  })
@@ -0,0 +1,218 @@
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
+ defaultRange: {type: 'string', default: 'Last 5 years'}
18
+ },
19
+
20
+ /**
21
+ * Set if component needs multiple instancing.
22
+ */
23
+ multiple: false,
24
+
25
+ /**
26
+ * Called once when component is attached. Generally for initial setup.
27
+ */
28
+ init: function () {
29
+ this.notiBuffer = new NotiBuffer();
30
+
31
+ this.options = [{label:'Last 15 minutes', time: 15*60000, interval: "30s"},
32
+ {label:'Last 30 minutes', time: 15*60000, interval: "30s"},
33
+ {label:'Last 1 hour', time: 60*60000, interval: "1m"},
34
+ {label:'Last 4 hours', time: 4*60*60000, interval: "5m"},
35
+ {label:'Last 12 hours', time: 12*60*60000, interval: "10m"},
36
+ {label:'Last 24 hours', time: 24*60*60000, interval: "30m"},
37
+ {label:'Last 7 days', time: 7*24*60*60000, interval: "3h"},
38
+ {label:'Last 30 days', time: 30*24*60*60000, interval: "12h"},
39
+ {label:'Last 60 days', time: 60*24*60*60000, interval: "1d"},
40
+ {label:'Last 90 days', time: 90*24*60*60000, interval: "2d"},
41
+ {label:'Last 6 months', time: 6*30*24*60*60000, interval: "3d"},
42
+ {label:'Last 1 year', time: 1*365*24*60*60000, interval: "1w"},
43
+ {label:'Last 2 years', time: 2*365*24*60*60000, interval: "15d"},
44
+ {label:'Last 5 years', time: 5*365*24*60*60000, interval: "30d"}];
45
+ // Set Initial Option
46
+ let index = 0;
47
+ for (i = 0; i < this.options.length; i++){
48
+ if (this.data.defaultRange === this.options[i].label){
49
+ index = i;
50
+ break;
51
+ }
52
+ }
53
+ this.label_select = 'babia-button-' + this.options[index].label.replaceAll(' ', '-');
54
+ },
55
+
56
+ /**
57
+ * Called when component is attached and when component data changes.
58
+ * Generally modifies the entity based on the data.
59
+ */
60
+
61
+ update: function (oldData) {
62
+ let data = this.data
63
+ this.updateInterface(data);
64
+ },
65
+
66
+ interface: undefined,
67
+ options: undefined,
68
+ handController: undefined,
69
+ label_select: undefined,
70
+
71
+ updateInterface: function(data) {
72
+ let self = this;
73
+
74
+ while (self.el.firstChild)
75
+ self.el.firstChild.remove();
76
+
77
+ // Generate interface
78
+ console.log('Generating interface...')
79
+ if (document.querySelector('#babia-menu-hand')) {
80
+ let hand_ui = document.querySelector('#babia-menu-hand')
81
+ hand_ui.parentNode.removeChild(hand_ui)
82
+ insertInterfaceOnHand(self, self.handController)
83
+ } else {
84
+ self.interface = generateInterface(self)
85
+ self.el.appendChild(self.interface)
86
+ }
87
+
88
+ document.addEventListener('controllerconnected', (event) => {
89
+ while (self.el.firstChild)
90
+ self.el.firstChild.remove();
91
+ // event.detail.name ----> which VR controller
92
+ let controller = event.detail.name;
93
+ let hand = event.target.getAttribute(controller).hand
94
+ if (hand === 'left' && !document.querySelector('#babia-menu-hand')){
95
+ self.handController = event.target.id
96
+ self.interface = generateInterface(self)
97
+ insertInterfaceOnHand(self, self.handController)
98
+ }
99
+ });
100
+ },
101
+ })
102
+
103
+ let insertInterfaceOnHand = (self, hand) => {
104
+ let hand_entity = document.getElementById(hand)
105
+ let scale = 0.03
106
+ self.interface.id = 'babia-menu-hand'
107
+ self.interface.setAttribute('scale', {x: scale, y: scale, z: scale})
108
+ self.interface.setAttribute('position', {x: -0.05, y: -0.05, z: -0.1})
109
+ self.interface.setAttribute('rotation', {x: -60, y: 0, z: 0})
110
+ self.interface.setAttribute('visible', false)
111
+ hand_entity.appendChild(self.interface);
112
+ openCloseMenu(hand, self.interface)
113
+ }
114
+
115
+
116
+ let generateInterface = (self) =>{
117
+ self.interface = document.createElement('a-entity');
118
+ self.interface.id = "babia-menu";
119
+
120
+ let posY = 7;
121
+ let posX = 0;
122
+
123
+ self.options.forEach(option => {
124
+ let button = createButton(self, option.label, posX, posY);
125
+ self.interface.appendChild(button);
126
+ if (posY > 1) {
127
+ --posY;
128
+ } else {
129
+ posX += 3.75;
130
+ posY = 7;
131
+ }
132
+ });
133
+ return self.interface
134
+ }
135
+
136
+ let createButton = (self, option, positionX, positionY) =>{
137
+ let entity = document.createElement('a-box')
138
+ entity.id = 'babia-button-' + option.replaceAll(' ', '-');
139
+ entity.classList.add("babiaxraycasterclass")
140
+ entity.setAttribute('position', { x: positionX, y: positionY, z: 0})
141
+ entity.setAttribute('rotation', { x: 0, y: 0, z: 0 })
142
+ entity.setAttribute('height', 0.8)
143
+ entity.setAttribute('width', 3.5)
144
+ entity.setAttribute('depth', 0.01)
145
+
146
+ let text = document.createElement('a-entity')
147
+ text.setAttribute('text', {
148
+ 'value': option,
149
+ 'align': 'center',
150
+ 'width': '10',
151
+ 'color': 'black'
152
+ })
153
+ text.setAttribute('position', "0 0 0.01")
154
+ entity.appendChild(text)
155
+
156
+ selection_events(self, entity)
157
+
158
+ if (self.label_select == entity.id){
159
+ entity.emit('click')
160
+ }
161
+
162
+ return entity
163
+ }
164
+
165
+ let selection_events = (self, entity) =>{
166
+ entity.addEventListener('mouseenter', function(){
167
+ entity.children[0].setAttribute('text', {color: '#FFFFFF'})
168
+ entity.setAttribute('color', '#333333')
169
+ });
170
+
171
+ entity.addEventListener('mouseleave', function(){
172
+ entity.children[0].setAttribute('text', {color: 'black'})
173
+ if (self.label_select == entity.id) {
174
+ entity.setAttribute('color', '#555555')
175
+ } else {
176
+ entity.setAttribute('color', '#FFFFFF')
177
+ }
178
+ });
179
+
180
+ entity.addEventListener('click', function(){
181
+ let aux = document.getElementById(self.label_select);
182
+ if (aux != null){
183
+ aux.children[0].setAttribute('text', {color: 'black'})
184
+ aux.setAttribute('color', '#FFFFFF');
185
+ }
186
+ self.label_select = entity.id;
187
+ entity.children[0].setAttribute('text', {color: 'black'})
188
+ entity.setAttribute('color', '#555555')
189
+
190
+ // Send new date to registered components
191
+ let label = self.label_select.slice(13).replaceAll('-', ' ');
192
+ self.options.forEach(option => {
193
+ if (option.label == label) {
194
+ let now = Date.now();
195
+ let to_send = {
196
+ from : now - option.time,
197
+ interval: option.interval,
198
+ to: now
199
+ }
200
+ self.notiBuffer.set(to_send);
201
+ }
202
+ });
203
+ });
204
+ }
205
+
206
+ let openCloseMenu = (hand_id, entity_menu) =>{
207
+ let menu_opened = false;
208
+ let entity_hand = document.getElementById(hand_id)
209
+ entity_hand.addEventListener('gripdown', function(){
210
+ if (menu_opened){
211
+ menu_opened = false
212
+ entity_menu.setAttribute('visible', false)
213
+ } else {
214
+ menu_opened = true
215
+ entity_menu.setAttribute('visible', true)
216
+ }
217
+ })
218
+ }
@@ -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)