diff --git a/DESCRIPTION b/DESCRIPTION index 4d2196d..0df4e20 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -19,7 +19,7 @@ Imports: purrr, viridisLite, grDevices -RoxygenNote: 7.2.0 +RoxygenNote: 7.3.2 Roxygen: list(markdown = TRUE) Suggests: testthat (>= 3.0.0), diff --git a/inst/htmlwidgets/lib/show_sage_2d.bundle.js b/inst/htmlwidgets/lib/show_sage_2d.bundle.js index 96ab4a8..c71ce36 100644 --- a/inst/htmlwidgets/lib/show_sage_2d.bundle.js +++ b/inst/htmlwidgets/lib/show_sage_2d.bundle.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.show_sage_2d=e():t.show_sage_2d=e()}(self,(function(){return(self.webpackChunk_name_=self.webpackChunk_name_||[]).push([[491,348],{5138:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var i=n(8081),o=n.n(i),s=n(3645),r=n.n(s)()(o());r.push([t.id,"button.detourrButton {\n background-color: transparent;\n position: absolute;\n color: rgb(0, 0, 0);\n text-align: center;\n width: 30px;\n height: 30px;\n border-color: transparent;\n left: 10px;\n padding-top: 0px;\n padding-right: 6px;\n}\n\nbutton.detourrButton:hover {\n color: rgb(56, 56, 56);\n}\n\nbutton.detourrButton.resetButton {\n top: 15px;\n border: 5px;\n}\n\nbutton.detourrButton.panButton {\n top: 50px;\n border: 5px;\n}\n\nbutton.detourrButton.orbitButton {\n top: 85px;\n border: 5px;\n}\n\nbutton.detourrButton.selectButton {\n top: 120px;\n border: 5px;\n}\n\nbutton.detourrButton.brushButton {\n top: 155px;\n border: 5px;\n}\n\nbutton.detourrButton.exportButton {\n top: 225px;\n border: 5px;\n}\n\n\nbutton.detourrButton.unselected {\n color: rgb(75, 75, 75);\n}\n\nbutton.detourrButton.selected {\n color: rgb(44, 44, 240);\n}\n\ninput.colourSelector {\n position: absolute;\n top: 190px;\n left: 13px;\n width: 22px;\n height: 22px;\n}\n\n.scatterWidgetContainer {\n position: relative;\n overflow: hidden;\n}\n\n.scatterWidgetCanvas {\n position: relative;\n}\n\n.selectionBox {\n border: 1px solid #55aaff;\n background-color: rgba(75, 160, 255, 0.3);\n position: absolute;\n}\n\ndiv.axisLabel {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: absolute;\n font-family: Helvetica, Sans-serif;\n pointer-events: none;\n}\n\ndiv.detourrTooltip {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n pointer-events: none;\n position: absolute;\n top: 0px;\n left: 0px;\n background: rgba(0, 0, 0, 0.5);\n padding: 5px;\n visibility: hidden;\n border-radius: 5px;\n color: white;\n font-family: sans-serif;\n user-select: none;\n}\n\ndiv.detourrTooltip.visible {\n visibility: visible;\n}\n\ndiv.timelineContainer {\n position: absolute;\n left: 10px;\n right: 10px;\n}\n\ndiv.timeline {\n position: absolute;\n left: 50px;\n right: 20px;\n background-color: rgba(0, 0, 0, 0.7);\n border-radius: 5px;\n z-index: 0;\n}\n\ndiv.scrubber {\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n cursor: move;\n left: 0px;\n z-index: 1;\n}\n\ndiv.basisIndicator {\n position: absolute;\n background-color: rgb(255, 255, 255);\n border-radius: 50%;\n z-index: 0.5;\n}\n\ndiv.scrubber.active {\n cursor: move;\n}\n",""]);const a=r},3645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,o,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(i)for(var a=0;a0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},8081:t=>{"use strict";t.exports=function(t){return t[1]}},8329:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>v});var i=n(3379),o=n.n(i),s=n(7795),r=n.n(s),a=n(569),c=n.n(a),l=n(3565),u=n.n(l),h=n(9216),d=n.n(h),p=n(4589),f=n.n(p),m=n(5138),g={};g.styleTagTransform=f(),g.setAttributes=u(),g.insert=c().bind(null,"head"),g.domAPI=r(),g.insertStyleElement=d(),o()(m.Z,g);const v=m.Z&&m.Z.locals?m.Z.locals:void 0},3379:t=>{"use strict";var e=[];function n(t){for(var n=-1,i=0;i{"use strict";var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},9216:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},3565:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},7795:t=>{"use strict";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},4589:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},7092:function(t,e,n){"use strict";var i,o=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&s(e,t,n);return r(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.DisplaySage2d=void 0;var c=n(3282),l=a(n(356)),u=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}return o(e,t),e.prototype.cumulative_radial_2d=function(t,e,n){return Math.sqrt(1-Math.pow(1-Math.pow(t/e,2),n/2))},e.prototype.scaleRadii=function(t){for(var e,n,i,o=t.dataSync(),s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ScatterControls=void 0;var i=n(370),o=n(2212),s=function(){function t(t){var e=this;this.widget=t,this.container=document.createElement("div"),this.widget.container.appendChild(this.container),this.resetButton=this.widget.resetButtonAction?this.createButton("resetButton","Reset camera position",i.resetIcon,(function(){e.widget.resetButtonAction(),e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.panButton=this.widget.panButtonAction?this.createButton("panButton","Switch to pan controls",i.panIcon,(function(){e.setSelectedButton(e.panButton),e.widget.panButtonAction()})):null,this.orbitButton=this.widget.orbitButtonAction?this.createButton("orbitButton","Switch to orbit controls",i.orbitIcon,(function(){e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.selectButton=this.widget.selectButtonAction?this.createButton("selectButton","Switch to selection controls",i.selectIcon,(function(){e.setSelectedButton(e.selectButton),e.widget.selectButtonAction()})):null,this.widget.brushButtonAction&&(this.brushButton=this.createButton("brushButton","Colour selected points",i.brushIcon,(function(){return e.widget.brushButtonAction()})),this.addColourSelector()),this.exportButton=this.widget.exportButtonAction?this.createButton("exportButton","Export data as csv with current brushed colours",i.downloadIcon,(function(){e.widget.exportButtonAction()})):null,this.setSelectedButton(this.orbitButton),this.widget.orbitButtonAction()}return t.prototype.getSelectedColour=function(){return new o.Color(this.colourSelector.value)},t.prototype.clear=function(){this.widget.container.removeChild(this.container)},t.prototype.createButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t),o.onclick=function(){return i()},this.container.appendChild(o),o},t.prototype.setSelectedButton=function(t){t.className=t.className+" selected",this.selectedButton&&(this.selectedButton.className=this.selectedButton.className.slice(0,-9)),this.selectedButton=t},t.prototype.addColourSelector=function(){var t=this,e=document.createElement("input");e.setAttribute("type","color"),e.className="colourSelector",e.setAttribute("value","#619CFF"),e.setAttribute("title","Select colour to apply using selection box"),e.addEventListener("change",(function(){return t.widget.brushButtonAction()})),this.container.appendChild(e),this.colourSelector=e},t}();e.ScatterControls=s},370:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.downloadIcon=e.orbitIcon=e.brushIcon=e.selectIcon=e.panIcon=e.resetIcon=e.playIcon=e.pauseIcon=void 0,e.pauseIcon='\n\n',e.playIcon='\n\n',e.resetIcon='\n\n',e.panIcon='\n',e.selectIcon='\n\n',e.brushIcon='\n\n',e.orbitIcon='\n\n',e.downloadIcon='\n\x3c!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. --\x3e\n'},8919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DisplayScatter=void 0;var i=n(3190);Object.defineProperty(e,"DisplayScatter",{enumerable:!0,get:function(){return i.DisplayScatter}})},1224:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionHelper=void 0;var i=n(2212),o=function(){function t(t){var e=this;this.startPoint=new i.Vector2,this.pointTopLeft=new i.Vector2,this.pointBottomRight=new i.Vector2,this.widget=t,this.element=document.createElement("div"),this.element.className="selectionBox",this.element.style.pointerEvents="none",this.isDown=!1,this.widget.container.addEventListener("pointerdown",(function(t){e.onSelectStart(t)})),this.widget.container.addEventListener("pointermove",(function(t){e.isDown&&e.onSelectMove(t)})),this.widget.container.addEventListener("pointerup",(function(t){e.isDown&&(e.isDown=!1,e.onSelectOver(t))}))}return t.prototype.disable=function(){this.enabled=!1},t.prototype.enable=function(){this.enabled=!0},t.prototype.scaleX=function(){return this.widget.canvas.clientWidth/this.widget.canvas.getBoundingClientRect().width},t.prototype.scaleY=function(){return this.widget.canvas.clientHeight/this.widget.canvas.getBoundingClientRect().height},t.prototype.onSelectStart=function(t){if(this.enabled&&t.target===this.widget.canvas){this.isDown=!0,this.widget.container.appendChild(this.element);var e=this.widget.canvas.getBoundingClientRect();this.element.style.left=(t.clientX-e.left)*this.scaleX()+"px",this.element.style.top=(t.clientY-e.top)*this.scaleY()+"px",this.element.style.width="0px",this.element.style.height="0px",this.startPoint.x=(t.clientX-e.left)*this.scaleX(),this.startPoint.y=(t.clientY-e.top)*this.scaleY()}},t.prototype.onSelectMove=function(t){if(this.enabled){var e=this.widget.canvas.getBoundingClientRect();this.pointBottomRight.x=Math.max(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointBottomRight.y=Math.max(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.pointTopLeft.x=Math.min(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointTopLeft.y=Math.min(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.element.style.left=this.pointTopLeft.x+"px",this.element.style.top=this.pointTopLeft.y+"px",this.element.style.width=this.pointBottomRight.x-this.pointTopLeft.x+"px",this.element.style.height=this.pointBottomRight.y-this.pointTopLeft.y+"px"}},t.prototype.onSelectOver=function(t){this.enabled&&(this.onSelectMove(t),this.widget.setPointSelectionFromBox(this.pointTopLeft,this.pointBottomRight,t.shiftKey),this.element.parentElement.removeChild(this.element))},t}();e.SelectionHelper=o},4814:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FRAGMENT_SHADER=void 0,e.FRAGMENT_SHADER="\nvarying float vSize;\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\n\nvoid main(){\n // 1.0 if picking else vAlpha\n float alpha = 1.0 - (1.0 - vPicking) * (1.0 - vAlpha);\n gl_FragColor = vec4(vColor, alpha);\n\n // make points circular\n float distance = length(2.0 * gl_PointCoord - 1.0);\n if (distance > 1.0) {\n discard;\n }\n}\n"},3190:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}c((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,i=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)for(var i=0,o=0;o>16&255)/255,t[e+1]=(n>>8&255)/255,t[e+2]=(255&n)/255,e+=3;return new l.BufferAttribute(t,3)},t.prototype.addAxisLabels=function(){var t=this,e=this.renderer.getPixelRatio();this.config.axisLabels==[]?this.hasAxisLabels=!1:(this.hasAxisLabels=!0,this.axisLabels=this.config.axisLabels.map((function(n){return new f.AxisLabel(n,[0,0,0],t.container,t.canvas,t.camera,t.dim,e)})))},t.prototype.addSleepEventListeners=function(){var t=this;this.container.addEventListener("mouseover",(function(){return t.wakeEventListener()})),this.container.addEventListener("scroll",(function(){return t.wakeEventListener()})),this.container.addEventListener("keydown",(function(){return t.wakeEventListener()})),this.container.addEventListener("mouseleave",(function(){return t.sleepEventListener()}))},t.prototype.setPointSelectionFromBox=function(t,e,n){var i=this,o=this.pickingTexture,s=this.renderer,r=s.getPixelRatio(),a=t.x*r,c=e.y*r,l=(e.x-t.x)*r,u=(e.y-t.y)*r,h=new Uint8Array(4*l*u);s.readRenderTargetPixels(o,a,o.height-c,l,u,h);for(var d,p=new Set,f=0;f=this.config.duration&&(this.time=0);var n=Math.floor(this.time*this.config.fps);if(this.currentFrame=n,n!=this.oldFrame){if(this.currentFrameBuffer=this.getPointsBuffer(n%this.projectionMatrices.length),this.points.geometry.setAttribute("position",this.currentFrameBuffer),this.hasAxes&&this.axisSegments.geometry.setAttribute("position",this.getAxisLinesBuffer(n)),this.hasEdges){var i=this.getEdgesBuffer(this.currentFrameBuffer);this.edgeSegments.geometry.setAttribute("position",i)}this.oldFrame=n,this.timeline.updatePosition(n/(this.projectionMatrices.length-1))}this.adjustPointSizeFromZoom&&this.adjustPointSizeFromZoom(),this.renderer.render(this.scene,this.camera),this.points.geometry.setAttribute("color",this.pickingColours),this.points.material.uniforms.picking.value=1,this.renderer.setRenderTarget(this.pickingTexture),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null),this.points.geometry.setAttribute("color",this.pointColours),this.points.material.uniforms.picking.value=0,this.hasAxisLabels&&this.axisLabels.map((function(e,i){return e.updatePosition(t.projectionMatrices[n].arraySync()[i],t.camera)})),this.isSleeping||requestAnimationFrame((function(){return t.animate()}))},t.prototype.getIsPaused=function(){return this.isPaused},t.prototype.setIsPaused=function(t){this.isPaused=t,t||this.animate(),this.timeline.updatePlayPauseIcon(t)},t.prototype.setSleep=function(t){this.isSleeping=t},t.prototype.setTime=function(t){this.time=this.config.duration*t},t.prototype.getBasisIndices=function(){return this.config.basisIndices},t.prototype.getNumAnimationFrames=function(){return this.projectionMatrices.length},t.prototype.sleepEventListener=function(){this.isPaused&&this.setSleep(!0)},t.prototype.wakeEventListener=function(){this.isSleeping&&(this.setSleep(!1),this.animate())},t.prototype.setSelectedPointColour=function(){for(var t=this.controls.getSelectedColour(),e=0,n=this.selectedPointIndices;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;var i=n(370),o=function(){function t(t){this.scrubberWidth=16,this.timelineThickness=4,this.hasBasisIndicators=!0,this.basisIndicators=[],this.basisIndicatorDiameter=4,this.mouseDown=!1,this.widget=t,this.parentDiv=t.container,this.canvas=t.canvas,this.addContainer(),this.addTimeline(),this.addScrubber(),this.addPlayPauseButton(),this.addBasisIndicators(),this.addEventListeners(),this.addTooltip()}return t.prototype.updatePosition=function(t){this.mouseDown||(this.scrubber.style.left=Math.floor(this.timelineWidth*t)+"px")},t.prototype.updatePlayPauseIcon=function(t){this.playPauseButton.innerHTML=t?i.playIcon:i.pauseIcon},t.prototype.addButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t,"Button"),o.onclick=function(){return i()},o},t.prototype.getElement=function(){return this.container},t.prototype.resize=function(t,e){if(this.container.style.top=t-40+"px",this.timelineWidth=this.timeline.offsetWidth-this.scrubberWidth,this.hasBasisIndicators)for(var n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERTEX_SHADER_2D=void 0,e.VERTEX_SHADER_2D="\nuniform float size;\nuniform float zoom;\nuniform float picking;\n\nattribute float alpha;\nattribute vec3 color;\n\n// passed to fragment shader\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\n\nvoid main(){\n vColor = color;\n vAlpha = alpha;\n vPicking = picking;\n\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = 100.0 * size * sqrt(zoom);\n}\n"},7256:()=>{},2578:()=>{},2980:()=>{},4862:()=>{},7958:()=>{},5410:()=>{},8628:()=>{},5042:()=>{}},t=>(t.O(0,[440,841,470,691],(()=>(7092,t(t.s=7092)))),t.O())])})); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.show_sage_2d=e():t.show_sage_2d=e()}(self,(function(){return(self.webpackChunk_name_=self.webpackChunk_name_||[]).push([[491,348],{5138:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var i=n(8081),o=n.n(i),s=n(3645),r=n.n(s)()(o());r.push([t.id,"button.detourrButton {\n background-color: transparent;\n position: absolute;\n color: rgb(0, 0, 0);\n text-align: center;\n width: 30px;\n height: 30px;\n border-color: transparent;\n left: 10px;\n padding-top: 0px;\n padding-right: 6px;\n}\n\nbutton.detourrButton:hover {\n color: rgb(56, 56, 56);\n}\n\nbutton.detourrButton.resetButton {\n top: 15px;\n border: 5px;\n}\n\nbutton.detourrButton.panButton {\n top: 50px;\n border: 5px;\n}\n\nbutton.detourrButton.orbitButton {\n top: 85px;\n border: 5px;\n}\n\nbutton.detourrButton.selectButton {\n top: 120px;\n border: 5px;\n}\n\nbutton.detourrButton.brushButton {\n top: 155px;\n border: 5px;\n}\n\nbutton.detourrButton.exportButton {\n top: 225px;\n border: 5px;\n}\n\n\nbutton.detourrButton.unselected {\n color: rgb(75, 75, 75);\n}\n\nbutton.detourrButton.selected {\n color: rgb(44, 44, 240);\n}\n\ninput.colourSelector {\n position: absolute;\n top: 190px;\n left: 13px;\n width: 22px;\n height: 22px;\n}\n\n.scatterWidgetContainer {\n position: relative;\n overflow: hidden;\n}\n\n.scatterWidgetCanvas {\n position: relative;\n}\n\n.selectionBox {\n border: 1px solid #55aaff;\n background-color: rgba(75, 160, 255, 0.3);\n position: absolute;\n}\n\ndiv.axisLabel {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: absolute;\n font-family: Helvetica, Sans-serif;\n pointer-events: none;\n}\n\ndiv.detourrTooltip {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n pointer-events: none;\n position: absolute;\n top: 0px;\n left: 0px;\n background: rgba(0, 0, 0, 0.5);\n padding: 5px;\n visibility: hidden;\n border-radius: 5px;\n color: white;\n font-family: sans-serif;\n user-select: none;\n}\n\ndiv.detourrTooltip.visible {\n visibility: visible;\n}\n\ndiv.timelineContainer {\n position: absolute;\n left: 10px;\n right: 10px;\n}\n\ndiv.timeline {\n position: absolute;\n left: 50px;\n right: 20px;\n background-color: rgba(0, 0, 0, 0.7);\n border-radius: 5px;\n z-index: 0;\n}\n\ndiv.scrubber {\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n cursor: move;\n left: 0px;\n z-index: 1;\n}\n\ndiv.basisIndicator {\n position: absolute;\n background-color: rgb(255, 255, 255);\n border-radius: 50%;\n z-index: 0.5;\n}\n\ndiv.scrubber.active {\n cursor: move;\n}\n",""]);const a=r},3645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,o,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(i)for(var a=0;a0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},8081:t=>{"use strict";t.exports=function(t){return t[1]}},8329:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>v});var i=n(3379),o=n.n(i),s=n(7795),r=n.n(s),a=n(569),c=n.n(a),l=n(3565),u=n.n(l),h=n(9216),d=n.n(h),p=n(4589),f=n.n(p),m=n(5138),g={};g.styleTagTransform=f(),g.setAttributes=u(),g.insert=c().bind(null,"head"),g.domAPI=r(),g.insertStyleElement=d(),o()(m.Z,g);const v=m.Z&&m.Z.locals?m.Z.locals:void 0},3379:t=>{"use strict";var e=[];function n(t){for(var n=-1,i=0;i{"use strict";var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},9216:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},3565:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},7795:t=>{"use strict";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},4589:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},7092:function(t,e,n){"use strict";var i,o=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&s(e,t,n);return r(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.DisplaySage2d=void 0;var c=n(3282),l=a(n(356)),u=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}return o(e,t),e.prototype.cumulative_radial_2d=function(t,e,n){return Math.sqrt(1-Math.pow(1-Math.pow(t/e,2),n/2))},e.prototype.scaleRadii=function(t){for(var e,n,i,o=t.dataSync(),s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ScatterControls=void 0;var i=n(370),o=n(2212),s=function(){function t(t){var e=this;this.widget=t,this.container=document.createElement("div"),this.widget.container.appendChild(this.container),this.resetButton=this.widget.resetButtonAction?this.createButton("resetButton","Reset camera position",i.resetIcon,(function(){e.widget.resetButtonAction(),e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.panButton=this.widget.panButtonAction?this.createButton("panButton","Switch to pan controls",i.panIcon,(function(){e.setSelectedButton(e.panButton),e.widget.panButtonAction()})):null,this.orbitButton=this.widget.orbitButtonAction?this.createButton("orbitButton","Switch to orbit controls",i.orbitIcon,(function(){e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.selectButton=this.widget.selectButtonAction?this.createButton("selectButton","Switch to selection controls",i.selectIcon,(function(){e.setSelectedButton(e.selectButton),e.widget.selectButtonAction()})):null,this.widget.brushButtonAction&&(this.brushButton=this.createButton("brushButton","Colour selected points",i.brushIcon,(function(){return e.widget.brushButtonAction()})),this.addColourSelector()),this.exportButton=this.widget.exportButtonAction?this.createButton("exportButton","Export data as csv with current brushed colours",i.downloadIcon,(function(){e.widget.exportButtonAction()})):null,this.setSelectedButton(this.orbitButton),this.widget.orbitButtonAction()}return t.prototype.getSelectedColour=function(){return new o.Color(this.colourSelector.value)},t.prototype.clear=function(){this.widget.container.removeChild(this.container)},t.prototype.createButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t),o.onclick=function(){return i()},this.container.appendChild(o),o},t.prototype.setSelectedButton=function(t){t.className=t.className+" selected",this.selectedButton&&(this.selectedButton.className=this.selectedButton.className.slice(0,-9)),this.selectedButton=t},t.prototype.addColourSelector=function(){var t=this,e=document.createElement("input");e.setAttribute("type","color"),e.className="colourSelector",e.setAttribute("value","#619CFF"),e.setAttribute("title","Select colour to apply using selection box"),e.addEventListener("change",(function(){return t.widget.brushButtonAction()})),this.container.appendChild(e),this.colourSelector=e},t}();e.ScatterControls=s},370:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.downloadIcon=e.orbitIcon=e.brushIcon=e.selectIcon=e.panIcon=e.resetIcon=e.playIcon=e.pauseIcon=void 0,e.pauseIcon='\n\n',e.playIcon='\n\n',e.resetIcon='\n\n',e.panIcon='\n',e.selectIcon='\n\n',e.brushIcon='\n\n',e.orbitIcon='\n\n',e.downloadIcon='\n\x3c!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. --\x3e\n'},8919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DisplayScatter=void 0;var i=n(3190);Object.defineProperty(e,"DisplayScatter",{enumerable:!0,get:function(){return i.DisplayScatter}})},1224:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionHelper=void 0;var i=n(2212),o=function(){function t(t){var e=this;this.startPoint=new i.Vector2,this.pointTopLeft=new i.Vector2,this.pointBottomRight=new i.Vector2,this.widget=t,this.element=document.createElement("div"),this.element.className="selectionBox",this.element.style.pointerEvents="none",this.isDown=!1,this.widget.container.addEventListener("pointerdown",(function(t){e.onSelectStart(t)})),this.widget.container.addEventListener("pointermove",(function(t){e.isDown&&e.onSelectMove(t)})),this.widget.container.addEventListener("pointerup",(function(t){e.isDown&&(e.isDown=!1,e.onSelectOver(t))}))}return t.prototype.disable=function(){this.enabled=!1},t.prototype.enable=function(){this.enabled=!0},t.prototype.scaleX=function(){return this.widget.canvas.clientWidth/this.widget.canvas.getBoundingClientRect().width},t.prototype.scaleY=function(){return this.widget.canvas.clientHeight/this.widget.canvas.getBoundingClientRect().height},t.prototype.onSelectStart=function(t){if(this.enabled&&t.target===this.widget.canvas){this.isDown=!0,this.widget.container.appendChild(this.element);var e=this.widget.canvas.getBoundingClientRect();this.element.style.left=(t.clientX-e.left)*this.scaleX()+"px",this.element.style.top=(t.clientY-e.top)*this.scaleY()+"px",this.element.style.width="0px",this.element.style.height="0px",this.startPoint.x=(t.clientX-e.left)*this.scaleX(),this.startPoint.y=(t.clientY-e.top)*this.scaleY()}},t.prototype.onSelectMove=function(t){if(this.enabled){var e=this.widget.canvas.getBoundingClientRect();this.pointBottomRight.x=Math.max(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointBottomRight.y=Math.max(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.pointTopLeft.x=Math.min(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointTopLeft.y=Math.min(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.element.style.left=this.pointTopLeft.x+"px",this.element.style.top=this.pointTopLeft.y+"px",this.element.style.width=this.pointBottomRight.x-this.pointTopLeft.x+"px",this.element.style.height=this.pointBottomRight.y-this.pointTopLeft.y+"px"}},t.prototype.onSelectOver=function(t){this.enabled&&(this.onSelectMove(t),this.widget.setPointSelectionFromBox(this.pointTopLeft,this.pointBottomRight,t.shiftKey),this.element.parentElement.removeChild(this.element))},t}();e.SelectionHelper=o},4814:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FRAGMENT_SHADER=void 0,e.FRAGMENT_SHADER="\nvarying float vSize;\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\nvarying float vShrink; // shrink points when picking\n\nvoid main(){\n // 1.0 if picking else vAlpha\n float alpha = 1.0 - (1.0 - vPicking) * (1.0 - vAlpha);\n gl_FragColor = vec4(vColor, alpha);\n\n // make points circular\n float distance = length(2.0 * gl_PointCoord - 1.0);\n if (distance > 1.0) {\n discard;\n }\n}\n"},3190:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}c((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,i=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)for(var i=0,o=0;o>16&255)/255,t[e+1]=(n>>8&255)/255,t[e+2]=(255&n)/255,e+=3;return new l.BufferAttribute(t,3)},t.prototype.addAxisLabels=function(){var t=this,e=this.renderer.getPixelRatio();this.config.axisLabels==[]?this.hasAxisLabels=!1:(this.hasAxisLabels=!0,this.axisLabels=this.config.axisLabels.map((function(n){return new f.AxisLabel(n,[0,0,0],t.container,t.canvas,t.camera,t.dim,e)})))},t.prototype.addSleepEventListeners=function(){var t=this;this.container.addEventListener("mouseover",(function(){return t.wakeEventListener()})),this.container.addEventListener("scroll",(function(){return t.wakeEventListener()})),this.container.addEventListener("keydown",(function(){return t.wakeEventListener()})),this.container.addEventListener("mouseleave",(function(){return t.sleepEventListener()}))},t.prototype.setPointSelectionFromBox=function(t,e,n){var i=this,o=this.pickingTexture,s=this.renderer,r=s.getPixelRatio(),a=t.x*r,c=e.y*r,l=(e.x-t.x)*r,u=(e.y-t.y)*r,h=new Uint8Array(4*l*u);this.points.geometry.setAttribute("color",this.pickingColours),this.points.material.uniforms.picking.value=1,this.points.material.uniforms.shrink.value=1,this.renderer.setRenderTarget(this.pickingTexture),this.renderer.render(this.scene,this.camera),s.readRenderTargetPixels(o,a,o.height-c,l,u,h),this.renderer.setRenderTarget(null),this.points.geometry.setAttribute("color",this.pointColours),this.points.material.uniforms.picking.value=0,this.points.material.uniforms.shrink.value=0;for(var d,p=new Set,f=0;f=this.config.duration&&(this.time=0);var n=Math.floor(this.time*this.config.fps);if(this.currentFrame=n,n!=this.oldFrame){if(this.currentFrameBuffer=this.getPointsBuffer(n%this.projectionMatrices.length),this.points.geometry.setAttribute("position",this.currentFrameBuffer),this.hasAxes&&this.axisSegments.geometry.setAttribute("position",this.getAxisLinesBuffer(n)),this.hasEdges){var i=this.getEdgesBuffer(this.currentFrameBuffer);this.edgeSegments.geometry.setAttribute("position",i)}this.oldFrame=n,this.timeline.updatePosition(n/(this.projectionMatrices.length-1))}this.adjustPointSizeFromZoom&&this.adjustPointSizeFromZoom(),this.renderer.render(this.scene,this.camera),this.points.geometry.setAttribute("color",this.pickingColours),this.points.material.uniforms.picking.value=1,this.renderer.setRenderTarget(this.pickingTexture),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null),this.points.geometry.setAttribute("color",this.pointColours),this.points.material.uniforms.picking.value=0,this.hasAxisLabels&&this.axisLabels.map((function(e,i){return e.updatePosition(t.projectionMatrices[n].arraySync()[i],t.camera)})),this.isSleeping||requestAnimationFrame((function(){return t.animate()}))},t.prototype.getIsPaused=function(){return this.isPaused},t.prototype.setIsPaused=function(t){this.isPaused=t,t||this.animate(),this.timeline.updatePlayPauseIcon(t)},t.prototype.setSleep=function(t){this.isSleeping=t},t.prototype.setTime=function(t){this.time=this.config.duration*t},t.prototype.getBasisIndices=function(){return this.config.basisIndices},t.prototype.getNumAnimationFrames=function(){return this.projectionMatrices.length},t.prototype.sleepEventListener=function(){this.isPaused&&this.setSleep(!0)},t.prototype.wakeEventListener=function(){this.isSleeping&&(this.setSleep(!1),this.animate())},t.prototype.setSelectedPointColour=function(){for(var t=this.controls.getSelectedColour(),e=0,n=this.selectedPointIndices;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;var i=n(370),o=function(){function t(t){this.scrubberWidth=16,this.timelineThickness=4,this.hasBasisIndicators=!0,this.basisIndicators=[],this.basisIndicatorDiameter=4,this.mouseDown=!1,this.widget=t,this.parentDiv=t.container,this.canvas=t.canvas,this.addContainer(),this.addTimeline(),this.addScrubber(),this.addPlayPauseButton(),this.addBasisIndicators(),this.addEventListeners(),this.addTooltip()}return t.prototype.updatePosition=function(t){this.mouseDown||(this.scrubber.style.left=Math.floor(this.timelineWidth*t)+"px")},t.prototype.updatePlayPauseIcon=function(t){this.playPauseButton.innerHTML=t?i.playIcon:i.pauseIcon},t.prototype.addButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t,"Button"),o.onclick=function(){return i()},o},t.prototype.getElement=function(){return this.container},t.prototype.resize=function(t,e){if(this.container.style.top=t-40+"px",this.timelineWidth=this.timeline.offsetWidth-this.scrubberWidth,this.hasBasisIndicators)for(var n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERTEX_SHADER_2D=void 0,e.VERTEX_SHADER_2D="\nuniform float size;\nuniform float zoom;\nuniform float picking;\nuniform float shrink;\n\nattribute float alpha;\nattribute vec3 color;\n\n// passed to fragment shader\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\nvarying float vShrink;\n\nvoid main(){\n vColor = color;\n vAlpha = alpha;\n vPicking = picking;\n vShrink = shrink;\n\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = 2.0 * shrink + (100.0 * size * sqrt(zoom)) * (1.0 - shrink);\n}\n"},7256:()=>{},2578:()=>{},2980:()=>{},4862:()=>{},7958:()=>{},5410:()=>{},8628:()=>{},5042:()=>{}},t=>(t.O(0,[440,841,470,691],(()=>(7092,t(t.s=7092)))),t.O())])})); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/show_sage_3d.bundle.js b/inst/htmlwidgets/lib/show_sage_3d.bundle.js index 9b385ff..ff76d6e 100644 --- a/inst/htmlwidgets/lib/show_sage_3d.bundle.js +++ b/inst/htmlwidgets/lib/show_sage_3d.bundle.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.show_sage_3d=e():t.show_sage_3d=e()}(self,(function(){return(self.webpackChunk_name_=self.webpackChunk_name_||[]).push([[183,248],{5138:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var i=n(8081),o=n.n(i),s=n(3645),r=n.n(s)()(o());r.push([t.id,"button.detourrButton {\n background-color: transparent;\n position: absolute;\n color: rgb(0, 0, 0);\n text-align: center;\n width: 30px;\n height: 30px;\n border-color: transparent;\n left: 10px;\n padding-top: 0px;\n padding-right: 6px;\n}\n\nbutton.detourrButton:hover {\n color: rgb(56, 56, 56);\n}\n\nbutton.detourrButton.resetButton {\n top: 15px;\n border: 5px;\n}\n\nbutton.detourrButton.panButton {\n top: 50px;\n border: 5px;\n}\n\nbutton.detourrButton.orbitButton {\n top: 85px;\n border: 5px;\n}\n\nbutton.detourrButton.selectButton {\n top: 120px;\n border: 5px;\n}\n\nbutton.detourrButton.brushButton {\n top: 155px;\n border: 5px;\n}\n\nbutton.detourrButton.exportButton {\n top: 225px;\n border: 5px;\n}\n\n\nbutton.detourrButton.unselected {\n color: rgb(75, 75, 75);\n}\n\nbutton.detourrButton.selected {\n color: rgb(44, 44, 240);\n}\n\ninput.colourSelector {\n position: absolute;\n top: 190px;\n left: 13px;\n width: 22px;\n height: 22px;\n}\n\n.scatterWidgetContainer {\n position: relative;\n overflow: hidden;\n}\n\n.scatterWidgetCanvas {\n position: relative;\n}\n\n.selectionBox {\n border: 1px solid #55aaff;\n background-color: rgba(75, 160, 255, 0.3);\n position: absolute;\n}\n\ndiv.axisLabel {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: absolute;\n font-family: Helvetica, Sans-serif;\n pointer-events: none;\n}\n\ndiv.detourrTooltip {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n pointer-events: none;\n position: absolute;\n top: 0px;\n left: 0px;\n background: rgba(0, 0, 0, 0.5);\n padding: 5px;\n visibility: hidden;\n border-radius: 5px;\n color: white;\n font-family: sans-serif;\n user-select: none;\n}\n\ndiv.detourrTooltip.visible {\n visibility: visible;\n}\n\ndiv.timelineContainer {\n position: absolute;\n left: 10px;\n right: 10px;\n}\n\ndiv.timeline {\n position: absolute;\n left: 50px;\n right: 20px;\n background-color: rgba(0, 0, 0, 0.7);\n border-radius: 5px;\n z-index: 0;\n}\n\ndiv.scrubber {\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n cursor: move;\n left: 0px;\n z-index: 1;\n}\n\ndiv.basisIndicator {\n position: absolute;\n background-color: rgb(255, 255, 255);\n border-radius: 50%;\n z-index: 0.5;\n}\n\ndiv.scrubber.active {\n cursor: move;\n}\n",""]);const a=r},3645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,o,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(i)for(var a=0;a0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},8081:t=>{"use strict";t.exports=function(t){return t[1]}},8329:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>m});var i=n(3379),o=n.n(i),s=n(7795),r=n.n(s),a=n(569),c=n.n(a),l=n(3565),u=n.n(l),h=n(9216),d=n.n(h),p=n(4589),f=n.n(p),v=n(5138),g={};g.styleTagTransform=f(),g.setAttributes=u(),g.insert=c().bind(null,"head"),g.domAPI=r(),g.insertStyleElement=d(),o()(v.Z,g);const m=v.Z&&v.Z.locals?v.Z.locals:void 0},3379:t=>{"use strict";var e=[];function n(t){for(var n=-1,i=0;i{"use strict";var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},9216:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},3565:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},7795:t=>{"use strict";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},4589:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},4658:function(t,e,n){"use strict";var i,o=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&s(e,t,n);return r(e,t),e},c=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DisplaySage3d=void 0;var l=n(5629),u=c(n(8911)),h=a(n(356)),d=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}return o(e,t),e.prototype.cumulative_radial_3d=function(t,e,n){return Math.pow((0,u.default)(Math.pow(t,2)/Math.pow(e,2),1.5,(n-1)/2),1/3)},e.prototype.scaleRadii=function(t){for(var e,n,i,o=t.dataSync(),s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ScatterControls=void 0;var i=n(370),o=n(2212),s=function(){function t(t){var e=this;this.widget=t,this.container=document.createElement("div"),this.widget.container.appendChild(this.container),this.resetButton=this.widget.resetButtonAction?this.createButton("resetButton","Reset camera position",i.resetIcon,(function(){e.widget.resetButtonAction(),e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.panButton=this.widget.panButtonAction?this.createButton("panButton","Switch to pan controls",i.panIcon,(function(){e.setSelectedButton(e.panButton),e.widget.panButtonAction()})):null,this.orbitButton=this.widget.orbitButtonAction?this.createButton("orbitButton","Switch to orbit controls",i.orbitIcon,(function(){e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.selectButton=this.widget.selectButtonAction?this.createButton("selectButton","Switch to selection controls",i.selectIcon,(function(){e.setSelectedButton(e.selectButton),e.widget.selectButtonAction()})):null,this.widget.brushButtonAction&&(this.brushButton=this.createButton("brushButton","Colour selected points",i.brushIcon,(function(){return e.widget.brushButtonAction()})),this.addColourSelector()),this.exportButton=this.widget.exportButtonAction?this.createButton("exportButton","Export data as csv with current brushed colours",i.downloadIcon,(function(){e.widget.exportButtonAction()})):null,this.setSelectedButton(this.orbitButton),this.widget.orbitButtonAction()}return t.prototype.getSelectedColour=function(){return new o.Color(this.colourSelector.value)},t.prototype.clear=function(){this.widget.container.removeChild(this.container)},t.prototype.createButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t),o.onclick=function(){return i()},this.container.appendChild(o),o},t.prototype.setSelectedButton=function(t){t.className=t.className+" selected",this.selectedButton&&(this.selectedButton.className=this.selectedButton.className.slice(0,-9)),this.selectedButton=t},t.prototype.addColourSelector=function(){var t=this,e=document.createElement("input");e.setAttribute("type","color"),e.className="colourSelector",e.setAttribute("value","#619CFF"),e.setAttribute("title","Select colour to apply using selection box"),e.addEventListener("change",(function(){return t.widget.brushButtonAction()})),this.container.appendChild(e),this.colourSelector=e},t}();e.ScatterControls=s},370:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.downloadIcon=e.orbitIcon=e.brushIcon=e.selectIcon=e.panIcon=e.resetIcon=e.playIcon=e.pauseIcon=void 0,e.pauseIcon='\n\n',e.playIcon='\n\n',e.resetIcon='\n\n',e.panIcon='\n',e.selectIcon='\n\n',e.brushIcon='\n\n',e.orbitIcon='\n\n',e.downloadIcon='\n\x3c!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. --\x3e\n'},8919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DisplayScatter=void 0;var i=n(3190);Object.defineProperty(e,"DisplayScatter",{enumerable:!0,get:function(){return i.DisplayScatter}})},1224:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionHelper=void 0;var i=n(2212),o=function(){function t(t){var e=this;this.startPoint=new i.Vector2,this.pointTopLeft=new i.Vector2,this.pointBottomRight=new i.Vector2,this.widget=t,this.element=document.createElement("div"),this.element.className="selectionBox",this.element.style.pointerEvents="none",this.isDown=!1,this.widget.container.addEventListener("pointerdown",(function(t){e.onSelectStart(t)})),this.widget.container.addEventListener("pointermove",(function(t){e.isDown&&e.onSelectMove(t)})),this.widget.container.addEventListener("pointerup",(function(t){e.isDown&&(e.isDown=!1,e.onSelectOver(t))}))}return t.prototype.disable=function(){this.enabled=!1},t.prototype.enable=function(){this.enabled=!0},t.prototype.scaleX=function(){return this.widget.canvas.clientWidth/this.widget.canvas.getBoundingClientRect().width},t.prototype.scaleY=function(){return this.widget.canvas.clientHeight/this.widget.canvas.getBoundingClientRect().height},t.prototype.onSelectStart=function(t){if(this.enabled&&t.target===this.widget.canvas){this.isDown=!0,this.widget.container.appendChild(this.element);var e=this.widget.canvas.getBoundingClientRect();this.element.style.left=(t.clientX-e.left)*this.scaleX()+"px",this.element.style.top=(t.clientY-e.top)*this.scaleY()+"px",this.element.style.width="0px",this.element.style.height="0px",this.startPoint.x=(t.clientX-e.left)*this.scaleX(),this.startPoint.y=(t.clientY-e.top)*this.scaleY()}},t.prototype.onSelectMove=function(t){if(this.enabled){var e=this.widget.canvas.getBoundingClientRect();this.pointBottomRight.x=Math.max(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointBottomRight.y=Math.max(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.pointTopLeft.x=Math.min(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointTopLeft.y=Math.min(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.element.style.left=this.pointTopLeft.x+"px",this.element.style.top=this.pointTopLeft.y+"px",this.element.style.width=this.pointBottomRight.x-this.pointTopLeft.x+"px",this.element.style.height=this.pointBottomRight.y-this.pointTopLeft.y+"px"}},t.prototype.onSelectOver=function(t){this.enabled&&(this.onSelectMove(t),this.widget.setPointSelectionFromBox(this.pointTopLeft,this.pointBottomRight,t.shiftKey),this.element.parentElement.removeChild(this.element))},t}();e.SelectionHelper=o},4814:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FRAGMENT_SHADER=void 0,e.FRAGMENT_SHADER="\nvarying float vSize;\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\n\nvoid main(){\n // 1.0 if picking else vAlpha\n float alpha = 1.0 - (1.0 - vPicking) * (1.0 - vAlpha);\n gl_FragColor = vec4(vColor, alpha);\n\n // make points circular\n float distance = length(2.0 * gl_PointCoord - 1.0);\n if (distance > 1.0) {\n discard;\n }\n}\n"},3190:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}c((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,i=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)for(var i=0,o=0;o>16&255)/255,t[e+1]=(n>>8&255)/255,t[e+2]=(255&n)/255,e+=3;return new l.BufferAttribute(t,3)},t.prototype.addAxisLabels=function(){var t=this,e=this.renderer.getPixelRatio();this.config.axisLabels==[]?this.hasAxisLabels=!1:(this.hasAxisLabels=!0,this.axisLabels=this.config.axisLabels.map((function(n){return new f.AxisLabel(n,[0,0,0],t.container,t.canvas,t.camera,t.dim,e)})))},t.prototype.addSleepEventListeners=function(){var t=this;this.container.addEventListener("mouseover",(function(){return t.wakeEventListener()})),this.container.addEventListener("scroll",(function(){return t.wakeEventListener()})),this.container.addEventListener("keydown",(function(){return t.wakeEventListener()})),this.container.addEventListener("mouseleave",(function(){return t.sleepEventListener()}))},t.prototype.setPointSelectionFromBox=function(t,e,n){var i=this,o=this.pickingTexture,s=this.renderer,r=s.getPixelRatio(),a=t.x*r,c=e.y*r,l=(e.x-t.x)*r,u=(e.y-t.y)*r,h=new Uint8Array(4*l*u);s.readRenderTargetPixels(o,a,o.height-c,l,u,h);for(var d,p=new Set,f=0;f=this.config.duration&&(this.time=0);var n=Math.floor(this.time*this.config.fps);if(this.currentFrame=n,n!=this.oldFrame){if(this.currentFrameBuffer=this.getPointsBuffer(n%this.projectionMatrices.length),this.points.geometry.setAttribute("position",this.currentFrameBuffer),this.hasAxes&&this.axisSegments.geometry.setAttribute("position",this.getAxisLinesBuffer(n)),this.hasEdges){var i=this.getEdgesBuffer(this.currentFrameBuffer);this.edgeSegments.geometry.setAttribute("position",i)}this.oldFrame=n,this.timeline.updatePosition(n/(this.projectionMatrices.length-1))}this.adjustPointSizeFromZoom&&this.adjustPointSizeFromZoom(),this.renderer.render(this.scene,this.camera),this.points.geometry.setAttribute("color",this.pickingColours),this.points.material.uniforms.picking.value=1,this.renderer.setRenderTarget(this.pickingTexture),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null),this.points.geometry.setAttribute("color",this.pointColours),this.points.material.uniforms.picking.value=0,this.hasAxisLabels&&this.axisLabels.map((function(e,i){return e.updatePosition(t.projectionMatrices[n].arraySync()[i],t.camera)})),this.isSleeping||requestAnimationFrame((function(){return t.animate()}))},t.prototype.getIsPaused=function(){return this.isPaused},t.prototype.setIsPaused=function(t){this.isPaused=t,t||this.animate(),this.timeline.updatePlayPauseIcon(t)},t.prototype.setSleep=function(t){this.isSleeping=t},t.prototype.setTime=function(t){this.time=this.config.duration*t},t.prototype.getBasisIndices=function(){return this.config.basisIndices},t.prototype.getNumAnimationFrames=function(){return this.projectionMatrices.length},t.prototype.sleepEventListener=function(){this.isPaused&&this.setSleep(!0)},t.prototype.wakeEventListener=function(){this.isSleeping&&(this.setSleep(!1),this.animate())},t.prototype.setSelectedPointColour=function(){for(var t=this.controls.getSelectedColour(),e=0,n=this.selectedPointIndices;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;var i=n(370),o=function(){function t(t){this.scrubberWidth=16,this.timelineThickness=4,this.hasBasisIndicators=!0,this.basisIndicators=[],this.basisIndicatorDiameter=4,this.mouseDown=!1,this.widget=t,this.parentDiv=t.container,this.canvas=t.canvas,this.addContainer(),this.addTimeline(),this.addScrubber(),this.addPlayPauseButton(),this.addBasisIndicators(),this.addEventListeners(),this.addTooltip()}return t.prototype.updatePosition=function(t){this.mouseDown||(this.scrubber.style.left=Math.floor(this.timelineWidth*t)+"px")},t.prototype.updatePlayPauseIcon=function(t){this.playPauseButton.innerHTML=t?i.playIcon:i.pauseIcon},t.prototype.addButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t,"Button"),o.onclick=function(){return i()},o},t.prototype.getElement=function(){return this.container},t.prototype.resize=function(t,e){if(this.container.style.top=t-40+"px",this.timelineWidth=this.timeline.offsetWidth-this.scrubberWidth,this.hasBasisIndicators)for(var n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERTEX_SHADER_3D=void 0,e.VERTEX_SHADER_3D="\nuniform float size;\nuniform float picking;\n\nattribute vec3 color;\nattribute float alpha;\n\n// passed to fragment shader\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\n\nvoid main(){\n vColor = color;\n vAlpha = alpha;\n vPicking = picking;\n \n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = 200.0 * size / -mvPosition.z;\n}\n"},7256:()=>{},2578:()=>{},2980:()=>{},4862:()=>{},7958:()=>{},5410:()=>{},8628:()=>{},5042:()=>{}},t=>(t.O(0,[440,841,470,691,558],(()=>(4658,t(t.s=4658)))),t.O())])})); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.show_sage_3d=e():t.show_sage_3d=e()}(self,(function(){return(self.webpackChunk_name_=self.webpackChunk_name_||[]).push([[183,248],{5138:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var i=n(8081),o=n.n(i),s=n(3645),r=n.n(s)()(o());r.push([t.id,"button.detourrButton {\n background-color: transparent;\n position: absolute;\n color: rgb(0, 0, 0);\n text-align: center;\n width: 30px;\n height: 30px;\n border-color: transparent;\n left: 10px;\n padding-top: 0px;\n padding-right: 6px;\n}\n\nbutton.detourrButton:hover {\n color: rgb(56, 56, 56);\n}\n\nbutton.detourrButton.resetButton {\n top: 15px;\n border: 5px;\n}\n\nbutton.detourrButton.panButton {\n top: 50px;\n border: 5px;\n}\n\nbutton.detourrButton.orbitButton {\n top: 85px;\n border: 5px;\n}\n\nbutton.detourrButton.selectButton {\n top: 120px;\n border: 5px;\n}\n\nbutton.detourrButton.brushButton {\n top: 155px;\n border: 5px;\n}\n\nbutton.detourrButton.exportButton {\n top: 225px;\n border: 5px;\n}\n\n\nbutton.detourrButton.unselected {\n color: rgb(75, 75, 75);\n}\n\nbutton.detourrButton.selected {\n color: rgb(44, 44, 240);\n}\n\ninput.colourSelector {\n position: absolute;\n top: 190px;\n left: 13px;\n width: 22px;\n height: 22px;\n}\n\n.scatterWidgetContainer {\n position: relative;\n overflow: hidden;\n}\n\n.scatterWidgetCanvas {\n position: relative;\n}\n\n.selectionBox {\n border: 1px solid #55aaff;\n background-color: rgba(75, 160, 255, 0.3);\n position: absolute;\n}\n\ndiv.axisLabel {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: absolute;\n font-family: Helvetica, Sans-serif;\n pointer-events: none;\n}\n\ndiv.detourrTooltip {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n pointer-events: none;\n position: absolute;\n top: 0px;\n left: 0px;\n background: rgba(0, 0, 0, 0.5);\n padding: 5px;\n visibility: hidden;\n border-radius: 5px;\n color: white;\n font-family: sans-serif;\n user-select: none;\n}\n\ndiv.detourrTooltip.visible {\n visibility: visible;\n}\n\ndiv.timelineContainer {\n position: absolute;\n left: 10px;\n right: 10px;\n}\n\ndiv.timeline {\n position: absolute;\n left: 50px;\n right: 20px;\n background-color: rgba(0, 0, 0, 0.7);\n border-radius: 5px;\n z-index: 0;\n}\n\ndiv.scrubber {\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n cursor: move;\n left: 0px;\n z-index: 1;\n}\n\ndiv.basisIndicator {\n position: absolute;\n background-color: rgb(255, 255, 255);\n border-radius: 50%;\n z-index: 0.5;\n}\n\ndiv.scrubber.active {\n cursor: move;\n}\n",""]);const a=r},3645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,o,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(i)for(var a=0;a0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},8081:t=>{"use strict";t.exports=function(t){return t[1]}},8329:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>m});var i=n(3379),o=n.n(i),s=n(7795),r=n.n(s),a=n(569),c=n.n(a),l=n(3565),u=n.n(l),h=n(9216),d=n.n(h),p=n(4589),f=n.n(p),g=n(5138),v={};v.styleTagTransform=f(),v.setAttributes=u(),v.insert=c().bind(null,"head"),v.domAPI=r(),v.insertStyleElement=d(),o()(g.Z,v);const m=g.Z&&g.Z.locals?g.Z.locals:void 0},3379:t=>{"use strict";var e=[];function n(t){for(var n=-1,i=0;i{"use strict";var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},9216:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},3565:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},7795:t=>{"use strict";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},4589:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},4658:function(t,e,n){"use strict";var i,o=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&s(e,t,n);return r(e,t),e},c=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DisplaySage3d=void 0;var l=n(5629),u=c(n(8911)),h=a(n(356)),d=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}return o(e,t),e.prototype.cumulative_radial_3d=function(t,e,n){return Math.pow((0,u.default)(Math.pow(t,2)/Math.pow(e,2),1.5,(n-1)/2),1/3)},e.prototype.scaleRadii=function(t){for(var e,n,i,o=t.dataSync(),s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ScatterControls=void 0;var i=n(370),o=n(2212),s=function(){function t(t){var e=this;this.widget=t,this.container=document.createElement("div"),this.widget.container.appendChild(this.container),this.resetButton=this.widget.resetButtonAction?this.createButton("resetButton","Reset camera position",i.resetIcon,(function(){e.widget.resetButtonAction(),e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.panButton=this.widget.panButtonAction?this.createButton("panButton","Switch to pan controls",i.panIcon,(function(){e.setSelectedButton(e.panButton),e.widget.panButtonAction()})):null,this.orbitButton=this.widget.orbitButtonAction?this.createButton("orbitButton","Switch to orbit controls",i.orbitIcon,(function(){e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.selectButton=this.widget.selectButtonAction?this.createButton("selectButton","Switch to selection controls",i.selectIcon,(function(){e.setSelectedButton(e.selectButton),e.widget.selectButtonAction()})):null,this.widget.brushButtonAction&&(this.brushButton=this.createButton("brushButton","Colour selected points",i.brushIcon,(function(){return e.widget.brushButtonAction()})),this.addColourSelector()),this.exportButton=this.widget.exportButtonAction?this.createButton("exportButton","Export data as csv with current brushed colours",i.downloadIcon,(function(){e.widget.exportButtonAction()})):null,this.setSelectedButton(this.orbitButton),this.widget.orbitButtonAction()}return t.prototype.getSelectedColour=function(){return new o.Color(this.colourSelector.value)},t.prototype.clear=function(){this.widget.container.removeChild(this.container)},t.prototype.createButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t),o.onclick=function(){return i()},this.container.appendChild(o),o},t.prototype.setSelectedButton=function(t){t.className=t.className+" selected",this.selectedButton&&(this.selectedButton.className=this.selectedButton.className.slice(0,-9)),this.selectedButton=t},t.prototype.addColourSelector=function(){var t=this,e=document.createElement("input");e.setAttribute("type","color"),e.className="colourSelector",e.setAttribute("value","#619CFF"),e.setAttribute("title","Select colour to apply using selection box"),e.addEventListener("change",(function(){return t.widget.brushButtonAction()})),this.container.appendChild(e),this.colourSelector=e},t}();e.ScatterControls=s},370:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.downloadIcon=e.orbitIcon=e.brushIcon=e.selectIcon=e.panIcon=e.resetIcon=e.playIcon=e.pauseIcon=void 0,e.pauseIcon='\n\n',e.playIcon='\n\n',e.resetIcon='\n\n',e.panIcon='\n',e.selectIcon='\n\n',e.brushIcon='\n\n',e.orbitIcon='\n\n',e.downloadIcon='\n\x3c!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. --\x3e\n'},8919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DisplayScatter=void 0;var i=n(3190);Object.defineProperty(e,"DisplayScatter",{enumerable:!0,get:function(){return i.DisplayScatter}})},1224:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionHelper=void 0;var i=n(2212),o=function(){function t(t){var e=this;this.startPoint=new i.Vector2,this.pointTopLeft=new i.Vector2,this.pointBottomRight=new i.Vector2,this.widget=t,this.element=document.createElement("div"),this.element.className="selectionBox",this.element.style.pointerEvents="none",this.isDown=!1,this.widget.container.addEventListener("pointerdown",(function(t){e.onSelectStart(t)})),this.widget.container.addEventListener("pointermove",(function(t){e.isDown&&e.onSelectMove(t)})),this.widget.container.addEventListener("pointerup",(function(t){e.isDown&&(e.isDown=!1,e.onSelectOver(t))}))}return t.prototype.disable=function(){this.enabled=!1},t.prototype.enable=function(){this.enabled=!0},t.prototype.scaleX=function(){return this.widget.canvas.clientWidth/this.widget.canvas.getBoundingClientRect().width},t.prototype.scaleY=function(){return this.widget.canvas.clientHeight/this.widget.canvas.getBoundingClientRect().height},t.prototype.onSelectStart=function(t){if(this.enabled&&t.target===this.widget.canvas){this.isDown=!0,this.widget.container.appendChild(this.element);var e=this.widget.canvas.getBoundingClientRect();this.element.style.left=(t.clientX-e.left)*this.scaleX()+"px",this.element.style.top=(t.clientY-e.top)*this.scaleY()+"px",this.element.style.width="0px",this.element.style.height="0px",this.startPoint.x=(t.clientX-e.left)*this.scaleX(),this.startPoint.y=(t.clientY-e.top)*this.scaleY()}},t.prototype.onSelectMove=function(t){if(this.enabled){var e=this.widget.canvas.getBoundingClientRect();this.pointBottomRight.x=Math.max(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointBottomRight.y=Math.max(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.pointTopLeft.x=Math.min(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointTopLeft.y=Math.min(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.element.style.left=this.pointTopLeft.x+"px",this.element.style.top=this.pointTopLeft.y+"px",this.element.style.width=this.pointBottomRight.x-this.pointTopLeft.x+"px",this.element.style.height=this.pointBottomRight.y-this.pointTopLeft.y+"px"}},t.prototype.onSelectOver=function(t){this.enabled&&(this.onSelectMove(t),this.widget.setPointSelectionFromBox(this.pointTopLeft,this.pointBottomRight,t.shiftKey),this.element.parentElement.removeChild(this.element))},t}();e.SelectionHelper=o},4814:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FRAGMENT_SHADER=void 0,e.FRAGMENT_SHADER="\nvarying float vSize;\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\nvarying float vShrink; // shrink points when picking\n\nvoid main(){\n // 1.0 if picking else vAlpha\n float alpha = 1.0 - (1.0 - vPicking) * (1.0 - vAlpha);\n gl_FragColor = vec4(vColor, alpha);\n\n // make points circular\n float distance = length(2.0 * gl_PointCoord - 1.0);\n if (distance > 1.0) {\n discard;\n }\n}\n"},3190:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}c((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,i=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)for(var i=0,o=0;o>16&255)/255,t[e+1]=(n>>8&255)/255,t[e+2]=(255&n)/255,e+=3;return new l.BufferAttribute(t,3)},t.prototype.addAxisLabels=function(){var t=this,e=this.renderer.getPixelRatio();this.config.axisLabels==[]?this.hasAxisLabels=!1:(this.hasAxisLabels=!0,this.axisLabels=this.config.axisLabels.map((function(n){return new f.AxisLabel(n,[0,0,0],t.container,t.canvas,t.camera,t.dim,e)})))},t.prototype.addSleepEventListeners=function(){var t=this;this.container.addEventListener("mouseover",(function(){return t.wakeEventListener()})),this.container.addEventListener("scroll",(function(){return t.wakeEventListener()})),this.container.addEventListener("keydown",(function(){return t.wakeEventListener()})),this.container.addEventListener("mouseleave",(function(){return t.sleepEventListener()}))},t.prototype.setPointSelectionFromBox=function(t,e,n){var i=this,o=this.pickingTexture,s=this.renderer,r=s.getPixelRatio(),a=t.x*r,c=e.y*r,l=(e.x-t.x)*r,u=(e.y-t.y)*r,h=new Uint8Array(4*l*u);this.points.geometry.setAttribute("color",this.pickingColours),this.points.material.uniforms.picking.value=1,this.points.material.uniforms.shrink.value=1,this.renderer.setRenderTarget(this.pickingTexture),this.renderer.render(this.scene,this.camera),s.readRenderTargetPixels(o,a,o.height-c,l,u,h),this.renderer.setRenderTarget(null),this.points.geometry.setAttribute("color",this.pointColours),this.points.material.uniforms.picking.value=0,this.points.material.uniforms.shrink.value=0;for(var d,p=new Set,f=0;f=this.config.duration&&(this.time=0);var n=Math.floor(this.time*this.config.fps);if(this.currentFrame=n,n!=this.oldFrame){if(this.currentFrameBuffer=this.getPointsBuffer(n%this.projectionMatrices.length),this.points.geometry.setAttribute("position",this.currentFrameBuffer),this.hasAxes&&this.axisSegments.geometry.setAttribute("position",this.getAxisLinesBuffer(n)),this.hasEdges){var i=this.getEdgesBuffer(this.currentFrameBuffer);this.edgeSegments.geometry.setAttribute("position",i)}this.oldFrame=n,this.timeline.updatePosition(n/(this.projectionMatrices.length-1))}this.adjustPointSizeFromZoom&&this.adjustPointSizeFromZoom(),this.renderer.render(this.scene,this.camera),this.points.geometry.setAttribute("color",this.pickingColours),this.points.material.uniforms.picking.value=1,this.renderer.setRenderTarget(this.pickingTexture),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null),this.points.geometry.setAttribute("color",this.pointColours),this.points.material.uniforms.picking.value=0,this.hasAxisLabels&&this.axisLabels.map((function(e,i){return e.updatePosition(t.projectionMatrices[n].arraySync()[i],t.camera)})),this.isSleeping||requestAnimationFrame((function(){return t.animate()}))},t.prototype.getIsPaused=function(){return this.isPaused},t.prototype.setIsPaused=function(t){this.isPaused=t,t||this.animate(),this.timeline.updatePlayPauseIcon(t)},t.prototype.setSleep=function(t){this.isSleeping=t},t.prototype.setTime=function(t){this.time=this.config.duration*t},t.prototype.getBasisIndices=function(){return this.config.basisIndices},t.prototype.getNumAnimationFrames=function(){return this.projectionMatrices.length},t.prototype.sleepEventListener=function(){this.isPaused&&this.setSleep(!0)},t.prototype.wakeEventListener=function(){this.isSleeping&&(this.setSleep(!1),this.animate())},t.prototype.setSelectedPointColour=function(){for(var t=this.controls.getSelectedColour(),e=0,n=this.selectedPointIndices;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;var i=n(370),o=function(){function t(t){this.scrubberWidth=16,this.timelineThickness=4,this.hasBasisIndicators=!0,this.basisIndicators=[],this.basisIndicatorDiameter=4,this.mouseDown=!1,this.widget=t,this.parentDiv=t.container,this.canvas=t.canvas,this.addContainer(),this.addTimeline(),this.addScrubber(),this.addPlayPauseButton(),this.addBasisIndicators(),this.addEventListeners(),this.addTooltip()}return t.prototype.updatePosition=function(t){this.mouseDown||(this.scrubber.style.left=Math.floor(this.timelineWidth*t)+"px")},t.prototype.updatePlayPauseIcon=function(t){this.playPauseButton.innerHTML=t?i.playIcon:i.pauseIcon},t.prototype.addButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t,"Button"),o.onclick=function(){return i()},o},t.prototype.getElement=function(){return this.container},t.prototype.resize=function(t,e){if(this.container.style.top=t-40+"px",this.timelineWidth=this.timeline.offsetWidth-this.scrubberWidth,this.hasBasisIndicators)for(var n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERTEX_SHADER_3D=void 0,e.VERTEX_SHADER_3D="\nuniform float size;\nuniform float picking;\n// shrink when picking with box, but not on hover\nuniform float shrink; \n\nattribute vec3 color;\nattribute float alpha;\n\n// passed to fragment shader\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\nvarying float vShrink;\n\nvoid main(){\n vColor = color;\n vAlpha = alpha;\n vPicking = picking;\n vShrink = shrink;\n \n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = 2.0 * shrink + (200.0 * size / -mvPosition.z) * (1.0 - shrink);\n}\n"},7256:()=>{},2578:()=>{},2980:()=>{},4862:()=>{},7958:()=>{},5410:()=>{},8628:()=>{},5042:()=>{}},t=>(t.O(0,[440,841,470,691,558],(()=>(4658,t(t.s=4658)))),t.O())])})); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/show_scatter_2d.bundle.js b/inst/htmlwidgets/lib/show_scatter_2d.bundle.js index 5cc9620..f729d58 100644 --- a/inst/htmlwidgets/lib/show_scatter_2d.bundle.js +++ b/inst/htmlwidgets/lib/show_scatter_2d.bundle.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.show_scatter_2d=e():t.show_scatter_2d=e()}(self,(function(){return(self.webpackChunk_name_=self.webpackChunk_name_||[]).push([[348],{5138:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var i=n(8081),o=n.n(i),s=n(3645),r=n.n(s)()(o());r.push([t.id,"button.detourrButton {\n background-color: transparent;\n position: absolute;\n color: rgb(0, 0, 0);\n text-align: center;\n width: 30px;\n height: 30px;\n border-color: transparent;\n left: 10px;\n padding-top: 0px;\n padding-right: 6px;\n}\n\nbutton.detourrButton:hover {\n color: rgb(56, 56, 56);\n}\n\nbutton.detourrButton.resetButton {\n top: 15px;\n border: 5px;\n}\n\nbutton.detourrButton.panButton {\n top: 50px;\n border: 5px;\n}\n\nbutton.detourrButton.orbitButton {\n top: 85px;\n border: 5px;\n}\n\nbutton.detourrButton.selectButton {\n top: 120px;\n border: 5px;\n}\n\nbutton.detourrButton.brushButton {\n top: 155px;\n border: 5px;\n}\n\nbutton.detourrButton.exportButton {\n top: 225px;\n border: 5px;\n}\n\n\nbutton.detourrButton.unselected {\n color: rgb(75, 75, 75);\n}\n\nbutton.detourrButton.selected {\n color: rgb(44, 44, 240);\n}\n\ninput.colourSelector {\n position: absolute;\n top: 190px;\n left: 13px;\n width: 22px;\n height: 22px;\n}\n\n.scatterWidgetContainer {\n position: relative;\n overflow: hidden;\n}\n\n.scatterWidgetCanvas {\n position: relative;\n}\n\n.selectionBox {\n border: 1px solid #55aaff;\n background-color: rgba(75, 160, 255, 0.3);\n position: absolute;\n}\n\ndiv.axisLabel {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: absolute;\n font-family: Helvetica, Sans-serif;\n pointer-events: none;\n}\n\ndiv.detourrTooltip {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n pointer-events: none;\n position: absolute;\n top: 0px;\n left: 0px;\n background: rgba(0, 0, 0, 0.5);\n padding: 5px;\n visibility: hidden;\n border-radius: 5px;\n color: white;\n font-family: sans-serif;\n user-select: none;\n}\n\ndiv.detourrTooltip.visible {\n visibility: visible;\n}\n\ndiv.timelineContainer {\n position: absolute;\n left: 10px;\n right: 10px;\n}\n\ndiv.timeline {\n position: absolute;\n left: 50px;\n right: 20px;\n background-color: rgba(0, 0, 0, 0.7);\n border-radius: 5px;\n z-index: 0;\n}\n\ndiv.scrubber {\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n cursor: move;\n left: 0px;\n z-index: 1;\n}\n\ndiv.basisIndicator {\n position: absolute;\n background-color: rgb(255, 255, 255);\n border-radius: 50%;\n z-index: 0.5;\n}\n\ndiv.scrubber.active {\n cursor: move;\n}\n",""]);const a=r},3645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,o,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(i)for(var a=0;a0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},8081:t=>{"use strict";t.exports=function(t){return t[1]}},8329:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>v});var i=n(3379),o=n.n(i),s=n(7795),r=n.n(s),a=n(569),c=n.n(a),l=n(3565),u=n.n(l),h=n(9216),d=n.n(h),p=n(4589),f=n.n(p),m=n(5138),g={};g.styleTagTransform=f(),g.setAttributes=u(),g.insert=c().bind(null,"head"),g.domAPI=r(),g.insertStyleElement=d(),o()(m.Z,g);const v=m.Z&&m.Z.locals?m.Z.locals:void 0},3379:t=>{"use strict";var e=[];function n(t){for(var n=-1,i=0;i{"use strict";var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},9216:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},3565:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},7795:t=>{"use strict";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},4589:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},5535:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.AxisLabel=void 0;var r=s(n(2212)),a=function(){function t(t,e,n,i,o,s,a){this.div=document.createElement("div"),this.div.innerHTML=t,this.div.className="axisLabel",this.canvas=i,this.text=t,this.position=new r.Vector3,this.dim=s,this.dpr=a,this.container=n,n.appendChild(this.div),this.updatePosition(e,o)}return t.prototype.updatePosition=function(t,e){this.position.set(t[0],t[1],t[2]);var n=this.get2DCoords(e);this.div.style.left=n.x+"px",this.div.style.top=n.y+"px"},t.prototype.setDpr=function(t){this.dpr=t},t.prototype.clear=function(){this.container.removeChild(this.div)},t.prototype.get2DCoords=function(t){var e=this.position.project(t);return e.x=(e.x+1)*this.canvas.width/(2*this.dpr),e.y=-(e.y-1)*this.canvas.height/(2*this.dpr),e},t}();e.AxisLabel=a},8370:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ScatterControls=void 0;var i=n(370),o=n(2212),s=function(){function t(t){var e=this;this.widget=t,this.container=document.createElement("div"),this.widget.container.appendChild(this.container),this.resetButton=this.widget.resetButtonAction?this.createButton("resetButton","Reset camera position",i.resetIcon,(function(){e.widget.resetButtonAction(),e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.panButton=this.widget.panButtonAction?this.createButton("panButton","Switch to pan controls",i.panIcon,(function(){e.setSelectedButton(e.panButton),e.widget.panButtonAction()})):null,this.orbitButton=this.widget.orbitButtonAction?this.createButton("orbitButton","Switch to orbit controls",i.orbitIcon,(function(){e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.selectButton=this.widget.selectButtonAction?this.createButton("selectButton","Switch to selection controls",i.selectIcon,(function(){e.setSelectedButton(e.selectButton),e.widget.selectButtonAction()})):null,this.widget.brushButtonAction&&(this.brushButton=this.createButton("brushButton","Colour selected points",i.brushIcon,(function(){return e.widget.brushButtonAction()})),this.addColourSelector()),this.exportButton=this.widget.exportButtonAction?this.createButton("exportButton","Export data as csv with current brushed colours",i.downloadIcon,(function(){e.widget.exportButtonAction()})):null,this.setSelectedButton(this.orbitButton),this.widget.orbitButtonAction()}return t.prototype.getSelectedColour=function(){return new o.Color(this.colourSelector.value)},t.prototype.clear=function(){this.widget.container.removeChild(this.container)},t.prototype.createButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t),o.onclick=function(){return i()},this.container.appendChild(o),o},t.prototype.setSelectedButton=function(t){t.className=t.className+" selected",this.selectedButton&&(this.selectedButton.className=this.selectedButton.className.slice(0,-9)),this.selectedButton=t},t.prototype.addColourSelector=function(){var t=this,e=document.createElement("input");e.setAttribute("type","color"),e.className="colourSelector",e.setAttribute("value","#619CFF"),e.setAttribute("title","Select colour to apply using selection box"),e.addEventListener("change",(function(){return t.widget.brushButtonAction()})),this.container.appendChild(e),this.colourSelector=e},t}();e.ScatterControls=s},370:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.downloadIcon=e.orbitIcon=e.brushIcon=e.selectIcon=e.panIcon=e.resetIcon=e.playIcon=e.pauseIcon=void 0,e.pauseIcon='\n\n',e.playIcon='\n\n',e.resetIcon='\n\n',e.panIcon='\n',e.selectIcon='\n\n',e.brushIcon='\n\n',e.orbitIcon='\n\n',e.downloadIcon='\n\x3c!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. --\x3e\n'},8919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DisplayScatter=void 0;var i=n(3190);Object.defineProperty(e,"DisplayScatter",{enumerable:!0,get:function(){return i.DisplayScatter}})},1224:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionHelper=void 0;var i=n(2212),o=function(){function t(t){var e=this;this.startPoint=new i.Vector2,this.pointTopLeft=new i.Vector2,this.pointBottomRight=new i.Vector2,this.widget=t,this.element=document.createElement("div"),this.element.className="selectionBox",this.element.style.pointerEvents="none",this.isDown=!1,this.widget.container.addEventListener("pointerdown",(function(t){e.onSelectStart(t)})),this.widget.container.addEventListener("pointermove",(function(t){e.isDown&&e.onSelectMove(t)})),this.widget.container.addEventListener("pointerup",(function(t){e.isDown&&(e.isDown=!1,e.onSelectOver(t))}))}return t.prototype.disable=function(){this.enabled=!1},t.prototype.enable=function(){this.enabled=!0},t.prototype.scaleX=function(){return this.widget.canvas.clientWidth/this.widget.canvas.getBoundingClientRect().width},t.prototype.scaleY=function(){return this.widget.canvas.clientHeight/this.widget.canvas.getBoundingClientRect().height},t.prototype.onSelectStart=function(t){if(this.enabled&&t.target===this.widget.canvas){this.isDown=!0,this.widget.container.appendChild(this.element);var e=this.widget.canvas.getBoundingClientRect();this.element.style.left=(t.clientX-e.left)*this.scaleX()+"px",this.element.style.top=(t.clientY-e.top)*this.scaleY()+"px",this.element.style.width="0px",this.element.style.height="0px",this.startPoint.x=(t.clientX-e.left)*this.scaleX(),this.startPoint.y=(t.clientY-e.top)*this.scaleY()}},t.prototype.onSelectMove=function(t){if(this.enabled){var e=this.widget.canvas.getBoundingClientRect();this.pointBottomRight.x=Math.max(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointBottomRight.y=Math.max(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.pointTopLeft.x=Math.min(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointTopLeft.y=Math.min(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.element.style.left=this.pointTopLeft.x+"px",this.element.style.top=this.pointTopLeft.y+"px",this.element.style.width=this.pointBottomRight.x-this.pointTopLeft.x+"px",this.element.style.height=this.pointBottomRight.y-this.pointTopLeft.y+"px"}},t.prototype.onSelectOver=function(t){this.enabled&&(this.onSelectMove(t),this.widget.setPointSelectionFromBox(this.pointTopLeft,this.pointBottomRight,t.shiftKey),this.element.parentElement.removeChild(this.element))},t}();e.SelectionHelper=o},4814:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FRAGMENT_SHADER=void 0,e.FRAGMENT_SHADER="\nvarying float vSize;\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\n\nvoid main(){\n // 1.0 if picking else vAlpha\n float alpha = 1.0 - (1.0 - vPicking) * (1.0 - vAlpha);\n gl_FragColor = vec4(vColor, alpha);\n\n // make points circular\n float distance = length(2.0 * gl_PointCoord - 1.0);\n if (distance > 1.0) {\n discard;\n }\n}\n"},3190:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}c((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,i=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)for(var i=0,o=0;o>16&255)/255,t[e+1]=(n>>8&255)/255,t[e+2]=(255&n)/255,e+=3;return new l.BufferAttribute(t,3)},t.prototype.addAxisLabels=function(){var t=this,e=this.renderer.getPixelRatio();this.config.axisLabels==[]?this.hasAxisLabels=!1:(this.hasAxisLabels=!0,this.axisLabels=this.config.axisLabels.map((function(n){return new f.AxisLabel(n,[0,0,0],t.container,t.canvas,t.camera,t.dim,e)})))},t.prototype.addSleepEventListeners=function(){var t=this;this.container.addEventListener("mouseover",(function(){return t.wakeEventListener()})),this.container.addEventListener("scroll",(function(){return t.wakeEventListener()})),this.container.addEventListener("keydown",(function(){return t.wakeEventListener()})),this.container.addEventListener("mouseleave",(function(){return t.sleepEventListener()}))},t.prototype.setPointSelectionFromBox=function(t,e,n){var i=this,o=this.pickingTexture,s=this.renderer,r=s.getPixelRatio(),a=t.x*r,c=e.y*r,l=(e.x-t.x)*r,u=(e.y-t.y)*r,h=new Uint8Array(4*l*u);s.readRenderTargetPixels(o,a,o.height-c,l,u,h);for(var d,p=new Set,f=0;f=this.config.duration&&(this.time=0);var n=Math.floor(this.time*this.config.fps);if(this.currentFrame=n,n!=this.oldFrame){if(this.currentFrameBuffer=this.getPointsBuffer(n%this.projectionMatrices.length),this.points.geometry.setAttribute("position",this.currentFrameBuffer),this.hasAxes&&this.axisSegments.geometry.setAttribute("position",this.getAxisLinesBuffer(n)),this.hasEdges){var i=this.getEdgesBuffer(this.currentFrameBuffer);this.edgeSegments.geometry.setAttribute("position",i)}this.oldFrame=n,this.timeline.updatePosition(n/(this.projectionMatrices.length-1))}this.adjustPointSizeFromZoom&&this.adjustPointSizeFromZoom(),this.renderer.render(this.scene,this.camera),this.points.geometry.setAttribute("color",this.pickingColours),this.points.material.uniforms.picking.value=1,this.renderer.setRenderTarget(this.pickingTexture),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null),this.points.geometry.setAttribute("color",this.pointColours),this.points.material.uniforms.picking.value=0,this.hasAxisLabels&&this.axisLabels.map((function(e,i){return e.updatePosition(t.projectionMatrices[n].arraySync()[i],t.camera)})),this.isSleeping||requestAnimationFrame((function(){return t.animate()}))},t.prototype.getIsPaused=function(){return this.isPaused},t.prototype.setIsPaused=function(t){this.isPaused=t,t||this.animate(),this.timeline.updatePlayPauseIcon(t)},t.prototype.setSleep=function(t){this.isSleeping=t},t.prototype.setTime=function(t){this.time=this.config.duration*t},t.prototype.getBasisIndices=function(){return this.config.basisIndices},t.prototype.getNumAnimationFrames=function(){return this.projectionMatrices.length},t.prototype.sleepEventListener=function(){this.isPaused&&this.setSleep(!0)},t.prototype.wakeEventListener=function(){this.isSleeping&&(this.setSleep(!1),this.animate())},t.prototype.setSelectedPointColour=function(){for(var t=this.controls.getSelectedColour(),e=0,n=this.selectedPointIndices;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;var i=n(370),o=function(){function t(t){this.scrubberWidth=16,this.timelineThickness=4,this.hasBasisIndicators=!0,this.basisIndicators=[],this.basisIndicatorDiameter=4,this.mouseDown=!1,this.widget=t,this.parentDiv=t.container,this.canvas=t.canvas,this.addContainer(),this.addTimeline(),this.addScrubber(),this.addPlayPauseButton(),this.addBasisIndicators(),this.addEventListeners(),this.addTooltip()}return t.prototype.updatePosition=function(t){this.mouseDown||(this.scrubber.style.left=Math.floor(this.timelineWidth*t)+"px")},t.prototype.updatePlayPauseIcon=function(t){this.playPauseButton.innerHTML=t?i.playIcon:i.pauseIcon},t.prototype.addButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t,"Button"),o.onclick=function(){return i()},o},t.prototype.getElement=function(){return this.container},t.prototype.resize=function(t,e){if(this.container.style.top=t-40+"px",this.timelineWidth=this.timeline.offsetWidth-this.scrubberWidth,this.hasBasisIndicators)for(var n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERTEX_SHADER_2D=void 0,e.VERTEX_SHADER_2D="\nuniform float size;\nuniform float zoom;\nuniform float picking;\n\nattribute float alpha;\nattribute vec3 color;\n\n// passed to fragment shader\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\n\nvoid main(){\n vColor = color;\n vAlpha = alpha;\n vPicking = picking;\n\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = 100.0 * size * sqrt(zoom);\n}\n"},7256:()=>{},2578:()=>{},2980:()=>{},4862:()=>{},7958:()=>{},5410:()=>{},8628:()=>{},5042:()=>{}},t=>(t.O(0,[440,841,470,691],(()=>(3282,t(t.s=3282)))),t.O())])})); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.show_scatter_2d=e():t.show_scatter_2d=e()}(self,(function(){return(self.webpackChunk_name_=self.webpackChunk_name_||[]).push([[348],{5138:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var i=n(8081),o=n.n(i),s=n(3645),r=n.n(s)()(o());r.push([t.id,"button.detourrButton {\n background-color: transparent;\n position: absolute;\n color: rgb(0, 0, 0);\n text-align: center;\n width: 30px;\n height: 30px;\n border-color: transparent;\n left: 10px;\n padding-top: 0px;\n padding-right: 6px;\n}\n\nbutton.detourrButton:hover {\n color: rgb(56, 56, 56);\n}\n\nbutton.detourrButton.resetButton {\n top: 15px;\n border: 5px;\n}\n\nbutton.detourrButton.panButton {\n top: 50px;\n border: 5px;\n}\n\nbutton.detourrButton.orbitButton {\n top: 85px;\n border: 5px;\n}\n\nbutton.detourrButton.selectButton {\n top: 120px;\n border: 5px;\n}\n\nbutton.detourrButton.brushButton {\n top: 155px;\n border: 5px;\n}\n\nbutton.detourrButton.exportButton {\n top: 225px;\n border: 5px;\n}\n\n\nbutton.detourrButton.unselected {\n color: rgb(75, 75, 75);\n}\n\nbutton.detourrButton.selected {\n color: rgb(44, 44, 240);\n}\n\ninput.colourSelector {\n position: absolute;\n top: 190px;\n left: 13px;\n width: 22px;\n height: 22px;\n}\n\n.scatterWidgetContainer {\n position: relative;\n overflow: hidden;\n}\n\n.scatterWidgetCanvas {\n position: relative;\n}\n\n.selectionBox {\n border: 1px solid #55aaff;\n background-color: rgba(75, 160, 255, 0.3);\n position: absolute;\n}\n\ndiv.axisLabel {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: absolute;\n font-family: Helvetica, Sans-serif;\n pointer-events: none;\n}\n\ndiv.detourrTooltip {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n pointer-events: none;\n position: absolute;\n top: 0px;\n left: 0px;\n background: rgba(0, 0, 0, 0.5);\n padding: 5px;\n visibility: hidden;\n border-radius: 5px;\n color: white;\n font-family: sans-serif;\n user-select: none;\n}\n\ndiv.detourrTooltip.visible {\n visibility: visible;\n}\n\ndiv.timelineContainer {\n position: absolute;\n left: 10px;\n right: 10px;\n}\n\ndiv.timeline {\n position: absolute;\n left: 50px;\n right: 20px;\n background-color: rgba(0, 0, 0, 0.7);\n border-radius: 5px;\n z-index: 0;\n}\n\ndiv.scrubber {\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n cursor: move;\n left: 0px;\n z-index: 1;\n}\n\ndiv.basisIndicator {\n position: absolute;\n background-color: rgb(255, 255, 255);\n border-radius: 50%;\n z-index: 0.5;\n}\n\ndiv.scrubber.active {\n cursor: move;\n}\n",""]);const a=r},3645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,o,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(i)for(var a=0;a0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},8081:t=>{"use strict";t.exports=function(t){return t[1]}},8329:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>v});var i=n(3379),o=n.n(i),s=n(7795),r=n.n(s),a=n(569),c=n.n(a),l=n(3565),u=n.n(l),h=n(9216),d=n.n(h),p=n(4589),f=n.n(p),m=n(5138),g={};g.styleTagTransform=f(),g.setAttributes=u(),g.insert=c().bind(null,"head"),g.domAPI=r(),g.insertStyleElement=d(),o()(m.Z,g);const v=m.Z&&m.Z.locals?m.Z.locals:void 0},3379:t=>{"use strict";var e=[];function n(t){for(var n=-1,i=0;i{"use strict";var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},9216:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},3565:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},7795:t=>{"use strict";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},4589:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},5535:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.AxisLabel=void 0;var r=s(n(2212)),a=function(){function t(t,e,n,i,o,s,a){this.div=document.createElement("div"),this.div.innerHTML=t,this.div.className="axisLabel",this.canvas=i,this.text=t,this.position=new r.Vector3,this.dim=s,this.dpr=a,this.container=n,n.appendChild(this.div),this.updatePosition(e,o)}return t.prototype.updatePosition=function(t,e){this.position.set(t[0],t[1],t[2]);var n=this.get2DCoords(e);this.div.style.left=n.x+"px",this.div.style.top=n.y+"px"},t.prototype.setDpr=function(t){this.dpr=t},t.prototype.clear=function(){this.container.removeChild(this.div)},t.prototype.get2DCoords=function(t){var e=this.position.project(t);return e.x=(e.x+1)*this.canvas.width/(2*this.dpr),e.y=-(e.y-1)*this.canvas.height/(2*this.dpr),e},t}();e.AxisLabel=a},8370:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ScatterControls=void 0;var i=n(370),o=n(2212),s=function(){function t(t){var e=this;this.widget=t,this.container=document.createElement("div"),this.widget.container.appendChild(this.container),this.resetButton=this.widget.resetButtonAction?this.createButton("resetButton","Reset camera position",i.resetIcon,(function(){e.widget.resetButtonAction(),e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.panButton=this.widget.panButtonAction?this.createButton("panButton","Switch to pan controls",i.panIcon,(function(){e.setSelectedButton(e.panButton),e.widget.panButtonAction()})):null,this.orbitButton=this.widget.orbitButtonAction?this.createButton("orbitButton","Switch to orbit controls",i.orbitIcon,(function(){e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.selectButton=this.widget.selectButtonAction?this.createButton("selectButton","Switch to selection controls",i.selectIcon,(function(){e.setSelectedButton(e.selectButton),e.widget.selectButtonAction()})):null,this.widget.brushButtonAction&&(this.brushButton=this.createButton("brushButton","Colour selected points",i.brushIcon,(function(){return e.widget.brushButtonAction()})),this.addColourSelector()),this.exportButton=this.widget.exportButtonAction?this.createButton("exportButton","Export data as csv with current brushed colours",i.downloadIcon,(function(){e.widget.exportButtonAction()})):null,this.setSelectedButton(this.orbitButton),this.widget.orbitButtonAction()}return t.prototype.getSelectedColour=function(){return new o.Color(this.colourSelector.value)},t.prototype.clear=function(){this.widget.container.removeChild(this.container)},t.prototype.createButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t),o.onclick=function(){return i()},this.container.appendChild(o),o},t.prototype.setSelectedButton=function(t){t.className=t.className+" selected",this.selectedButton&&(this.selectedButton.className=this.selectedButton.className.slice(0,-9)),this.selectedButton=t},t.prototype.addColourSelector=function(){var t=this,e=document.createElement("input");e.setAttribute("type","color"),e.className="colourSelector",e.setAttribute("value","#619CFF"),e.setAttribute("title","Select colour to apply using selection box"),e.addEventListener("change",(function(){return t.widget.brushButtonAction()})),this.container.appendChild(e),this.colourSelector=e},t}();e.ScatterControls=s},370:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.downloadIcon=e.orbitIcon=e.brushIcon=e.selectIcon=e.panIcon=e.resetIcon=e.playIcon=e.pauseIcon=void 0,e.pauseIcon='\n\n',e.playIcon='\n\n',e.resetIcon='\n\n',e.panIcon='\n',e.selectIcon='\n\n',e.brushIcon='\n\n',e.orbitIcon='\n\n',e.downloadIcon='\n\x3c!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. --\x3e\n'},8919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DisplayScatter=void 0;var i=n(3190);Object.defineProperty(e,"DisplayScatter",{enumerable:!0,get:function(){return i.DisplayScatter}})},1224:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionHelper=void 0;var i=n(2212),o=function(){function t(t){var e=this;this.startPoint=new i.Vector2,this.pointTopLeft=new i.Vector2,this.pointBottomRight=new i.Vector2,this.widget=t,this.element=document.createElement("div"),this.element.className="selectionBox",this.element.style.pointerEvents="none",this.isDown=!1,this.widget.container.addEventListener("pointerdown",(function(t){e.onSelectStart(t)})),this.widget.container.addEventListener("pointermove",(function(t){e.isDown&&e.onSelectMove(t)})),this.widget.container.addEventListener("pointerup",(function(t){e.isDown&&(e.isDown=!1,e.onSelectOver(t))}))}return t.prototype.disable=function(){this.enabled=!1},t.prototype.enable=function(){this.enabled=!0},t.prototype.scaleX=function(){return this.widget.canvas.clientWidth/this.widget.canvas.getBoundingClientRect().width},t.prototype.scaleY=function(){return this.widget.canvas.clientHeight/this.widget.canvas.getBoundingClientRect().height},t.prototype.onSelectStart=function(t){if(this.enabled&&t.target===this.widget.canvas){this.isDown=!0,this.widget.container.appendChild(this.element);var e=this.widget.canvas.getBoundingClientRect();this.element.style.left=(t.clientX-e.left)*this.scaleX()+"px",this.element.style.top=(t.clientY-e.top)*this.scaleY()+"px",this.element.style.width="0px",this.element.style.height="0px",this.startPoint.x=(t.clientX-e.left)*this.scaleX(),this.startPoint.y=(t.clientY-e.top)*this.scaleY()}},t.prototype.onSelectMove=function(t){if(this.enabled){var e=this.widget.canvas.getBoundingClientRect();this.pointBottomRight.x=Math.max(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointBottomRight.y=Math.max(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.pointTopLeft.x=Math.min(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointTopLeft.y=Math.min(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.element.style.left=this.pointTopLeft.x+"px",this.element.style.top=this.pointTopLeft.y+"px",this.element.style.width=this.pointBottomRight.x-this.pointTopLeft.x+"px",this.element.style.height=this.pointBottomRight.y-this.pointTopLeft.y+"px"}},t.prototype.onSelectOver=function(t){this.enabled&&(this.onSelectMove(t),this.widget.setPointSelectionFromBox(this.pointTopLeft,this.pointBottomRight,t.shiftKey),this.element.parentElement.removeChild(this.element))},t}();e.SelectionHelper=o},4814:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FRAGMENT_SHADER=void 0,e.FRAGMENT_SHADER="\nvarying float vSize;\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\nvarying float vShrink; // shrink points when picking\n\nvoid main(){\n // 1.0 if picking else vAlpha\n float alpha = 1.0 - (1.0 - vPicking) * (1.0 - vAlpha);\n gl_FragColor = vec4(vColor, alpha);\n\n // make points circular\n float distance = length(2.0 * gl_PointCoord - 1.0);\n if (distance > 1.0) {\n discard;\n }\n}\n"},3190:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}c((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,i=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)for(var i=0,o=0;o>16&255)/255,t[e+1]=(n>>8&255)/255,t[e+2]=(255&n)/255,e+=3;return new l.BufferAttribute(t,3)},t.prototype.addAxisLabels=function(){var t=this,e=this.renderer.getPixelRatio();this.config.axisLabels==[]?this.hasAxisLabels=!1:(this.hasAxisLabels=!0,this.axisLabels=this.config.axisLabels.map((function(n){return new f.AxisLabel(n,[0,0,0],t.container,t.canvas,t.camera,t.dim,e)})))},t.prototype.addSleepEventListeners=function(){var t=this;this.container.addEventListener("mouseover",(function(){return t.wakeEventListener()})),this.container.addEventListener("scroll",(function(){return t.wakeEventListener()})),this.container.addEventListener("keydown",(function(){return t.wakeEventListener()})),this.container.addEventListener("mouseleave",(function(){return t.sleepEventListener()}))},t.prototype.setPointSelectionFromBox=function(t,e,n){var i=this,o=this.pickingTexture,s=this.renderer,r=s.getPixelRatio(),a=t.x*r,c=e.y*r,l=(e.x-t.x)*r,u=(e.y-t.y)*r,h=new Uint8Array(4*l*u);this.points.geometry.setAttribute("color",this.pickingColours),this.points.material.uniforms.picking.value=1,this.points.material.uniforms.shrink.value=1,this.renderer.setRenderTarget(this.pickingTexture),this.renderer.render(this.scene,this.camera),s.readRenderTargetPixels(o,a,o.height-c,l,u,h),this.renderer.setRenderTarget(null),this.points.geometry.setAttribute("color",this.pointColours),this.points.material.uniforms.picking.value=0,this.points.material.uniforms.shrink.value=0;for(var d,p=new Set,f=0;f=this.config.duration&&(this.time=0);var n=Math.floor(this.time*this.config.fps);if(this.currentFrame=n,n!=this.oldFrame){if(this.currentFrameBuffer=this.getPointsBuffer(n%this.projectionMatrices.length),this.points.geometry.setAttribute("position",this.currentFrameBuffer),this.hasAxes&&this.axisSegments.geometry.setAttribute("position",this.getAxisLinesBuffer(n)),this.hasEdges){var i=this.getEdgesBuffer(this.currentFrameBuffer);this.edgeSegments.geometry.setAttribute("position",i)}this.oldFrame=n,this.timeline.updatePosition(n/(this.projectionMatrices.length-1))}this.adjustPointSizeFromZoom&&this.adjustPointSizeFromZoom(),this.renderer.render(this.scene,this.camera),this.points.geometry.setAttribute("color",this.pickingColours),this.points.material.uniforms.picking.value=1,this.renderer.setRenderTarget(this.pickingTexture),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null),this.points.geometry.setAttribute("color",this.pointColours),this.points.material.uniforms.picking.value=0,this.hasAxisLabels&&this.axisLabels.map((function(e,i){return e.updatePosition(t.projectionMatrices[n].arraySync()[i],t.camera)})),this.isSleeping||requestAnimationFrame((function(){return t.animate()}))},t.prototype.getIsPaused=function(){return this.isPaused},t.prototype.setIsPaused=function(t){this.isPaused=t,t||this.animate(),this.timeline.updatePlayPauseIcon(t)},t.prototype.setSleep=function(t){this.isSleeping=t},t.prototype.setTime=function(t){this.time=this.config.duration*t},t.prototype.getBasisIndices=function(){return this.config.basisIndices},t.prototype.getNumAnimationFrames=function(){return this.projectionMatrices.length},t.prototype.sleepEventListener=function(){this.isPaused&&this.setSleep(!0)},t.prototype.wakeEventListener=function(){this.isSleeping&&(this.setSleep(!1),this.animate())},t.prototype.setSelectedPointColour=function(){for(var t=this.controls.getSelectedColour(),e=0,n=this.selectedPointIndices;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;var i=n(370),o=function(){function t(t){this.scrubberWidth=16,this.timelineThickness=4,this.hasBasisIndicators=!0,this.basisIndicators=[],this.basisIndicatorDiameter=4,this.mouseDown=!1,this.widget=t,this.parentDiv=t.container,this.canvas=t.canvas,this.addContainer(),this.addTimeline(),this.addScrubber(),this.addPlayPauseButton(),this.addBasisIndicators(),this.addEventListeners(),this.addTooltip()}return t.prototype.updatePosition=function(t){this.mouseDown||(this.scrubber.style.left=Math.floor(this.timelineWidth*t)+"px")},t.prototype.updatePlayPauseIcon=function(t){this.playPauseButton.innerHTML=t?i.playIcon:i.pauseIcon},t.prototype.addButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t,"Button"),o.onclick=function(){return i()},o},t.prototype.getElement=function(){return this.container},t.prototype.resize=function(t,e){if(this.container.style.top=t-40+"px",this.timelineWidth=this.timeline.offsetWidth-this.scrubberWidth,this.hasBasisIndicators)for(var n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERTEX_SHADER_2D=void 0,e.VERTEX_SHADER_2D="\nuniform float size;\nuniform float zoom;\nuniform float picking;\nuniform float shrink;\n\nattribute float alpha;\nattribute vec3 color;\n\n// passed to fragment shader\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\nvarying float vShrink;\n\nvoid main(){\n vColor = color;\n vAlpha = alpha;\n vPicking = picking;\n vShrink = shrink;\n\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = 2.0 * shrink + (100.0 * size * sqrt(zoom)) * (1.0 - shrink);\n}\n"},7256:()=>{},2578:()=>{},2980:()=>{},4862:()=>{},7958:()=>{},5410:()=>{},8628:()=>{},5042:()=>{}},t=>(t.O(0,[440,841,470,691],(()=>(3282,t(t.s=3282)))),t.O())])})); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/show_scatter_3d.bundle.js b/inst/htmlwidgets/lib/show_scatter_3d.bundle.js index 184dad1..514c03f 100644 --- a/inst/htmlwidgets/lib/show_scatter_3d.bundle.js +++ b/inst/htmlwidgets/lib/show_scatter_3d.bundle.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.show_scatter_3d=e():t.show_scatter_3d=e()}(self,(function(){return(self.webpackChunk_name_=self.webpackChunk_name_||[]).push([[248],{5138:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var i=n(8081),o=n.n(i),s=n(3645),r=n.n(s)()(o());r.push([t.id,"button.detourrButton {\n background-color: transparent;\n position: absolute;\n color: rgb(0, 0, 0);\n text-align: center;\n width: 30px;\n height: 30px;\n border-color: transparent;\n left: 10px;\n padding-top: 0px;\n padding-right: 6px;\n}\n\nbutton.detourrButton:hover {\n color: rgb(56, 56, 56);\n}\n\nbutton.detourrButton.resetButton {\n top: 15px;\n border: 5px;\n}\n\nbutton.detourrButton.panButton {\n top: 50px;\n border: 5px;\n}\n\nbutton.detourrButton.orbitButton {\n top: 85px;\n border: 5px;\n}\n\nbutton.detourrButton.selectButton {\n top: 120px;\n border: 5px;\n}\n\nbutton.detourrButton.brushButton {\n top: 155px;\n border: 5px;\n}\n\nbutton.detourrButton.exportButton {\n top: 225px;\n border: 5px;\n}\n\n\nbutton.detourrButton.unselected {\n color: rgb(75, 75, 75);\n}\n\nbutton.detourrButton.selected {\n color: rgb(44, 44, 240);\n}\n\ninput.colourSelector {\n position: absolute;\n top: 190px;\n left: 13px;\n width: 22px;\n height: 22px;\n}\n\n.scatterWidgetContainer {\n position: relative;\n overflow: hidden;\n}\n\n.scatterWidgetCanvas {\n position: relative;\n}\n\n.selectionBox {\n border: 1px solid #55aaff;\n background-color: rgba(75, 160, 255, 0.3);\n position: absolute;\n}\n\ndiv.axisLabel {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: absolute;\n font-family: Helvetica, Sans-serif;\n pointer-events: none;\n}\n\ndiv.detourrTooltip {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n pointer-events: none;\n position: absolute;\n top: 0px;\n left: 0px;\n background: rgba(0, 0, 0, 0.5);\n padding: 5px;\n visibility: hidden;\n border-radius: 5px;\n color: white;\n font-family: sans-serif;\n user-select: none;\n}\n\ndiv.detourrTooltip.visible {\n visibility: visible;\n}\n\ndiv.timelineContainer {\n position: absolute;\n left: 10px;\n right: 10px;\n}\n\ndiv.timeline {\n position: absolute;\n left: 50px;\n right: 20px;\n background-color: rgba(0, 0, 0, 0.7);\n border-radius: 5px;\n z-index: 0;\n}\n\ndiv.scrubber {\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n cursor: move;\n left: 0px;\n z-index: 1;\n}\n\ndiv.basisIndicator {\n position: absolute;\n background-color: rgb(255, 255, 255);\n border-radius: 50%;\n z-index: 0.5;\n}\n\ndiv.scrubber.active {\n cursor: move;\n}\n",""]);const a=r},3645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,o,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(i)for(var a=0;a0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},8081:t=>{"use strict";t.exports=function(t){return t[1]}},8329:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>m});var i=n(3379),o=n.n(i),s=n(7795),r=n.n(s),a=n(569),c=n.n(a),l=n(3565),u=n.n(l),h=n(9216),d=n.n(h),p=n(4589),f=n.n(p),g=n(5138),v={};v.styleTagTransform=f(),v.setAttributes=u(),v.insert=c().bind(null,"head"),v.domAPI=r(),v.insertStyleElement=d(),o()(g.Z,v);const m=g.Z&&g.Z.locals?g.Z.locals:void 0},3379:t=>{"use strict";var e=[];function n(t){for(var n=-1,i=0;i{"use strict";var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},9216:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},3565:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},7795:t=>{"use strict";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},4589:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},5535:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.AxisLabel=void 0;var r=s(n(2212)),a=function(){function t(t,e,n,i,o,s,a){this.div=document.createElement("div"),this.div.innerHTML=t,this.div.className="axisLabel",this.canvas=i,this.text=t,this.position=new r.Vector3,this.dim=s,this.dpr=a,this.container=n,n.appendChild(this.div),this.updatePosition(e,o)}return t.prototype.updatePosition=function(t,e){this.position.set(t[0],t[1],t[2]);var n=this.get2DCoords(e);this.div.style.left=n.x+"px",this.div.style.top=n.y+"px"},t.prototype.setDpr=function(t){this.dpr=t},t.prototype.clear=function(){this.container.removeChild(this.div)},t.prototype.get2DCoords=function(t){var e=this.position.project(t);return e.x=(e.x+1)*this.canvas.width/(2*this.dpr),e.y=-(e.y-1)*this.canvas.height/(2*this.dpr),e},t}();e.AxisLabel=a},8370:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ScatterControls=void 0;var i=n(370),o=n(2212),s=function(){function t(t){var e=this;this.widget=t,this.container=document.createElement("div"),this.widget.container.appendChild(this.container),this.resetButton=this.widget.resetButtonAction?this.createButton("resetButton","Reset camera position",i.resetIcon,(function(){e.widget.resetButtonAction(),e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.panButton=this.widget.panButtonAction?this.createButton("panButton","Switch to pan controls",i.panIcon,(function(){e.setSelectedButton(e.panButton),e.widget.panButtonAction()})):null,this.orbitButton=this.widget.orbitButtonAction?this.createButton("orbitButton","Switch to orbit controls",i.orbitIcon,(function(){e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.selectButton=this.widget.selectButtonAction?this.createButton("selectButton","Switch to selection controls",i.selectIcon,(function(){e.setSelectedButton(e.selectButton),e.widget.selectButtonAction()})):null,this.widget.brushButtonAction&&(this.brushButton=this.createButton("brushButton","Colour selected points",i.brushIcon,(function(){return e.widget.brushButtonAction()})),this.addColourSelector()),this.exportButton=this.widget.exportButtonAction?this.createButton("exportButton","Export data as csv with current brushed colours",i.downloadIcon,(function(){e.widget.exportButtonAction()})):null,this.setSelectedButton(this.orbitButton),this.widget.orbitButtonAction()}return t.prototype.getSelectedColour=function(){return new o.Color(this.colourSelector.value)},t.prototype.clear=function(){this.widget.container.removeChild(this.container)},t.prototype.createButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t),o.onclick=function(){return i()},this.container.appendChild(o),o},t.prototype.setSelectedButton=function(t){t.className=t.className+" selected",this.selectedButton&&(this.selectedButton.className=this.selectedButton.className.slice(0,-9)),this.selectedButton=t},t.prototype.addColourSelector=function(){var t=this,e=document.createElement("input");e.setAttribute("type","color"),e.className="colourSelector",e.setAttribute("value","#619CFF"),e.setAttribute("title","Select colour to apply using selection box"),e.addEventListener("change",(function(){return t.widget.brushButtonAction()})),this.container.appendChild(e),this.colourSelector=e},t}();e.ScatterControls=s},370:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.downloadIcon=e.orbitIcon=e.brushIcon=e.selectIcon=e.panIcon=e.resetIcon=e.playIcon=e.pauseIcon=void 0,e.pauseIcon='\n\n',e.playIcon='\n\n',e.resetIcon='\n\n',e.panIcon='\n',e.selectIcon='\n\n',e.brushIcon='\n\n',e.orbitIcon='\n\n',e.downloadIcon='\n\x3c!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. --\x3e\n'},8919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DisplayScatter=void 0;var i=n(3190);Object.defineProperty(e,"DisplayScatter",{enumerable:!0,get:function(){return i.DisplayScatter}})},1224:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionHelper=void 0;var i=n(2212),o=function(){function t(t){var e=this;this.startPoint=new i.Vector2,this.pointTopLeft=new i.Vector2,this.pointBottomRight=new i.Vector2,this.widget=t,this.element=document.createElement("div"),this.element.className="selectionBox",this.element.style.pointerEvents="none",this.isDown=!1,this.widget.container.addEventListener("pointerdown",(function(t){e.onSelectStart(t)})),this.widget.container.addEventListener("pointermove",(function(t){e.isDown&&e.onSelectMove(t)})),this.widget.container.addEventListener("pointerup",(function(t){e.isDown&&(e.isDown=!1,e.onSelectOver(t))}))}return t.prototype.disable=function(){this.enabled=!1},t.prototype.enable=function(){this.enabled=!0},t.prototype.scaleX=function(){return this.widget.canvas.clientWidth/this.widget.canvas.getBoundingClientRect().width},t.prototype.scaleY=function(){return this.widget.canvas.clientHeight/this.widget.canvas.getBoundingClientRect().height},t.prototype.onSelectStart=function(t){if(this.enabled&&t.target===this.widget.canvas){this.isDown=!0,this.widget.container.appendChild(this.element);var e=this.widget.canvas.getBoundingClientRect();this.element.style.left=(t.clientX-e.left)*this.scaleX()+"px",this.element.style.top=(t.clientY-e.top)*this.scaleY()+"px",this.element.style.width="0px",this.element.style.height="0px",this.startPoint.x=(t.clientX-e.left)*this.scaleX(),this.startPoint.y=(t.clientY-e.top)*this.scaleY()}},t.prototype.onSelectMove=function(t){if(this.enabled){var e=this.widget.canvas.getBoundingClientRect();this.pointBottomRight.x=Math.max(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointBottomRight.y=Math.max(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.pointTopLeft.x=Math.min(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointTopLeft.y=Math.min(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.element.style.left=this.pointTopLeft.x+"px",this.element.style.top=this.pointTopLeft.y+"px",this.element.style.width=this.pointBottomRight.x-this.pointTopLeft.x+"px",this.element.style.height=this.pointBottomRight.y-this.pointTopLeft.y+"px"}},t.prototype.onSelectOver=function(t){this.enabled&&(this.onSelectMove(t),this.widget.setPointSelectionFromBox(this.pointTopLeft,this.pointBottomRight,t.shiftKey),this.element.parentElement.removeChild(this.element))},t}();e.SelectionHelper=o},4814:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FRAGMENT_SHADER=void 0,e.FRAGMENT_SHADER="\nvarying float vSize;\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\n\nvoid main(){\n // 1.0 if picking else vAlpha\n float alpha = 1.0 - (1.0 - vPicking) * (1.0 - vAlpha);\n gl_FragColor = vec4(vColor, alpha);\n\n // make points circular\n float distance = length(2.0 * gl_PointCoord - 1.0);\n if (distance > 1.0) {\n discard;\n }\n}\n"},3190:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}c((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,i=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)for(var i=0,o=0;o>16&255)/255,t[e+1]=(n>>8&255)/255,t[e+2]=(255&n)/255,e+=3;return new l.BufferAttribute(t,3)},t.prototype.addAxisLabels=function(){var t=this,e=this.renderer.getPixelRatio();this.config.axisLabels==[]?this.hasAxisLabels=!1:(this.hasAxisLabels=!0,this.axisLabels=this.config.axisLabels.map((function(n){return new f.AxisLabel(n,[0,0,0],t.container,t.canvas,t.camera,t.dim,e)})))},t.prototype.addSleepEventListeners=function(){var t=this;this.container.addEventListener("mouseover",(function(){return t.wakeEventListener()})),this.container.addEventListener("scroll",(function(){return t.wakeEventListener()})),this.container.addEventListener("keydown",(function(){return t.wakeEventListener()})),this.container.addEventListener("mouseleave",(function(){return t.sleepEventListener()}))},t.prototype.setPointSelectionFromBox=function(t,e,n){var i=this,o=this.pickingTexture,s=this.renderer,r=s.getPixelRatio(),a=t.x*r,c=e.y*r,l=(e.x-t.x)*r,u=(e.y-t.y)*r,h=new Uint8Array(4*l*u);s.readRenderTargetPixels(o,a,o.height-c,l,u,h);for(var d,p=new Set,f=0;f=this.config.duration&&(this.time=0);var n=Math.floor(this.time*this.config.fps);if(this.currentFrame=n,n!=this.oldFrame){if(this.currentFrameBuffer=this.getPointsBuffer(n%this.projectionMatrices.length),this.points.geometry.setAttribute("position",this.currentFrameBuffer),this.hasAxes&&this.axisSegments.geometry.setAttribute("position",this.getAxisLinesBuffer(n)),this.hasEdges){var i=this.getEdgesBuffer(this.currentFrameBuffer);this.edgeSegments.geometry.setAttribute("position",i)}this.oldFrame=n,this.timeline.updatePosition(n/(this.projectionMatrices.length-1))}this.adjustPointSizeFromZoom&&this.adjustPointSizeFromZoom(),this.renderer.render(this.scene,this.camera),this.points.geometry.setAttribute("color",this.pickingColours),this.points.material.uniforms.picking.value=1,this.renderer.setRenderTarget(this.pickingTexture),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null),this.points.geometry.setAttribute("color",this.pointColours),this.points.material.uniforms.picking.value=0,this.hasAxisLabels&&this.axisLabels.map((function(e,i){return e.updatePosition(t.projectionMatrices[n].arraySync()[i],t.camera)})),this.isSleeping||requestAnimationFrame((function(){return t.animate()}))},t.prototype.getIsPaused=function(){return this.isPaused},t.prototype.setIsPaused=function(t){this.isPaused=t,t||this.animate(),this.timeline.updatePlayPauseIcon(t)},t.prototype.setSleep=function(t){this.isSleeping=t},t.prototype.setTime=function(t){this.time=this.config.duration*t},t.prototype.getBasisIndices=function(){return this.config.basisIndices},t.prototype.getNumAnimationFrames=function(){return this.projectionMatrices.length},t.prototype.sleepEventListener=function(){this.isPaused&&this.setSleep(!0)},t.prototype.wakeEventListener=function(){this.isSleeping&&(this.setSleep(!1),this.animate())},t.prototype.setSelectedPointColour=function(){for(var t=this.controls.getSelectedColour(),e=0,n=this.selectedPointIndices;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;var i=n(370),o=function(){function t(t){this.scrubberWidth=16,this.timelineThickness=4,this.hasBasisIndicators=!0,this.basisIndicators=[],this.basisIndicatorDiameter=4,this.mouseDown=!1,this.widget=t,this.parentDiv=t.container,this.canvas=t.canvas,this.addContainer(),this.addTimeline(),this.addScrubber(),this.addPlayPauseButton(),this.addBasisIndicators(),this.addEventListeners(),this.addTooltip()}return t.prototype.updatePosition=function(t){this.mouseDown||(this.scrubber.style.left=Math.floor(this.timelineWidth*t)+"px")},t.prototype.updatePlayPauseIcon=function(t){this.playPauseButton.innerHTML=t?i.playIcon:i.pauseIcon},t.prototype.addButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t,"Button"),o.onclick=function(){return i()},o},t.prototype.getElement=function(){return this.container},t.prototype.resize=function(t,e){if(this.container.style.top=t-40+"px",this.timelineWidth=this.timeline.offsetWidth-this.scrubberWidth,this.hasBasisIndicators)for(var n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERTEX_SHADER_3D=void 0,e.VERTEX_SHADER_3D="\nuniform float size;\nuniform float picking;\n\nattribute vec3 color;\nattribute float alpha;\n\n// passed to fragment shader\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\n\nvoid main(){\n vColor = color;\n vAlpha = alpha;\n vPicking = picking;\n \n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = 200.0 * size / -mvPosition.z;\n}\n"},7256:()=>{},2578:()=>{},2980:()=>{},4862:()=>{},7958:()=>{},5410:()=>{},8628:()=>{},5042:()=>{}},t=>(t.O(0,[440,841,470,691],(()=>(5629,t(t.s=5629)))),t.O())])})); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.show_scatter_3d=e():t.show_scatter_3d=e()}(self,(function(){return(self.webpackChunk_name_=self.webpackChunk_name_||[]).push([[248],{5138:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var i=n(8081),o=n.n(i),s=n(3645),r=n.n(s)()(o());r.push([t.id,"button.detourrButton {\n background-color: transparent;\n position: absolute;\n color: rgb(0, 0, 0);\n text-align: center;\n width: 30px;\n height: 30px;\n border-color: transparent;\n left: 10px;\n padding-top: 0px;\n padding-right: 6px;\n}\n\nbutton.detourrButton:hover {\n color: rgb(56, 56, 56);\n}\n\nbutton.detourrButton.resetButton {\n top: 15px;\n border: 5px;\n}\n\nbutton.detourrButton.panButton {\n top: 50px;\n border: 5px;\n}\n\nbutton.detourrButton.orbitButton {\n top: 85px;\n border: 5px;\n}\n\nbutton.detourrButton.selectButton {\n top: 120px;\n border: 5px;\n}\n\nbutton.detourrButton.brushButton {\n top: 155px;\n border: 5px;\n}\n\nbutton.detourrButton.exportButton {\n top: 225px;\n border: 5px;\n}\n\n\nbutton.detourrButton.unselected {\n color: rgb(75, 75, 75);\n}\n\nbutton.detourrButton.selected {\n color: rgb(44, 44, 240);\n}\n\ninput.colourSelector {\n position: absolute;\n top: 190px;\n left: 13px;\n width: 22px;\n height: 22px;\n}\n\n.scatterWidgetContainer {\n position: relative;\n overflow: hidden;\n}\n\n.scatterWidgetCanvas {\n position: relative;\n}\n\n.selectionBox {\n border: 1px solid #55aaff;\n background-color: rgba(75, 160, 255, 0.3);\n position: absolute;\n}\n\ndiv.axisLabel {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: absolute;\n font-family: Helvetica, Sans-serif;\n pointer-events: none;\n}\n\ndiv.detourrTooltip {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n pointer-events: none;\n position: absolute;\n top: 0px;\n left: 0px;\n background: rgba(0, 0, 0, 0.5);\n padding: 5px;\n visibility: hidden;\n border-radius: 5px;\n color: white;\n font-family: sans-serif;\n user-select: none;\n}\n\ndiv.detourrTooltip.visible {\n visibility: visible;\n}\n\ndiv.timelineContainer {\n position: absolute;\n left: 10px;\n right: 10px;\n}\n\ndiv.timeline {\n position: absolute;\n left: 50px;\n right: 20px;\n background-color: rgba(0, 0, 0, 0.7);\n border-radius: 5px;\n z-index: 0;\n}\n\ndiv.scrubber {\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n cursor: move;\n left: 0px;\n z-index: 1;\n}\n\ndiv.basisIndicator {\n position: absolute;\n background-color: rgb(255, 255, 255);\n border-radius: 50%;\n z-index: 0.5;\n}\n\ndiv.scrubber.active {\n cursor: move;\n}\n",""]);const a=r},3645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,o,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(i)for(var a=0;a0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},8081:t=>{"use strict";t.exports=function(t){return t[1]}},8329:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>m});var i=n(3379),o=n.n(i),s=n(7795),r=n.n(s),a=n(569),c=n.n(a),l=n(3565),u=n.n(l),h=n(9216),d=n.n(h),p=n(4589),f=n.n(p),g=n(5138),v={};v.styleTagTransform=f(),v.setAttributes=u(),v.insert=c().bind(null,"head"),v.domAPI=r(),v.insertStyleElement=d(),o()(g.Z,v);const m=g.Z&&g.Z.locals?g.Z.locals:void 0},3379:t=>{"use strict";var e=[];function n(t){for(var n=-1,i=0;i{"use strict";var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},9216:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},3565:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},7795:t=>{"use strict";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},4589:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},5535:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.AxisLabel=void 0;var r=s(n(2212)),a=function(){function t(t,e,n,i,o,s,a){this.div=document.createElement("div"),this.div.innerHTML=t,this.div.className="axisLabel",this.canvas=i,this.text=t,this.position=new r.Vector3,this.dim=s,this.dpr=a,this.container=n,n.appendChild(this.div),this.updatePosition(e,o)}return t.prototype.updatePosition=function(t,e){this.position.set(t[0],t[1],t[2]);var n=this.get2DCoords(e);this.div.style.left=n.x+"px",this.div.style.top=n.y+"px"},t.prototype.setDpr=function(t){this.dpr=t},t.prototype.clear=function(){this.container.removeChild(this.div)},t.prototype.get2DCoords=function(t){var e=this.position.project(t);return e.x=(e.x+1)*this.canvas.width/(2*this.dpr),e.y=-(e.y-1)*this.canvas.height/(2*this.dpr),e},t}();e.AxisLabel=a},8370:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ScatterControls=void 0;var i=n(370),o=n(2212),s=function(){function t(t){var e=this;this.widget=t,this.container=document.createElement("div"),this.widget.container.appendChild(this.container),this.resetButton=this.widget.resetButtonAction?this.createButton("resetButton","Reset camera position",i.resetIcon,(function(){e.widget.resetButtonAction(),e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.panButton=this.widget.panButtonAction?this.createButton("panButton","Switch to pan controls",i.panIcon,(function(){e.setSelectedButton(e.panButton),e.widget.panButtonAction()})):null,this.orbitButton=this.widget.orbitButtonAction?this.createButton("orbitButton","Switch to orbit controls",i.orbitIcon,(function(){e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.selectButton=this.widget.selectButtonAction?this.createButton("selectButton","Switch to selection controls",i.selectIcon,(function(){e.setSelectedButton(e.selectButton),e.widget.selectButtonAction()})):null,this.widget.brushButtonAction&&(this.brushButton=this.createButton("brushButton","Colour selected points",i.brushIcon,(function(){return e.widget.brushButtonAction()})),this.addColourSelector()),this.exportButton=this.widget.exportButtonAction?this.createButton("exportButton","Export data as csv with current brushed colours",i.downloadIcon,(function(){e.widget.exportButtonAction()})):null,this.setSelectedButton(this.orbitButton),this.widget.orbitButtonAction()}return t.prototype.getSelectedColour=function(){return new o.Color(this.colourSelector.value)},t.prototype.clear=function(){this.widget.container.removeChild(this.container)},t.prototype.createButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t),o.onclick=function(){return i()},this.container.appendChild(o),o},t.prototype.setSelectedButton=function(t){t.className=t.className+" selected",this.selectedButton&&(this.selectedButton.className=this.selectedButton.className.slice(0,-9)),this.selectedButton=t},t.prototype.addColourSelector=function(){var t=this,e=document.createElement("input");e.setAttribute("type","color"),e.className="colourSelector",e.setAttribute("value","#619CFF"),e.setAttribute("title","Select colour to apply using selection box"),e.addEventListener("change",(function(){return t.widget.brushButtonAction()})),this.container.appendChild(e),this.colourSelector=e},t}();e.ScatterControls=s},370:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.downloadIcon=e.orbitIcon=e.brushIcon=e.selectIcon=e.panIcon=e.resetIcon=e.playIcon=e.pauseIcon=void 0,e.pauseIcon='\n\n',e.playIcon='\n\n',e.resetIcon='\n\n',e.panIcon='\n',e.selectIcon='\n\n',e.brushIcon='\n\n',e.orbitIcon='\n\n',e.downloadIcon='\n\x3c!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. --\x3e\n'},8919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DisplayScatter=void 0;var i=n(3190);Object.defineProperty(e,"DisplayScatter",{enumerable:!0,get:function(){return i.DisplayScatter}})},1224:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionHelper=void 0;var i=n(2212),o=function(){function t(t){var e=this;this.startPoint=new i.Vector2,this.pointTopLeft=new i.Vector2,this.pointBottomRight=new i.Vector2,this.widget=t,this.element=document.createElement("div"),this.element.className="selectionBox",this.element.style.pointerEvents="none",this.isDown=!1,this.widget.container.addEventListener("pointerdown",(function(t){e.onSelectStart(t)})),this.widget.container.addEventListener("pointermove",(function(t){e.isDown&&e.onSelectMove(t)})),this.widget.container.addEventListener("pointerup",(function(t){e.isDown&&(e.isDown=!1,e.onSelectOver(t))}))}return t.prototype.disable=function(){this.enabled=!1},t.prototype.enable=function(){this.enabled=!0},t.prototype.scaleX=function(){return this.widget.canvas.clientWidth/this.widget.canvas.getBoundingClientRect().width},t.prototype.scaleY=function(){return this.widget.canvas.clientHeight/this.widget.canvas.getBoundingClientRect().height},t.prototype.onSelectStart=function(t){if(this.enabled&&t.target===this.widget.canvas){this.isDown=!0,this.widget.container.appendChild(this.element);var e=this.widget.canvas.getBoundingClientRect();this.element.style.left=(t.clientX-e.left)*this.scaleX()+"px",this.element.style.top=(t.clientY-e.top)*this.scaleY()+"px",this.element.style.width="0px",this.element.style.height="0px",this.startPoint.x=(t.clientX-e.left)*this.scaleX(),this.startPoint.y=(t.clientY-e.top)*this.scaleY()}},t.prototype.onSelectMove=function(t){if(this.enabled){var e=this.widget.canvas.getBoundingClientRect();this.pointBottomRight.x=Math.max(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointBottomRight.y=Math.max(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.pointTopLeft.x=Math.min(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointTopLeft.y=Math.min(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.element.style.left=this.pointTopLeft.x+"px",this.element.style.top=this.pointTopLeft.y+"px",this.element.style.width=this.pointBottomRight.x-this.pointTopLeft.x+"px",this.element.style.height=this.pointBottomRight.y-this.pointTopLeft.y+"px"}},t.prototype.onSelectOver=function(t){this.enabled&&(this.onSelectMove(t),this.widget.setPointSelectionFromBox(this.pointTopLeft,this.pointBottomRight,t.shiftKey),this.element.parentElement.removeChild(this.element))},t}();e.SelectionHelper=o},4814:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FRAGMENT_SHADER=void 0,e.FRAGMENT_SHADER="\nvarying float vSize;\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\nvarying float vShrink; // shrink points when picking\n\nvoid main(){\n // 1.0 if picking else vAlpha\n float alpha = 1.0 - (1.0 - vPicking) * (1.0 - vAlpha);\n gl_FragColor = vec4(vColor, alpha);\n\n // make points circular\n float distance = length(2.0 * gl_PointCoord - 1.0);\n if (distance > 1.0) {\n discard;\n }\n}\n"},3190:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}c((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,i=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)for(var i=0,o=0;o>16&255)/255,t[e+1]=(n>>8&255)/255,t[e+2]=(255&n)/255,e+=3;return new l.BufferAttribute(t,3)},t.prototype.addAxisLabels=function(){var t=this,e=this.renderer.getPixelRatio();this.config.axisLabels==[]?this.hasAxisLabels=!1:(this.hasAxisLabels=!0,this.axisLabels=this.config.axisLabels.map((function(n){return new f.AxisLabel(n,[0,0,0],t.container,t.canvas,t.camera,t.dim,e)})))},t.prototype.addSleepEventListeners=function(){var t=this;this.container.addEventListener("mouseover",(function(){return t.wakeEventListener()})),this.container.addEventListener("scroll",(function(){return t.wakeEventListener()})),this.container.addEventListener("keydown",(function(){return t.wakeEventListener()})),this.container.addEventListener("mouseleave",(function(){return t.sleepEventListener()}))},t.prototype.setPointSelectionFromBox=function(t,e,n){var i=this,o=this.pickingTexture,s=this.renderer,r=s.getPixelRatio(),a=t.x*r,c=e.y*r,l=(e.x-t.x)*r,u=(e.y-t.y)*r,h=new Uint8Array(4*l*u);this.points.geometry.setAttribute("color",this.pickingColours),this.points.material.uniforms.picking.value=1,this.points.material.uniforms.shrink.value=1,this.renderer.setRenderTarget(this.pickingTexture),this.renderer.render(this.scene,this.camera),s.readRenderTargetPixels(o,a,o.height-c,l,u,h),this.renderer.setRenderTarget(null),this.points.geometry.setAttribute("color",this.pointColours),this.points.material.uniforms.picking.value=0,this.points.material.uniforms.shrink.value=0;for(var d,p=new Set,f=0;f=this.config.duration&&(this.time=0);var n=Math.floor(this.time*this.config.fps);if(this.currentFrame=n,n!=this.oldFrame){if(this.currentFrameBuffer=this.getPointsBuffer(n%this.projectionMatrices.length),this.points.geometry.setAttribute("position",this.currentFrameBuffer),this.hasAxes&&this.axisSegments.geometry.setAttribute("position",this.getAxisLinesBuffer(n)),this.hasEdges){var i=this.getEdgesBuffer(this.currentFrameBuffer);this.edgeSegments.geometry.setAttribute("position",i)}this.oldFrame=n,this.timeline.updatePosition(n/(this.projectionMatrices.length-1))}this.adjustPointSizeFromZoom&&this.adjustPointSizeFromZoom(),this.renderer.render(this.scene,this.camera),this.points.geometry.setAttribute("color",this.pickingColours),this.points.material.uniforms.picking.value=1,this.renderer.setRenderTarget(this.pickingTexture),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null),this.points.geometry.setAttribute("color",this.pointColours),this.points.material.uniforms.picking.value=0,this.hasAxisLabels&&this.axisLabels.map((function(e,i){return e.updatePosition(t.projectionMatrices[n].arraySync()[i],t.camera)})),this.isSleeping||requestAnimationFrame((function(){return t.animate()}))},t.prototype.getIsPaused=function(){return this.isPaused},t.prototype.setIsPaused=function(t){this.isPaused=t,t||this.animate(),this.timeline.updatePlayPauseIcon(t)},t.prototype.setSleep=function(t){this.isSleeping=t},t.prototype.setTime=function(t){this.time=this.config.duration*t},t.prototype.getBasisIndices=function(){return this.config.basisIndices},t.prototype.getNumAnimationFrames=function(){return this.projectionMatrices.length},t.prototype.sleepEventListener=function(){this.isPaused&&this.setSleep(!0)},t.prototype.wakeEventListener=function(){this.isSleeping&&(this.setSleep(!1),this.animate())},t.prototype.setSelectedPointColour=function(){for(var t=this.controls.getSelectedColour(),e=0,n=this.selectedPointIndices;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;var i=n(370),o=function(){function t(t){this.scrubberWidth=16,this.timelineThickness=4,this.hasBasisIndicators=!0,this.basisIndicators=[],this.basisIndicatorDiameter=4,this.mouseDown=!1,this.widget=t,this.parentDiv=t.container,this.canvas=t.canvas,this.addContainer(),this.addTimeline(),this.addScrubber(),this.addPlayPauseButton(),this.addBasisIndicators(),this.addEventListeners(),this.addTooltip()}return t.prototype.updatePosition=function(t){this.mouseDown||(this.scrubber.style.left=Math.floor(this.timelineWidth*t)+"px")},t.prototype.updatePlayPauseIcon=function(t){this.playPauseButton.innerHTML=t?i.playIcon:i.pauseIcon},t.prototype.addButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t,"Button"),o.onclick=function(){return i()},o},t.prototype.getElement=function(){return this.container},t.prototype.resize=function(t,e){if(this.container.style.top=t-40+"px",this.timelineWidth=this.timeline.offsetWidth-this.scrubberWidth,this.hasBasisIndicators)for(var n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERTEX_SHADER_3D=void 0,e.VERTEX_SHADER_3D="\nuniform float size;\nuniform float picking;\n// shrink when picking with box, but not on hover\nuniform float shrink; \n\nattribute vec3 color;\nattribute float alpha;\n\n// passed to fragment shader\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\nvarying float vShrink;\n\nvoid main(){\n vColor = color;\n vAlpha = alpha;\n vPicking = picking;\n vShrink = shrink;\n \n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = 2.0 * shrink + (200.0 * size / -mvPosition.z) * (1.0 - shrink);\n}\n"},7256:()=>{},2578:()=>{},2980:()=>{},4862:()=>{},7958:()=>{},5410:()=>{},8628:()=>{},5042:()=>{}},t=>(t.O(0,[440,841,470,691],(()=>(5629,t(t.s=5629)))),t.O())])})); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/show_slice_2d.bundle.js b/inst/htmlwidgets/lib/show_slice_2d.bundle.js index 8d2ab8a..ebf1fba 100644 --- a/inst/htmlwidgets/lib/show_slice_2d.bundle.js +++ b/inst/htmlwidgets/lib/show_slice_2d.bundle.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.show_slice_2d=e():t.show_slice_2d=e()}(self,(function(){return(self.webpackChunk_name_=self.webpackChunk_name_||[]).push([[139,348],{5138:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var i=n(8081),o=n.n(i),s=n(3645),r=n.n(s)()(o());r.push([t.id,"button.detourrButton {\n background-color: transparent;\n position: absolute;\n color: rgb(0, 0, 0);\n text-align: center;\n width: 30px;\n height: 30px;\n border-color: transparent;\n left: 10px;\n padding-top: 0px;\n padding-right: 6px;\n}\n\nbutton.detourrButton:hover {\n color: rgb(56, 56, 56);\n}\n\nbutton.detourrButton.resetButton {\n top: 15px;\n border: 5px;\n}\n\nbutton.detourrButton.panButton {\n top: 50px;\n border: 5px;\n}\n\nbutton.detourrButton.orbitButton {\n top: 85px;\n border: 5px;\n}\n\nbutton.detourrButton.selectButton {\n top: 120px;\n border: 5px;\n}\n\nbutton.detourrButton.brushButton {\n top: 155px;\n border: 5px;\n}\n\nbutton.detourrButton.exportButton {\n top: 225px;\n border: 5px;\n}\n\n\nbutton.detourrButton.unselected {\n color: rgb(75, 75, 75);\n}\n\nbutton.detourrButton.selected {\n color: rgb(44, 44, 240);\n}\n\ninput.colourSelector {\n position: absolute;\n top: 190px;\n left: 13px;\n width: 22px;\n height: 22px;\n}\n\n.scatterWidgetContainer {\n position: relative;\n overflow: hidden;\n}\n\n.scatterWidgetCanvas {\n position: relative;\n}\n\n.selectionBox {\n border: 1px solid #55aaff;\n background-color: rgba(75, 160, 255, 0.3);\n position: absolute;\n}\n\ndiv.axisLabel {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: absolute;\n font-family: Helvetica, Sans-serif;\n pointer-events: none;\n}\n\ndiv.detourrTooltip {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n pointer-events: none;\n position: absolute;\n top: 0px;\n left: 0px;\n background: rgba(0, 0, 0, 0.5);\n padding: 5px;\n visibility: hidden;\n border-radius: 5px;\n color: white;\n font-family: sans-serif;\n user-select: none;\n}\n\ndiv.detourrTooltip.visible {\n visibility: visible;\n}\n\ndiv.timelineContainer {\n position: absolute;\n left: 10px;\n right: 10px;\n}\n\ndiv.timeline {\n position: absolute;\n left: 50px;\n right: 20px;\n background-color: rgba(0, 0, 0, 0.7);\n border-radius: 5px;\n z-index: 0;\n}\n\ndiv.scrubber {\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n cursor: move;\n left: 0px;\n z-index: 1;\n}\n\ndiv.basisIndicator {\n position: absolute;\n background-color: rgb(255, 255, 255);\n border-radius: 50%;\n z-index: 0.5;\n}\n\ndiv.scrubber.active {\n cursor: move;\n}\n",""]);const a=r},3645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,o,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(i)for(var a=0;a0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},8081:t=>{"use strict";t.exports=function(t){return t[1]}},8329:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>g});var i=n(3379),o=n.n(i),s=n(7795),r=n.n(s),a=n(569),c=n.n(a),l=n(3565),u=n.n(l),h=n(9216),d=n.n(h),p=n(4589),f=n.n(p),m=n(5138),v={};v.styleTagTransform=f(),v.setAttributes=u(),v.insert=c().bind(null,"head"),v.domAPI=r(),v.insertStyleElement=d(),o()(m.Z,v);const g=m.Z&&m.Z.locals?m.Z.locals:void 0},3379:t=>{"use strict";var e=[];function n(t){for(var n=-1,i=0;i{"use strict";var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},9216:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},3565:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},7795:t=>{"use strict";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},4589:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},5535:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.AxisLabel=void 0;var r=s(n(2212)),a=function(){function t(t,e,n,i,o,s,a){this.div=document.createElement("div"),this.div.innerHTML=t,this.div.className="axisLabel",this.canvas=i,this.text=t,this.position=new r.Vector3,this.dim=s,this.dpr=a,this.container=n,n.appendChild(this.div),this.updatePosition(e,o)}return t.prototype.updatePosition=function(t,e){this.position.set(t[0],t[1],t[2]);var n=this.get2DCoords(e);this.div.style.left=n.x+"px",this.div.style.top=n.y+"px"},t.prototype.setDpr=function(t){this.dpr=t},t.prototype.clear=function(){this.container.removeChild(this.div)},t.prototype.get2DCoords=function(t){var e=this.position.project(t);return e.x=(e.x+1)*this.canvas.width/(2*this.dpr),e.y=-(e.y-1)*this.canvas.height/(2*this.dpr),e},t}();e.AxisLabel=a},8370:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ScatterControls=void 0;var i=n(370),o=n(2212),s=function(){function t(t){var e=this;this.widget=t,this.container=document.createElement("div"),this.widget.container.appendChild(this.container),this.resetButton=this.widget.resetButtonAction?this.createButton("resetButton","Reset camera position",i.resetIcon,(function(){e.widget.resetButtonAction(),e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.panButton=this.widget.panButtonAction?this.createButton("panButton","Switch to pan controls",i.panIcon,(function(){e.setSelectedButton(e.panButton),e.widget.panButtonAction()})):null,this.orbitButton=this.widget.orbitButtonAction?this.createButton("orbitButton","Switch to orbit controls",i.orbitIcon,(function(){e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.selectButton=this.widget.selectButtonAction?this.createButton("selectButton","Switch to selection controls",i.selectIcon,(function(){e.setSelectedButton(e.selectButton),e.widget.selectButtonAction()})):null,this.widget.brushButtonAction&&(this.brushButton=this.createButton("brushButton","Colour selected points",i.brushIcon,(function(){return e.widget.brushButtonAction()})),this.addColourSelector()),this.exportButton=this.widget.exportButtonAction?this.createButton("exportButton","Export data as csv with current brushed colours",i.downloadIcon,(function(){e.widget.exportButtonAction()})):null,this.setSelectedButton(this.orbitButton),this.widget.orbitButtonAction()}return t.prototype.getSelectedColour=function(){return new o.Color(this.colourSelector.value)},t.prototype.clear=function(){this.widget.container.removeChild(this.container)},t.prototype.createButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t),o.onclick=function(){return i()},this.container.appendChild(o),o},t.prototype.setSelectedButton=function(t){t.className=t.className+" selected",this.selectedButton&&(this.selectedButton.className=this.selectedButton.className.slice(0,-9)),this.selectedButton=t},t.prototype.addColourSelector=function(){var t=this,e=document.createElement("input");e.setAttribute("type","color"),e.className="colourSelector",e.setAttribute("value","#619CFF"),e.setAttribute("title","Select colour to apply using selection box"),e.addEventListener("change",(function(){return t.widget.brushButtonAction()})),this.container.appendChild(e),this.colourSelector=e},t}();e.ScatterControls=s},370:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.downloadIcon=e.orbitIcon=e.brushIcon=e.selectIcon=e.panIcon=e.resetIcon=e.playIcon=e.pauseIcon=void 0,e.pauseIcon='\n\n',e.playIcon='\n\n',e.resetIcon='\n\n',e.panIcon='\n',e.selectIcon='\n\n',e.brushIcon='\n\n',e.orbitIcon='\n\n',e.downloadIcon='\n\x3c!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. --\x3e\n'},8919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DisplayScatter=void 0;var i=n(3190);Object.defineProperty(e,"DisplayScatter",{enumerable:!0,get:function(){return i.DisplayScatter}})},1224:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionHelper=void 0;var i=n(2212),o=function(){function t(t){var e=this;this.startPoint=new i.Vector2,this.pointTopLeft=new i.Vector2,this.pointBottomRight=new i.Vector2,this.widget=t,this.element=document.createElement("div"),this.element.className="selectionBox",this.element.style.pointerEvents="none",this.isDown=!1,this.widget.container.addEventListener("pointerdown",(function(t){e.onSelectStart(t)})),this.widget.container.addEventListener("pointermove",(function(t){e.isDown&&e.onSelectMove(t)})),this.widget.container.addEventListener("pointerup",(function(t){e.isDown&&(e.isDown=!1,e.onSelectOver(t))}))}return t.prototype.disable=function(){this.enabled=!1},t.prototype.enable=function(){this.enabled=!0},t.prototype.scaleX=function(){return this.widget.canvas.clientWidth/this.widget.canvas.getBoundingClientRect().width},t.prototype.scaleY=function(){return this.widget.canvas.clientHeight/this.widget.canvas.getBoundingClientRect().height},t.prototype.onSelectStart=function(t){if(this.enabled&&t.target===this.widget.canvas){this.isDown=!0,this.widget.container.appendChild(this.element);var e=this.widget.canvas.getBoundingClientRect();this.element.style.left=(t.clientX-e.left)*this.scaleX()+"px",this.element.style.top=(t.clientY-e.top)*this.scaleY()+"px",this.element.style.width="0px",this.element.style.height="0px",this.startPoint.x=(t.clientX-e.left)*this.scaleX(),this.startPoint.y=(t.clientY-e.top)*this.scaleY()}},t.prototype.onSelectMove=function(t){if(this.enabled){var e=this.widget.canvas.getBoundingClientRect();this.pointBottomRight.x=Math.max(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointBottomRight.y=Math.max(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.pointTopLeft.x=Math.min(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointTopLeft.y=Math.min(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.element.style.left=this.pointTopLeft.x+"px",this.element.style.top=this.pointTopLeft.y+"px",this.element.style.width=this.pointBottomRight.x-this.pointTopLeft.x+"px",this.element.style.height=this.pointBottomRight.y-this.pointTopLeft.y+"px"}},t.prototype.onSelectOver=function(t){this.enabled&&(this.onSelectMove(t),this.widget.setPointSelectionFromBox(this.pointTopLeft,this.pointBottomRight,t.shiftKey),this.element.parentElement.removeChild(this.element))},t}();e.SelectionHelper=o},4814:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FRAGMENT_SHADER=void 0,e.FRAGMENT_SHADER="\nvarying float vSize;\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\n\nvoid main(){\n // 1.0 if picking else vAlpha\n float alpha = 1.0 - (1.0 - vPicking) * (1.0 - vAlpha);\n gl_FragColor = vec4(vColor, alpha);\n\n // make points circular\n float distance = length(2.0 * gl_PointCoord - 1.0);\n if (distance > 1.0) {\n discard;\n }\n}\n"},3190:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}c((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,i=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)for(var i=0,o=0;o>16&255)/255,t[e+1]=(n>>8&255)/255,t[e+2]=(255&n)/255,e+=3;return new l.BufferAttribute(t,3)},t.prototype.addAxisLabels=function(){var t=this,e=this.renderer.getPixelRatio();this.config.axisLabels==[]?this.hasAxisLabels=!1:(this.hasAxisLabels=!0,this.axisLabels=this.config.axisLabels.map((function(n){return new f.AxisLabel(n,[0,0,0],t.container,t.canvas,t.camera,t.dim,e)})))},t.prototype.addSleepEventListeners=function(){var t=this;this.container.addEventListener("mouseover",(function(){return t.wakeEventListener()})),this.container.addEventListener("scroll",(function(){return t.wakeEventListener()})),this.container.addEventListener("keydown",(function(){return t.wakeEventListener()})),this.container.addEventListener("mouseleave",(function(){return t.sleepEventListener()}))},t.prototype.setPointSelectionFromBox=function(t,e,n){var i=this,o=this.pickingTexture,s=this.renderer,r=s.getPixelRatio(),a=t.x*r,c=e.y*r,l=(e.x-t.x)*r,u=(e.y-t.y)*r,h=new Uint8Array(4*l*u);s.readRenderTargetPixels(o,a,o.height-c,l,u,h);for(var d,p=new Set,f=0;f=this.config.duration&&(this.time=0);var n=Math.floor(this.time*this.config.fps);if(this.currentFrame=n,n!=this.oldFrame){if(this.currentFrameBuffer=this.getPointsBuffer(n%this.projectionMatrices.length),this.points.geometry.setAttribute("position",this.currentFrameBuffer),this.hasAxes&&this.axisSegments.geometry.setAttribute("position",this.getAxisLinesBuffer(n)),this.hasEdges){var i=this.getEdgesBuffer(this.currentFrameBuffer);this.edgeSegments.geometry.setAttribute("position",i)}this.oldFrame=n,this.timeline.updatePosition(n/(this.projectionMatrices.length-1))}this.adjustPointSizeFromZoom&&this.adjustPointSizeFromZoom(),this.renderer.render(this.scene,this.camera),this.points.geometry.setAttribute("color",this.pickingColours),this.points.material.uniforms.picking.value=1,this.renderer.setRenderTarget(this.pickingTexture),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null),this.points.geometry.setAttribute("color",this.pointColours),this.points.material.uniforms.picking.value=0,this.hasAxisLabels&&this.axisLabels.map((function(e,i){return e.updatePosition(t.projectionMatrices[n].arraySync()[i],t.camera)})),this.isSleeping||requestAnimationFrame((function(){return t.animate()}))},t.prototype.getIsPaused=function(){return this.isPaused},t.prototype.setIsPaused=function(t){this.isPaused=t,t||this.animate(),this.timeline.updatePlayPauseIcon(t)},t.prototype.setSleep=function(t){this.isSleeping=t},t.prototype.setTime=function(t){this.time=this.config.duration*t},t.prototype.getBasisIndices=function(){return this.config.basisIndices},t.prototype.getNumAnimationFrames=function(){return this.projectionMatrices.length},t.prototype.sleepEventListener=function(){this.isPaused&&this.setSleep(!0)},t.prototype.wakeEventListener=function(){this.isSleeping&&(this.setSleep(!1),this.animate())},t.prototype.setSelectedPointColour=function(){for(var t=this.controls.getSelectedColour(),e=0,n=this.selectedPointIndices;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;var i=n(370),o=function(){function t(t){this.scrubberWidth=16,this.timelineThickness=4,this.hasBasisIndicators=!0,this.basisIndicators=[],this.basisIndicatorDiameter=4,this.mouseDown=!1,this.widget=t,this.parentDiv=t.container,this.canvas=t.canvas,this.addContainer(),this.addTimeline(),this.addScrubber(),this.addPlayPauseButton(),this.addBasisIndicators(),this.addEventListeners(),this.addTooltip()}return t.prototype.updatePosition=function(t){this.mouseDown||(this.scrubber.style.left=Math.floor(this.timelineWidth*t)+"px")},t.prototype.updatePlayPauseIcon=function(t){this.playPauseButton.innerHTML=t?i.playIcon:i.pauseIcon},t.prototype.addButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t,"Button"),o.onclick=function(){return i()},o},t.prototype.getElement=function(){return this.container},t.prototype.resize=function(t,e){if(this.container.style.top=t-40+"px",this.timelineWidth=this.timeline.offsetWidth-this.scrubberWidth,this.hasBasisIndicators)for(var n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERTEX_SHADER_2D=void 0,e.VERTEX_SHADER_2D="\nuniform float size;\nuniform float zoom;\nuniform float picking;\n\nattribute float alpha;\nattribute vec3 color;\n\n// passed to fragment shader\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\n\nvoid main(){\n vColor = color;\n vAlpha = alpha;\n vPicking = picking;\n\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = 100.0 * size * sqrt(zoom);\n}\n"},3307:function(t,e,n){"use strict";var i,o=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&s(e,t,n);return r(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.DisplaySlice2d=void 0;var c=n(3282),l=a(n(356)),u=function(t){function e(e,n,i){var o=t.call(this,e,n,i)||this;return o.selectButtonAction=null,o.brushButtonAction=null,o}return o(e,t),e.prototype.preConstructPlotCallback=function(){this.anchor=l.expandDims(l.tensor(this.config.anchor),0)},e.prototype.project=function(t,e){var n=this,i=l.matMul(t,e),o=l.sub(t,this.anchor),s=l.sqrt(l.sum(l.square(l.sub(o,l.matMul(o,l.matMul(e,l.transpose(e))))),1)).dataSync();return this.pointAlphas.set(s.map((function(t){return t{},2578:()=>{},2980:()=>{},4862:()=>{},7958:()=>{},5410:()=>{},8628:()=>{},5042:()=>{}},t=>(t.O(0,[440,841,470,691],(()=>(3307,t(t.s=3307)))),t.O())])})); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.show_slice_2d=e():t.show_slice_2d=e()}(self,(function(){return(self.webpackChunk_name_=self.webpackChunk_name_||[]).push([[139,348],{5138:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var i=n(8081),o=n.n(i),s=n(3645),r=n.n(s)()(o());r.push([t.id,"button.detourrButton {\n background-color: transparent;\n position: absolute;\n color: rgb(0, 0, 0);\n text-align: center;\n width: 30px;\n height: 30px;\n border-color: transparent;\n left: 10px;\n padding-top: 0px;\n padding-right: 6px;\n}\n\nbutton.detourrButton:hover {\n color: rgb(56, 56, 56);\n}\n\nbutton.detourrButton.resetButton {\n top: 15px;\n border: 5px;\n}\n\nbutton.detourrButton.panButton {\n top: 50px;\n border: 5px;\n}\n\nbutton.detourrButton.orbitButton {\n top: 85px;\n border: 5px;\n}\n\nbutton.detourrButton.selectButton {\n top: 120px;\n border: 5px;\n}\n\nbutton.detourrButton.brushButton {\n top: 155px;\n border: 5px;\n}\n\nbutton.detourrButton.exportButton {\n top: 225px;\n border: 5px;\n}\n\n\nbutton.detourrButton.unselected {\n color: rgb(75, 75, 75);\n}\n\nbutton.detourrButton.selected {\n color: rgb(44, 44, 240);\n}\n\ninput.colourSelector {\n position: absolute;\n top: 190px;\n left: 13px;\n width: 22px;\n height: 22px;\n}\n\n.scatterWidgetContainer {\n position: relative;\n overflow: hidden;\n}\n\n.scatterWidgetCanvas {\n position: relative;\n}\n\n.selectionBox {\n border: 1px solid #55aaff;\n background-color: rgba(75, 160, 255, 0.3);\n position: absolute;\n}\n\ndiv.axisLabel {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: absolute;\n font-family: Helvetica, Sans-serif;\n pointer-events: none;\n}\n\ndiv.detourrTooltip {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n pointer-events: none;\n position: absolute;\n top: 0px;\n left: 0px;\n background: rgba(0, 0, 0, 0.5);\n padding: 5px;\n visibility: hidden;\n border-radius: 5px;\n color: white;\n font-family: sans-serif;\n user-select: none;\n}\n\ndiv.detourrTooltip.visible {\n visibility: visible;\n}\n\ndiv.timelineContainer {\n position: absolute;\n left: 10px;\n right: 10px;\n}\n\ndiv.timeline {\n position: absolute;\n left: 50px;\n right: 20px;\n background-color: rgba(0, 0, 0, 0.7);\n border-radius: 5px;\n z-index: 0;\n}\n\ndiv.scrubber {\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n cursor: move;\n left: 0px;\n z-index: 1;\n}\n\ndiv.basisIndicator {\n position: absolute;\n background-color: rgb(255, 255, 255);\n border-radius: 50%;\n z-index: 0.5;\n}\n\ndiv.scrubber.active {\n cursor: move;\n}\n",""]);const a=r},3645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,o,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(i)for(var a=0;a0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},8081:t=>{"use strict";t.exports=function(t){return t[1]}},8329:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>g});var i=n(3379),o=n.n(i),s=n(7795),r=n.n(s),a=n(569),c=n.n(a),l=n(3565),u=n.n(l),h=n(9216),d=n.n(h),p=n(4589),f=n.n(p),m=n(5138),v={};v.styleTagTransform=f(),v.setAttributes=u(),v.insert=c().bind(null,"head"),v.domAPI=r(),v.insertStyleElement=d(),o()(m.Z,v);const g=m.Z&&m.Z.locals?m.Z.locals:void 0},3379:t=>{"use strict";var e=[];function n(t){for(var n=-1,i=0;i{"use strict";var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},9216:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},3565:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},7795:t=>{"use strict";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},4589:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},5535:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.AxisLabel=void 0;var r=s(n(2212)),a=function(){function t(t,e,n,i,o,s,a){this.div=document.createElement("div"),this.div.innerHTML=t,this.div.className="axisLabel",this.canvas=i,this.text=t,this.position=new r.Vector3,this.dim=s,this.dpr=a,this.container=n,n.appendChild(this.div),this.updatePosition(e,o)}return t.prototype.updatePosition=function(t,e){this.position.set(t[0],t[1],t[2]);var n=this.get2DCoords(e);this.div.style.left=n.x+"px",this.div.style.top=n.y+"px"},t.prototype.setDpr=function(t){this.dpr=t},t.prototype.clear=function(){this.container.removeChild(this.div)},t.prototype.get2DCoords=function(t){var e=this.position.project(t);return e.x=(e.x+1)*this.canvas.width/(2*this.dpr),e.y=-(e.y-1)*this.canvas.height/(2*this.dpr),e},t}();e.AxisLabel=a},8370:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ScatterControls=void 0;var i=n(370),o=n(2212),s=function(){function t(t){var e=this;this.widget=t,this.container=document.createElement("div"),this.widget.container.appendChild(this.container),this.resetButton=this.widget.resetButtonAction?this.createButton("resetButton","Reset camera position",i.resetIcon,(function(){e.widget.resetButtonAction(),e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.panButton=this.widget.panButtonAction?this.createButton("panButton","Switch to pan controls",i.panIcon,(function(){e.setSelectedButton(e.panButton),e.widget.panButtonAction()})):null,this.orbitButton=this.widget.orbitButtonAction?this.createButton("orbitButton","Switch to orbit controls",i.orbitIcon,(function(){e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.selectButton=this.widget.selectButtonAction?this.createButton("selectButton","Switch to selection controls",i.selectIcon,(function(){e.setSelectedButton(e.selectButton),e.widget.selectButtonAction()})):null,this.widget.brushButtonAction&&(this.brushButton=this.createButton("brushButton","Colour selected points",i.brushIcon,(function(){return e.widget.brushButtonAction()})),this.addColourSelector()),this.exportButton=this.widget.exportButtonAction?this.createButton("exportButton","Export data as csv with current brushed colours",i.downloadIcon,(function(){e.widget.exportButtonAction()})):null,this.setSelectedButton(this.orbitButton),this.widget.orbitButtonAction()}return t.prototype.getSelectedColour=function(){return new o.Color(this.colourSelector.value)},t.prototype.clear=function(){this.widget.container.removeChild(this.container)},t.prototype.createButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t),o.onclick=function(){return i()},this.container.appendChild(o),o},t.prototype.setSelectedButton=function(t){t.className=t.className+" selected",this.selectedButton&&(this.selectedButton.className=this.selectedButton.className.slice(0,-9)),this.selectedButton=t},t.prototype.addColourSelector=function(){var t=this,e=document.createElement("input");e.setAttribute("type","color"),e.className="colourSelector",e.setAttribute("value","#619CFF"),e.setAttribute("title","Select colour to apply using selection box"),e.addEventListener("change",(function(){return t.widget.brushButtonAction()})),this.container.appendChild(e),this.colourSelector=e},t}();e.ScatterControls=s},370:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.downloadIcon=e.orbitIcon=e.brushIcon=e.selectIcon=e.panIcon=e.resetIcon=e.playIcon=e.pauseIcon=void 0,e.pauseIcon='\n\n',e.playIcon='\n\n',e.resetIcon='\n\n',e.panIcon='\n',e.selectIcon='\n\n',e.brushIcon='\n\n',e.orbitIcon='\n\n',e.downloadIcon='\n\x3c!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. --\x3e\n'},8919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DisplayScatter=void 0;var i=n(3190);Object.defineProperty(e,"DisplayScatter",{enumerable:!0,get:function(){return i.DisplayScatter}})},1224:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionHelper=void 0;var i=n(2212),o=function(){function t(t){var e=this;this.startPoint=new i.Vector2,this.pointTopLeft=new i.Vector2,this.pointBottomRight=new i.Vector2,this.widget=t,this.element=document.createElement("div"),this.element.className="selectionBox",this.element.style.pointerEvents="none",this.isDown=!1,this.widget.container.addEventListener("pointerdown",(function(t){e.onSelectStart(t)})),this.widget.container.addEventListener("pointermove",(function(t){e.isDown&&e.onSelectMove(t)})),this.widget.container.addEventListener("pointerup",(function(t){e.isDown&&(e.isDown=!1,e.onSelectOver(t))}))}return t.prototype.disable=function(){this.enabled=!1},t.prototype.enable=function(){this.enabled=!0},t.prototype.scaleX=function(){return this.widget.canvas.clientWidth/this.widget.canvas.getBoundingClientRect().width},t.prototype.scaleY=function(){return this.widget.canvas.clientHeight/this.widget.canvas.getBoundingClientRect().height},t.prototype.onSelectStart=function(t){if(this.enabled&&t.target===this.widget.canvas){this.isDown=!0,this.widget.container.appendChild(this.element);var e=this.widget.canvas.getBoundingClientRect();this.element.style.left=(t.clientX-e.left)*this.scaleX()+"px",this.element.style.top=(t.clientY-e.top)*this.scaleY()+"px",this.element.style.width="0px",this.element.style.height="0px",this.startPoint.x=(t.clientX-e.left)*this.scaleX(),this.startPoint.y=(t.clientY-e.top)*this.scaleY()}},t.prototype.onSelectMove=function(t){if(this.enabled){var e=this.widget.canvas.getBoundingClientRect();this.pointBottomRight.x=Math.max(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointBottomRight.y=Math.max(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.pointTopLeft.x=Math.min(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointTopLeft.y=Math.min(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.element.style.left=this.pointTopLeft.x+"px",this.element.style.top=this.pointTopLeft.y+"px",this.element.style.width=this.pointBottomRight.x-this.pointTopLeft.x+"px",this.element.style.height=this.pointBottomRight.y-this.pointTopLeft.y+"px"}},t.prototype.onSelectOver=function(t){this.enabled&&(this.onSelectMove(t),this.widget.setPointSelectionFromBox(this.pointTopLeft,this.pointBottomRight,t.shiftKey),this.element.parentElement.removeChild(this.element))},t}();e.SelectionHelper=o},4814:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FRAGMENT_SHADER=void 0,e.FRAGMENT_SHADER="\nvarying float vSize;\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\nvarying float vShrink; // shrink points when picking\n\nvoid main(){\n // 1.0 if picking else vAlpha\n float alpha = 1.0 - (1.0 - vPicking) * (1.0 - vAlpha);\n gl_FragColor = vec4(vColor, alpha);\n\n // make points circular\n float distance = length(2.0 * gl_PointCoord - 1.0);\n if (distance > 1.0) {\n discard;\n }\n}\n"},3190:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}c((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,i=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)for(var i=0,o=0;o>16&255)/255,t[e+1]=(n>>8&255)/255,t[e+2]=(255&n)/255,e+=3;return new l.BufferAttribute(t,3)},t.prototype.addAxisLabels=function(){var t=this,e=this.renderer.getPixelRatio();this.config.axisLabels==[]?this.hasAxisLabels=!1:(this.hasAxisLabels=!0,this.axisLabels=this.config.axisLabels.map((function(n){return new f.AxisLabel(n,[0,0,0],t.container,t.canvas,t.camera,t.dim,e)})))},t.prototype.addSleepEventListeners=function(){var t=this;this.container.addEventListener("mouseover",(function(){return t.wakeEventListener()})),this.container.addEventListener("scroll",(function(){return t.wakeEventListener()})),this.container.addEventListener("keydown",(function(){return t.wakeEventListener()})),this.container.addEventListener("mouseleave",(function(){return t.sleepEventListener()}))},t.prototype.setPointSelectionFromBox=function(t,e,n){var i=this,o=this.pickingTexture,s=this.renderer,r=s.getPixelRatio(),a=t.x*r,c=e.y*r,l=(e.x-t.x)*r,u=(e.y-t.y)*r,h=new Uint8Array(4*l*u);this.points.geometry.setAttribute("color",this.pickingColours),this.points.material.uniforms.picking.value=1,this.points.material.uniforms.shrink.value=1,this.renderer.setRenderTarget(this.pickingTexture),this.renderer.render(this.scene,this.camera),s.readRenderTargetPixels(o,a,o.height-c,l,u,h),this.renderer.setRenderTarget(null),this.points.geometry.setAttribute("color",this.pointColours),this.points.material.uniforms.picking.value=0,this.points.material.uniforms.shrink.value=0;for(var d,p=new Set,f=0;f=this.config.duration&&(this.time=0);var n=Math.floor(this.time*this.config.fps);if(this.currentFrame=n,n!=this.oldFrame){if(this.currentFrameBuffer=this.getPointsBuffer(n%this.projectionMatrices.length),this.points.geometry.setAttribute("position",this.currentFrameBuffer),this.hasAxes&&this.axisSegments.geometry.setAttribute("position",this.getAxisLinesBuffer(n)),this.hasEdges){var i=this.getEdgesBuffer(this.currentFrameBuffer);this.edgeSegments.geometry.setAttribute("position",i)}this.oldFrame=n,this.timeline.updatePosition(n/(this.projectionMatrices.length-1))}this.adjustPointSizeFromZoom&&this.adjustPointSizeFromZoom(),this.renderer.render(this.scene,this.camera),this.points.geometry.setAttribute("color",this.pickingColours),this.points.material.uniforms.picking.value=1,this.renderer.setRenderTarget(this.pickingTexture),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null),this.points.geometry.setAttribute("color",this.pointColours),this.points.material.uniforms.picking.value=0,this.hasAxisLabels&&this.axisLabels.map((function(e,i){return e.updatePosition(t.projectionMatrices[n].arraySync()[i],t.camera)})),this.isSleeping||requestAnimationFrame((function(){return t.animate()}))},t.prototype.getIsPaused=function(){return this.isPaused},t.prototype.setIsPaused=function(t){this.isPaused=t,t||this.animate(),this.timeline.updatePlayPauseIcon(t)},t.prototype.setSleep=function(t){this.isSleeping=t},t.prototype.setTime=function(t){this.time=this.config.duration*t},t.prototype.getBasisIndices=function(){return this.config.basisIndices},t.prototype.getNumAnimationFrames=function(){return this.projectionMatrices.length},t.prototype.sleepEventListener=function(){this.isPaused&&this.setSleep(!0)},t.prototype.wakeEventListener=function(){this.isSleeping&&(this.setSleep(!1),this.animate())},t.prototype.setSelectedPointColour=function(){for(var t=this.controls.getSelectedColour(),e=0,n=this.selectedPointIndices;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;var i=n(370),o=function(){function t(t){this.scrubberWidth=16,this.timelineThickness=4,this.hasBasisIndicators=!0,this.basisIndicators=[],this.basisIndicatorDiameter=4,this.mouseDown=!1,this.widget=t,this.parentDiv=t.container,this.canvas=t.canvas,this.addContainer(),this.addTimeline(),this.addScrubber(),this.addPlayPauseButton(),this.addBasisIndicators(),this.addEventListeners(),this.addTooltip()}return t.prototype.updatePosition=function(t){this.mouseDown||(this.scrubber.style.left=Math.floor(this.timelineWidth*t)+"px")},t.prototype.updatePlayPauseIcon=function(t){this.playPauseButton.innerHTML=t?i.playIcon:i.pauseIcon},t.prototype.addButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t,"Button"),o.onclick=function(){return i()},o},t.prototype.getElement=function(){return this.container},t.prototype.resize=function(t,e){if(this.container.style.top=t-40+"px",this.timelineWidth=this.timeline.offsetWidth-this.scrubberWidth,this.hasBasisIndicators)for(var n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERTEX_SHADER_2D=void 0,e.VERTEX_SHADER_2D="\nuniform float size;\nuniform float zoom;\nuniform float picking;\nuniform float shrink;\n\nattribute float alpha;\nattribute vec3 color;\n\n// passed to fragment shader\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\nvarying float vShrink;\n\nvoid main(){\n vColor = color;\n vAlpha = alpha;\n vPicking = picking;\n vShrink = shrink;\n\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = 2.0 * shrink + (100.0 * size * sqrt(zoom)) * (1.0 - shrink);\n}\n"},3307:function(t,e,n){"use strict";var i,o=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&s(e,t,n);return r(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.DisplaySlice2d=void 0;var c=n(3282),l=a(n(356)),u=function(t){function e(e,n,i){var o=t.call(this,e,n,i)||this;return o.selectButtonAction=null,o.brushButtonAction=null,o}return o(e,t),e.prototype.preConstructPlotCallback=function(){this.anchor=l.expandDims(l.tensor(this.config.anchor),0)},e.prototype.project=function(t,e){var n=this,i=l.matMul(t,e),o=l.sub(t,this.anchor),s=l.sqrt(l.sum(l.square(l.sub(o,l.matMul(o,l.matMul(e,l.transpose(e))))),1)).dataSync();return this.pointAlphas.set(s.map((function(t){return t{},2578:()=>{},2980:()=>{},4862:()=>{},7958:()=>{},5410:()=>{},8628:()=>{},5042:()=>{}},t=>(t.O(0,[440,841,470,691],(()=>(3307,t(t.s=3307)))),t.O())])})); \ No newline at end of file diff --git a/inst/htmlwidgets/lib/show_slice_3d.bundle.js b/inst/htmlwidgets/lib/show_slice_3d.bundle.js index 979fe7d..573b7f9 100644 --- a/inst/htmlwidgets/lib/show_slice_3d.bundle.js +++ b/inst/htmlwidgets/lib/show_slice_3d.bundle.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.show_slice_3d=e():t.show_slice_3d=e()}(self,(function(){return(self.webpackChunk_name_=self.webpackChunk_name_||[]).push([[297,248],{5138:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var i=n(8081),o=n.n(i),s=n(3645),r=n.n(s)()(o());r.push([t.id,"button.detourrButton {\n background-color: transparent;\n position: absolute;\n color: rgb(0, 0, 0);\n text-align: center;\n width: 30px;\n height: 30px;\n border-color: transparent;\n left: 10px;\n padding-top: 0px;\n padding-right: 6px;\n}\n\nbutton.detourrButton:hover {\n color: rgb(56, 56, 56);\n}\n\nbutton.detourrButton.resetButton {\n top: 15px;\n border: 5px;\n}\n\nbutton.detourrButton.panButton {\n top: 50px;\n border: 5px;\n}\n\nbutton.detourrButton.orbitButton {\n top: 85px;\n border: 5px;\n}\n\nbutton.detourrButton.selectButton {\n top: 120px;\n border: 5px;\n}\n\nbutton.detourrButton.brushButton {\n top: 155px;\n border: 5px;\n}\n\nbutton.detourrButton.exportButton {\n top: 225px;\n border: 5px;\n}\n\n\nbutton.detourrButton.unselected {\n color: rgb(75, 75, 75);\n}\n\nbutton.detourrButton.selected {\n color: rgb(44, 44, 240);\n}\n\ninput.colourSelector {\n position: absolute;\n top: 190px;\n left: 13px;\n width: 22px;\n height: 22px;\n}\n\n.scatterWidgetContainer {\n position: relative;\n overflow: hidden;\n}\n\n.scatterWidgetCanvas {\n position: relative;\n}\n\n.selectionBox {\n border: 1px solid #55aaff;\n background-color: rgba(75, 160, 255, 0.3);\n position: absolute;\n}\n\ndiv.axisLabel {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: absolute;\n font-family: Helvetica, Sans-serif;\n pointer-events: none;\n}\n\ndiv.detourrTooltip {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n pointer-events: none;\n position: absolute;\n top: 0px;\n left: 0px;\n background: rgba(0, 0, 0, 0.5);\n padding: 5px;\n visibility: hidden;\n border-radius: 5px;\n color: white;\n font-family: sans-serif;\n user-select: none;\n}\n\ndiv.detourrTooltip.visible {\n visibility: visible;\n}\n\ndiv.timelineContainer {\n position: absolute;\n left: 10px;\n right: 10px;\n}\n\ndiv.timeline {\n position: absolute;\n left: 50px;\n right: 20px;\n background-color: rgba(0, 0, 0, 0.7);\n border-radius: 5px;\n z-index: 0;\n}\n\ndiv.scrubber {\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n cursor: move;\n left: 0px;\n z-index: 1;\n}\n\ndiv.basisIndicator {\n position: absolute;\n background-color: rgb(255, 255, 255);\n border-radius: 50%;\n z-index: 0.5;\n}\n\ndiv.scrubber.active {\n cursor: move;\n}\n",""]);const a=r},3645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,o,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(i)for(var a=0;a0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},8081:t=>{"use strict";t.exports=function(t){return t[1]}},8329:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>m});var i=n(3379),o=n.n(i),s=n(7795),r=n.n(s),a=n(569),c=n.n(a),l=n(3565),u=n.n(l),h=n(9216),d=n.n(h),p=n(4589),f=n.n(p),v=n(5138),g={};g.styleTagTransform=f(),g.setAttributes=u(),g.insert=c().bind(null,"head"),g.domAPI=r(),g.insertStyleElement=d(),o()(v.Z,g);const m=v.Z&&v.Z.locals?v.Z.locals:void 0},3379:t=>{"use strict";var e=[];function n(t){for(var n=-1,i=0;i{"use strict";var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},9216:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},3565:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},7795:t=>{"use strict";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},4589:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},5535:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.AxisLabel=void 0;var r=s(n(2212)),a=function(){function t(t,e,n,i,o,s,a){this.div=document.createElement("div"),this.div.innerHTML=t,this.div.className="axisLabel",this.canvas=i,this.text=t,this.position=new r.Vector3,this.dim=s,this.dpr=a,this.container=n,n.appendChild(this.div),this.updatePosition(e,o)}return t.prototype.updatePosition=function(t,e){this.position.set(t[0],t[1],t[2]);var n=this.get2DCoords(e);this.div.style.left=n.x+"px",this.div.style.top=n.y+"px"},t.prototype.setDpr=function(t){this.dpr=t},t.prototype.clear=function(){this.container.removeChild(this.div)},t.prototype.get2DCoords=function(t){var e=this.position.project(t);return e.x=(e.x+1)*this.canvas.width/(2*this.dpr),e.y=-(e.y-1)*this.canvas.height/(2*this.dpr),e},t}();e.AxisLabel=a},8370:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ScatterControls=void 0;var i=n(370),o=n(2212),s=function(){function t(t){var e=this;this.widget=t,this.container=document.createElement("div"),this.widget.container.appendChild(this.container),this.resetButton=this.widget.resetButtonAction?this.createButton("resetButton","Reset camera position",i.resetIcon,(function(){e.widget.resetButtonAction(),e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.panButton=this.widget.panButtonAction?this.createButton("panButton","Switch to pan controls",i.panIcon,(function(){e.setSelectedButton(e.panButton),e.widget.panButtonAction()})):null,this.orbitButton=this.widget.orbitButtonAction?this.createButton("orbitButton","Switch to orbit controls",i.orbitIcon,(function(){e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.selectButton=this.widget.selectButtonAction?this.createButton("selectButton","Switch to selection controls",i.selectIcon,(function(){e.setSelectedButton(e.selectButton),e.widget.selectButtonAction()})):null,this.widget.brushButtonAction&&(this.brushButton=this.createButton("brushButton","Colour selected points",i.brushIcon,(function(){return e.widget.brushButtonAction()})),this.addColourSelector()),this.exportButton=this.widget.exportButtonAction?this.createButton("exportButton","Export data as csv with current brushed colours",i.downloadIcon,(function(){e.widget.exportButtonAction()})):null,this.setSelectedButton(this.orbitButton),this.widget.orbitButtonAction()}return t.prototype.getSelectedColour=function(){return new o.Color(this.colourSelector.value)},t.prototype.clear=function(){this.widget.container.removeChild(this.container)},t.prototype.createButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t),o.onclick=function(){return i()},this.container.appendChild(o),o},t.prototype.setSelectedButton=function(t){t.className=t.className+" selected",this.selectedButton&&(this.selectedButton.className=this.selectedButton.className.slice(0,-9)),this.selectedButton=t},t.prototype.addColourSelector=function(){var t=this,e=document.createElement("input");e.setAttribute("type","color"),e.className="colourSelector",e.setAttribute("value","#619CFF"),e.setAttribute("title","Select colour to apply using selection box"),e.addEventListener("change",(function(){return t.widget.brushButtonAction()})),this.container.appendChild(e),this.colourSelector=e},t}();e.ScatterControls=s},370:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.downloadIcon=e.orbitIcon=e.brushIcon=e.selectIcon=e.panIcon=e.resetIcon=e.playIcon=e.pauseIcon=void 0,e.pauseIcon='\n\n',e.playIcon='\n\n',e.resetIcon='\n\n',e.panIcon='\n',e.selectIcon='\n\n',e.brushIcon='\n\n',e.orbitIcon='\n\n',e.downloadIcon='\n\x3c!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. --\x3e\n'},8919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DisplayScatter=void 0;var i=n(3190);Object.defineProperty(e,"DisplayScatter",{enumerable:!0,get:function(){return i.DisplayScatter}})},1224:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionHelper=void 0;var i=n(2212),o=function(){function t(t){var e=this;this.startPoint=new i.Vector2,this.pointTopLeft=new i.Vector2,this.pointBottomRight=new i.Vector2,this.widget=t,this.element=document.createElement("div"),this.element.className="selectionBox",this.element.style.pointerEvents="none",this.isDown=!1,this.widget.container.addEventListener("pointerdown",(function(t){e.onSelectStart(t)})),this.widget.container.addEventListener("pointermove",(function(t){e.isDown&&e.onSelectMove(t)})),this.widget.container.addEventListener("pointerup",(function(t){e.isDown&&(e.isDown=!1,e.onSelectOver(t))}))}return t.prototype.disable=function(){this.enabled=!1},t.prototype.enable=function(){this.enabled=!0},t.prototype.scaleX=function(){return this.widget.canvas.clientWidth/this.widget.canvas.getBoundingClientRect().width},t.prototype.scaleY=function(){return this.widget.canvas.clientHeight/this.widget.canvas.getBoundingClientRect().height},t.prototype.onSelectStart=function(t){if(this.enabled&&t.target===this.widget.canvas){this.isDown=!0,this.widget.container.appendChild(this.element);var e=this.widget.canvas.getBoundingClientRect();this.element.style.left=(t.clientX-e.left)*this.scaleX()+"px",this.element.style.top=(t.clientY-e.top)*this.scaleY()+"px",this.element.style.width="0px",this.element.style.height="0px",this.startPoint.x=(t.clientX-e.left)*this.scaleX(),this.startPoint.y=(t.clientY-e.top)*this.scaleY()}},t.prototype.onSelectMove=function(t){if(this.enabled){var e=this.widget.canvas.getBoundingClientRect();this.pointBottomRight.x=Math.max(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointBottomRight.y=Math.max(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.pointTopLeft.x=Math.min(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointTopLeft.y=Math.min(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.element.style.left=this.pointTopLeft.x+"px",this.element.style.top=this.pointTopLeft.y+"px",this.element.style.width=this.pointBottomRight.x-this.pointTopLeft.x+"px",this.element.style.height=this.pointBottomRight.y-this.pointTopLeft.y+"px"}},t.prototype.onSelectOver=function(t){this.enabled&&(this.onSelectMove(t),this.widget.setPointSelectionFromBox(this.pointTopLeft,this.pointBottomRight,t.shiftKey),this.element.parentElement.removeChild(this.element))},t}();e.SelectionHelper=o},4814:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FRAGMENT_SHADER=void 0,e.FRAGMENT_SHADER="\nvarying float vSize;\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\n\nvoid main(){\n // 1.0 if picking else vAlpha\n float alpha = 1.0 - (1.0 - vPicking) * (1.0 - vAlpha);\n gl_FragColor = vec4(vColor, alpha);\n\n // make points circular\n float distance = length(2.0 * gl_PointCoord - 1.0);\n if (distance > 1.0) {\n discard;\n }\n}\n"},3190:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}c((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,i=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)for(var i=0,o=0;o>16&255)/255,t[e+1]=(n>>8&255)/255,t[e+2]=(255&n)/255,e+=3;return new l.BufferAttribute(t,3)},t.prototype.addAxisLabels=function(){var t=this,e=this.renderer.getPixelRatio();this.config.axisLabels==[]?this.hasAxisLabels=!1:(this.hasAxisLabels=!0,this.axisLabels=this.config.axisLabels.map((function(n){return new f.AxisLabel(n,[0,0,0],t.container,t.canvas,t.camera,t.dim,e)})))},t.prototype.addSleepEventListeners=function(){var t=this;this.container.addEventListener("mouseover",(function(){return t.wakeEventListener()})),this.container.addEventListener("scroll",(function(){return t.wakeEventListener()})),this.container.addEventListener("keydown",(function(){return t.wakeEventListener()})),this.container.addEventListener("mouseleave",(function(){return t.sleepEventListener()}))},t.prototype.setPointSelectionFromBox=function(t,e,n){var i=this,o=this.pickingTexture,s=this.renderer,r=s.getPixelRatio(),a=t.x*r,c=e.y*r,l=(e.x-t.x)*r,u=(e.y-t.y)*r,h=new Uint8Array(4*l*u);s.readRenderTargetPixels(o,a,o.height-c,l,u,h);for(var d,p=new Set,f=0;f=this.config.duration&&(this.time=0);var n=Math.floor(this.time*this.config.fps);if(this.currentFrame=n,n!=this.oldFrame){if(this.currentFrameBuffer=this.getPointsBuffer(n%this.projectionMatrices.length),this.points.geometry.setAttribute("position",this.currentFrameBuffer),this.hasAxes&&this.axisSegments.geometry.setAttribute("position",this.getAxisLinesBuffer(n)),this.hasEdges){var i=this.getEdgesBuffer(this.currentFrameBuffer);this.edgeSegments.geometry.setAttribute("position",i)}this.oldFrame=n,this.timeline.updatePosition(n/(this.projectionMatrices.length-1))}this.adjustPointSizeFromZoom&&this.adjustPointSizeFromZoom(),this.renderer.render(this.scene,this.camera),this.points.geometry.setAttribute("color",this.pickingColours),this.points.material.uniforms.picking.value=1,this.renderer.setRenderTarget(this.pickingTexture),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null),this.points.geometry.setAttribute("color",this.pointColours),this.points.material.uniforms.picking.value=0,this.hasAxisLabels&&this.axisLabels.map((function(e,i){return e.updatePosition(t.projectionMatrices[n].arraySync()[i],t.camera)})),this.isSleeping||requestAnimationFrame((function(){return t.animate()}))},t.prototype.getIsPaused=function(){return this.isPaused},t.prototype.setIsPaused=function(t){this.isPaused=t,t||this.animate(),this.timeline.updatePlayPauseIcon(t)},t.prototype.setSleep=function(t){this.isSleeping=t},t.prototype.setTime=function(t){this.time=this.config.duration*t},t.prototype.getBasisIndices=function(){return this.config.basisIndices},t.prototype.getNumAnimationFrames=function(){return this.projectionMatrices.length},t.prototype.sleepEventListener=function(){this.isPaused&&this.setSleep(!0)},t.prototype.wakeEventListener=function(){this.isSleeping&&(this.setSleep(!1),this.animate())},t.prototype.setSelectedPointColour=function(){for(var t=this.controls.getSelectedColour(),e=0,n=this.selectedPointIndices;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;var i=n(370),o=function(){function t(t){this.scrubberWidth=16,this.timelineThickness=4,this.hasBasisIndicators=!0,this.basisIndicators=[],this.basisIndicatorDiameter=4,this.mouseDown=!1,this.widget=t,this.parentDiv=t.container,this.canvas=t.canvas,this.addContainer(),this.addTimeline(),this.addScrubber(),this.addPlayPauseButton(),this.addBasisIndicators(),this.addEventListeners(),this.addTooltip()}return t.prototype.updatePosition=function(t){this.mouseDown||(this.scrubber.style.left=Math.floor(this.timelineWidth*t)+"px")},t.prototype.updatePlayPauseIcon=function(t){this.playPauseButton.innerHTML=t?i.playIcon:i.pauseIcon},t.prototype.addButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t,"Button"),o.onclick=function(){return i()},o},t.prototype.getElement=function(){return this.container},t.prototype.resize=function(t,e){if(this.container.style.top=t-40+"px",this.timelineWidth=this.timeline.offsetWidth-this.scrubberWidth,this.hasBasisIndicators)for(var n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERTEX_SHADER_3D=void 0,e.VERTEX_SHADER_3D="\nuniform float size;\nuniform float picking;\n\nattribute vec3 color;\nattribute float alpha;\n\n// passed to fragment shader\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\n\nvoid main(){\n vColor = color;\n vAlpha = alpha;\n vPicking = picking;\n \n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = 200.0 * size / -mvPosition.z;\n}\n"},2206:function(t,e,n){"use strict";var i,o=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&s(e,t,n);return r(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.DisplaySlice3d=void 0;var c=n(5629),l=a(n(356)),u=function(t){function e(e,n,i){var o=t.call(this,e,n,i)||this;return o.selectButtonAction=null,o.brushButtonAction=null,o}return o(e,t),e.prototype.preConstructPlotCallback=function(){this.anchor=l.expandDims(l.tensor(this.config.anchor),0)},e.prototype.project=function(t,e){var n=this,i=l.matMul(t,e),o=l.sub(t,this.anchor),s=l.sqrt(l.sum(l.square(l.sub(o,l.matMul(o,l.matMul(e,l.transpose(e))))),1)).dataSync();return this.pointAlphas.set(s.map((function(t){return t{},2578:()=>{},2980:()=>{},4862:()=>{},7958:()=>{},5410:()=>{},8628:()=>{},5042:()=>{}},t=>(t.O(0,[440,841,470,691],(()=>(2206,t(t.s=2206)))),t.O())])})); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.show_slice_3d=e():t.show_slice_3d=e()}(self,(function(){return(self.webpackChunk_name_=self.webpackChunk_name_||[]).push([[297,248],{5138:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var i=n(8081),o=n.n(i),s=n(3645),r=n.n(s)()(o());r.push([t.id,"button.detourrButton {\n background-color: transparent;\n position: absolute;\n color: rgb(0, 0, 0);\n text-align: center;\n width: 30px;\n height: 30px;\n border-color: transparent;\n left: 10px;\n padding-top: 0px;\n padding-right: 6px;\n}\n\nbutton.detourrButton:hover {\n color: rgb(56, 56, 56);\n}\n\nbutton.detourrButton.resetButton {\n top: 15px;\n border: 5px;\n}\n\nbutton.detourrButton.panButton {\n top: 50px;\n border: 5px;\n}\n\nbutton.detourrButton.orbitButton {\n top: 85px;\n border: 5px;\n}\n\nbutton.detourrButton.selectButton {\n top: 120px;\n border: 5px;\n}\n\nbutton.detourrButton.brushButton {\n top: 155px;\n border: 5px;\n}\n\nbutton.detourrButton.exportButton {\n top: 225px;\n border: 5px;\n}\n\n\nbutton.detourrButton.unselected {\n color: rgb(75, 75, 75);\n}\n\nbutton.detourrButton.selected {\n color: rgb(44, 44, 240);\n}\n\ninput.colourSelector {\n position: absolute;\n top: 190px;\n left: 13px;\n width: 22px;\n height: 22px;\n}\n\n.scatterWidgetContainer {\n position: relative;\n overflow: hidden;\n}\n\n.scatterWidgetCanvas {\n position: relative;\n}\n\n.selectionBox {\n border: 1px solid #55aaff;\n background-color: rgba(75, 160, 255, 0.3);\n position: absolute;\n}\n\ndiv.axisLabel {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: absolute;\n font-family: Helvetica, Sans-serif;\n pointer-events: none;\n}\n\ndiv.detourrTooltip {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n pointer-events: none;\n position: absolute;\n top: 0px;\n left: 0px;\n background: rgba(0, 0, 0, 0.5);\n padding: 5px;\n visibility: hidden;\n border-radius: 5px;\n color: white;\n font-family: sans-serif;\n user-select: none;\n}\n\ndiv.detourrTooltip.visible {\n visibility: visible;\n}\n\ndiv.timelineContainer {\n position: absolute;\n left: 10px;\n right: 10px;\n}\n\ndiv.timeline {\n position: absolute;\n left: 50px;\n right: 20px;\n background-color: rgba(0, 0, 0, 0.7);\n border-radius: 5px;\n z-index: 0;\n}\n\ndiv.scrubber {\n position: absolute;\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n cursor: move;\n left: 0px;\n z-index: 1;\n}\n\ndiv.basisIndicator {\n position: absolute;\n background-color: rgb(255, 255, 255);\n border-radius: 50%;\n z-index: 0.5;\n}\n\ndiv.scrubber.active {\n cursor: move;\n}\n",""]);const a=r},3645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,o,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(i)for(var a=0;a0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},8081:t=>{"use strict";t.exports=function(t){return t[1]}},8329:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>m});var i=n(3379),o=n.n(i),s=n(7795),r=n.n(s),a=n(569),c=n.n(a),l=n(3565),u=n.n(l),h=n(9216),d=n.n(h),p=n(4589),f=n.n(p),v=n(5138),g={};g.styleTagTransform=f(),g.setAttributes=u(),g.insert=c().bind(null,"head"),g.domAPI=r(),g.insertStyleElement=d(),o()(v.Z,g);const m=v.Z&&v.Z.locals?v.Z.locals:void 0},3379:t=>{"use strict";var e=[];function n(t){for(var n=-1,i=0;i{"use strict";var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},9216:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},3565:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},7795:t=>{"use strict";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},4589:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},5535:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.AxisLabel=void 0;var r=s(n(2212)),a=function(){function t(t,e,n,i,o,s,a){this.div=document.createElement("div"),this.div.innerHTML=t,this.div.className="axisLabel",this.canvas=i,this.text=t,this.position=new r.Vector3,this.dim=s,this.dpr=a,this.container=n,n.appendChild(this.div),this.updatePosition(e,o)}return t.prototype.updatePosition=function(t,e){this.position.set(t[0],t[1],t[2]);var n=this.get2DCoords(e);this.div.style.left=n.x+"px",this.div.style.top=n.y+"px"},t.prototype.setDpr=function(t){this.dpr=t},t.prototype.clear=function(){this.container.removeChild(this.div)},t.prototype.get2DCoords=function(t){var e=this.position.project(t);return e.x=(e.x+1)*this.canvas.width/(2*this.dpr),e.y=-(e.y-1)*this.canvas.height/(2*this.dpr),e},t}();e.AxisLabel=a},8370:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ScatterControls=void 0;var i=n(370),o=n(2212),s=function(){function t(t){var e=this;this.widget=t,this.container=document.createElement("div"),this.widget.container.appendChild(this.container),this.resetButton=this.widget.resetButtonAction?this.createButton("resetButton","Reset camera position",i.resetIcon,(function(){e.widget.resetButtonAction(),e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.panButton=this.widget.panButtonAction?this.createButton("panButton","Switch to pan controls",i.panIcon,(function(){e.setSelectedButton(e.panButton),e.widget.panButtonAction()})):null,this.orbitButton=this.widget.orbitButtonAction?this.createButton("orbitButton","Switch to orbit controls",i.orbitIcon,(function(){e.setSelectedButton(e.orbitButton),e.widget.orbitButtonAction()})):null,this.selectButton=this.widget.selectButtonAction?this.createButton("selectButton","Switch to selection controls",i.selectIcon,(function(){e.setSelectedButton(e.selectButton),e.widget.selectButtonAction()})):null,this.widget.brushButtonAction&&(this.brushButton=this.createButton("brushButton","Colour selected points",i.brushIcon,(function(){return e.widget.brushButtonAction()})),this.addColourSelector()),this.exportButton=this.widget.exportButtonAction?this.createButton("exportButton","Export data as csv with current brushed colours",i.downloadIcon,(function(){e.widget.exportButtonAction()})):null,this.setSelectedButton(this.orbitButton),this.widget.orbitButtonAction()}return t.prototype.getSelectedColour=function(){return new o.Color(this.colourSelector.value)},t.prototype.clear=function(){this.widget.container.removeChild(this.container)},t.prototype.createButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t),o.onclick=function(){return i()},this.container.appendChild(o),o},t.prototype.setSelectedButton=function(t){t.className=t.className+" selected",this.selectedButton&&(this.selectedButton.className=this.selectedButton.className.slice(0,-9)),this.selectedButton=t},t.prototype.addColourSelector=function(){var t=this,e=document.createElement("input");e.setAttribute("type","color"),e.className="colourSelector",e.setAttribute("value","#619CFF"),e.setAttribute("title","Select colour to apply using selection box"),e.addEventListener("change",(function(){return t.widget.brushButtonAction()})),this.container.appendChild(e),this.colourSelector=e},t}();e.ScatterControls=s},370:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.downloadIcon=e.orbitIcon=e.brushIcon=e.selectIcon=e.panIcon=e.resetIcon=e.playIcon=e.pauseIcon=void 0,e.pauseIcon='\n\n',e.playIcon='\n\n',e.resetIcon='\n\n',e.panIcon='\n',e.selectIcon='\n\n',e.brushIcon='\n\n',e.orbitIcon='\n\n',e.downloadIcon='\n\x3c!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. --\x3e\n'},8919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DisplayScatter=void 0;var i=n(3190);Object.defineProperty(e,"DisplayScatter",{enumerable:!0,get:function(){return i.DisplayScatter}})},1224:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionHelper=void 0;var i=n(2212),o=function(){function t(t){var e=this;this.startPoint=new i.Vector2,this.pointTopLeft=new i.Vector2,this.pointBottomRight=new i.Vector2,this.widget=t,this.element=document.createElement("div"),this.element.className="selectionBox",this.element.style.pointerEvents="none",this.isDown=!1,this.widget.container.addEventListener("pointerdown",(function(t){e.onSelectStart(t)})),this.widget.container.addEventListener("pointermove",(function(t){e.isDown&&e.onSelectMove(t)})),this.widget.container.addEventListener("pointerup",(function(t){e.isDown&&(e.isDown=!1,e.onSelectOver(t))}))}return t.prototype.disable=function(){this.enabled=!1},t.prototype.enable=function(){this.enabled=!0},t.prototype.scaleX=function(){return this.widget.canvas.clientWidth/this.widget.canvas.getBoundingClientRect().width},t.prototype.scaleY=function(){return this.widget.canvas.clientHeight/this.widget.canvas.getBoundingClientRect().height},t.prototype.onSelectStart=function(t){if(this.enabled&&t.target===this.widget.canvas){this.isDown=!0,this.widget.container.appendChild(this.element);var e=this.widget.canvas.getBoundingClientRect();this.element.style.left=(t.clientX-e.left)*this.scaleX()+"px",this.element.style.top=(t.clientY-e.top)*this.scaleY()+"px",this.element.style.width="0px",this.element.style.height="0px",this.startPoint.x=(t.clientX-e.left)*this.scaleX(),this.startPoint.y=(t.clientY-e.top)*this.scaleY()}},t.prototype.onSelectMove=function(t){if(this.enabled){var e=this.widget.canvas.getBoundingClientRect();this.pointBottomRight.x=Math.max(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointBottomRight.y=Math.max(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.pointTopLeft.x=Math.min(this.startPoint.x,(t.clientX-e.left)*this.scaleX()),this.pointTopLeft.y=Math.min(this.startPoint.y,(t.clientY-e.top)*this.scaleY()),this.element.style.left=this.pointTopLeft.x+"px",this.element.style.top=this.pointTopLeft.y+"px",this.element.style.width=this.pointBottomRight.x-this.pointTopLeft.x+"px",this.element.style.height=this.pointBottomRight.y-this.pointTopLeft.y+"px"}},t.prototype.onSelectOver=function(t){this.enabled&&(this.onSelectMove(t),this.widget.setPointSelectionFromBox(this.pointTopLeft,this.pointBottomRight,t.shiftKey),this.element.parentElement.removeChild(this.element))},t}();e.SelectionHelper=o},4814:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FRAGMENT_SHADER=void 0,e.FRAGMENT_SHADER="\nvarying float vSize;\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\nvarying float vShrink; // shrink points when picking\n\nvoid main(){\n // 1.0 if picking else vAlpha\n float alpha = 1.0 - (1.0 - vPicking) * (1.0 - vAlpha);\n gl_FragColor = vec4(vColor, alpha);\n\n // make points circular\n float distance = length(2.0 * gl_PointCoord - 1.0);\n if (distance > 1.0) {\n discard;\n }\n}\n"},3190:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}c((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,i=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)for(var i=0,o=0;o>16&255)/255,t[e+1]=(n>>8&255)/255,t[e+2]=(255&n)/255,e+=3;return new l.BufferAttribute(t,3)},t.prototype.addAxisLabels=function(){var t=this,e=this.renderer.getPixelRatio();this.config.axisLabels==[]?this.hasAxisLabels=!1:(this.hasAxisLabels=!0,this.axisLabels=this.config.axisLabels.map((function(n){return new f.AxisLabel(n,[0,0,0],t.container,t.canvas,t.camera,t.dim,e)})))},t.prototype.addSleepEventListeners=function(){var t=this;this.container.addEventListener("mouseover",(function(){return t.wakeEventListener()})),this.container.addEventListener("scroll",(function(){return t.wakeEventListener()})),this.container.addEventListener("keydown",(function(){return t.wakeEventListener()})),this.container.addEventListener("mouseleave",(function(){return t.sleepEventListener()}))},t.prototype.setPointSelectionFromBox=function(t,e,n){var i=this,o=this.pickingTexture,s=this.renderer,r=s.getPixelRatio(),a=t.x*r,c=e.y*r,l=(e.x-t.x)*r,u=(e.y-t.y)*r,h=new Uint8Array(4*l*u);this.points.geometry.setAttribute("color",this.pickingColours),this.points.material.uniforms.picking.value=1,this.points.material.uniforms.shrink.value=1,this.renderer.setRenderTarget(this.pickingTexture),this.renderer.render(this.scene,this.camera),s.readRenderTargetPixels(o,a,o.height-c,l,u,h),this.renderer.setRenderTarget(null),this.points.geometry.setAttribute("color",this.pointColours),this.points.material.uniforms.picking.value=0,this.points.material.uniforms.shrink.value=0;for(var d,p=new Set,f=0;f=this.config.duration&&(this.time=0);var n=Math.floor(this.time*this.config.fps);if(this.currentFrame=n,n!=this.oldFrame){if(this.currentFrameBuffer=this.getPointsBuffer(n%this.projectionMatrices.length),this.points.geometry.setAttribute("position",this.currentFrameBuffer),this.hasAxes&&this.axisSegments.geometry.setAttribute("position",this.getAxisLinesBuffer(n)),this.hasEdges){var i=this.getEdgesBuffer(this.currentFrameBuffer);this.edgeSegments.geometry.setAttribute("position",i)}this.oldFrame=n,this.timeline.updatePosition(n/(this.projectionMatrices.length-1))}this.adjustPointSizeFromZoom&&this.adjustPointSizeFromZoom(),this.renderer.render(this.scene,this.camera),this.points.geometry.setAttribute("color",this.pickingColours),this.points.material.uniforms.picking.value=1,this.renderer.setRenderTarget(this.pickingTexture),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null),this.points.geometry.setAttribute("color",this.pointColours),this.points.material.uniforms.picking.value=0,this.hasAxisLabels&&this.axisLabels.map((function(e,i){return e.updatePosition(t.projectionMatrices[n].arraySync()[i],t.camera)})),this.isSleeping||requestAnimationFrame((function(){return t.animate()}))},t.prototype.getIsPaused=function(){return this.isPaused},t.prototype.setIsPaused=function(t){this.isPaused=t,t||this.animate(),this.timeline.updatePlayPauseIcon(t)},t.prototype.setSleep=function(t){this.isSleeping=t},t.prototype.setTime=function(t){this.time=this.config.duration*t},t.prototype.getBasisIndices=function(){return this.config.basisIndices},t.prototype.getNumAnimationFrames=function(){return this.projectionMatrices.length},t.prototype.sleepEventListener=function(){this.isPaused&&this.setSleep(!0)},t.prototype.wakeEventListener=function(){this.isSleeping&&(this.setSleep(!1),this.animate())},t.prototype.setSelectedPointColour=function(){for(var t=this.controls.getSelectedColour(),e=0,n=this.selectedPointIndices;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=void 0;var i=n(370),o=function(){function t(t){this.scrubberWidth=16,this.timelineThickness=4,this.hasBasisIndicators=!0,this.basisIndicators=[],this.basisIndicatorDiameter=4,this.mouseDown=!1,this.widget=t,this.parentDiv=t.container,this.canvas=t.canvas,this.addContainer(),this.addTimeline(),this.addScrubber(),this.addPlayPauseButton(),this.addBasisIndicators(),this.addEventListeners(),this.addTooltip()}return t.prototype.updatePosition=function(t){this.mouseDown||(this.scrubber.style.left=Math.floor(this.timelineWidth*t)+"px")},t.prototype.updatePlayPauseIcon=function(t){this.playPauseButton.innerHTML=t?i.playIcon:i.pauseIcon},t.prototype.addButton=function(t,e,n,i){var o=document.createElement("button");return o.innerHTML=n,o.title=e,o.className="detourrButton ".concat(t,"Button"),o.onclick=function(){return i()},o},t.prototype.getElement=function(){return this.container},t.prototype.resize=function(t,e){if(this.container.style.top=t-40+"px",this.timelineWidth=this.timeline.offsetWidth-this.scrubberWidth,this.hasBasisIndicators)for(var n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERTEX_SHADER_3D=void 0,e.VERTEX_SHADER_3D="\nuniform float size;\nuniform float picking;\n// shrink when picking with box, but not on hover\nuniform float shrink; \n\nattribute vec3 color;\nattribute float alpha;\n\n// passed to fragment shader\nvarying vec3 vColor;\nvarying float vAlpha;\nvarying float vPicking;\nvarying float vShrink;\n\nvoid main(){\n vColor = color;\n vAlpha = alpha;\n vPicking = picking;\n vShrink = shrink;\n \n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = 2.0 * shrink + (200.0 * size / -mvPosition.z) * (1.0 - shrink);\n}\n"},2206:function(t,e,n){"use strict";var i,o=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&s(e,t,n);return r(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.DisplaySlice3d=void 0;var c=n(5629),l=a(n(356)),u=function(t){function e(e,n,i){var o=t.call(this,e,n,i)||this;return o.selectButtonAction=null,o.brushButtonAction=null,o}return o(e,t),e.prototype.preConstructPlotCallback=function(){this.anchor=l.expandDims(l.tensor(this.config.anchor),0)},e.prototype.project=function(t,e){var n=this,i=l.matMul(t,e),o=l.sub(t,this.anchor),s=l.sqrt(l.sum(l.square(l.sub(o,l.matMul(o,l.matMul(e,l.transpose(e))))),1)).dataSync();return this.pointAlphas.set(s.map((function(t){return t{},2578:()=>{},2980:()=>{},4862:()=>{},7958:()=>{},5410:()=>{},8628:()=>{},5042:()=>{}},t=>(t.O(0,[440,841,470,691],(()=>(2206,t(t.s=2206)))),t.O())])})); \ No newline at end of file diff --git a/man/reexports.Rd b/man/reexports.Rd index b8aae23..5bb8f3a 100644 --- a/man/reexports.Rd +++ b/man/reexports.Rd @@ -19,6 +19,6 @@ These objects are imported from other packages. Follow the links below to see their documentation. \describe{ - \item{tourr}{\code{\link[tourr]{dependence_tour}}, \code{\link[tourr]{frozen_guided_tour}}, \code{\link[tourr]{frozen_tour}}, \code{\link[tourr]{grand_tour}}, \code{\link[tourr]{guided_section_tour}}, \code{\link[tourr]{guided_tour}}, \code{\link[tourr]{little_tour}}, \code{\link[tourr]{local_tour}}, \code{\link[tourr]{planned_tour}}} + \item{tourr}{\code{\link[tourr]{dependence_tour}}, \code{\link[tourr]{frozen_guided_tour}}, \code{\link[tourr]{frozen_tour}}, \code{\link[tourr]{grand_tour}}, \code{\link[tourr]{guided_section_tour}}, \code{\link[tourr]{guided_tour}}, \code{\link[tourr]{little_tour}}, \code{\link[tourr]{local_tour}}, \code{\link[tourr:planned-tour]{planned_tour}}} }} diff --git a/srcts/show_scatter/shaders.ts b/srcts/show_scatter/shaders.ts index f6ee7b9..82fe62d 100644 --- a/srcts/show_scatter/shaders.ts +++ b/srcts/show_scatter/shaders.ts @@ -3,6 +3,7 @@ varying float vSize; varying vec3 vColor; varying float vAlpha; varying float vPicking; +varying float vShrink; // shrink points when picking void main(){ // 1.0 if picking else vAlpha diff --git a/srcts/show_scatter/show_scatter.ts b/srcts/show_scatter/show_scatter.ts index a9722b6..3d59cfe 100644 --- a/srcts/show_scatter/show_scatter.ts +++ b/srcts/show_scatter/show_scatter.ts @@ -575,6 +575,14 @@ export abstract class DisplayScatter { const pixelBuffer = new Uint8Array(4 * width * height); + // re-render the picking scene with smaller points to prevent overplotting + // when picking + this.points.geometry.setAttribute("color", this.pickingColours); + (this.points.material as THREE.ShaderMaterial).uniforms.picking.value = 1; + (this.points.material as THREE.ShaderMaterial).uniforms.shrink.value = 1; + this.renderer.setRenderTarget(this.pickingTexture); + this.renderer.render(this.scene, this.camera); + renderer.readRenderTargetPixels( pickingTexture, x, @@ -584,6 +592,12 @@ export abstract class DisplayScatter { pixelBuffer ); + // reset from picking scene + this.renderer.setRenderTarget(null); + this.points.geometry.setAttribute("color", this.pointColours); + (this.points.material as THREE.ShaderMaterial).uniforms.picking.value = 0; + (this.points.material as THREE.ShaderMaterial).uniforms.shrink.value = 0; + const selectedPointSet = new Set(); let id; for (let i = 0; i < width * height; i++) { @@ -706,12 +720,10 @@ export abstract class DisplayScatter { this.filteredPointIndices.includes(id - 1) ) { const toolTipCoords = this.toolTip.getBoundingClientRect(); - this.toolTip.style.left = `${ - Math.floor(x / dpr) - toolTipCoords.width - }px`; - this.toolTip.style.top = `${ - Math.floor(y / dpr) - toolTipCoords.height - }px`; + this.toolTip.style.left = `${Math.floor(x / dpr) - toolTipCoords.width + }px`; + this.toolTip.style.top = `${Math.floor(y / dpr) - toolTipCoords.height + }px`; this.toolTip.className = "detourrTooltip visible"; const span = this.toolTip.querySelector("span"); span.innerHTML = `${this.mapping.label[id - 1]}`; diff --git a/srcts/show_scatter_2d/index.ts b/srcts/show_scatter_2d/index.ts index 3ace2ab..92e492c 100644 --- a/srcts/show_scatter_2d/index.ts +++ b/srcts/show_scatter_2d/index.ts @@ -73,6 +73,7 @@ export class DisplayScatter2d extends DisplayScatter { size: { value: Math.max(pointSize, this.minPointSize) }, zoom: { value: this.camera.zoom }, picking: { value: 0 }, + shrink: { value: 0 } }, vertexShader: VERTEX_SHADER_2D, fragmentShader: FRAGMENT_SHADER, diff --git a/srcts/show_scatter_2d/shaders.ts b/srcts/show_scatter_2d/shaders.ts index 54efa4a..741e869 100644 --- a/srcts/show_scatter_2d/shaders.ts +++ b/srcts/show_scatter_2d/shaders.ts @@ -2,6 +2,7 @@ export const VERTEX_SHADER_2D = ` uniform float size; uniform float zoom; uniform float picking; +uniform float shrink; attribute float alpha; attribute vec3 color; @@ -10,14 +11,16 @@ attribute vec3 color; varying vec3 vColor; varying float vAlpha; varying float vPicking; +varying float vShrink; void main(){ vColor = color; vAlpha = alpha; vPicking = picking; + vShrink = shrink; vec4 mvPosition = modelViewMatrix * vec4( position, 1.0); gl_Position = projectionMatrix * mvPosition; - gl_PointSize = 100.0 * size * sqrt(zoom); + gl_PointSize = 2.0 * shrink + (100.0 * size * sqrt(zoom)) * (1.0 - shrink); } `; diff --git a/srcts/show_scatter_3d/index.ts b/srcts/show_scatter_3d/index.ts index 25ef2e3..7aaf88b 100644 --- a/srcts/show_scatter_3d/index.ts +++ b/srcts/show_scatter_3d/index.ts @@ -45,6 +45,7 @@ export class DisplayScatter3d extends DisplayScatter { uniforms: { size: { value: Math.max(pointSize, this.minPointSize) }, picking: { value: 0 }, + shrink: { value: 0 } }, vertexShader: VERTEX_SHADER_3D, fragmentShader: FRAGMENT_SHADER, diff --git a/srcts/show_scatter_3d/shaders.ts b/srcts/show_scatter_3d/shaders.ts index a621892..2020030 100644 --- a/srcts/show_scatter_3d/shaders.ts +++ b/srcts/show_scatter_3d/shaders.ts @@ -1,6 +1,8 @@ export const VERTEX_SHADER_3D = ` uniform float size; uniform float picking; +// shrink when picking with box, but not on hover +uniform float shrink; attribute vec3 color; attribute float alpha; @@ -9,14 +11,16 @@ attribute float alpha; varying vec3 vColor; varying float vAlpha; varying float vPicking; +varying float vShrink; void main(){ vColor = color; vAlpha = alpha; vPicking = picking; + vShrink = shrink; vec4 mvPosition = modelViewMatrix * vec4( position, 1.0); gl_Position = projectionMatrix * mvPosition; - gl_PointSize = 200.0 * size / -mvPosition.z; + gl_PointSize = 2.0 * shrink + (200.0 * size / -mvPosition.z) * (1.0 - shrink); } `;