diff --git a/docs/releases/v2.7.3.md b/docs/releases/v2.7.3.md index c871714212a11ea27d688ef4d54711ac4c086692..ec24dc460b6f4bc81b0faab9a78fa5eaf29ff948 100644 --- a/docs/releases/v2.7.3.md +++ b/docs/releases/v2.7.3.md @@ -4,8 +4,10 @@ - fixed matomo visitor counting (broke since 2.7.0 release) - fixed sane url generation +- fixed reset navigation buttons in navigation card ## Under the hood - minor refactor of unused code - added mirrors to siibra-api +- experimental support for drag and drop swc diff --git a/src/viewerModule/nehuba/nehubaViewerGlue/nehubaViewerGlue.component.ts b/src/viewerModule/nehuba/nehubaViewerGlue/nehubaViewerGlue.component.ts index 0c7b084eb8dab41764d88d913578e8eeb843478b..fea1911266af6a410bdd339c805c4aeb3129f20c 100644 --- a/src/viewerModule/nehuba/nehubaViewerGlue/nehubaViewerGlue.component.ts +++ b/src/viewerModule/nehuba/nehubaViewerGlue/nehubaViewerGlue.component.ts @@ -284,8 +284,33 @@ export class NehubaGlueCmp implements IViewer<'nehuba'>, OnDestroy, AfterViewIni /** * TODO check extension? */ - this.dismissAllAddedLayers() + + if (/\.swc$/i.test(file.name)) { + const url = URL.createObjectURL(file) + this.droppedLayerNames.push({ + layerName: randomUuid, + resourceUrl: url + }) + this.store$.dispatch( + atlasAppearance.actions.addCustomLayer({ + customLayer: { + id: randomUuid, + source: `swc://${url}`, + segments: ["1"], + transform: [ + [1e3, 0, 0, 0], + [0, 1e3, 0, 0], + [0, 0, 1e3, 0], + [0, 0, 0, 1], + ], + clType: 'customlayer/nglayer' as const + } + }) + ) + return + } + // Get file, try to inflate, if files, use original array buffer const buf = await file.arrayBuffer() diff --git a/src/viewerModule/nehuba/statusCard/statusCard.component.ts b/src/viewerModule/nehuba/statusCard/statusCard.component.ts index 26d6786e8b7f7ea3723eb47d7a32bc299c46b720..58bbdf911ed843cd5e68123f65869fe5843b3ace 100644 --- a/src/viewerModule/nehuba/statusCard/statusCard.component.ts +++ b/src/viewerModule/nehuba/statusCard/statusCard.component.ts @@ -177,10 +177,7 @@ export class StatusCardComponent implements OnInit, OnChanges{ */ public resetNavigation({rotation: rotationFlag = false, position: positionFlag = false, zoom : zoomFlag = false}: {rotation?: boolean, position?: boolean, zoom?: boolean}): void { const config = getNehubaConfig(this.selectedTemplate) - const { - orientation, - position - } = config.dataset.initialNgState.navigation.pose + const { zoomFactor: zoom } = config.dataset.initialNgState.navigation @@ -189,8 +186,8 @@ export class StatusCardComponent implements OnInit, OnChanges{ actions.navigateTo({ navigation: { ...this.currentNavigation, - ...(rotationFlag ? { orientation: orientation } : {}), - ...(positionFlag ? { position: position } : {}), + ...(rotationFlag ? { orientation: [0, 0, 0, 1] } : {}), + ...(positionFlag ? { position: [0, 0, 0] } : {}), ...(zoomFlag ? { zoom: zoom } : {}), }, physical: true,