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.
- package/components/filters/babia-selector.js +256 -79
- package/components/filters/babia-treebuilder.js +1 -2
- package/components/geometries/babia-bar.js +13 -1
- package/components/geometries/babia-cyl.js +189 -0
- package/components/others/assets/tooltip.png +0 -0
- package/components/others/babia-camera.js +195 -0
- package/components/others/babia-controls.js +56 -31
- package/components/others/babia-navigator.js +55 -49
- package/components/others/babia-range-selector.js +218 -0
- package/components/others/babia-slider.js +36 -8
- package/components/others/babia-ui.js +246 -73
- package/components/others/common.js +91 -83
- package/components/queriers/babia-querycsv.js +96 -0
- package/components/queriers/babia-queryes.js +209 -131
- package/components/visualizers/babia-bars.js +15 -38
- package/components/visualizers/babia-barsmap.js +19 -34
- package/components/visualizers/babia-boats.js +221 -134
- package/components/visualizers/babia-bubbles.js +13 -26
- package/components/visualizers/babia-cyls.js +203 -201
- package/components/visualizers/babia-cylsmap.js +173 -241
- package/components/visualizers/babia-doughnut.js +6 -28
- package/components/visualizers/babia-network.js +191 -124
- package/components/visualizers/babia-pie.js +6 -30
- package/dist/aframe-babia-components.js +21913 -19571
- package/dist/aframe-babia-components.min.js +7 -1
- package/dist/aframe-babia-components.min.js.map +1 -1
- package/docs/APIs/CHARTS.md +33 -14
- package/docs/APIs/DATAMANAGEMENT.md +7 -0
- package/docs/APIs/OTHERS.md +42 -0
- package/docs/APIs/QUERIERS.md +18 -0
- package/docs/RELEASE_NOTES.md +58 -21
- package/docs/Tutorials/multiuser.md +47 -2
- package/examples/assets/door/New Bitmap Image.jpg +0 -0
- package/examples/assets/door/door.mtl +26 -0
- package/examples/assets/door/door.obj +6927 -0
- package/examples/assets/popups/0.png +0 -0
- package/examples/assets/popups/1.png +0 -0
- package/examples/assets/popups/10.png +0 -0
- package/examples/assets/popups/2.png +0 -0
- package/examples/assets/popups/3.png +0 -0
- package/examples/assets/popups/4.png +0 -0
- package/examples/assets/popups/5.png +0 -0
- package/examples/assets/popups/6.png +0 -0
- package/examples/assets/popups/7.png +0 -0
- package/examples/assets/popups/8.png +0 -0
- package/examples/assets/popups/9.png +0 -0
- package/examples/assets/popups/close.jpg +0 -0
- package/examples/assets/popups/info.jpg +0 -0
- package/examples/assets/textures/brownwall.png +0 -0
- package/examples/assets/textures/concrete.png +0 -0
- package/examples/assets/textures/white-wall-texture.jpg +0 -0
- package/examples/charts/cyls/index.html +13 -4
- package/examples/charts/cyls/primitive.html +76 -0
- package/examples/charts/cylsmap/index.html +14 -5
- package/examples/charts_querier/bars_querier/data.csv +10 -0
- package/examples/charts_querier/bars_querier/index_csv.html +80 -0
- package/examples/charts_querier/multichart_querier/manual_colors.html +81 -0
- package/examples/dashboard/chaoss-dashboards.html +259 -0
- package/examples/dashboard/chaoss-issues.html +248 -0
- package/examples/dashboard/chaoss-pr.html +248 -0
- package/examples/dashboard/index.html +247 -0
- package/examples/dashboard/issues_queries/80-percent-open-time.json +123 -0
- package/examples/dashboard/issues_queries/issues-by-organization.json +107 -0
- package/examples/dashboard/issues_queries/issues.json +117 -0
- package/examples/dashboard/issues_queries/median-open-time.json +123 -0
- package/examples/dashboard/issues_queries/organizations.json +130 -0
- package/examples/dashboard/issues_queries/projects.json +130 -0
- package/examples/dashboard/issues_queries/repositories.json +130 -0
- package/examples/dashboard/issues_queries/status.json +107 -0
- package/examples/dashboard/issues_queries/submitter.json +125 -0
- package/examples/dashboard/issues_queries/submitters.json +113 -0
- package/examples/dashboard/pullrequests_queries/80-percent-open-time.json +123 -0
- package/examples/dashboard/pullrequests_queries/median-open-time.json +123 -0
- package/examples/dashboard/pullrequests_queries/organizations.json +130 -0
- package/examples/dashboard/pullrequests_queries/projects.json +130 -0
- package/examples/dashboard/pullrequests_queries/pull-requests-by-organization.json +107 -0
- package/examples/dashboard/pullrequests_queries/pull-requests.json +117 -0
- package/examples/dashboard/pullrequests_queries/repositories.json +130 -0
- package/examples/dashboard/pullrequests_queries/status.json +107 -0
- package/examples/dashboard/pullrequests_queries/submitter.json +125 -0
- package/examples/dashboard/pullrequests_queries/submitters.json +113 -0
- package/examples/dashboard/range.html +88 -0
- package/examples/dashboard/template.html +136 -0
- package/examples/demos/1.0.11/index_multiuser_ui.html +1 -1
- package/examples/multi_bars/data.json +14 -0
- package/examples/multi_bars/data2.json +15 -0
- package/examples/multi_bars/data3.json +23 -0
- package/examples/multi_bars/easyrtc.js +11984 -0
- package/examples/multi_bars/index.html +97 -0
- package/examples/multi_bars/index1.html +111 -0
- package/examples/multi_bars/index2.html +102 -0
- package/examples/multi_bars/index3.html +104 -0
- package/examples/multi_boats/data3.json +174 -0
- package/examples/multi_boats/data4.json +192 -0
- package/examples/multi_boats/{index.html → index_multi_boats.html} +50 -55
- package/examples/multi_boats/jetuml.html +124 -115
- package/examples/multi_boats/jetuml_evolution_experiment.html +419 -0
- package/examples/multi_boats/only_queryjson.html +132 -0
- package/examples/multi_boats/only_queryjson2.html +167 -0
- package/examples/multi_boats/only_queryjson3.html +165 -0
- package/examples/multi_boats/queryjson_treebuilder.html +132 -0
- package/examples/multi_boats/with_selector.html +121 -111
- package/examples/multiuser/choose_avatar/index.html +18 -8
- package/examples/selector_boats/jetuml_from_3_2_to_1_0.json +62382 -0
- package/examples/ui/network/data.json +123 -0
- package/examples/ui/network/links.json +13 -0
- package/examples/ui/network/network.html +75 -0
- package/examples/ui/network/network_nodes_links.html +82 -0
- package/examples/ui/network/nodes.json +12 -0
- package/index.html +69 -3
- package/index.js +6 -1
- package/package.json +4 -3
- package/tests/screenshots/other_snapshots.js/chaoss-issues.png +0 -0
- package/tests/screenshots/other_snapshots.js/chaoss-pr.png +0 -0
- package/tests/screenshots/other_snapshots.js/template.png +0 -0
- package/tests/ui.js +7 -0
- package/webpack.common.js +1 -1
- package/webpack.devnossl.js +16 -0
- package/.idea/vcs.xml +0 -6
- package/.idea/workspace.xml +0 -79
|
@@ -55,7 +55,7 @@ AFRAME.registerComponent('babia-ui', {
|
|
|
55
55
|
// Register to target component notiBuffer
|
|
56
56
|
if (this.targetComponent.notiBuffer) {
|
|
57
57
|
this.notiBufferId = this.targetComponent.notiBuffer
|
|
58
|
-
.register(this.
|
|
58
|
+
.register(this.updateInterface.bind(this))
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
|
|
@@ -66,10 +66,18 @@ AFRAME.registerComponent('babia-ui', {
|
|
|
66
66
|
dataQueriers: undefined,
|
|
67
67
|
handController: undefined,
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Only for babia-network
|
|
71
|
+
*/
|
|
72
|
+
nodesQueriers: undefined,
|
|
73
|
+
linksQueriers: undefined,
|
|
74
|
+
|
|
75
|
+
updateInterface: function(data) {
|
|
70
76
|
let self = this;
|
|
71
77
|
if(data){
|
|
72
|
-
|
|
78
|
+
// if (!self.targetComponent.el.components['babia-network']){
|
|
79
|
+
getDataMetrics(self,data, self.targetComponentVisProperties)
|
|
80
|
+
//}
|
|
73
81
|
}
|
|
74
82
|
|
|
75
83
|
while (self.el.firstChild)
|
|
@@ -99,23 +107,48 @@ AFRAME.registerComponent('babia-ui', {
|
|
|
99
107
|
},
|
|
100
108
|
|
|
101
109
|
findQuerierComponents: function() {
|
|
102
|
-
this.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
110
|
+
if (this.targetComponent.el.components['babia-network'] && (this.targetComponent.el.components['babia-network'].data.nodesFrom || this.targetComponent.el.components['babia-network'].data.nodes)){
|
|
111
|
+
console.log("nodesFrom or nodes")
|
|
112
|
+
this.nodesQueriers = [];
|
|
113
|
+
this.linksQueriers = [];
|
|
114
|
+
document.querySelectorAll('[babia-queryjson]').forEach(querier => {
|
|
115
|
+
// Skip querier data when the target visualizer has included filtered data too.
|
|
116
|
+
if (querier.id != this.data.target || ( querier.id == this.data.target && !this.targetComponent.prodComponent.attrName == 'babia-filter')){
|
|
117
|
+
this.nodesQueriers.push(querier.id)
|
|
118
|
+
this.linksQueriers.push(querier.id)
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
document.querySelectorAll('[babia-queryes]').forEach(querier => {
|
|
122
|
+
this.nodesQueriers.push(querier.id)
|
|
123
|
+
this.linksQueriers.push(querier.id)
|
|
124
|
+
});
|
|
125
|
+
document.querySelectorAll('[babia-querygithub]').forEach(querier => {
|
|
126
|
+
this.nodesQueriers.push(querier.id)
|
|
127
|
+
this.linksQueriers.push(querier.id)
|
|
128
|
+
});
|
|
129
|
+
document.querySelectorAll('[babia-filter]').forEach(querier => {
|
|
130
|
+
this.nodesQueriers.push(querier.id)
|
|
131
|
+
this.linksQueriers.push(querier.id)
|
|
132
|
+
});
|
|
133
|
+
} else {
|
|
134
|
+
this.dataQueriers = []
|
|
135
|
+
// All queriers and filterdatas of the scene
|
|
136
|
+
document.querySelectorAll('[babia-queryjson]').forEach(querier => {
|
|
137
|
+
// Skip querier data when the target visualizer has included filtered data too.
|
|
138
|
+
if (querier.id != this.data.target || ( querier.id == this.data.target && !this.targetComponent.prodComponent.attrName == 'babia-filter')){
|
|
139
|
+
this.dataQueriers.push(querier.id)
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
document.querySelectorAll('[babia-queryes]').forEach(querier => {
|
|
107
143
|
this.dataQueriers.push(querier.id)
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
document.querySelectorAll('[babia-filter]').forEach(querier => {
|
|
117
|
-
this.dataQueriers.push(querier.id)
|
|
118
|
-
});
|
|
144
|
+
});
|
|
145
|
+
document.querySelectorAll('[babia-querygithub]').forEach(querier => {
|
|
146
|
+
this.dataQueriers.push(querier.id)
|
|
147
|
+
});
|
|
148
|
+
document.querySelectorAll('[babia-filter]').forEach(querier => {
|
|
149
|
+
this.dataQueriers.push(querier.id)
|
|
150
|
+
});
|
|
151
|
+
}
|
|
119
152
|
}
|
|
120
153
|
})
|
|
121
154
|
|
|
@@ -139,37 +172,106 @@ let insertInterfaceOnHand = (self, hand) => {
|
|
|
139
172
|
}
|
|
140
173
|
|
|
141
174
|
let getDataMetrics = (self, data, properties) =>{
|
|
142
|
-
self.
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
if(self.targetComponent.attrName == 'babia-city')
|
|
150
|
-
{
|
|
151
|
-
// Get last child of the tree
|
|
152
|
-
last_child = getLastChild(data)
|
|
153
|
-
} else if (self.targetComponent.attrName == 'babia-boats'){
|
|
154
|
-
last_child = getLastChild(data[0])
|
|
155
|
-
} else {
|
|
156
|
-
last_child = data[0]
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
Object.keys(last_child).forEach(metric => {
|
|
160
|
-
if (typeof last_child[metric] == 'number'){
|
|
161
|
-
number_metrics.push(metric)
|
|
175
|
+
if (self.targetComponent.attrName == 'babia-network') {
|
|
176
|
+
if (data.nodes){
|
|
177
|
+
self.dataMetrics={
|
|
178
|
+
'nodes': [],
|
|
179
|
+
'links': []
|
|
180
|
+
}
|
|
162
181
|
|
|
163
|
-
|
|
164
|
-
|
|
182
|
+
// Create structure
|
|
183
|
+
let number_properties = ['height', 'radius', 'width', 'size', 'farea', 'fheight', 'area', 'depth']
|
|
184
|
+
let number_metrics = []
|
|
185
|
+
let last_child
|
|
186
|
+
|
|
187
|
+
last_child = getLastChild(data.nodes[0])
|
|
188
|
+
|
|
189
|
+
Object.keys(last_child).forEach(metric => {
|
|
190
|
+
if (typeof last_child[metric] == 'number'){
|
|
191
|
+
number_metrics.push(metric)
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
properties['nodes'].forEach(property => {
|
|
196
|
+
if (number_properties.includes(property)){
|
|
197
|
+
self.dataMetrics['nodes'].push({property: property, metrics: number_metrics})
|
|
198
|
+
} else {
|
|
199
|
+
self.dataMetrics['nodes'].push({property: property, metrics: Object.keys(data.nodes[0])})
|
|
200
|
+
}
|
|
201
|
+
});
|
|
165
202
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
203
|
+
properties['links1'].forEach(property => {
|
|
204
|
+
if (number_properties.includes(property)){
|
|
205
|
+
self.dataMetrics['links'].push({property: property, metrics: number_metrics})
|
|
206
|
+
} else {
|
|
207
|
+
self.dataMetrics['links'].push({property: property, metrics: Object.keys(data.links[0])})
|
|
208
|
+
}
|
|
209
|
+
});
|
|
169
210
|
} else {
|
|
170
|
-
self.dataMetrics
|
|
211
|
+
self.dataMetrics=[]
|
|
212
|
+
|
|
213
|
+
// Create structure
|
|
214
|
+
let number_properties = ['height', 'radius', 'width', 'size', 'farea', 'fheight', 'area', 'depth']
|
|
215
|
+
let number_metrics = []
|
|
216
|
+
let last_child
|
|
217
|
+
|
|
218
|
+
last_child = getLastChild(data[0])
|
|
219
|
+
|
|
220
|
+
Object.keys(last_child).forEach(metric => {
|
|
221
|
+
if (typeof last_child[metric] == 'number'){
|
|
222
|
+
number_metrics.push(metric)
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
properties['nodes'].forEach(property => {
|
|
227
|
+
if (number_properties.includes(property)){
|
|
228
|
+
self.dataMetrics.push({property: property, metrics: number_metrics})
|
|
229
|
+
} else {
|
|
230
|
+
self.dataMetrics.push({property: property, metrics: Object.keys(data[0])})
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
properties['links0'].forEach(property => {
|
|
235
|
+
if (number_properties.includes(property)){
|
|
236
|
+
self.dataMetrics.push({property: property, metrics: number_metrics})
|
|
237
|
+
} else {
|
|
238
|
+
self.dataMetrics.push({property: property, metrics: Object.keys(data[0])})
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
} else {
|
|
244
|
+
self.dataMetrics=[]
|
|
245
|
+
|
|
246
|
+
// Create structure
|
|
247
|
+
let number_properties = ['height', 'radius', 'width', 'size', 'farea', 'fheight', 'area', 'depth']
|
|
248
|
+
let number_metrics = []
|
|
249
|
+
let last_child
|
|
250
|
+
|
|
251
|
+
if(self.targetComponent.attrName == 'babia-city')
|
|
252
|
+
{
|
|
253
|
+
// Get last child of the tree
|
|
254
|
+
last_child = getLastChild(data)
|
|
255
|
+
} else if (self.targetComponent.attrName == 'babia-boats'){
|
|
256
|
+
last_child = getLastChild(data[0])
|
|
257
|
+
} else {
|
|
258
|
+
last_child = data[0]
|
|
171
259
|
}
|
|
172
|
-
|
|
260
|
+
|
|
261
|
+
Object.keys(last_child).forEach(metric => {
|
|
262
|
+
if (typeof last_child[metric] == 'number'){
|
|
263
|
+
number_metrics.push(metric)
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
properties.forEach(property => {
|
|
268
|
+
if (number_properties.includes(property)){
|
|
269
|
+
self.dataMetrics.push({property: property, metrics: number_metrics})
|
|
270
|
+
} else {
|
|
271
|
+
self.dataMetrics.push({property: property, metrics: Object.keys(data[0])})
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
}
|
|
173
275
|
}
|
|
174
276
|
|
|
175
277
|
let getLastChild = (data) =>{
|
|
@@ -189,36 +291,97 @@ let generateInterface = (self, metrics, parent) =>{
|
|
|
189
291
|
let posX = 0
|
|
190
292
|
let maxX = 0
|
|
191
293
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
294
|
+
if (self.targetComponent.el.components['babia-network'] && (self.targetComponent.el.components['babia-network'].data.nodesFrom || self.targetComponent.el.components['babia-network'].data.nodes)){
|
|
295
|
+
// Nodes files
|
|
296
|
+
if (self.nodesQueriers.length > 1) {
|
|
297
|
+
let button = createProperty("Nodes", posX, posY)
|
|
298
|
+
self.interface.appendChild(button)
|
|
299
|
+
self.nodesQueriers.forEach(data => {
|
|
300
|
+
posX += 3.25
|
|
301
|
+
let button = createDataSelect(self, data, posX, posY, 'nodes')
|
|
302
|
+
button.classList.add("babiaxraycasterclass")
|
|
303
|
+
self.interface.appendChild(button)
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
--posY
|
|
307
|
+
if(maxX < posX) { maxX = posX }
|
|
308
|
+
posX = 0
|
|
309
|
+
|
|
310
|
+
// Links files
|
|
311
|
+
if (self.linksQueriers.length > 1) {
|
|
312
|
+
let button = createProperty("Links", posX, posY)
|
|
313
|
+
self.interface.appendChild(button)
|
|
314
|
+
self.linksQueriers.forEach(data => {
|
|
315
|
+
posX += 3.25
|
|
316
|
+
let button = createDataSelect(self, data, posX, posY, 'links')
|
|
317
|
+
button.classList.add("babiaxraycasterclass")
|
|
318
|
+
self.interface.appendChild(button)
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
--posY
|
|
322
|
+
if(maxX < posX) { maxX = posX }
|
|
323
|
+
posX = 0
|
|
324
|
+
|
|
325
|
+
// Properties and metrics
|
|
326
|
+
metrics.nodes.forEach(property => {
|
|
327
|
+
let button = createProperty(property.property, posX, posY)
|
|
328
|
+
self.interface.appendChild(button)
|
|
329
|
+
property.metrics.forEach(metric => {
|
|
330
|
+
posX += 3.25
|
|
331
|
+
let button = createMetric(self, property.property, metric, posX, posY)
|
|
332
|
+
button.classList.add("babiaxraycasterclass")
|
|
333
|
+
self.interface.appendChild(button)
|
|
334
|
+
});
|
|
335
|
+
--posY
|
|
336
|
+
if(maxX < posX) { maxX = posX }
|
|
337
|
+
posX = 0
|
|
201
338
|
});
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
posX = 0
|
|
206
|
-
|
|
207
|
-
// Properties and metrics
|
|
208
|
-
metrics.forEach(property => {
|
|
209
|
-
let button = createProperty(property.property, posX, posY)
|
|
210
|
-
self.interface.appendChild(button)
|
|
211
|
-
property.metrics.forEach(metric => {
|
|
212
|
-
posX += 3.25
|
|
213
|
-
let button = createMetric(self, property.property, metric, posX, posY)
|
|
214
|
-
button.classList.add("babiaxraycasterclass")
|
|
339
|
+
|
|
340
|
+
metrics.links.forEach(property => {
|
|
341
|
+
let button = createProperty(property.property, posX, posY)
|
|
215
342
|
self.interface.appendChild(button)
|
|
343
|
+
property.metrics.forEach(metric => {
|
|
344
|
+
posX += 3.25
|
|
345
|
+
let button = createMetric(self, property.property, metric, posX, posY)
|
|
346
|
+
button.classList.add("babiaxraycasterclass")
|
|
347
|
+
self.interface.appendChild(button)
|
|
348
|
+
});
|
|
349
|
+
--posY
|
|
350
|
+
if(maxX < posX) { maxX = posX }
|
|
351
|
+
posX = 0
|
|
216
352
|
});
|
|
353
|
+
} else {
|
|
354
|
+
// Data files
|
|
355
|
+
if (self.dataQueriers.length > 1) {
|
|
356
|
+
let button = createProperty("Data", posX, posY)
|
|
357
|
+
self.interface.appendChild(button)
|
|
358
|
+
self.dataQueriers.forEach(data => {
|
|
359
|
+
posX += 3.25
|
|
360
|
+
let button = createDataSelect(self, data, posX, posY)
|
|
361
|
+
button.classList.add("babiaxraycasterclass")
|
|
362
|
+
self.interface.appendChild(button)
|
|
363
|
+
});
|
|
364
|
+
}
|
|
217
365
|
--posY
|
|
218
366
|
if(maxX < posX) { maxX = posX }
|
|
219
|
-
posX = 0
|
|
220
|
-
|
|
221
|
-
|
|
367
|
+
posX = 0
|
|
368
|
+
|
|
369
|
+
// Properties and metrics
|
|
370
|
+
metrics.forEach(property => {
|
|
371
|
+
let button = createProperty(property.property, posX, posY)
|
|
372
|
+
self.interface.appendChild(button)
|
|
373
|
+
property.metrics.forEach(metric => {
|
|
374
|
+
posX += 3.25
|
|
375
|
+
let button = createMetric(self, property.property, metric, posX, posY)
|
|
376
|
+
button.classList.add("babiaxraycasterclass")
|
|
377
|
+
self.interface.appendChild(button)
|
|
378
|
+
});
|
|
379
|
+
--posY
|
|
380
|
+
if(maxX < posX) { maxX = posX }
|
|
381
|
+
posX = 0
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
|
|
222
385
|
self.interface.width = maxX + 3;
|
|
223
386
|
self.interface.height = Math.abs(posY)
|
|
224
387
|
|
|
@@ -303,6 +466,10 @@ let selection_events = (entity, visualizer, isData) =>{
|
|
|
303
466
|
// Change selected querier in visualializer (from)
|
|
304
467
|
} else if (entity.from) {
|
|
305
468
|
visualizer.el.setAttribute(visualizer.attrName, "from", entity.from )
|
|
469
|
+
} else if (entity.nodes) {
|
|
470
|
+
visualizer.el.setAttribute(visualizer.attrName, 'nodesFrom', entity.nodes)
|
|
471
|
+
} else if (entity.links) {
|
|
472
|
+
visualizer.el.setAttribute(visualizer.attrName, 'linksFrom', entity.links)
|
|
306
473
|
}
|
|
307
474
|
});
|
|
308
475
|
}
|
|
@@ -323,9 +490,15 @@ let createProperty = (property, positionX, positionY) =>{
|
|
|
323
490
|
return entity
|
|
324
491
|
}
|
|
325
492
|
|
|
326
|
-
let createDataSelect = (self, id, positionX, positionY) =>{
|
|
493
|
+
let createDataSelect = (self, id, positionX, positionY, networkType) =>{
|
|
327
494
|
let entity = document.createElement('a-box')
|
|
328
|
-
|
|
495
|
+
if (networkType == 'nodes'){
|
|
496
|
+
entity.nodes = id
|
|
497
|
+
} else if (networkType == 'links'){
|
|
498
|
+
entity.links = id
|
|
499
|
+
} else {
|
|
500
|
+
entity.from = id;
|
|
501
|
+
}
|
|
329
502
|
entity.classList.add("babiaxraycasterclass")
|
|
330
503
|
entity.setAttribute('position', { x: positionX, y: positionY, z: 0})
|
|
331
504
|
entity.setAttribute('rotation', { x: 0, y: 0, z: 0 })
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const colors = {
|
|
2
|
+
// https://gka.github.io/palettes/
|
|
2
3
|
'palettes': {
|
|
3
4
|
"blues": ["#142850", "#27496d", "#00909e", "#dae1e7"],
|
|
4
5
|
"foxy": ["#f79071", "#fa744f", "#16817a", "#024249"],
|
|
@@ -8,82 +9,33 @@ const colors = {
|
|
|
8
9
|
"icecream": ["#f76a8c", "#f8dc88", "#f8fab8", "#ccf0e1"],
|
|
9
10
|
"ubuntu": ["#511845", "#900c3f", "#c70039", "#ff5733"],
|
|
10
11
|
"pearl": ["#efa8e4", "#f8e1f4", "#fff0f5", "#97e5ef"],
|
|
11
|
-
"commerce": ["#222831", "#30475e", "#f2a365", "#ececec"]
|
|
12
|
+
"commerce": ["#222831", "#30475e", "#f2a365", "#ececec"],
|
|
13
|
+
"bluesextra": ['#00429d', '#09459e', '#1147a0', '#174aa1', '#1c4da2', '#214fa3', '#2552a5', '#2855a6', '#2c57a7', '#2f5aa8', '#335daa', '#3660ab', '#3962ac', '#3b65ad', '#3e68ae', '#416bb0', '#446eb1', '#4670b2', '#4973b3', '#4c76b4', '#4e79b6', '#517cb7', '#537eb8', '#5681b9', '#5884ba', '#5b87bc', '#5d8abd', '#608dbe', '#6290bf', '#6593c0', '#6895c1', '#6a98c2', '#6d9bc4', '#6f9ec5', '#72a1c6', '#74a4c7', '#77a7c8', '#7aaac9', '#7cadca', '#7fb0cb', '#82b3cc', '#84b5cd', '#87b8ce', '#8abbcf', '#8dbed0', '#90c1d1', '#93c4d2', '#96c7d3', '#99cad4', '#9ccdd5', '#9fd0d6', '#a2d3d7', '#a5d5d8', '#a9d8d9', '#acdbda', '#b0dedb', '#b4e1db', '#b7e4dc', '#bbe6dd', '#c0e9de', '#c4ecde', '#c8efdf', '#cdf1e0', '#d2f4e0', '#d7f6e1', '#ddf9e1', '#e4fbe1', '#ebfde1', '#f3fee1', '#ffffe0'],
|
|
14
|
+
"ubuntuextra": ['#511845', '#541845', '#581844', '#5b1844', '#5e1744', '#621744', '#651743', '#681743', '#6b1743', '#6e1643', '#711642', '#741642', '#771642', '#7a1641', '#7d1541', '#801541', '#831541', '#861540', '#891540', '#8c1540', '#8f1540', '#92153f', '#94163f', '#97163f', '#9a163f', '#9d173e', '#9f173e', '#a2183e', '#a5183e', '#a7193d', '#aa1a3d', '#ac1a3d', '#af1b3d', '#b21c3d', '#b41d3c', '#b71e3c', '#b9203c', '#bb213c', '#be223b', '#c0233b', '#c3253b', '#c5263b', '#c7273b', '#ca293a', '#cc2a3a', '#ce2c3a', '#d02e3a', '#d32f39', '#d53139', '#d73239', '#d93439', '#db3638', '#dd3738', '#e03938', '#e23b38', '#e43d37', '#e63e37', '#e84037', '#ea4236', '#ec4436', '#ee4636', '#f04836', '#f24a35', '#f44b35', '#f64d35', '#f84f34', '#f95134', '#fb5334', '#fd5533', '#ff5733'],
|
|
15
|
+
"ubuntudiver": ['#511845', '#711643', '#8d1640', '#a81b3f', '#c1253d', '#d7333a', '#ec4437', '#ff5733', '#ffdac4', '#ffb3a7', '#fb8a8c', '#eb6574', '#d5405e', '#b81b4a', '#93003a'],
|
|
16
|
+
"bluesdiver": ['#00429d', '#325da9', '#4e78b5', '#6694c1', '#80b1cc', '#9dced6', '#c0eade', '#ffffe0', '#f2f0e4', '#e5e1e8', '#d7d3eb', '#c8c5ed', '#b8b7ef', '#a5aaf0', '#6ea9da']
|
|
12
17
|
},
|
|
13
18
|
'get': function (i, palette) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
let dataReadyToSend = (propertyName, self) => {
|
|
21
|
-
self.interestedElements.forEach(element => {
|
|
22
|
-
dispatchEventOnElement(element, propertyName)
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
let dispatchEventOnElement = (element, propertyName) => {
|
|
27
|
-
element.emit("babiaVisualizerUpdated", propertyName)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
let findDataComponent = (data, el, self) => {
|
|
31
|
-
let eventName = "babiaQuerierDataReady"
|
|
32
|
-
if (data.from) {
|
|
33
|
-
// Save the reference to the querier or filterdata
|
|
34
|
-
let dataElement = document.getElementById(data.from)
|
|
35
|
-
if (dataElement.components['babia-filter']) {
|
|
36
|
-
self.dataComponent = dataElement.components['babia-filter']
|
|
37
|
-
eventName = "babiaFilterDataReady"
|
|
38
|
-
} else if (dataElement.components['babia-queryjson']) {
|
|
39
|
-
self.dataComponent = dataElement.components['babia-queryjson']
|
|
40
|
-
} else if (dataElement.components['babia-queryes']) {
|
|
41
|
-
self.dataComponent = dataElement.components['babia-queryes']
|
|
42
|
-
} else if (dataElement.components['babia-querygithub']) {
|
|
43
|
-
self.dataComponent = dataElement.components['babia-querygithub']
|
|
44
|
-
} else if (dataElement.components['babia-selector']) {
|
|
45
|
-
self.dataComponent = dataElement.components['babia-selector'];
|
|
46
|
-
eventName = "babiaSelectorDataReady";
|
|
19
|
+
// CAMBIAR LA LOGICA POR SI METES UN ARRAY DIRECTAMENTE EN VEZ DE AÑADIR UNA DE POR DEFECTO
|
|
20
|
+
if (palette in colors) {
|
|
21
|
+
let length = this.palettes[palette].length;
|
|
22
|
+
return this.palettes[palette][i % length];
|
|
47
23
|
} else {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
eventName = "babiaFilterDataReady"
|
|
56
|
-
} else if (el.components['babia-queryjson']) {
|
|
57
|
-
self.dataComponent = el.components['babia-queryjson']
|
|
58
|
-
} else if (el.components['babia-queryes']) {
|
|
59
|
-
self.dataComponent = el.components['babia-queryes']
|
|
60
|
-
} else if (el.components['babia-querygithub']) {
|
|
61
|
-
self.dataComponent = el.components['babia-querygithub']
|
|
62
|
-
} else if (el.components['babia-selector']) {
|
|
63
|
-
self.dataComponent = el.components['babia-selector'];
|
|
64
|
-
eventName = "babiaSelectorDataReady";
|
|
65
|
-
} else {
|
|
66
|
-
// Look for a querier or filterdata in the scene
|
|
67
|
-
if (document.querySelectorAll("[babia-filter]").length > 0) {
|
|
68
|
-
self.dataComponent = document.querySelectorAll("[babia-filter]")[0].components['babia-filter']
|
|
69
|
-
eventName = "babiaFilterDataReady"
|
|
70
|
-
} else if (document.querySelectorAll("[babia-queryjson]").length > 0) {
|
|
71
|
-
self.dataComponent = document.querySelectorAll("[babia-queryjson]")[0].components['babia-queryjson']
|
|
72
|
-
} else if (document.querySelectorAll("[babia-queryjson]").length > 0) {
|
|
73
|
-
self.dataComponent = document.querySelectorAll("[babia-queryes]")[0].components['babia-queryes']
|
|
74
|
-
} else if (document.querySelectorAll("[babia-querygithub]").length > 0) {
|
|
75
|
-
self.dataComponent = document.querySelectorAll("[babia-querygithub]")[0].components['babia-querygithub']
|
|
76
|
-
} else if (document.querySelectorAll('[babia-selector]').length > 0) {
|
|
77
|
-
self.dataComponent = document.querySelectorAll('[babia-selector]')[0].components['babia-selector'];
|
|
78
|
-
eventName = "babiaSelectorDataReady";
|
|
79
|
-
} else {
|
|
80
|
-
console.error("Error, querier not found", el, el.components, el.components['babia-selector']);
|
|
81
|
-
return
|
|
24
|
+
try {
|
|
25
|
+
let paletteParsed = JSON.parse(palette)
|
|
26
|
+
let length = paletteParsed.length;
|
|
27
|
+
return paletteParsed[i % length];
|
|
28
|
+
} catch (e) {
|
|
29
|
+
// Do nothing
|
|
30
|
+
console.error(e)
|
|
82
31
|
}
|
|
83
32
|
}
|
|
33
|
+
|
|
34
|
+
let length = this.palettes['ubuntu'].length;
|
|
35
|
+
return this.palettes[palette][i % length];
|
|
36
|
+
|
|
84
37
|
}
|
|
85
|
-
|
|
86
|
-
}
|
|
38
|
+
};
|
|
87
39
|
|
|
88
40
|
let findProdComponent = (data, el, selfProducer) => {
|
|
89
41
|
let prodComponent;
|
|
@@ -94,6 +46,8 @@ let findProdComponent = (data, el, selfProducer) => {
|
|
|
94
46
|
prodComponent = prodElement.components['babia-filter']
|
|
95
47
|
} else if (prodElement.components['babia-queryjson']) {
|
|
96
48
|
prodComponent = prodElement.components['babia-queryjson']
|
|
49
|
+
} else if (prodElement.components['babia-querycsv']) {
|
|
50
|
+
prodComponent = prodElement.components['babia-querycsv']
|
|
97
51
|
} else if (prodElement.components['babia-queryes']) {
|
|
98
52
|
prodComponent = prodElement.components['babia-queryes']
|
|
99
53
|
} else if (prodElement.components['babia-querygithub']) {
|
|
@@ -113,6 +67,8 @@ let findProdComponent = (data, el, selfProducer) => {
|
|
|
113
67
|
prodComponentNodes = prodElementNodes.components['babia-filter']
|
|
114
68
|
} else if (prodElementNodes.components['babia-queryjson']) {
|
|
115
69
|
prodComponentNodes = prodElementNodes.components['babia-queryjson']
|
|
70
|
+
} else if (prodElementNodes.components['babia-querycsv']) {
|
|
71
|
+
prodComponentNodes = prodElementNodes.components['babia-querycsv']
|
|
116
72
|
} else if (prodElementNodes.components['babia-queryes']) {
|
|
117
73
|
prodComponentNodes = prodElementNodes.components['babia-queryes']
|
|
118
74
|
} else if (prodElementNodes.components['babia-querygithub']) {
|
|
@@ -121,13 +77,15 @@ let findProdComponent = (data, el, selfProducer) => {
|
|
|
121
77
|
console.error("Problem registering to the querier", el);
|
|
122
78
|
return
|
|
123
79
|
}
|
|
124
|
-
|
|
80
|
+
|
|
125
81
|
// Save the reference to the querier or filterdata
|
|
126
82
|
let prodElementLinks = document.getElementById(data.linksFrom)
|
|
127
83
|
if (prodElementLinks.components['babia-filter']) {
|
|
128
84
|
prodComponentLinks = prodElementLinks.components['babia-filter']
|
|
129
85
|
} else if (prodElementLinks.components['babia-queryjson']) {
|
|
130
86
|
prodComponentLinks = prodElementLinks.components['babia-queryjson']
|
|
87
|
+
} else if (prodElementLinks.components['babia-querycsv']) {
|
|
88
|
+
prodComponentLinks = prodElementLinks.components['babia-querycsv']
|
|
131
89
|
} else if (prodElementLinks.components['babia-queryes']) {
|
|
132
90
|
prodComponentLinks = prodElementLinks.components['babia-queryes']
|
|
133
91
|
} else if (prodElementLinks.components['babia-querygithub']) {
|
|
@@ -136,14 +94,16 @@ let findProdComponent = (data, el, selfProducer) => {
|
|
|
136
94
|
console.error("Problem registering to the querier", el);
|
|
137
95
|
return
|
|
138
96
|
}
|
|
139
|
-
return {'nodes': prodComponentNodes, 'links': prodComponentLinks}
|
|
140
|
-
|
|
97
|
+
return { 'nodes': prodComponentNodes, 'links': prodComponentLinks }
|
|
98
|
+
|
|
141
99
|
} else {
|
|
142
100
|
// Look for a querier or filterdata in the same element and register
|
|
143
101
|
if (el.components['babia-filter'] && selfProducer != 'babia-filter') {
|
|
144
102
|
prodComponent = el.components['babia-filter']
|
|
145
103
|
} else if (el.components['babia-queryjson'] && selfProducer != 'babia-queryjson') {
|
|
146
104
|
prodComponent = el.components['babia-queryjson']
|
|
105
|
+
} else if (el.components['babia-querycsv'] && selfProducer != 'babia-querycsv') {
|
|
106
|
+
prodComponent = el.components['babia-querycsv']
|
|
147
107
|
} else if (el.components['babia-queryes'] && selfProducer != 'babia-queryes') {
|
|
148
108
|
prodComponent = el.components['babia-queryes']
|
|
149
109
|
} else if (el.components['babia-querygithub'] && selfProducer != 'babia-querygithub') {
|
|
@@ -158,7 +118,9 @@ let findProdComponent = (data, el, selfProducer) => {
|
|
|
158
118
|
prodComponent = document.querySelectorAll("[babia-filter]")[0].components['babia-filter']
|
|
159
119
|
} else if (document.querySelectorAll("[babia-queryjson]").length > 0) {
|
|
160
120
|
prodComponent = document.querySelectorAll("[babia-queryjson]")[0].components['babia-queryjson']
|
|
161
|
-
} else if (document.querySelectorAll("[babia-
|
|
121
|
+
} else if (document.querySelectorAll("[babia-querycsv]").length > 0) {
|
|
122
|
+
prodComponent = document.querySelectorAll("[babia-querycsv]")[0].components['babia-queryjson']
|
|
123
|
+
} else if (document.querySelectorAll("[babia-queryes]").length > 0) {
|
|
162
124
|
prodComponent = document.querySelectorAll("[babia-queryes]")[0].components['babia-queryes']
|
|
163
125
|
} else if (document.querySelectorAll("[babia-querygithub]").length > 0) {
|
|
164
126
|
prodComponent = document.querySelectorAll("[babia-querygithub]")[0].components['babia-querygithub']
|
|
@@ -194,7 +156,7 @@ let findNavComponent = (data, el) => {
|
|
|
194
156
|
// Look for a navigator in the scene
|
|
195
157
|
if (document.querySelectorAll("[babia-navigator]").length > 0) {
|
|
196
158
|
navComponent = document.querySelectorAll("[babia-navigator]")[0].components['babia-navigator']
|
|
197
|
-
}else {
|
|
159
|
+
} else {
|
|
198
160
|
console.error("Error, navigator not found", el, el.components, el.components['babia-navigator']);
|
|
199
161
|
return
|
|
200
162
|
}
|
|
@@ -207,7 +169,7 @@ let findTargetComponent = (data, self) => {
|
|
|
207
169
|
if (data.target) {
|
|
208
170
|
// Save the reference to the querier or filterdata
|
|
209
171
|
let targetElement = document.getElementById(data.target)
|
|
210
|
-
if (targetElement != null) {
|
|
172
|
+
if (targetElement != null) {
|
|
211
173
|
if (targetElement.components['babia-bars']) {
|
|
212
174
|
targetComponent = targetElement.components['babia-bars']
|
|
213
175
|
} else if (targetElement.components['babia-barsmap']) {
|
|
@@ -226,6 +188,8 @@ let findTargetComponent = (data, self) => {
|
|
|
226
188
|
targetComponent = targetElement.components['babia-city']
|
|
227
189
|
} else if (targetElement.components['babia-boats']) {
|
|
228
190
|
targetComponent = targetElement.components['babia-boats']
|
|
191
|
+
} else if (targetElement.components['babia-network']) {
|
|
192
|
+
targetComponent = targetElement.components['babia-network']
|
|
229
193
|
} else {
|
|
230
194
|
console.error("Visualizer not found.")
|
|
231
195
|
return
|
|
@@ -244,9 +208,9 @@ let findTargetComponent = (data, self) => {
|
|
|
244
208
|
let updateTitle = (data, titleRotation) => {
|
|
245
209
|
let titleEl = document.createElement('a-entity');
|
|
246
210
|
titleEl.classList.add("babiaxrTitle")
|
|
247
|
-
titleEl.setAttribute('text-geometry', {'value': data.title});
|
|
248
|
-
if (data.titleFont) titleEl.setAttribute('text-geometry', {'font': data.titleFont});
|
|
249
|
-
if (data.titleColor) titleEl.setAttribute('material', {'color': data.titleColor});
|
|
211
|
+
titleEl.setAttribute('text-geometry', { 'value': data.title });
|
|
212
|
+
if (data.titleFont) titleEl.setAttribute('text-geometry', { 'font': data.titleFont });
|
|
213
|
+
if (data.titleColor) titleEl.setAttribute('material', { 'color': data.titleColor });
|
|
250
214
|
titleEl.setAttribute('position', data.titlePosition);
|
|
251
215
|
titleEl.setAttribute('rotation', titleRotation);
|
|
252
216
|
return titleEl
|
|
@@ -254,7 +218,7 @@ let updateTitle = (data, titleRotation) => {
|
|
|
254
218
|
|
|
255
219
|
let parseJson = (json) => {
|
|
256
220
|
let object;
|
|
257
|
-
if (typeof(json) === 'string' || json instanceof String) {
|
|
221
|
+
if (typeof (json) === 'string' || json instanceof String) {
|
|
258
222
|
object = JSON.parse(json);
|
|
259
223
|
} else {
|
|
260
224
|
object = json;
|
|
@@ -262,13 +226,57 @@ let parseJson = (json) => {
|
|
|
262
226
|
return object;
|
|
263
227
|
}
|
|
264
228
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
229
|
+
let updateFunction = (self, oldData) => {
|
|
230
|
+
let data = self.data;
|
|
231
|
+
let el = self.el;
|
|
232
|
+
|
|
233
|
+
if (el.components["babia-bars"] || el.components["babia-barsmap"] || el.components["babia-cyls"]) {
|
|
234
|
+
if (!data.index) {
|
|
235
|
+
data.index = data.x_axis;
|
|
236
|
+
}
|
|
237
|
+
self.animation = data.animation;
|
|
238
|
+
self.bar_array = [];
|
|
239
|
+
}
|
|
240
|
+
if (el.components["babia-boats"]) {
|
|
241
|
+
if (!self.figures) {
|
|
242
|
+
self.figures = [];
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if (data.data && oldData.data !== data.data) {
|
|
247
|
+
let _data = parseJson(data.data);
|
|
248
|
+
self.processData(_data);
|
|
249
|
+
} else if (data.from !== oldData.from) {
|
|
250
|
+
if (self.slice_array) {
|
|
251
|
+
self.slice_array = [];
|
|
252
|
+
}
|
|
253
|
+
// Unregister from old producer
|
|
254
|
+
if (self.prodComponent) {
|
|
255
|
+
self.prodComponent.notiBuffer.unregister(self.notiBufferId);
|
|
256
|
+
};
|
|
257
|
+
self.prodComponent = findProdComponent(data, el);
|
|
258
|
+
if (self.prodComponent.notiBuffer) {
|
|
259
|
+
self.notiBufferId = self.prodComponent.notiBuffer
|
|
260
|
+
.register(self.processData.bind(self));
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
// If changed whatever, re-print with the current data
|
|
264
|
+
else if (data !== oldData && self.newData) {
|
|
265
|
+
if (self.slice_array) {
|
|
266
|
+
self.slice_array = [];
|
|
267
|
+
}
|
|
268
|
+
if (self.bar_array) {
|
|
269
|
+
self.bar_array = [];
|
|
270
|
+
}
|
|
271
|
+
self.processData(self.newData);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
268
275
|
module.exports.findProdComponent = findProdComponent;
|
|
269
276
|
module.exports.findNavComponent = findNavComponent;
|
|
270
277
|
module.exports.findTargetComponent = findTargetComponent;
|
|
271
278
|
module.exports.colors = colors;
|
|
272
279
|
module.exports.updateTitle = updateTitle;
|
|
273
280
|
module.exports.parseJson = parseJson;
|
|
281
|
+
module.exports.updateFunction = updateFunction;
|
|
274
282
|
|