From a71f4daf4e59c2c6b1d06f35e464da7d3ed67e9e Mon Sep 17 00:00:00 2001 From: Janith Wanniarachchi Date: Thu, 29 Feb 2024 01:33:30 +1100 Subject: [PATCH 01/12] :truck: add shiny as yarn dependency --- package.json | 1 + yarn.lock | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) diff --git a/package.json b/package.json index 6962119..aba0030 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "@stdlib/math-base-special-betainc": "^0.0.6", "@tensorflow/tfjs-backend-wasm": "^3.15.0", "@tensorflow/tfjs-core": "^3.15.0", + "shiny": "https://github.com/rstudio/shiny#v1.8.0", "three": "^0.128.0", "url-loader": "^4.1.1" }, diff --git a/yarn.lock b/yarn.lock index 68a346f..95244a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2379,6 +2379,24 @@ __metadata: languageName: node linkType: hard +"@types/bootstrap-datepicker@npm:0.0.14": + version: 0.0.14 + resolution: "@types/bootstrap-datepicker@npm:0.0.14" + dependencies: + "@types/jquery": "*" + checksum: 3544d5188f208894a632024c8bb9c1cb9b2d503c890157f88c8fe383b2370dc0d57df926b075a4a7456979d329128364433de13223dbdf01a1fa64f8f94be663 + languageName: node + linkType: hard + +"@types/bootstrap@npm:3.4.0": + version: 3.4.0 + resolution: "@types/bootstrap@npm:3.4.0" + dependencies: + "@types/jquery": "*" + checksum: 33f7bb9ad4a1610baf0e7d3f8dd20eee095ae2ab6cfa9109d2b40e03684ace284b86738997f9c9e73e2da429b57a36372b162758c93d698ca4900031227cd3ae + languageName: node + linkType: hard + "@types/connect-history-api-fallback@npm:^1.3.5": version: 1.3.5 resolution: "@types/connect-history-api-fallback@npm:1.3.5" @@ -2398,6 +2416,15 @@ __metadata: languageName: node linkType: hard +"@types/datatables.net@npm:^1.10.19": + version: 1.10.28 + resolution: "@types/datatables.net@npm:1.10.28" + dependencies: + "@types/jquery": "*" + checksum: 23763886a99fbca304199913ec619bd723fbcfae629e20cac7a2adcbed52e8663a0793b4a926a5564b4c233204e1ca2123fb3d2c68914d132f8931b507030aaf + languageName: node + linkType: hard + "@types/emscripten@npm:~0.0.34": version: 0.0.34 resolution: "@types/emscripten@npm:0.0.34" @@ -2464,6 +2491,31 @@ __metadata: languageName: node linkType: hard +"@types/ion-rangeslider@npm:2.3.0": + version: 2.3.0 + resolution: "@types/ion-rangeslider@npm:2.3.0" + checksum: d84fe5714a53cd8709dcfda1396c9b1328e396a45013afcb3baaec1015c6c8cd5edc5cff4eff987cf3fe6211e63822532776206da0a1b4229304bccb577e7481 + languageName: node + linkType: hard + +"@types/jquery@npm:*": + version: 3.5.29 + resolution: "@types/jquery@npm:3.5.29" + dependencies: + "@types/sizzle": "*" + checksum: 5e959762d6f7050b07b4387b6507a308113384566a77cfc4f8d0f54c2fb0a79f6bc8c057706c6aa4840cde56f32ad0e5814fb53c5f078c5db9e01670a1ecd535 + languageName: node + linkType: hard + +"@types/jquery@npm:3.5.14": + version: 3.5.14 + resolution: "@types/jquery@npm:3.5.14" + dependencies: + "@types/sizzle": "*" + checksum: 159d6f804ed1a204b3f79f2d591a271d82e866bd45bd49fb6ef40561a25dbe0f47ec7815681b44cc2db5598425f72811e7e80ab0e983d980470998ac56feb375 + languageName: node + linkType: hard + "@types/json-schema@npm:*, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": version: 7.0.9 resolution: "@types/json-schema@npm:7.0.9" @@ -2534,6 +2586,13 @@ __metadata: languageName: node linkType: hard +"@types/selectize@npm:0.12.34": + version: 0.12.34 + resolution: "@types/selectize@npm:0.12.34" + checksum: 3e9b0ad37ae8fb1c4178b557b7d55dfb0319377f935e87bee8ac91d42e297b1fa72ea6d4276990b653ad8e991c7a393d2fb7f4d1d613922da2b77742813080e2 + languageName: node + linkType: hard + "@types/serve-index@npm:^1.9.1": version: 1.9.1 resolution: "@types/serve-index@npm:1.9.1" @@ -2563,6 +2622,13 @@ __metadata: languageName: node linkType: hard +"@types/sizzle@npm:*": + version: 2.3.8 + resolution: "@types/sizzle@npm:2.3.8" + checksum: 2ac62443dc917f5f903cbd9afc51c7d6cc1c6569b4e1a15faf04aea5b13b486e7f208650014c3dc4fed34653eded3e00fe5abffe0e6300cbf0e8a01beebf11a6 + languageName: node + linkType: hard + "@types/sockjs@npm:^0.3.33": version: 0.3.33 resolution: "@types/sockjs@npm:0.3.33" @@ -3669,6 +3735,7 @@ __metadata: eslint: ^8.8.0 eslint-config-prettier: ^8.3.0 prettier: ^2.5.1 + shiny: "https://github.com/rstudio/shiny#v1.8.0" style-loader: ^3.1.0 three: ^0.128.0 ts-loader: ^9.1.2 @@ -6121,6 +6188,20 @@ __metadata: languageName: node linkType: hard +"shiny@https://github.com/rstudio/shiny#v1.8.0": + version: 1.8.0 + resolution: "shiny@https://github.com/rstudio/shiny.git#commit=283c71e77274588e8c6b5540c774a91f71865474" + dependencies: + "@types/bootstrap": 3.4.0 + "@types/bootstrap-datepicker": 0.0.14 + "@types/datatables.net": ^1.10.19 + "@types/ion-rangeslider": 2.3.0 + "@types/jquery": 3.5.14 + "@types/selectize": 0.12.34 + checksum: ce646b957864b4f76994067be1c87ab8ec8a2d38b5bf54ff98bb611f2c1ef7059deefe15dea61842fe711d4e8b1da18e75ae2e1c72db9a6976d483d64bffedf4 + languageName: node + linkType: hard + "signal-exit@npm:^3.0.0, signal-exit@npm:^3.0.3": version: 3.0.6 resolution: "signal-exit@npm:3.0.6" From 77263062c7da07a36dfe0c0f570890a2a34807ed Mon Sep 17 00:00:00 2001 From: Janith Wanniarachchi Date: Thu, 29 Feb 2024 01:35:12 +1100 Subject: [PATCH 02/12] :sparkles: add function to export click id --- srcts/show_scatter/show_scatter.ts | 39 +++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/srcts/show_scatter/show_scatter.ts b/srcts/show_scatter/show_scatter.ts index 3d59cfe..da4da50 100644 --- a/srcts/show_scatter/show_scatter.ts +++ b/srcts/show_scatter/show_scatter.ts @@ -8,6 +8,7 @@ import { AxisLabel } from "./axis_label"; import { ScatterControls } from "./controls"; import { OrbitControls } from "three/examples/jsm/controls/OrbitControls"; import "./style.css"; +import Shiny from "shiny"; import wasmSimdPath from "../../node_modules/@tensorflow/tfjs-backend-wasm/dist/tfjs-backend-wasm-simd.wasm"; import wasmSimdThreadedPath from "../../node_modules/@tensorflow/tfjs-backend-wasm/dist/tfjs-backend-wasm-threaded-simd.wasm"; @@ -125,9 +126,14 @@ export abstract class DisplayScatter { if (this.hasPointLabels) { this.addToolTip(); - this.canvas.addEventListener("mousemove", (event: MouseEvent) => - this.setTooltipFromHover(event) - ); + this.canvas.addEventListener("mousemove", (event: MouseEvent) => { + this.setTooltipFromHover(event); + }); + this.canvas.addEventListener("click", (event: PointerEvent) => { + const clickId = this.getIdfromClick(event); + console.log(clickId); + window.Shiny.setInputValue("detour_click", clickId); + }) } const pointsGeometry = new THREE.BufferGeometry(); @@ -731,6 +737,33 @@ export abstract class DisplayScatter { this.toolTip.className = "detourrTooltip"; } } + private getCoordsfromClick(event: PointerEvent, canvas: HTMLCanvasElement, dpr: number) { + const canvas_coords = canvas.getBoundingClientRect(); + const x = (event.x - canvas_coords.left) * dpr * this.scaleX(); + const y = (event.y - canvas_coords.top) * dpr * this.scaleY(); + const width = 1; + const height = 1; + return {x: x, y: y, width: width, height: height}; + } + + private getIdfromClick(event: PointerEvent) : number { + const { pickingTexture, renderer, canvas } = this; + const dpr = renderer.getPixelRatio(); + const { x, y, width, height } = this.getCoordsfromClick(event, canvas, dpr); + const pixelBuffer = new Uint8Array(12); + + renderer.readRenderTargetPixels( + pickingTexture, + x, + pickingTexture.height - y, + width, + height, + pixelBuffer + ); + + const id = (pixelBuffer[0] << 16) | (pixelBuffer[1] << 8) | pixelBuffer[2]; + return(id); + } // TODO: break away chunks in to separate functions private animate() { From a96b0e6d25251ae4f427a68569aa82a05a3fd2b3 Mon Sep 17 00:00:00 2001 From: Janith Wanniarachchi Date: Thu, 29 Feb 2024 02:29:03 +1100 Subject: [PATCH 03/12] :bug: fix issue for nonshiny environments --- srcts/show_scatter/show_scatter.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/srcts/show_scatter/show_scatter.ts b/srcts/show_scatter/show_scatter.ts index da4da50..1d06f82 100644 --- a/srcts/show_scatter/show_scatter.ts +++ b/srcts/show_scatter/show_scatter.ts @@ -132,7 +132,9 @@ export abstract class DisplayScatter { this.canvas.addEventListener("click", (event: PointerEvent) => { const clickId = this.getIdfromClick(event); console.log(clickId); - window.Shiny.setInputValue("detour_click", clickId); + if(window.Shiny != null) { + window.Shiny.setInputValue("detour_click", clickId); + } }) } From 2e1b86aecf55ac8ea7e75915eaccd1b8dbfeadf0 Mon Sep 17 00:00:00 2001 From: Janith Wanniarachchi Date: Tue, 5 Mar 2024 13:14:16 +1100 Subject: [PATCH 04/12] :bug: fix remove unnecessary inputs --- srcts/show_scatter/show_scatter.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/srcts/show_scatter/show_scatter.ts b/srcts/show_scatter/show_scatter.ts index 1d06f82..9b5dde2 100644 --- a/srcts/show_scatter/show_scatter.ts +++ b/srcts/show_scatter/show_scatter.ts @@ -764,7 +764,16 @@ export abstract class DisplayScatter { ); const id = (pixelBuffer[0] << 16) | (pixelBuffer[1] << 8) | pixelBuffer[2]; - return(id); + if ( + id != 0 && + id != this.backgroundColour && + this.filteredPointIndices.includes(id - 1) + ) { + return(id); + } else { + return(null); + } + } // TODO: break away chunks in to separate functions From 226929f5e75f703f447a938316fae73162c81e0a Mon Sep 17 00:00:00 2001 From: janithwanni Date: Tue, 13 Aug 2024 00:32:28 +0530 Subject: [PATCH 05/12] :mute: remove logs --- srcts/show_scatter/show_scatter.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/srcts/show_scatter/show_scatter.ts b/srcts/show_scatter/show_scatter.ts index 9b5dde2..66dc052 100644 --- a/srcts/show_scatter/show_scatter.ts +++ b/srcts/show_scatter/show_scatter.ts @@ -131,7 +131,6 @@ export abstract class DisplayScatter { }); this.canvas.addEventListener("click", (event: PointerEvent) => { const clickId = this.getIdfromClick(event); - console.log(clickId); if(window.Shiny != null) { window.Shiny.setInputValue("detour_click", clickId); } From 51c540db7b7f73842fc34dac0a4f096dd37c6d17 Mon Sep 17 00:00:00 2001 From: janithwanni Date: Tue, 13 Aug 2024 00:36:35 +0530 Subject: [PATCH 06/12] :sparkles: add support for shiny modules --- srcts/show_scatter/show_scatter.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/srcts/show_scatter/show_scatter.ts b/srcts/show_scatter/show_scatter.ts index 66dc052..c656b8c 100644 --- a/srcts/show_scatter/show_scatter.ts +++ b/srcts/show_scatter/show_scatter.ts @@ -132,7 +132,10 @@ export abstract class DisplayScatter { this.canvas.addEventListener("click", (event: PointerEvent) => { const clickId = this.getIdfromClick(event); if(window.Shiny != null) { - window.Shiny.setInputValue("detour_click", clickId); + window.Shiny.setInputValue( + `${this.getContainerElement().id}_detour_click`, + clickId == null ? -1: clickId + ); } }) } From 5c4be5e32ccb6f13c9d0a209a540cae09cfd4cc2 Mon Sep 17 00:00:00 2001 From: Janith Wanniarachchi Date: Thu, 29 Feb 2024 01:37:25 +1100 Subject: [PATCH 07/12] :memo: add demo of shiny id export --- demo/detourr_shiny.R | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 demo/detourr_shiny.R diff --git a/demo/detourr_shiny.R b/demo/detourr_shiny.R new file mode 100644 index 0000000..5653c12 --- /dev/null +++ b/demo/detourr_shiny.R @@ -0,0 +1,24 @@ +library(shiny) +library(detourr) + +ui <- function() { + fluidPage( + displayScatter3dOutput("detourr_out", width = "100%", height = "400px") + ) +} + +server <- function(input, output, session) { + output$detourr_out <- shinyRenderDisplayScatter2d({ + detour( + tourr::flea |> dplyr::mutate(id = dplyr::row_number()), tour_aes(projection = -species, colour = species, label = id) + ) |> + tour_path(grand_tour(3), fps = 60) |> + show_scatter(alpha = 0.7, axes = TRUE) + }) + + observeEvent(input$detour_click, { + print(input$detour_click) + }) +} + +shinyApp(ui, server, options = list(port = 5534)) \ No newline at end of file From 53dd844c3c24d38b30844afdf57273c97a976d79 Mon Sep 17 00:00:00 2001 From: Janith Wanniarachchi Date: Thu, 29 Feb 2024 02:30:47 +1100 Subject: [PATCH 08/12] :memo: update demo --- demo/detourr_shiny.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/demo/detourr_shiny.R b/demo/detourr_shiny.R index 5653c12..853c219 100644 --- a/demo/detourr_shiny.R +++ b/demo/detourr_shiny.R @@ -3,7 +3,8 @@ library(detourr) ui <- function() { fluidPage( - displayScatter3dOutput("detourr_out", width = "100%", height = "400px") + displayScatter3dOutput("detourr_out", width = "100%", height = "400px"), + textOutput("detour_click_output") ) } @@ -16,7 +17,7 @@ server <- function(input, output, session) { show_scatter(alpha = 0.7, axes = TRUE) }) - observeEvent(input$detour_click, { + output$detour_click_output <- renderText({ print(input$detour_click) }) } From 4a2005cfb347f760536c4b92a735071f13452194 Mon Sep 17 00:00:00 2001 From: Janith Wanniarachchi Date: Tue, 5 Mar 2024 13:14:16 +1100 Subject: [PATCH 09/12] :bug: fix demo for namespaced ids --- demo/shiny_detourr/click_events.R | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 demo/shiny_detourr/click_events.R diff --git a/demo/shiny_detourr/click_events.R b/demo/shiny_detourr/click_events.R new file mode 100644 index 0000000..3f11aa7 --- /dev/null +++ b/demo/shiny_detourr/click_events.R @@ -0,0 +1,26 @@ +library(shiny) +library(detourr) + +ui <- function() { + fluidPage( + displayScatter3dOutput("detourr_out", width = "100%", height = "400px") + ) +} + +server <- function(input, output, session) { + output$detourr_out <- shinyRenderDisplayScatter2d({ + detour( + tourr::flea |> + dplyr::mutate(id = dplyr::row_number()), + tour_aes(projection = -species, colour = species, label = id) + ) |> + tour_path(grand_tour(3), fps = 60) |> + show_scatter(alpha = 0.7, axes = TRUE) + }) + + observeEvent(input$detourr_out_detour_click, { + print(input$detourr_out_detour_click) + }) +} + +shinyApp(ui, server, options = list(port = 5534)) \ No newline at end of file From 19c22aece15cab6c9e9a1a565fc43e81c6056644 Mon Sep 17 00:00:00 2001 From: janithwanni Date: Tue, 13 Aug 2024 00:54:04 +0530 Subject: [PATCH 10/12] :see_no_evil: ignore renv for pkg build --- .Rbuildignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.Rbuildignore b/.Rbuildignore index c0322b4..2e2c4ff 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,3 +1,5 @@ +^renv$ +^renv\.lock$ ^.*\.Rproj$ ^\.Rproj\.user$ srcts/* From 00dbbe8fa8db67400673f52c1bb2982a94062592 Mon Sep 17 00:00:00 2001 From: janithwanni Date: Tue, 13 Aug 2024 00:57:10 +0530 Subject: [PATCH 11/12] :rocket: build package --- inst/htmlwidgets/lib/show_sage_2d.bundle.js | 2 +- inst/htmlwidgets/lib/show_sage_3d.bundle.js | 2 +- inst/htmlwidgets/lib/show_scatter_2d.bundle.js | 2 +- inst/htmlwidgets/lib/show_scatter_3d.bundle.js | 2 +- inst/htmlwidgets/lib/show_slice_2d.bundle.js | 2 +- inst/htmlwidgets/lib/show_slice_3d.bundle.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/inst/htmlwidgets/lib/show_sage_2d.bundle.js b/inst/htmlwidgets/lib/show_sage_2d.bundle.js index c71ce36..8556a32 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;\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 +!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),g=n(5138),m={};m.styleTagTransform=f(),m.setAttributes=u(),m.insert=c().bind(null,"head"),m.domAPI=r(),m.insertStyleElement=d(),o()(g.Z,m);const v=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))}}},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 ff76d6e..dd519a0 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),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 +!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 f729d58..8bd85db 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;\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 +!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),g=n(5138),m={};m.styleTagTransform=f(),m.setAttributes=u(),m.insert=c().bind(null,"head"),m.domAPI=r(),m.insertStyleElement=d(),o()(g.Z,m);const v=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_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 514c03f..044ec8e 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;\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 +!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 ebf1fba..fcb4ce1 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;\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 +!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:()=>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"},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 573b7f9..5403ece 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;\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 +!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),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"},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 From 682699c0082d56c81fa50e40c33fb9f37fb9a3b7 Mon Sep 17 00:00:00 2001 From: janithwanni Date: Tue, 13 Aug 2024 01:03:35 +0530 Subject: [PATCH 12/12] :memo: update demo to show id on app --- demo/shiny_detourr/click_events.R | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/demo/shiny_detourr/click_events.R b/demo/shiny_detourr/click_events.R index 3f11aa7..5305d11 100644 --- a/demo/shiny_detourr/click_events.R +++ b/demo/shiny_detourr/click_events.R @@ -3,7 +3,10 @@ library(detourr) ui <- function() { fluidPage( - displayScatter3dOutput("detourr_out", width = "100%", height = "400px") + fluidRow( + column(6,displayScatter3dOutput("detourr_out", width = "100%", height = "400px")), + column(6,textOutput("detourr_id")) + ) ) } @@ -18,6 +21,11 @@ server <- function(input, output, session) { show_scatter(alpha = 0.7, axes = TRUE) }) + output$detourr_id <- renderText({ + req(!is.null(input$detourr_out_detour_click)) + paste0("Clicked on id: ", input$detourr_out_detour_click) + }) + observeEvent(input$detourr_out_detour_click, { print(input$detourr_out_detour_click) })