UNPKG

aframe-babia-components

Version:

A data visualization set of components for A-Frame.

7 lines 815 kB
!function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=12)}([function(t,e){const i={palettes:{blues:["#142850","#27496d","#00909e","#dae1e7"],foxy:["#f79071","#fa744f","#16817a","#024249"],flat:["#120136","#035aa6","#40bad5","#fcbf1e"],sunset:["#202040","#543864","#ff6363","#ffbd69"],bussiness:["#de7119","#dee3e2","#116979","#18b0b0"],icecream:["#f76a8c","#f8dc88","#f8fab8","#ccf0e1"],ubuntu:["#511845","#900c3f","#c70039","#ff5733"],pearl:["#efa8e4","#f8e1f4","#fff0f5","#97e5ef"],commerce:["#222831","#30475e","#f2a365","#ececec"],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"],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"],ubuntudiver:["#511845","#711643","#8d1640","#a81b3f","#c1253d","#d7333a","#ec4437","#ff5733","#ffdac4","#ffb3a7","#fb8a8c","#eb6574","#d5405e","#b81b4a","#93003a"],bluesdiver:["#00429d","#325da9","#4e78b5","#6694c1","#80b1cc","#9dced6","#c0eade","#ffffe0","#f2f0e4","#e5e1e8","#d7d3eb","#c8c5ed","#b8b7ef","#a5aaf0","#6ea9da"],categoric:["#ffb75f","#8e009a","#5c2800","#ff95ff","#a69fff","#da8800","#073479","#ffff00","#00d3ff","#b60026","#00a59d","#7e0000","#0099cc","#ff8080","#7491eb","#365e00","#743570","#00805e","#570000","#00629c","#6d4e00","#002c47","#95824d","#001b2b","#006020","#3d142e","#ffb75f","#8e009a"]},get:function(t,e){if(e in this.palettes){let i=this.palettes[e].length;return this.palettes[e][t%i]}try{let i=JSON.parse(e);return i[t%i.length]}catch(t){console.error(t)}let i=this.palettes.ubuntu.length;return this.palettes[e][t%i]}};let n=(t,e,i)=>{let n;if(t.from){let i=document.getElementById(t.from);if(i.components["babia-filter"])n=i.components["babia-filter"];else if(i.components["babia-queryjson"])n=i.components["babia-queryjson"];else if(i.components["babia-querycsv"])n=i.components["babia-querycsv"];else if(i.components["babia-queryes"])n=i.components["babia-queryes"];else if(i.components["babia-querygithub"])n=i.components["babia-querygithub"];else if(i.components["babia-selector"])n=i.components["babia-selector"];else{if(!i.components["babia-treebuilder"])return void console.error("Problem registering to the querier",e);n=i.components["babia-treebuilder"]}}else{if(t.nodesFrom){let i=document.getElementById(t.nodesFrom);if(i.components["babia-filter"])prodComponentNodes=i.components["babia-filter"];else if(i.components["babia-queryjson"])prodComponentNodes=i.components["babia-queryjson"];else if(i.components["babia-querycsv"])prodComponentNodes=i.components["babia-querycsv"];else if(i.components["babia-queryes"])prodComponentNodes=i.components["babia-queryes"];else{if(!i.components["babia-querygithub"])return void console.error("Problem registering to the querier",e);prodComponentNodes=i.components["babia-querygithub"]}let n=document.getElementById(t.linksFrom);if(n.components["babia-filter"])prodComponentLinks=n.components["babia-filter"];else if(n.components["babia-queryjson"])prodComponentLinks=n.components["babia-queryjson"];else if(n.components["babia-querycsv"])prodComponentLinks=n.components["babia-querycsv"];else if(n.components["babia-queryes"])prodComponentLinks=n.components["babia-queryes"];else{if(!n.components["babia-querygithub"])return void console.error("Problem registering to the querier",e);prodComponentLinks=n.components["babia-querygithub"]}return{nodes:prodComponentNodes,links:prodComponentLinks}}if(e.components["babia-filter"]&&"babia-filter"!=i)n=e.components["babia-filter"];else if(e.components["babia-queryjson"]&&"babia-queryjson"!=i)n=e.components["babia-queryjson"];else if(e.components["babia-querycsv"]&&"babia-querycsv"!=i)n=e.components["babia-querycsv"];else if(e.components["babia-queryes"]&&"babia-queryes"!=i)n=e.components["babia-queryes"];else if(e.components["babia-querygithub"]&&"babia-querygithub"!=i)n=e.components["babia-querygithub"];else if(e.components["babia-selector"]&&"babia-selector"!=i)n=e.components["babia-selector"];else if(e.components["babia-treebuilder"])n=e.components["babia-treebuilder"];else if(document.querySelectorAll("[babia-filter]").length>0)n=document.querySelectorAll("[babia-filter]")[0].components["babia-filter"];else if(document.querySelectorAll("[babia-queryjson]").length>0)n=document.querySelectorAll("[babia-queryjson]")[0].components["babia-queryjson"];else if(document.querySelectorAll("[babia-querycsv]").length>0)n=document.querySelectorAll("[babia-querycsv]")[0].components["babia-queryjson"];else if(document.querySelectorAll("[babia-queryes]").length>0)n=document.querySelectorAll("[babia-queryes]")[0].components["babia-queryes"];else if(document.querySelectorAll("[babia-querygithub]").length>0)n=document.querySelectorAll("[babia-querygithub]")[0].components["babia-querygithub"];else if(document.querySelectorAll("[babia-selector]").length>0)n=document.querySelectorAll("[babia-selector]")[0].components["babia-selector"];else{if(!(document.querySelectorAll("[babia-treebuilder]").length>0))return void console.error("Error, querier not found",e,e.components,e.components["babia-selector"]);n=document.querySelectorAll("[babia-treebuilder]")[0].components["babia-treebuilder"]}}return n},r=t=>{let e;return e="string"==typeof t||t instanceof String?JSON.parse(t):t,e};t.exports.findProdComponent=n,t.exports.findNavComponent=(t,e)=>{let i;if(t.controller){let n=document.getElementById(t.controller);if(!n.components["babia-navigator"])return void console.error("Problem registering to the navigator",e);i=n.components["babia-navigator"]}else if(e.components["babia-navigator"])i=e.components["babia-navigator"];else{if(!(document.querySelectorAll("[babia-navigator]").length>0))return void console.error("Error, navigator not found",e,e.components,e.components["babia-navigator"]);i=document.querySelectorAll("[babia-navigator]")[0].components["babia-navigator"]}return i},t.exports.findTargetComponent=(t,e)=>{let i;if(t.target){{let e=document.getElementById(t.target);if(null==e)return void console.error("Target not exist.");if(e.components["babia-bars"])i=e.components["babia-bars"];else if(e.components["babia-barsmap"])i=e.components["babia-barsmap"];else if(e.components["babia-cyls"])i=e.components["babia-cyls"];else if(e.components["babia-cylsmap"])i=e.components["babia-cylsmap"];else if(e.components["babia-pie"])i=e.components["babia-pie"];else if(e.components["babia-doughnut"])i=e.components["babia-doughnut"];else if(e.components["babia-bubbles"])i=e.components["babia-bubbles"];else if(e.components["babia-city"])i=e.components["babia-city"];else if(e.components["babia-boats"])i=e.components["babia-boats"];else{if(!e.components["babia-network"])return void console.error("Visualizer not found.");i=e.components["babia-network"]}}return i}console.error("Error: Target not inserted. ")},t.exports.colors=i,t.exports.updateTitle=(t,e)=>{let i=document.createElement("a-entity");return i.classList.add("babiaxrTitle"),i.setAttribute("text",{value:t.title}),t.titleColor&&i.setAttribute("material",{color:t.titleColor}),i.setAttribute("scale","10 10 10"),i.setAttribute("wrapCount","10"),i.setAttribute("position",t.titlePosition),i.setAttribute("rotation",e),i},t.exports.parseJson=r,t.exports.updateFunction=(t,e)=>{let i=t.data,a=t.el;if((a.components["babia-bars"]||a.components["babia-barsmap"]||a.components["babia-cyls"])&&(i.index||(i.index=i.x_axis),t.animation=i.animation,t.bar_array=[]),a.components["babia-boats"]&&(t.figures||(t.figures=[])),i.data&&e.data!==i.data){let e=r(i.data);t.processData(e)}else i.from!==e.from?(t.slice_array&&(t.slice_array=[]),t.prodComponent&&t.prodComponent.notiBuffer.unregister(t.notiBufferId),t.prodComponent=n(i,a),t.prodComponent.notiBuffer&&(t.notiBufferId=t.prodComponent.notiBuffer.register(t.processData.bind(t)))):i!==e&&t.newData&&(t.slice_array&&(t.slice_array=[]),t.bar_array&&(t.bar_array=[]),t.processData(t.newData))}},function(t,e,i){"use strict";i.r(e);e.default=function(t){return t instanceof Function?t:"string"==typeof t?function(e){return e[t]}:function(e){return t}}},function(t,e,i){class n{constructor(t,e){this.currentId=0,this.notifiers={},this.data,this.function1=t,this.function2=e}set(t){console.log("produced",t),this.data=t;for(const t of Object.values(this.notifiers))t(this.data)}register(t,e){void 0!==this.data&&(console.log("Data was ready"),t(this.data));let i=this.currentId;return this.notifiers[i]=t,this.currentId++,e&&this.function1&&this.function1(e),i}unregister(t,e){delete this.notifiers[t],e&&this.function2&&this.function2(e)}}t.exports.NotiBuffer=n},function(t,e,i){const n=i(8);t.exports=function(t){return function(e,i){let r=i&&i.indent||0,a=i&&void 0!==i.join?i.join:"\n",s=Array(r+1).join(" "),o=[];for(let i=0;i<t;++i){let t=n(i),r=0===i?"":s;o.push(r+e.replace(/{var}/g,t))}return o.join(a)}}},function(t,e){t.exports=function(t){!function(t){if(!t)throw new Error("Eventify cannot use falsy object as events subject");for(var e=["on","fire","off"],i=0;i<e.length;++i)if(t.hasOwnProperty(e[i]))throw new Error("Subject cannot be eventified, since it already has property '"+e[i]+"'")}(t);var e=function(t){var e=Object.create(null);return{on:function(i,n,r){if("function"!=typeof n)throw new Error("callback is expected to be a function");var a=e[i];return a||(a=e[i]=[]),a.push({callback:n,ctx:r}),t},off:function(i,n){if(void 0===i)return e=Object.create(null),t;if(e[i])if("function"!=typeof n)delete e[i];else for(var r=e[i],a=0;a<r.length;++a)r[a].callback===n&&r.splice(a,1);return t},fire:function(i){var n,r=e[i];if(!r)return t;arguments.length>1&&(n=Array.prototype.splice.call(arguments,1));for(var a=0;a<r.length;++a){var s=r[a];s.callback.apply(s.ctx,n)}return t}}}(t);return t.on=e.on,t.off=e.off,t.fire=e.fire,t}},function(t,e,i){var n;!function(r){var a=/^\s+/,s=/\s+$/,o=0,l=r.round,c=r.min,d=r.max,h=r.random;function u(t,e){if(e=e||{},(t=t||"")instanceof u)return t;if(!(this instanceof u))return new u(t,e);var i=function(t){var e={r:0,g:0,b:0},i=1,n=null,o=null,l=null,h=!1,u=!1;"string"==typeof t&&(t=function(t){t=t.replace(a,"").replace(s,"").toLowerCase();var e,i=!1;if(F[t])t=F[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=H.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=H.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=H.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=H.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=H.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=H.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=H.hex8.exec(t))return{r:R(e[1]),g:R(e[2]),b:R(e[3]),a:O(e[4]),format:i?"name":"hex8"};if(e=H.hex6.exec(t))return{r:R(e[1]),g:R(e[2]),b:R(e[3]),format:i?"name":"hex"};if(e=H.hex4.exec(t))return{r:R(e[1]+""+e[1]),g:R(e[2]+""+e[2]),b:R(e[3]+""+e[3]),a:O(e[4]+""+e[4]),format:i?"name":"hex8"};if(e=H.hex3.exec(t))return{r:R(e[1]+""+e[1]),g:R(e[2]+""+e[2]),b:R(e[3]+""+e[3]),format:i?"name":"hex"};return!1}(t));"object"==typeof t&&(j(t.r)&&j(t.g)&&j(t.b)?(p=t.r,f=t.g,g=t.b,e={r:255*L(p,255),g:255*L(f,255),b:255*L(g,255)},h=!0,u="%"===String(t.r).substr(-1)?"prgb":"rgb"):j(t.h)&&j(t.s)&&j(t.v)?(n=N(t.s),o=N(t.v),e=function(t,e,i){t=6*L(t,360),e=L(e,100),i=L(i,100);var n=r.floor(t),a=t-n,s=i*(1-e),o=i*(1-a*e),l=i*(1-(1-a)*e),c=n%6;return{r:255*[i,o,s,s,l,i][c],g:255*[l,i,i,o,s,s][c],b:255*[s,s,l,i,i,o][c]}}(t.h,n,o),h=!0,u="hsv"):j(t.h)&&j(t.s)&&j(t.l)&&(n=N(t.s),l=N(t.l),e=function(t,e,i){var n,r,a;function s(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}if(t=L(t,360),e=L(e,100),i=L(i,100),0===e)n=r=a=i;else{var o=i<.5?i*(1+e):i+e-i*e,l=2*i-o;n=s(l,o,t+1/3),r=s(l,o,t),a=s(l,o,t-1/3)}return{r:255*n,g:255*r,b:255*a}}(t.h,n,l),h=!0,u="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,f,g;return i=U(i),{ok:h,format:t.format||u,r:c(255,d(e.r,0)),g:c(255,d(e.g,0)),b:c(255,d(e.b,0)),a:i}}(t);this._originalInput=t,this._r=i.r,this._g=i.g,this._b=i.b,this._a=i.a,this._roundA=l(100*this._a)/100,this._format=e.format||i.format,this._gradientType=e.gradientType,this._r<1&&(this._r=l(this._r)),this._g<1&&(this._g=l(this._g)),this._b<1&&(this._b=l(this._b)),this._ok=i.ok,this._tc_id=o++}function p(t,e,i){t=L(t,255),e=L(e,255),i=L(i,255);var n,r,a=d(t,e,i),s=c(t,e,i),o=(a+s)/2;if(a==s)n=r=0;else{var l=a-s;switch(r=o>.5?l/(2-a-s):l/(a+s),a){case t:n=(e-i)/l+(e<i?6:0);break;case e:n=(i-t)/l+2;break;case i:n=(t-e)/l+4}n/=6}return{h:n,s:r,l:o}}function f(t,e,i){t=L(t,255),e=L(e,255),i=L(i,255);var n,r,a=d(t,e,i),s=c(t,e,i),o=a,l=a-s;if(r=0===a?0:l/a,a==s)n=0;else{switch(a){case t:n=(e-i)/l+(e<i?6:0);break;case e:n=(i-t)/l+2;break;case i:n=(t-e)/l+4}n/=6}return{h:n,s:r,v:o}}function g(t,e,i,n){var r=[k(l(t).toString(16)),k(l(e).toString(16)),k(l(i).toString(16))];return n&&r[0].charAt(0)==r[0].charAt(1)&&r[1].charAt(0)==r[1].charAt(1)&&r[2].charAt(0)==r[2].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function m(t,e,i,n){return[k(P(n)),k(l(t).toString(16)),k(l(e).toString(16)),k(l(i).toString(16))].join("")}function b(t,e){e=0===e?0:e||10;var i=u(t).toHsl();return i.s-=e/100,i.s=D(i.s),u(i)}function v(t,e){e=0===e?0:e||10;var i=u(t).toHsl();return i.s+=e/100,i.s=D(i.s),u(i)}function y(t){return u(t).desaturate(100)}function x(t,e){e=0===e?0:e||10;var i=u(t).toHsl();return i.l+=e/100,i.l=D(i.l),u(i)}function _(t,e){e=0===e?0:e||10;var i=u(t).toRgb();return i.r=d(0,c(255,i.r-l(-e/100*255))),i.g=d(0,c(255,i.g-l(-e/100*255))),i.b=d(0,c(255,i.b-l(-e/100*255))),u(i)}function A(t,e){e=0===e?0:e||10;var i=u(t).toHsl();return i.l-=e/100,i.l=D(i.l),u(i)}function C(t,e){var i=u(t).toHsl(),n=(i.h+e)%360;return i.h=n<0?360+n:n,u(i)}function w(t){var e=u(t).toHsl();return e.h=(e.h+180)%360,u(e)}function M(t){var e=u(t).toHsl(),i=e.h;return[u(t),u({h:(i+120)%360,s:e.s,l:e.l}),u({h:(i+240)%360,s:e.s,l:e.l})]}function I(t){var e=u(t).toHsl(),i=e.h;return[u(t),u({h:(i+90)%360,s:e.s,l:e.l}),u({h:(i+180)%360,s:e.s,l:e.l}),u({h:(i+270)%360,s:e.s,l:e.l})]}function E(t){var e=u(t).toHsl(),i=e.h;return[u(t),u({h:(i+72)%360,s:e.s,l:e.l}),u({h:(i+216)%360,s:e.s,l:e.l})]}function S(t,e,i){e=e||6,i=i||30;var n=u(t).toHsl(),r=360/i,a=[u(t)];for(n.h=(n.h-(r*e>>1)+720)%360;--e;)n.h=(n.h+r)%360,a.push(u(n));return a}function B(t,e){e=e||6;for(var i=u(t).toHsv(),n=i.h,r=i.s,a=i.v,s=[],o=1/e;e--;)s.push(u({h:n,s:r,v:a})),a=(a+o)%1;return s}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,i,n=this.toRgb();return t=n.r/255,e=n.g/255,i=n.b/255,.2126*(t<=.03928?t/12.92:r.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:r.pow((e+.055)/1.055,2.4))+.0722*(i<=.03928?i/12.92:r.pow((i+.055)/1.055,2.4))},setAlpha:function(t){return this._a=U(t),this._roundA=l(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=l(360*t.h),i=l(100*t.s),n=l(100*t.v);return 1==this._a?"hsv("+e+", "+i+"%, "+n+"%)":"hsva("+e+", "+i+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=p(this._r,this._g,this._b),e=l(360*t.h),i=l(100*t.s),n=l(100*t.l);return 1==this._a?"hsl("+e+", "+i+"%, "+n+"%)":"hsla("+e+", "+i+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return g(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,i,n,r){var a=[k(l(t).toString(16)),k(l(e).toString(16)),k(l(i).toString(16)),k(P(n))];if(r&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1))return a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0);return a.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:l(this._r),g:l(this._g),b:l(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+l(this._r)+", "+l(this._g)+", "+l(this._b)+")":"rgba("+l(this._r)+", "+l(this._g)+", "+l(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:l(100*L(this._r,255))+"%",g:l(100*L(this._g,255))+"%",b:l(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+l(100*L(this._r,255))+"%, "+l(100*L(this._g,255))+"%, "+l(100*L(this._b,255))+"%)":"rgba("+l(100*L(this._r,255))+"%, "+l(100*L(this._g,255))+"%, "+l(100*L(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(T[g(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+m(this._r,this._g,this._b,this._a),i=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var r=u(t);i="#"+m(r._r,r._g,r._b,r._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+i+")"},toString:function(t){var e=!!t;t=t||this._format;var i=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(i=this.toRgbString()),"prgb"===t&&(i=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(i=this.toHexString()),"hex3"===t&&(i=this.toHexString(!0)),"hex4"===t&&(i=this.toHex8String(!0)),"hex8"===t&&(i=this.toHex8String()),"name"===t&&(i=this.toName()),"hsl"===t&&(i=this.toHslString()),"hsv"===t&&(i=this.toHsvString()),i||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(this.toString())},_applyModification:function(t,e){var i=t.apply(null,[this].concat([].slice.call(e)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(x,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(A,arguments)},desaturate:function(){return this._applyModification(b,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(C,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(w,arguments)},monochromatic:function(){return this._applyCombination(B,arguments)},splitcomplement:function(){return this._applyCombination(E,arguments)},triad:function(){return this._applyCombination(M,arguments)},tetrad:function(){return this._applyCombination(I,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var i={};for(var n in t)t.hasOwnProperty(n)&&(i[n]="a"===n?t[n]:N(t[n]));t=i}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:h(),g:h(),b:h()})},u.mix=function(t,e,i){i=0===i?0:i||50;var n=u(t).toRgb(),r=u(e).toRgb(),a=i/100;return u({r:(r.r-n.r)*a+n.r,g:(r.g-n.g)*a+n.g,b:(r.b-n.b)*a+n.b,a:(r.a-n.a)*a+n.a})},u.readability=function(t,e){var i=u(t),n=u(e);return(r.max(i.getLuminance(),n.getLuminance())+.05)/(r.min(i.getLuminance(),n.getLuminance())+.05)},u.isReadable=function(t,e,i){var n,r,a=u.readability(t,e);switch(r=!1,(n=function(t){var e,i;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),i=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==i&&"large"!==i&&(i="small");return{level:e,size:i}}(i)).level+n.size){case"AAsmall":case"AAAlarge":r=a>=4.5;break;case"AAlarge":r=a>=3;break;case"AAAsmall":r=a>=7}return r},u.mostReadable=function(t,e,i){var n,r,a,s,o=null,l=0;r=(i=i||{}).includeFallbackColors,a=i.level,s=i.size;for(var c=0;c<e.length;c++)(n=u.readability(t,e[c]))>l&&(l=n,o=u(e[c]));return u.isReadable(t,o,{level:a,size:s})||!r?o:(i.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],i))};var F=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},T=u.hexNames=function(t){var e={};for(var i in t)t.hasOwnProperty(i)&&(e[t[i]]=i);return e}(F);function U(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function L(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var i=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=c(e,d(0,parseFloat(t))),i&&(t=parseInt(t*e,10)/100),r.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function D(t){return c(1,d(0,t))}function R(t){return parseInt(t,16)}function k(t){return 1==t.length?"0"+t:""+t}function N(t){return t<=1&&(t=100*t+"%"),t}function P(t){return r.round(255*parseFloat(t)).toString(16)}function O(t){return R(t)/255}var z,Q,V,H=(Q="[\\s|\\(]+("+(z="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",V="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",{CSS_UNIT:new RegExp(z),rgb:new RegExp("rgb"+Q),rgba:new RegExp("rgba"+V),hsl:new RegExp("hsl"+Q),hsla:new RegExp("hsla"+V),hsv:new RegExp("hsv"+Q),hsva:new RegExp("hsva"+V),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function j(t){return!!H.CSS_UNIT.exec(t)}t.exports?t.exports=u:void 0===(n=function(){return u}.call(e,i,e,t))||(t.exports=n)}(Math)},function(t,e,i){let n=i(0).updateTitle;const r=i(0).colors;let a=i(0).updateFunction;const s=i(2).NotiBuffer;if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("babia-cyls",{schema:{data:{type:"string"},height:{type:"string",default:"height"},radius:{type:"string",default:"radius"},x_axis:{type:"string",default:"x_axis"},from:{type:"string"},legend:{type:"boolean",default:!1},legend_lookat:{type:"string",default:"[camera]"},legend_scale:{type:"number",default:1},axis:{type:"boolean",default:!0},axis_name:{type:"boolean",default:!1},palette:{type:"string",default:"ubuntu"},title:{type:"string"},titleFont:{type:"string"},titleColor:{type:"string"},titlePosition:{type:"vec3",default:{x:0,y:0,z:0}},chartHeight:{type:"number",default:10},radiusMax:{type:"number",default:2},keepHeight:{type:"boolean",default:!0},incremental:{type:"boolean",default:!1},index:{type:"string"},animation:{type:"boolean",default:!0},dur:{type:"number",default:2e3},uiLink:{type:"boolean",default:!1},uiLinkPosition:{type:"vec3",default:{x:-4.5,y:2,z:2.5}}},visProperties:["height","radius","x_axis"],multiple:!1,init:function(){this.notiBuffer=new s,this.chartEl=document.createElement("a-entity"),this.chartEl.classList.add("babiaxrChart"),this.el.appendChild(this.chartEl),this.updateTitle(),this.el.appendChild(this.titleEl)},update:function(t){a(this,t),this.data.uiLink&&l(el,this.data.uiLinkPosition)},prodComponent:void 0,notiBufferId:void 0,newData:void 0,currentData:void 0,babiaMetadata:{id:0},valueMax:void 0,xLabels:[],xTicks:[],updateTitle:function(){this.titleEl=n(this.data,{x:0,y:0,z:0})},updateChart:function(){let t=this.newData;t=this.currentData?this.currentData:this.newData,console.log("Data babia-cyls:",t);const e=this.data;this.el;this.updateTitle();let i=Math.max.apply(Math,t.map((function(t){return t[e.height]})));this.lengthY?e.keepHeight||(this.lengthY=this.lengthY*maxValue/this.maxValue):this.lengthY=e.chartHeight,this.maxValue=i;let n=Math.max.apply(Math,t.map((function(t){return t[e.radius]})));this.radius_scale=e.radiusMax/n;let r=this.chartEl.querySelectorAll("a-entity[babia-cyl]"),a={};for(let t of r){a[t.getAttribute("babia-name")]={el:t,found:!1}}let s,l=[],c=[],d=0;for(let i=0;i<t.length;i++){let n,r,h=t[i],u=h[e.x_axis];n=0==i?.5+h[e.radius]*this.radius_scale:c[i-1]+s+.5+h[e.radius]*this.radius_scale,a[u]&&!h._not?(r=a[u].el,a[u].found=!0):(r=document.createElement("a-entity"),r.setAttribute("babia-name",u),r.id=h[e.index],r.object3D.position.x=n,this.chartEl.appendChild(r)),o(this,r,e,h,d,u,n,0),l.push(u),c.push(n),d++,s=h[e.radius]*this.radius_scale}for(let t in a)a[t].found||a[t].el.remove();if(e.axis){const i=c[c.length-1]+(t[0][e.radius]+t[t.length-1][e.radius])*this.radius_scale/2;this.updateAxis(l,c,i,this.maxValue)}},updateAxis:function(t,e,i,n){const r=this.data;r.axis&&(this.xAxisEl||(this.xAxisEl=document.createElement("a-entity"),this.chartEl.appendChild(this.xAxisEl)),this.xAxisEl.setAttribute("babia-axis-x",{labels:t,ticks:e,length:i,palette:r.palette}),this.xAxisEl.setAttribute("position",{x:0,y:0,z:r.radiusMax+.25}),this.yAxisEl||(this.yAxisEl=document.createElement("a-entity"),this.chartEl.appendChild(this.yAxisEl)),this.yAxisEl.setAttribute("babia-axis-y",{maxValue:n,length:this.lengthY}),this.yAxisEl.setAttribute("position",{x:0,y:0,z:r.radiusMax+.25}),r.axis_name&&(r.index?this.xAxisEl.setAttribute("babia-axis-x","name",r.index):this.xAxisEl.setAttribute("babia-axis-x","name",r.x_axis),this.yAxisEl.setAttribute("babia-axis-y","name",r.height)))},processData:function(t){console.log("processData",this),this.newData=t,this.babiaMetadata={id:this.babiaMetadata.id++},console.log("Generating cyls..."),this.updateChart(),this.notiBuffer.set(this.newData)}});let o=(t,e,i,n,a,s,o,l,c)=>{e.setAttribute("babia-cyl",{height:n[i.height]*t.lengthY/t.maxValue,radius:n[i.radius]*t.radius_scale,color:r.get(a,i.palette),label:"events",animation:i.animation}),i.legend&&(c?e.setAttribute("babia-cyl",{labelText:s+" | "+c+"\nHeight: "+n[i.height]+"\nRadius: "+n[i.radius],labelLookat:i.legend_lookat,labelScale:i.legend_scale}):e.setAttribute("babia-cyl",{labelText:s+"\nHeight: "+n[i.height]+"\nRadius: "+n[i.radius],labelLookat:i.legend_lookat,labelScale:i.legend_scale})),o!==e.object3D.position.x&&(i.animation?e.setAttribute("animation",{property:"object3D.position.x",to:o,dur:i.dur}):e.object3D.position.x=o),l!==e.object3D.position.z&&(i.animation?e.setAttribute("animation",{property:"object3D.position.z",to:l,dur:i.dur}):e.object3D.position.z=l)},l=(t,e)=>{let i=document.createElement("a-entity");if(!t.id){let e="bars"+Math.floor(1e3*Math.random());t.id=e}console.log("id:",t.id),i.setAttribute("babia-ui-link",{viz:t.id}),i.setAttribute("position",{x:e.x,y:e.y,z:e.z}),t.appendChild(i),console.log("Create Button",t)};t.exports.createCylinder=o},function(t,e,i){t.exports=function(t){var e=i(39),h=i(40),u=i(4);if(t){if(void 0!==t.springCoeff)throw new Error("springCoeff was renamed to springCoefficient");if(void 0!==t.dragCoeff)throw new Error("dragCoeff was renamed to dragCoefficient")}t=h(t,{springLength:10,springCoefficient:.8,gravity:-12,theta:.8,dragCoefficient:.9,timeStep:.5,adaptiveTimeStepWeight:0,dimensions:2,debug:!1});var p=c[t.dimensions];if(!p){var f=t.dimensions;p={Body:n(f,t.debug),createQuadTree:r(f),createBounds:a(f),createDragForce:s(f),createSpringForce:o(f),integrate:l(f)},c[f]=p}var g=p.Body,m=p.createQuadTree,b=p.createBounds,v=p.createDragForce,y=p.createSpringForce,x=p.integrate,_=i(41).random(42),A=[],C=[],w=m(t,_),M=b(A,t,_),I=y(t,_),E=v(t),S=[],B=new Map,F=0;L("nbody",(function(){if(0===A.length)return;w.insertBodies(A);var t=A.length;for(;t--;){var e=A[t];e.isPinned||(e.reset(),w.updateBodyForce(e),E.update(e))}})),L("spring",(function(){var t=C.length;for(;t--;)I.update(C[t])}));var T={bodies:A,quadTree:w,springs:C,settings:t,addForce:L,removeForce:function(t){var e=S.indexOf(B.get(t));if(e<0)return;S.splice(e,1),B.delete(t)},getForces:function(){return B},step:function(){for(var e=0;e<S.length;++e)S[e](F);var i=x(A,t.timeStep,t.adaptiveTimeStepWeight);return F+=1,i},addBody:function(t){if(!t)throw new Error("Body is required");return A.push(t),t},addBodyAt:function(t){if(!t)throw new Error("Body position is required");var e=(t=>new g(t))(t);return A.push(e),e},removeBody:function(t){if(t){var e=A.indexOf(t);if(!(e<0))return A.splice(e,1),0===A.length&&M.reset(),!0}},addSpring:function(t,i,n,r){if(!t||!i)throw new Error("Cannot add null spring to force simulator");"number"!=typeof n&&(n=-1);var a=new e(t,i,n,r>=0?r:-1);return C.push(a),a},getTotalMovement:function(){return 0},removeSpring:function(t){if(t){var e=C.indexOf(t);return e>-1?(C.splice(e,1),!0):void 0}},getBestNewBodyPosition:function(t){return M.getBestNewPosition(t)},getBBox:U,getBoundingBox:U,invalidateBBox:function(){console.warn("invalidateBBox() is deprecated, bounds always recomputed on `getBBox()` call")},gravity:function(e){return void 0!==e?(t.gravity=e,w.options({gravity:e}),this):t.gravity},theta:function(e){return void 0!==e?(t.theta=e,w.options({theta:e}),this):t.theta},random:_};return function(t,e){for(var i in t)d(t,e,i)}(t,T),u(T),T;function U(){return M.update(),M.box}function L(t,e){if(B.has(t))throw new Error("Force "+t+" is already added");B.set(t,e),S.push(e)}};var n=i(33),r=i(34),a=i(35),s=i(36),o=i(37),l=i(38),c={};function d(t,e,i){if(t.hasOwnProperty(i)&&"function"!=typeof e[i]){var n=Number.isFinite(t[i]);e[i]=n?function(n){if(void 0!==n){if(!Number.isFinite(n))throw new Error("Value of "+i+" should be a valid number.");return t[i]=n,e}return t[i]}:function(n){return void 0!==n?(t[i]=n,e):t[i]}}}},function(t,e){t.exports=function(t){return 0===t?"x":1===t?"y":2===t?"z":"c"+(t+1)}},function(t,e,i){t.exports=function(t){"uniqueLinkId"in(t=t||{})&&(console.warn("ngraph.graph: Starting from version 0.14 `uniqueLinkId` is deprecated.\nUse `multigraph` option instead\n","\n","Note: there is also change in default behavior: From now on each graph\nis considered to be not a multigraph by default (each edge is unique)."),t.multigraph=t.uniqueLinkId);void 0===t.multigraph&&(t.multigraph=!1);if("function"!=typeof Map)throw new Error("ngraph.graph requires `Map` to be defined. Please polyfill it before using ngraph");var e=new Map,i=new Map,l={},c=0,d=t.multigraph?function(t,e,i){var n=o(t,e),r=l.hasOwnProperty(n);if(r||M(t,e)){r||(l[n]=0);var a="@"+ ++l[n];n=o(t+a,e+a)}return new s(t,e,i,n)}:function(t,e,n){var r=o(t,e),a=i.get(r);if(a)return a.data=n,a;return new s(t,e,n,r)},h=[],u=I,p=I,f=I,g=I,m={version:20,addNode:y,addLink:function(t,e,n){f();var r=x(t)||y(t),s=x(e)||y(e),o=d(t,e,n),l=i.has(o.id);i.set(o.id,o),a(r,o),t!==e&&a(s,o);return u(o,l?"update":"add"),g(),o},removeLink:function(t,e){void 0!==e&&(t=M(t,e));return w(t)},removeNode:_,getNode:x,getNodeCount:A,getLinkCount:C,getEdgeCount:C,getLinksCount:C,getNodesCount:A,getLinks:function(t){var e=x(t);return e?e.links:null},forEachNode:B,forEachLinkedNode:function(t,i,n){var r=x(t);if(r&&r.links&&"function"==typeof i)return n?function(t,i,n){var r=t.values(),a=r.next();for(;!a.done;){var s=a.value;if(s.fromId===i&&n(e.get(s.toId),s))return!0;a=r.next()}}(r.links,t,i):function(t,i,n){var r=t.values(),a=r.next();for(;!a.done;){var s=a.value,o=s.fromId===i?s.toId:s.fromId;if(n(e.get(o),s))return!0;a=r.next()}}(r.links,t,i)},forEachLink:function(t){if("function"==typeof t)for(var e=i.values(),n=e.next();!n.done;){if(t(n.value))return!0;n=e.next()}},beginUpdate:f,endUpdate:g,clear:function(){f(),B((function(t){_(t.id)})),g()},hasLink:M,hasNode:x,getLink:M};return n(m),function(){var t=m.on;m.on=function(){return m.beginUpdate=f=E,m.endUpdate=g=S,u=b,p=v,m.on=t,t.apply(m,arguments)}}(),m;function b(t,e){h.push({link:t,changeType:e})}function v(t,e){h.push({node:t,changeType:e})}function y(t,i){if(void 0===t)throw new Error("Invalid node identifier");f();var n=x(t);return n?(n.data=i,p(n,"update")):(n=new r(t,i),p(n,"add")),e.set(t,n),g(),n}function x(t){return e.get(t)}function _(t){var i=x(t);if(!i)return!1;f();var n=i.links;return n&&(n.forEach(w),i.links=null),e.delete(t),p(i,"remove"),g(),!0}function A(){return e.size}function C(){return i.size}function w(t){if(!t)return!1;if(!i.get(t.id))return!1;f(),i.delete(t.id);var e=x(t.fromId),n=x(t.toId);return e&&e.links.delete(t),n&&n.links.delete(t),u(t,"remove"),g(),!0}function M(t,e){if(void 0!==t&&void 0!==e)return i.get(o(t,e))}function I(){}function E(){c+=1}function S(){0===(c-=1)&&h.length>0&&(m.fire("changed",h),h.length=0)}function B(t){if("function"!=typeof t)throw new Error("Function is expected to iterate over graph nodes. You passed "+t);for(var i=e.values(),n=i.next();!n.done;){if(t(n.value))return!0;n=i.next()}}};var n=i(4);function r(t,e){this.id=t,this.links=null,this.data=e}function a(t,e){t.links?t.links.add(e):t.links=new Set([e])}function s(t,e,i,n){this.fromId=t,this.toId=e,this.data=i,this.id=n}function o(t,e){return t.toString()+"👉 "+e.toString()}},function(t,e,i){t.exports=function(t,e){if(!t)throw new Error("Graph structure cannot be undefined");var a=(e&&e.createSimulator||i(7))(e);if(Array.isArray(e))throw new Error("Physics settings is expected to be an object");var s=t.version>19?function(e){var i=t.getLinks(e);return i?1+i.size/3:1}:function(e){var i=t.getLinks(e);return i?1+i.length/3:1};e&&"function"==typeof e.nodeMass&&(s=e.nodeMass);var o=new Map,l={},c=0,d=a.settings.springTransform||r;c=0,t.forEachNode((function(t){m(t.id),c+=1})),t.forEachLink(v),t.on("changed",g);var h=!1,u={step:function(){if(0===c)return p(!0),!0;var t=a.step();u.lastMove=t,u.fire("step");var e=t/c<=.01;return p(e),e},getNodePosition:function(t){return _(t).pos},setNodePosition:function(t){var e=_(t);e.setPosition.apply(e,Array.prototype.slice.call(arguments,1))},getLinkPosition:function(t){var e=l[t];if(e)return{from:e.from.pos,to:e.to.pos}},getGraphRect:function(){return a.getBBox()},forEachBody:f,pinNode:function(t,e){_(t.id).isPinned=!!e},isNodePinned:function(t){return _(t.id).isPinned},dispose:function(){t.off("changed",g),u.fire("disposed")},getBody:function(t){return o.get(t)},getSpring:function(e,i){var n;if(void 0===i)n="object"!=typeof e?e:e.id;else{var r=t.hasLink(e,i);if(!r)return;n=r.id}return l[n]},getForceVectorLength:function(){var t=0,e=0;return f((function(i){t+=Math.abs(i.force.x),e+=Math.abs(i.force.y)})),Math.sqrt(t*t+e*e)},simulator:a,graph:t,lastMove:0};return n(u),u;function p(t){var e;h!==t&&(h=t,e=t,u.fire("stable",e))}function f(t){o.forEach(t)}function g(e){for(var i=0;i<e.length;++i){var n=e[i];"add"===n.changeType?(n.node&&m(n.node.id),n.link&&v(n.link)):"remove"===n.changeType&&(n.node&&b(n.node),n.link&&y(n.link))}c=t.getNodesCount()}function m(e){var i=o.get(e);if(!i){var n=t.getNode(e);if(!n)throw new Error("initBody() was called with unknown node id");var r=n.position;if(!r){var s=function(t){var e=[];if(!t.links)return e;for(var i=Math.min(t.links.length,2),n=0;n<i;++n){var r=t.links[n],a=r.fromId!==t.id?o.get(r.fromId):o.get(r.toId);a&&a.pos&&e.push(a)}return e}(n);r=a.getBestNewBodyPosition(s)}(i=a.addBodyAt(r)).id=e,o.set(e,i),x(e),function(t){return t&&(t.isPinned||t.data&&t.data.isPinned)}(n)&&(i.isPinned=!0)}}function b(t){var e=t.id,i=o.get(e);i&&(o.delete(e),a.removeBody(i))}function v(t){x(t.fromId),x(t.toId);var e=o.get(t.fromId),i=o.get(t.toId),n=a.addSpring(e,i,t.length);d(t,n),l[t.id]=n}function y(e){var i=l[e.id];if(i){var n=t.getNode(e.fromId),r=t.getNode(e.toId);n&&x(n.id),r&&x(r.id),delete l[e.id],a.removeSpring(i)}}function x(t){var e=o.get(t);if(e.mass=s(t),Number.isNaN(e.mass))throw new Error("Node mass should be a number")}function _(t){var e=o.get(t);return e||(m(t),e=o.get(t)),e}},t.exports.simulator=i(7);var n=i(4);function r(){}},function(t,e){function i(t,e,i){var n,r,a,s,o;function l(){var c=Date.now()-s;c<e&&c>=0?n=setTimeout(l,e-c):(n=null,i||(o=t.apply(a,r),a=r=null))}null==e&&(e=100);var c=function(){a=this,r=arguments,s=Date.now();var c=i&&!n;return n||(n=setTimeout(l,e)),c&&(o=t.apply(a,r),a=r=null),o};return c.clear=function(){n&&(clearTimeout(n),n=null)},c.flush=function(){n&&(o=t.apply(a,r),a=r=null,clearTimeout(n),n=null)},c}i.debounce=i,t.exports=i},function(t,e,i){i(14),i(15),i(16),i(18),i(19),i(20),i(21),i(22),i(23),i(24),i(25),i(26),i(27),i(6),i(28),i(29),i(30),i(31),i(32),i(42),i(43),i(44),i(45),i(46),i(47),i(48),i(49),i(50),i(0),i(51),i(52),i(53),i(54),i(55),i(56),i(57),i(58),i(59),i(61),i(62),i(2),pauseButton=i(63),playButton=i(64),skipButton=i(65),rewindButton=i(66),tooltip=i(67)},,function(t,e){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("babia-querygithub",{schema:{user:{type:"string"},token:{type:"string"},repos:{type:"array"},data:{type:"string"}},multiple:!1,init:function(){},update:function(t){let e=this.data,r=this.el,s=this;e.data&&t.data!==e.data?a(e.data,r,s):t.user===e.user&&t.repos===e.repos&&t.token===e.token||(e.user&&0===e.repos.length?n(e,r,s):e.repos.length>0&&i(e,r,s))},remove:function(){},pause:function(){},play:function(){},babiaData:void 0,babiaMetadata:{id:0},register:function(t){this.el;this.interestedElements.push(t),this.babiaData&&o(t,"babiaData")},unregister:function(t){const e=this.interestedElements.indexOf(t);e>-1&&this.interestedElements.splice(e,1)},interestedElements:[]});let i=(t,e,i)=>{let n=[];t.repos.forEach((i,r)=>{let a=new XMLHttpRequest,s="https://api.github.com/repos/"+t.user+"/"+i+"?_="+(new Date).getTime();a.open("get",s,!1),a.onload=function(){if(this.status>=200&&this.status<300){console.log("data OK in request.response",e.id);let t=JSON.parse(a.response);n.push(t)}else reject({status:this.status,statusText:xhr.statusText}),console.error("Error during requesting data",this.status,xhr.statusText)},a.onerror=function(){reject({status:this.status,statusText:xhr.statusText}),console.error("Error during requesting data",this.status,xhr.statusText)},a.send()}),i.babiaData=n,i.babiaMetadata={id:i.babiaMetadata.id++},s("babiaData",i)},n=(t,e,i)=>{let n=new XMLHttpRequest,a="https://api.github.com/users/"+t.user+"/repos?_="+(new Date).getTime();n.open("get",a),n.onload=function(){this.status>=200&&this.status<300?(console.log("data OK in request.response",e.id),i.babiaData=r(JSON.parse(n.response)),i.babiaMetadata={id:i.babiaMetadata.id++},s("babiaData",i)):(reject({status:this.status,statusText:xhr.statusText}),console.error("Error during requesting data",this.status,xhr.statusText))},n.onerror=function(){reject({status:this.status,statusText:xhr.statusText}),console.error("Error during requesting data",this.status,xhr.statusText)},n.send()},r=t=>{let e=[];return t.forEach((t,i)=>{e.push(t)}),e},a=(t,e,i)=>{let n=JSON.parse(t);i.babiaData=n,i.babiaMetadata={id:i.babiaMetadata.id++},s("babiaData",i)},s=(t,e)=>{e.interestedElements.forEach(e=>{o(e,t)})},o=(t,e)=>{t.emit("babiaQuerierDataReady",e)}},function(t,e,i){let n=i(0).parseJson;if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");const r=i(2).NotiBuffer;AFRAME.registerComponent("babia-queryjson",{schema:{url:{type:"string"},data:{type:"string"}},multiple:!1,init:function(){this.notiBuffer=new r},update:function(t){let e=this.data;if(e.data&&t.data!==e.data){let t=n(e.data);this.notiBuffer.set(t)}else t.url!==e.url&&this.getJSON(e.url)},remove:function(){},pause:function(){},play:function(){},getJSON:async function(t){let e=await fetch(t);if(200!=e.status)throw new Error(e.status);{let t=await e.json(),i=n(t);this.notiBuffer.set(i)}}})},function(t,e,i){let n=i(17).parse;if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");const r=i(2).NotiBuffer;AFRAME.registerComponent("babia-querycsv",{schema:{url:{type:"string"},data:{type:"string"}},multiple:!1,init:function(){this.notiBuffer=new r},update:function(t){let e=this.data;if(e.data&&t.data!==e.data){let t=n(e.data,{header:!0,dynamicTyping:!0,skipEmptyLines:!0});this.notiBuffer.set(t.data)}else t.url!==e.url&&this.getCSV(e.url)},remove:function(){},pause:function(){},play:function(){},getCSV:async function(t){let e=this.notiBuffer;n(t,{download:!0,header:!0,skipEmptyLines:!0,dynamicTyping:!0,complete:function(t){e.set(t.data)}})}})},function(t,e,i){var n,r,a; /* @license Papa Parse v5.3.2 https://github.com/mholt/PapaParse License: MIT */r=[],void 0===(a="function"==typeof(n=function t(){"use strict";var e="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:{},i=!e.document&&!!e.postMessage,n=i&&/blob:/i.test((e.location||{}).protocol),r={},a=0,s={parse:function(i,n){var o=(n=n||{}).dynamicTyping||!1;if(_(o)&&(n.dynamicTypingFunction=o,o={}),n.dynamicTyping=o,n.transform=!!_(n.transform)&&n.transform,n.worker&&s.WORKERS_SUPPORTED){var l=function(){if(!s.WORKERS_SUPPORTED)return!1;var i,n,o=(i=e.URL||e.webkitURL||null,n=t.toString(),s.BLOB_URL||(s.BLOB_URL=i.createObjectURL(new Blob(["(",n,")();"],{type:"text/javascript"})))),l=new e.Worker(o);return l.onmessage=m,l.id=a++,r[l.id]=l}();return l.userStep=n.step,l.userChunk=n.chunk,l.userComplete=n.complete,l.userError=n.error,n.step=_(n.step),n.chunk=_(n.chunk),n.complete=_(n.complete),n.error=_(n.error),delete n.worker,void l.postMessage({input:i,config:n,workerId:l.id})}var p=null;return s.NODE_STREAM_INPUT,"string"==typeof i?p=n.download?new c(n):new h(n):!0===i.readable&&_(i.read)&&_(i.on)?p=new u(n):(e.File&&i instanceof File||i instanceof Object)&&(p=new d(n)),p.stream(i)},unparse:function(t,e){var i=!1,n=!0,r=",",a="\r\n",o='"',l=o+o,c=!1,d=null,h=!1;!function(){if("object"==typeof e){if("string"!=typeof e.delimiter||s.BAD_DELIMITERS.filter((function(t){return-1!==e.delimiter.indexOf(t)})).length||(r=e.delimiter),("boolean"==typeof e.quotes||"function"==typeof e.quotes||Array.isArray(e.quotes))&&(i=e.quotes),"boolean"!=typeof e.skipEmptyLines&&"string"!=typeof e.skipEmptyLines||(c=e.skipEmptyLines),"string"==typeof e.newline&&(a=e.newline),"string"==typeof e.quoteChar&&(o=e.quoteChar),"boolean"==typeof e.header&&(n=e.header),Array.isArray(e.columns)){if(0===e.columns.length)throw new Error("Option columns is empty");d=e.columns}void 0!==e.escapeChar&&(l=e.escapeChar+o),("boolean"==typeof e.escapeFormulae||e.escapeFormulae instanceof RegExp)&&(h=e.escapeFormulae instanceof RegExp?e.escapeFormulae:/^[=+\-@\t\r].*$/)}}();var u=new RegExp(f(o),"g");if("string"==typeof t&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return p(null,t,c);if("object"==typeof t[0])return p(d||Object.keys(t[0]),t,c)}else if("object"==typeof t)return"string"==typeof t.data&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields||d),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:"object"==typeof t.data[0]?Object.keys(t.data[0]):[]),Array.isArray(t.data[0])||"object"==typeof t.data[0]||(t.data=[t.data])),p(t.fields||[],t.data||[],c);throw new Error("Unable to serialize unrecognized input");function p(t,e,i){var s="";"string"==typeof t&&(t=JSON.parse(t)),"string"==typeof e&&(e=JSON.parse(e));var o=Array.isArray(t)&&0<t.length,l=!Array.isArray(e[0]);if(o&&n){for(var c=0;c<t.length;c++)0<c&&(s+=r),s+=g(t[c],c);0<e.length&&(s+=a)}for(var d=0;d<e.length;d++){var h=o?t.length:e[d].length,u=!1,p=o?0===Object.keys(e[d]).length:0===e[d].length;if(i&&!o&&(u="greedy"===i?""===e[d].join("").trim():1===e[d].length&&0===e[d][0].length),"greedy"===i&&o){for(var f=[],m=0;m<h;m++){var b=l?t[m]:m;f.push(e[d][b])}u=""===f.join("").trim()}if(!u){for(var v=0;v<h;v++){0<v&&!p&&(s+=r);var y=o&&l?t[v]:v;s+=g(e[d][y],v)}d<e.length-1&&(!i||0<h&&!p)&&(s+=a)}}return s}function g(t,e){if(null==t)return"";if(t.constructor===Date)return JSON.stringify(t).slice(1,25);var n=!1;h&&"string"==typeof t&&h.test(t)&&(t="'"+t,n=!0);var a=t.toString().replace(u,l);return(n=n||!0===i||"function"==typeof i&&i(t,e)||Array.isArray(i)&&i[e]||function(t,e){for(var i=0;i<e.length;i++)if(-1<t.indexOf(e[i]))return!0;return!1}(a,s.BAD_DELIMITERS)||-1<a.indexOf(r)||" "===a.charAt(0)||" "===a.charAt(a.length-1))?o+a+o:a}}};if(s.RECORD_SEP=String.fromCharCode(30),s.UNIT_SEP=String.fromCharCode(31),s.BYTE_ORDER_MARK="\ufeff",s.BAD_DELIMITERS=["\r","\n",'"',s.BYTE_ORDER_MARK],s.WORKERS_SUPPORTED=!i&&!!e.Worker,s.NODE_STREAM_INPUT=1,s.LocalChunkSize=10485760,s.RemoteChunkSize=5242880,s.DefaultDelimiter=",",s.Parser=g,s.ParserHandle=p,s.NetworkStreamer=c,s.FileStreamer=d,s.StringStreamer=h,s.ReadableStreamStreamer=u,e.jQuery){var o=e.jQuery;o.fn.parse=function(t){var i=t.config||{},n=[];return this.each((function(t){if("INPUT"!==o(this).prop("tagName").toUpperCase()||"file"!==o(this).attr("type").toLowerCase()||!e.FileReader||!this.files||0===this.files.length)return!0;for(var r=0;r<this.files.length;r++)n.push({file:this.files[r],inputElem:this,instanceConfig:o.extend({},i)})})),r(),this;function r(){if(0!==n.length){var e,i,r,l=n[0];if(_(t.before)){var c=t.before(l.file,l.inputElem);if("object"==typeof c){if("abort"===c.action)return e=l.file,i=l.inputElem,r=c.reason,void(_(t.error)&&t.error({name:"AbortError"},e,i,r));if("skip"===c.action)return void a();"object"==typeof c.config&&(l.instanceConfig=o.extend(l.instanceConfig,c.config))}else if("skip"===c)return void a()}var d=l.instanceConfig.complete;l.instanceConfig.complete=function(t){_(d)&&d(t,l.file,l.inputElem),a()},s.parse(l.file,l.instanceConfig)}else _(t.complete)&&t.complete()}function a(){n