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.
- package/components/filters/babia-selector.js +256 -79
- package/components/filters/babia-treebuilder.js +4 -5
- package/components/geometries/babia-cyl.js +180 -0
- package/components/others/assets/tooltip.png +0 -0
- package/components/others/babia-camera.js +195 -0
- package/components/others/babia-controls.js +62 -37
- package/components/others/babia-navigator.js +55 -49
- package/components/others/babia-range-selector.js +208 -0
- package/components/others/babia-slider.js +36 -8
- package/components/others/babia-ui.js +246 -73
- package/components/others/common.js +60 -73
- package/components/queriers/babia-querycsv.js +96 -0
- package/components/queriers/babia-queryes.js +203 -132
- package/components/visualizers/babia-bars.js +4 -35
- package/components/visualizers/babia-barsmap.js +2 -30
- package/components/visualizers/babia-boats.js +291 -279
- package/components/visualizers/babia-bubbles.js +9 -26
- package/components/visualizers/babia-city.js +19 -9
- package/components/visualizers/babia-cyls.js +197 -201
- package/components/visualizers/babia-cylsmap.js +171 -241
- package/components/visualizers/babia-doughnut.js +2 -28
- package/components/visualizers/babia-network.js +191 -124
- package/components/visualizers/babia-pie.js +2 -30
- package/dist/aframe-babia-components.js +6785 -5626
- package/dist/aframe-babia-components.min.js +7 -1
- package/dist/aframe-babia-components.min.js.map +1 -0
- package/docs/APIs/CHARTS.md +11 -4
- package/docs/APIs/DATAMANAGEMENT.md +7 -0
- package/docs/APIs/OTHERS.md +27 -0
- package/docs/APIs/QUERIERS.md +16 -0
- package/docs/RELEASE_NOTES.md +44 -23
- package/docs/Tutorials/multiuser.md +47 -2
- package/docs/Tutorials/temporal_evol_with_boats.md +4 -4
- 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/boats/boats_new_element/data1.json +18 -18
- package/examples/boats/boats_new_element/data2.json +19 -19
- package/examples/boats/boats_new_element/index.html +1 -1
- 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/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/easyrtc.js +11984 -0
- package/examples/multi_boats/index_multi_boats.html +223 -0
- package/examples/multi_boats/jetuml.html +256 -0
- package/examples/multi_boats/jetuml_code_data.json +1 -0
- 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 +255 -0
- package/examples/multiuser/choose_avatar/index.html +18 -8
- package/examples/selector_boats/jetuml.html +74 -0
- package/examples/selector_boats/jetuml_evol_data.json +1 -0
- package/examples/selector_boats/jetuml_from_3_2_to_1_0.json +62382 -0
- package/examples/selector_boats/jetumltest.html +80 -0
- package/examples/ui/link/index.html +12 -11
- 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 +73 -2
- package/index.js +12 -1
- package/package.json +6 -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 +10 -1
- package/webpack.devnossl.js +16 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
|
|
3
|
+
<head>
|
|
4
|
+
<title>Multiuser Time Evolution with Babia-Bars</title>
|
|
5
|
+
<script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script>
|
|
6
|
+
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v6.1.0/dist/aframe-extras.min.js"></script>
|
|
7
|
+
<script src="https://unpkg.com/aframe-environment-component@1.2.0/dist/aframe-environment-component.min.js"></script>
|
|
8
|
+
<script src="https://unpkg.com/aframe-text-geometry-component@0.5.1/dist/aframe-text-geometry-component.min.js"></script>
|
|
9
|
+
<script src="../../dist/aframe-babia-components.js"></script>
|
|
10
|
+
<!-- Mulituser -->
|
|
11
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.slim.js"></script>
|
|
12
|
+
<script src="./easyrtc.js"></script>
|
|
13
|
+
<script src="https://unpkg.com/networked-aframe@^0.8.0/dist/networked-aframe.js"></script>
|
|
14
|
+
</head>
|
|
15
|
+
|
|
16
|
+
<body>
|
|
17
|
+
<a-scene rain background="color: #ECECEC" networked-scene="
|
|
18
|
+
room: multi_bars;
|
|
19
|
+
adapter: easyrtc;
|
|
20
|
+
debug: true;
|
|
21
|
+
audio: false;
|
|
22
|
+
serverURL: https://f-l2108-pc02.aulas.etsit.urjc.es:49153/;
|
|
23
|
+
">
|
|
24
|
+
<a-assets>
|
|
25
|
+
<!-- Dummy asset to make the scene sync (WIP)-->
|
|
26
|
+
<img src="https://wallpapercave.com/wp/wp2345390.jpg?dummy=8484744">
|
|
27
|
+
|
|
28
|
+
<template id="bars-template">
|
|
29
|
+
<a-entity class="bars"></a-entity>
|
|
30
|
+
</template>
|
|
31
|
+
</a-assets>
|
|
32
|
+
<a-entity environment="preset: japan"></a-entity>
|
|
33
|
+
|
|
34
|
+
<a-entity id="bars" babia-queryjson="url: data.json;"
|
|
35
|
+
babia-bars='legend: true; axis: true; keepHeight: true'
|
|
36
|
+
position="-5 0 0.1" rotation="0 0 0"
|
|
37
|
+
networked="template:#bars-template; networkId:bars; persistent: true; owner: scene">
|
|
38
|
+
</a-entity>
|
|
39
|
+
|
|
40
|
+
<a-entity movement-controls="fly: true" position="2 5 15">
|
|
41
|
+
<a-entity camera position="0 0 0" look-controls></a-entity>
|
|
42
|
+
<a-entity cursor="rayOrigin:mouse"></a-entity>
|
|
43
|
+
<a-entity laser-controls="hand: right"></a-entity>
|
|
44
|
+
</a-entity>
|
|
45
|
+
</a-scene>
|
|
46
|
+
<script>
|
|
47
|
+
|
|
48
|
+
let bars = document.getElementById('bars')
|
|
49
|
+
document.body.addEventListener('clientConnected', function (event) {
|
|
50
|
+
let clientId = event.detail.clientId;
|
|
51
|
+
console.log('clientConnected event. clientId =', clientId);
|
|
52
|
+
console.log("Bars owner: ", bars.components.networked.data.owner);
|
|
53
|
+
if (bars.components.networked.data.owner == 'scene'){
|
|
54
|
+
for (client in NAF.connection.getConnectedClients()){
|
|
55
|
+
let otherTime = NAF.connection.getConnectedClients()[client].roomJoinTime
|
|
56
|
+
let myTime = NAF.connection.adapter._myRoomJoinTime
|
|
57
|
+
console.log("Other: ", otherTime)
|
|
58
|
+
console.log("Mine: ", myTime)
|
|
59
|
+
let imCreator = false
|
|
60
|
+
if (myTime < otherTime){
|
|
61
|
+
setTimeout(updateScale, 4000);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
function updateScale() {
|
|
68
|
+
NAF.utils.takeOwnership(bars)
|
|
69
|
+
bars.setAttribute("scale", "0.5 0.5 0.5")
|
|
70
|
+
setTimeout(updateData, 4000);
|
|
71
|
+
}
|
|
72
|
+
function updateData () {
|
|
73
|
+
bars.setAttribute('babia-queryjson', 'url', 'data2.json');
|
|
74
|
+
setTimeout(updateData1, 4000);
|
|
75
|
+
}
|
|
76
|
+
function updateData1 () {
|
|
77
|
+
bars.setAttribute('babia-queryjson', 'url', 'data3.json');
|
|
78
|
+
setTimeout(updateData2, 4000);
|
|
79
|
+
}
|
|
80
|
+
function updateData2 () {
|
|
81
|
+
bars.setAttribute('babia-queryjson', 'url', 'data.json');
|
|
82
|
+
}
|
|
83
|
+
</script>
|
|
84
|
+
<script>
|
|
85
|
+
NAF.schemas.add({
|
|
86
|
+
template: '#bars-template',
|
|
87
|
+
components: [
|
|
88
|
+
'position',
|
|
89
|
+
'rotation',
|
|
90
|
+
'scale',
|
|
91
|
+
'babia-bars',
|
|
92
|
+
'babia-queryjson'
|
|
93
|
+
]
|
|
94
|
+
});
|
|
95
|
+
</script>
|
|
96
|
+
</body>
|
|
97
|
+
</html>
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
|
|
3
|
+
<head>
|
|
4
|
+
<title>Multiuser Time Evolution with Babia-Bars, separate queryjson from bars</title>
|
|
5
|
+
<script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script>
|
|
6
|
+
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v6.1.0/dist/aframe-extras.min.js"></script>
|
|
7
|
+
<script src="https://unpkg.com/aframe-environment-component@1.2.0/dist/aframe-environment-component.min.js"></script>
|
|
8
|
+
<script src="https://unpkg.com/aframe-text-geometry-component@0.5.1/dist/aframe-text-geometry-component.min.js"></script>
|
|
9
|
+
<script src="../../dist/aframe-babia-components.js"></script>
|
|
10
|
+
<!-- Mulituser -->
|
|
11
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.slim.js"></script>
|
|
12
|
+
<script src="./easyrtc.js"></script>
|
|
13
|
+
<script src="https://unpkg.com/networked-aframe@^0.8.0/dist/networked-aframe.js"></script>
|
|
14
|
+
</head>
|
|
15
|
+
|
|
16
|
+
<body>
|
|
17
|
+
<a-scene rain background="color: #ECECEC" networked-scene="
|
|
18
|
+
room: multi_bars_1;
|
|
19
|
+
adapter: easyrtc;
|
|
20
|
+
debug: true;
|
|
21
|
+
audio: false;
|
|
22
|
+
serverURL: https://f-l2108-pc02.aulas.etsit.urjc.es:49153/;
|
|
23
|
+
">
|
|
24
|
+
<!--audio:true
|
|
25
|
+
serverURL: https://f-l2108-pc02.aulas.etsit.urjc.es:49153/"-->
|
|
26
|
+
<a-assets>
|
|
27
|
+
<!-- Dummy asset to make the scene sync (WIP)-->
|
|
28
|
+
<img src="https://wallpapercave.com/wp/wp2345390.jpg?dummy=8484744">
|
|
29
|
+
|
|
30
|
+
<template id="querier-template">
|
|
31
|
+
<a-entity class="querier"></a-entity>
|
|
32
|
+
</template>
|
|
33
|
+
<template id="bars-template">
|
|
34
|
+
<a-entity class="bars"></a-entity>
|
|
35
|
+
</template>
|
|
36
|
+
</a-assets>
|
|
37
|
+
<a-entity environment="preset: japan"></a-entity>
|
|
38
|
+
|
|
39
|
+
<a-entity id="querier" babia-queryjson="url: data.json;"
|
|
40
|
+
networked="template:#querier-template; networkId:querier; persistent: true; owner: scene" ></a-entity>
|
|
41
|
+
<a-entity id="bars"
|
|
42
|
+
babia-bars='legend: true; axis: true; keepHeight: true; from: querier'
|
|
43
|
+
position="-5 0 0.1" rotation="0 0 0"
|
|
44
|
+
networked="template:#bars-template; networkId:bars; persistent: true; owner: scene">
|
|
45
|
+
</a-entity>
|
|
46
|
+
|
|
47
|
+
<a-entity movement-controls="fly: true" position="2 5 15">
|
|
48
|
+
<a-entity camera position="0 0 0" look-controls></a-entity>
|
|
49
|
+
<a-entity cursor="rayOrigin:mouse"></a-entity>
|
|
50
|
+
<a-entity laser-controls="hand: right"></a-entity>
|
|
51
|
+
</a-entity>
|
|
52
|
+
</a-scene>
|
|
53
|
+
<script>
|
|
54
|
+
|
|
55
|
+
let bars = document.getElementById('bars')
|
|
56
|
+
let querier = document.getElementById('querier')
|
|
57
|
+
document.body.addEventListener('clientConnected', function (event) {
|
|
58
|
+
let clientId = event.detail.clientId;
|
|
59
|
+
console.log('clientConnected event. clientId =', clientId);
|
|
60
|
+
console.log("Bars owner: ", bars.components.networked.data.owner);
|
|
61
|
+
if (bars.components.networked.data.owner == 'scene'){
|
|
62
|
+
for (client in NAF.connection.getConnectedClients()){
|
|
63
|
+
let otherTime = NAF.connection.getConnectedClients()[client].roomJoinTime
|
|
64
|
+
let myTime = NAF.connection.adapter._myRoomJoinTime
|
|
65
|
+
console.log("Other: ", otherTime)
|
|
66
|
+
console.log("Mine: ", myTime)
|
|
67
|
+
let imCreator = false
|
|
68
|
+
if (myTime < otherTime){
|
|
69
|
+
setTimeout(updateScale, 4000);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
function updateScale() {
|
|
75
|
+
NAF.utils.takeOwnership(bars)
|
|
76
|
+
bars.setAttribute("scale", "0.5 0.5 0.5")
|
|
77
|
+
setTimeout(updateData, 4000);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function updateData () {
|
|
81
|
+
NAF.utils.takeOwnership(querier)
|
|
82
|
+
querier.setAttribute('babia-queryjson', 'url', 'data2.json');
|
|
83
|
+
setTimeout(updateData1, 4000);
|
|
84
|
+
}
|
|
85
|
+
function updateData1 () {
|
|
86
|
+
querier.setAttribute('babia-queryjson', 'url', 'data3.json');
|
|
87
|
+
setTimeout(updateData2, 4000);
|
|
88
|
+
}
|
|
89
|
+
function updateData2 () {
|
|
90
|
+
querier.setAttribute('babia-queryjson', 'url', 'data.json');
|
|
91
|
+
}
|
|
92
|
+
</script>
|
|
93
|
+
<script>
|
|
94
|
+
NAF.schemas.add({
|
|
95
|
+
template: '#bars-template',
|
|
96
|
+
components: [
|
|
97
|
+
'position',
|
|
98
|
+
'rotation',
|
|
99
|
+
'scale',
|
|
100
|
+
'babia-bars',
|
|
101
|
+
]
|
|
102
|
+
});
|
|
103
|
+
NAF.schemas.add({
|
|
104
|
+
template: '#querier-template',
|
|
105
|
+
components: [
|
|
106
|
+
'babia-queryjson'
|
|
107
|
+
]
|
|
108
|
+
});
|
|
109
|
+
</script>
|
|
110
|
+
</body>
|
|
111
|
+
</html>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
|
|
3
|
+
<head>
|
|
4
|
+
<title>Multiuser Time Evolution with Babia-Bars, queryjson, filter and bars together</title>
|
|
5
|
+
<script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script>
|
|
6
|
+
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v6.1.0/dist/aframe-extras.min.js"></script>
|
|
7
|
+
<script src="https://unpkg.com/aframe-environment-component@1.2.0/dist/aframe-environment-component.min.js"></script>
|
|
8
|
+
<script src="https://unpkg.com/aframe-text-geometry-component@0.5.1/dist/aframe-text-geometry-component.min.js"></script>
|
|
9
|
+
<script src="../../dist/aframe-babia-components.js"></script>
|
|
10
|
+
<!-- Mulituser -->
|
|
11
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.slim.js"></script>
|
|
12
|
+
<script src="./easyrtc.js"></script>
|
|
13
|
+
<script src="https://unpkg.com/networked-aframe@^0.8.0/dist/networked-aframe.js"></script>
|
|
14
|
+
</head>
|
|
15
|
+
|
|
16
|
+
<body>
|
|
17
|
+
<a-scene rain background="color: #ECECEC" networked-scene="
|
|
18
|
+
room: multi_bars_2;
|
|
19
|
+
adapter: easyrtc;
|
|
20
|
+
debug: true;
|
|
21
|
+
audio: false;
|
|
22
|
+
serverURL: https://f-l2108-pc02.aulas.etsit.urjc.es:49153/;
|
|
23
|
+
">
|
|
24
|
+
<a-assets>
|
|
25
|
+
<!-- Dummy asset to make the scene sync (WIP)-->
|
|
26
|
+
<img src="https://wallpapercave.com/wp/wp2345390.jpg?dummy=8484744">
|
|
27
|
+
|
|
28
|
+
<template id="bars-template">
|
|
29
|
+
<a-entity class="bars"></a-entity>
|
|
30
|
+
</template>
|
|
31
|
+
</a-assets>
|
|
32
|
+
<a-entity environment="preset: japan"></a-entity>
|
|
33
|
+
|
|
34
|
+
<a-entity id="bars" babia-queryjson="url: data.json;"
|
|
35
|
+
babia-filter='filter: x_axis=A '
|
|
36
|
+
babia-bars='legend: true; axis: true; keepHeight: true'
|
|
37
|
+
position="-5 0 0.1" rotation="0 0 0"
|
|
38
|
+
networked="template:#bars-template; networkId:bars; persistent: true; owner: scene">
|
|
39
|
+
</a-entity>
|
|
40
|
+
|
|
41
|
+
<a-entity movement-controls="fly: true" position="2 5 15">
|
|
42
|
+
<a-entity camera position="0 0 0" look-controls></a-entity>
|
|
43
|
+
<a-entity cursor="rayOrigin:mouse"></a-entity>
|
|
44
|
+
<a-entity laser-controls="hand: right"></a-entity>
|
|
45
|
+
</a-entity>
|
|
46
|
+
</a-scene>
|
|
47
|
+
<script>
|
|
48
|
+
|
|
49
|
+
let bars = document.getElementById('bars')
|
|
50
|
+
document.body.addEventListener('clientConnected', function (event) {
|
|
51
|
+
let clientId = event.detail.clientId;
|
|
52
|
+
console.log('clientConnected event. clientId =', clientId);
|
|
53
|
+
console.log("Bars owner: ", bars.components.networked.data.owner);
|
|
54
|
+
if (bars.components.networked.data.owner == 'scene'){
|
|
55
|
+
for (client in NAF.connection.getConnectedClients()){
|
|
56
|
+
let otherTime = NAF.connection.getConnectedClients()[client].roomJoinTime
|
|
57
|
+
let myTime = NAF.connection.adapter._myRoomJoinTime
|
|
58
|
+
console.log("Other: ", otherTime)
|
|
59
|
+
console.log("Mine: ", myTime)
|
|
60
|
+
let imCreator = false
|
|
61
|
+
if (myTime < otherTime){
|
|
62
|
+
setTimeout(updateScale, 4000);
|
|
63
|
+
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
function updateScale() {
|
|
70
|
+
NAF.utils.takeOwnership(bars)
|
|
71
|
+
bars.setAttribute("scale", "0.5 0.5 0.5")
|
|
72
|
+
setTimeout(updateData, 4000);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function updateData () {
|
|
76
|
+
bars.setAttribute('babia-queryjson', 'url', 'data2.json');
|
|
77
|
+
setTimeout(updateData1, 4000);
|
|
78
|
+
}
|
|
79
|
+
function updateData1 () {
|
|
80
|
+
bars.setAttribute('babia-queryjson', 'url', 'data3.json');
|
|
81
|
+
setTimeout(updateData2, 4000);
|
|
82
|
+
}
|
|
83
|
+
function updateData2 () {
|
|
84
|
+
bars.setAttribute('babia-queryjson', 'url', 'data.json');
|
|
85
|
+
bars.setAttribute('babia-filter', 'filter', 'x_axis=B')
|
|
86
|
+
}
|
|
87
|
+
</script>
|
|
88
|
+
<script>
|
|
89
|
+
NAF.schemas.add({
|
|
90
|
+
template: '#bars-template',
|
|
91
|
+
components: [
|
|
92
|
+
'position',
|
|
93
|
+
'rotation',
|
|
94
|
+
'scale',
|
|
95
|
+
'babia-bars',
|
|
96
|
+
'babia-queryjson',
|
|
97
|
+
'babia-filter'
|
|
98
|
+
]
|
|
99
|
+
});
|
|
100
|
+
</script>
|
|
101
|
+
</body>
|
|
102
|
+
</html>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
|
|
3
|
+
<head>
|
|
4
|
+
<title>Multiuser Time Evolution with Babia-Bars, separate queryjson, filter and bars. Not sharing bars.</title>
|
|
5
|
+
<script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script>
|
|
6
|
+
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v6.1.0/dist/aframe-extras.min.js"></script>
|
|
7
|
+
<script src="https://unpkg.com/aframe-environment-component@1.2.0/dist/aframe-environment-component.min.js"></script>
|
|
8
|
+
<script src="https://unpkg.com/aframe-text-geometry-component@0.5.1/dist/aframe-text-geometry-component.min.js"></script>
|
|
9
|
+
<script src="../../dist/aframe-babia-components.js"></script>
|
|
10
|
+
<!-- Mulituser -->
|
|
11
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.slim.js"></script>
|
|
12
|
+
<script src="./easyrtc.js"></script>
|
|
13
|
+
<script src="https://unpkg.com/networked-aframe@^0.8.0/dist/networked-aframe.js"></script>
|
|
14
|
+
</head>
|
|
15
|
+
|
|
16
|
+
<body>
|
|
17
|
+
<a-scene rain background="color: #ECECEC" networked-scene="
|
|
18
|
+
room: multi_bars_3;
|
|
19
|
+
adapter: easyrtc;
|
|
20
|
+
debug: true;
|
|
21
|
+
audio: false;
|
|
22
|
+
serverURL: https://f-l2108-pc02.aulas.etsit.urjc.es:49153/;
|
|
23
|
+
">
|
|
24
|
+
<a-assets>
|
|
25
|
+
<!-- Dummy asset to make the scene sync (WIP)-->
|
|
26
|
+
<img src="https://wallpapercave.com/wp/wp2345390.jpg?dummy=8484744">
|
|
27
|
+
|
|
28
|
+
<template id="querier-template">
|
|
29
|
+
<a-entity class="querier"></a-entity>
|
|
30
|
+
</template>
|
|
31
|
+
<template id="filter-template">
|
|
32
|
+
<a-entity class="filter"></a-entity>
|
|
33
|
+
</template>
|
|
34
|
+
</a-assets>
|
|
35
|
+
<a-entity environment="preset: japan"></a-entity>
|
|
36
|
+
|
|
37
|
+
<a-entity id="querier" babia-queryjson="url: data.json;"
|
|
38
|
+
networked="template:#querier-template; networkId:querier; persistent: true; owner: scene" ></a-entity>
|
|
39
|
+
<a-entity id="filter" babia-filter='from: querier; filter: x_axis=A'
|
|
40
|
+
networked="template:#filter-template; networkId:filter; persistent: true; owner: scene" ></a-entity>
|
|
41
|
+
<a-entity id="bars"
|
|
42
|
+
babia-bars='legend: true; axis: true; keepHeight: true; from: filter'
|
|
43
|
+
position="-5 0 0.1" rotation="0 0 0">
|
|
44
|
+
</a-entity>
|
|
45
|
+
|
|
46
|
+
<a-entity movement-controls="fly: true" position="2 5 15">
|
|
47
|
+
<a-entity camera position="0 0 0" look-controls></a-entity>
|
|
48
|
+
<a-entity cursor="rayOrigin:mouse"></a-entity>
|
|
49
|
+
<a-entity laser-controls="hand: right"></a-entity>
|
|
50
|
+
</a-entity>
|
|
51
|
+
</a-scene>
|
|
52
|
+
<script>
|
|
53
|
+
|
|
54
|
+
let querier = document.getElementById('querier')
|
|
55
|
+
let filter = document.getElementById('filter')
|
|
56
|
+
document.body.addEventListener('clientConnected', function (event) {
|
|
57
|
+
let clientId = event.detail.clientId;
|
|
58
|
+
console.log('clientConnected event. clientId =', clientId);
|
|
59
|
+
console.log("Bars owner: ", querier.components.networked.data.owner);
|
|
60
|
+
if (querier.components.networked.data.owner == 'scene'){
|
|
61
|
+
for (client in NAF.connection.getConnectedClients()){
|
|
62
|
+
let otherTime = NAF.connection.getConnectedClients()[client].roomJoinTime
|
|
63
|
+
let myTime = NAF.connection.adapter._myRoomJoinTime
|
|
64
|
+
console.log("Other: ", otherTime)
|
|
65
|
+
console.log("Mine: ", myTime)
|
|
66
|
+
let imCreator = false
|
|
67
|
+
if (myTime < otherTime){
|
|
68
|
+
setTimeout(updateData, 4000);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
function updateData () {
|
|
75
|
+
NAF.utils.takeOwnership(querier)
|
|
76
|
+
querier.setAttribute('babia-queryjson', 'url', 'data2.json');
|
|
77
|
+
setTimeout(updateData1, 4000);
|
|
78
|
+
}
|
|
79
|
+
function updateData1 () {
|
|
80
|
+
querier.setAttribute('babia-queryjson', 'url', 'data3.json');
|
|
81
|
+
setTimeout(updateData2, 4000);
|
|
82
|
+
}
|
|
83
|
+
function updateData2 () {
|
|
84
|
+
querier.setAttribute('babia-queryjson', 'url', 'data.json');
|
|
85
|
+
NAF.utils.takeOwnership(filter)
|
|
86
|
+
filter.setAttribute('babia-filter', 'filter', 'x_axis=B');
|
|
87
|
+
}
|
|
88
|
+
</script>
|
|
89
|
+
<script>
|
|
90
|
+
NAF.schemas.add({
|
|
91
|
+
template: '#querier-template',
|
|
92
|
+
components: [
|
|
93
|
+
'babia-queryjson'
|
|
94
|
+
]
|
|
95
|
+
});
|
|
96
|
+
NAF.schemas.add({
|
|
97
|
+
template: '#filter-template',
|
|
98
|
+
components: [
|
|
99
|
+
'babia-filter'
|
|
100
|
+
]
|
|
101
|
+
});
|
|
102
|
+
</script>
|
|
103
|
+
</body>
|
|
104
|
+
</html>
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"uid": "001",
|
|
4
|
+
"width": "5",
|
|
5
|
+
"height": "1",
|
|
6
|
+
"depth": "5"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"uid": "/barrio",
|
|
10
|
+
"children": [
|
|
11
|
+
{
|
|
12
|
+
"uid": "/barrio/002",
|
|
13
|
+
"width": "3",
|
|
14
|
+
"height": "1",
|
|
15
|
+
"depth": "3"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"uid": "/barrio/003",
|
|
19
|
+
"children": [
|
|
20
|
+
{
|
|
21
|
+
"uid": "barrio/003/block1",
|
|
22
|
+
"width": "5",
|
|
23
|
+
"height": "1",
|
|
24
|
+
"depth": "5"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"uid": "barrio/003/block2",
|
|
28
|
+
"width": "3",
|
|
29
|
+
"height": "4",
|
|
30
|
+
"depth": "3"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"uid": "003",
|
|
38
|
+
"width": "5",
|
|
39
|
+
"height": "1",
|
|
40
|
+
"depth": "5"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"uid": "004",
|
|
44
|
+
"width": "1",
|
|
45
|
+
"height": "10",
|
|
46
|
+
"depth": "2"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"uid": "005",
|
|
50
|
+
"width": "3",
|
|
51
|
+
"height": "1",
|
|
52
|
+
"depth": "3"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"uid": "006",
|
|
56
|
+
"width": "5",
|
|
57
|
+
"height": "20",
|
|
58
|
+
"depth": "3"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"uid": "007",
|
|
62
|
+
"width": "5",
|
|
63
|
+
"height": "1",
|
|
64
|
+
"depth": "5"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"uid": "008",
|
|
68
|
+
"width": "7",
|
|
69
|
+
"height": "10",
|
|
70
|
+
"depth": "3"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"uid": "009",
|
|
74
|
+
"width": "5",
|
|
75
|
+
"height": "1",
|
|
76
|
+
"depth": "5"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"uid": "010",
|
|
80
|
+
"width": "5",
|
|
81
|
+
"height": "1",
|
|
82
|
+
"depth": "5"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"uid": "011",
|
|
86
|
+
"width": "5",
|
|
87
|
+
"height": "10",
|
|
88
|
+
"depth": "3"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"uid": "012",
|
|
92
|
+
"width": "3",
|
|
93
|
+
"height": "1",
|
|
94
|
+
"depth": "3"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"uid": "013",
|
|
98
|
+
"width": "5",
|
|
99
|
+
"height": "1",
|
|
100
|
+
"depth": "5"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"uid": "014",
|
|
104
|
+
"width": "3",
|
|
105
|
+
"height": "8",
|
|
106
|
+
"depth": "3"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"uid": "015",
|
|
110
|
+
"width": "5",
|
|
111
|
+
"height": "1",
|
|
112
|
+
"depth": "5"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"uid": "016",
|
|
116
|
+
"width": "5",
|
|
117
|
+
"height": "1",
|
|
118
|
+
"depth": "5"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"uid": "017",
|
|
122
|
+
"width": "3",
|
|
123
|
+
"height": "1",
|
|
124
|
+
"depth": "3"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"uid": "018",
|
|
128
|
+
"width": "3",
|
|
129
|
+
"height": "1",
|
|
130
|
+
"depth": "3"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"uid": "019",
|
|
134
|
+
"width": "5",
|
|
135
|
+
"height": "1",
|
|
136
|
+
"depth": "5"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"uid": "020",
|
|
140
|
+
"width": "3",
|
|
141
|
+
"height": "1",
|
|
142
|
+
"depth": "3"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"uid": "021",
|
|
146
|
+
"width": "5",
|
|
147
|
+
"height": "1",
|
|
148
|
+
"depth": "5"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"uid": "022",
|
|
152
|
+
"width": "5",
|
|
153
|
+
"height": "1",
|
|
154
|
+
"depth": "5"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"uid": "023",
|
|
158
|
+
"width": "3",
|
|
159
|
+
"height": "1",
|
|
160
|
+
"depth": "3"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"uid": "024",
|
|
164
|
+
"width": "3",
|
|
165
|
+
"height": "1",
|
|
166
|
+
"depth": "3"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"uid": "025",
|
|
170
|
+
"width": "5",
|
|
171
|
+
"height": "1",
|
|
172
|
+
"depth": "5"
|
|
173
|
+
}
|
|
174
|
+
]
|