Skip to content
Snippets Groups Projects
Unverified Commit 0701c5b5 authored by xgui3783's avatar xgui3783 Committed by GitHub
Browse files

Merge pull request #223 from HumanBrainProject/pr_removeDeprecatedDependency

chore: remove allaggregated.json
parents 620b8a58 c94bafa4
No related branches found
No related tags found
No related merge requests found
import { Injectable } from "@angular/core"; import { Injectable } from "@angular/core";
import { Store } from "@ngrx/store"; import { Store } from "@ngrx/store";
import { ViewerStateInterface, Property, FETCHED_METADATA } from "../services/stateStore.service"; import { ViewerStateInterface, Property } from "../services/stateStore.service";
import { Subject } from "rxjs"; import { Subject } from "rxjs";
import { ACTION_TYPES, ViewerConfiguration } from 'src/services/state/viewerConfig.store' import { ACTION_TYPES, ViewerConfiguration } from 'src/services/state/viewerConfig.store'
...@@ -258,31 +258,6 @@ Interactive atlas viewer requires **webgl2.0**, and the \`EXT_color_buffer_float ...@@ -258,31 +258,6 @@ Interactive atlas viewer requires **webgl2.0**, and the \`EXT_color_buffer_float
} as Partial<ViewerConfiguration> } as Partial<ViewerConfiguration>
}) })
} }
/**
* TODO deprecate
*/
const meta = 'res/json/allAggregatedData.json'
fetch(meta)
.then(res=>res.json())
.then(metadata=>{
const data = metadata.reduce((acc:[string,Map<string,{properties:Property}>][],curr:any)=>{
const idx = acc.findIndex((it)=>it[0]===curr[0].targetParcellation)
return idx >= 0 ?
acc.map((it,i)=> i === idx ? [it[0], it[1].set(curr[0].datasetName,curr[1])] : it ) :
acc.concat([[ curr[0].targetParcellation , new Map([[curr[0].datasetName , curr[1]]]) ]])
/* [[ curr[0].targetParcellation , [ curr[0].datasetName , curr[1]] ]] */
},[] as [string,Map<string,{properties:Property}>][])
this.store.dispatch({
type : FETCHED_METADATA,
fetchedMetadataMap : new Map(data)
})
})
.catch(console.error)
} }
} }
......
...@@ -3,19 +3,16 @@ import { Action } from '@ngrx/store' ...@@ -3,19 +3,16 @@ import { Action } from '@ngrx/store'
export function dataStore(state:any,action:DatasetAction){ export function dataStore(state:any,action:DatasetAction){
switch (action.type){ switch (action.type){
case FETCHED_DATAENTRIES: { case FETCHED_DATAENTRIES: {
return Object.assign({},state,{ return {
...state,
fetchedDataEntries : action.fetchedDataEntries fetchedDataEntries : action.fetchedDataEntries
}) }
} }
case FETCHED_SPATIAL_DATA :{ case FETCHED_SPATIAL_DATA :{
return Object.assign({},state,{ return {
...state,
fetchedSpatialData : action.fetchedDataEntries fetchedSpatialData : action.fetchedDataEntries
}) }
}
case FETCHED_METADATA : {
return Object.assign({},state,{
fetchedMetadataMap : action.fetchedMetadataMap
})
} }
default: default:
return state return state
...@@ -25,11 +22,9 @@ export function dataStore(state:any,action:DatasetAction){ ...@@ -25,11 +22,9 @@ export function dataStore(state:any,action:DatasetAction){
export interface DatasetAction extends Action{ export interface DatasetAction extends Action{
fetchedDataEntries : DataEntry[] fetchedDataEntries : DataEntry[]
fetchedSpatialData : DataEntry[] fetchedSpatialData : DataEntry[]
fetchedMetadataMap : Map<string,Map<string,{properties:Property}>>
} }
export const FETCHED_DATAENTRIES = 'FETCHED_DATAENTRIES' export const FETCHED_DATAENTRIES = 'FETCHED_DATAENTRIES'
export const FETCHED_METADATA = 'FETCHED_METADATA'
export const FETCHED_SPATIAL_DATA = `FETCHED_SPATIAL_DATA` export const FETCHED_SPATIAL_DATA = `FETCHED_SPATIAL_DATA`
export interface Activity{ export interface Activity{
......
...@@ -4,7 +4,7 @@ export { viewerConfigState } from './state/viewerConfig.store' ...@@ -4,7 +4,7 @@ export { viewerConfigState } from './state/viewerConfig.store'
export { pluginState } from './state/pluginState.store' export { pluginState } from './state/pluginState.store'
export { NgViewerAction, NgViewerStateInterface, ngViewerState, ADD_NG_LAYER, FORCE_SHOW_SEGMENT, HIDE_NG_LAYER, REMOVE_NG_LAYER, SHOW_NG_LAYER } from './state/ngViewerState.store' export { NgViewerAction, NgViewerStateInterface, ngViewerState, ADD_NG_LAYER, FORCE_SHOW_SEGMENT, HIDE_NG_LAYER, REMOVE_NG_LAYER, SHOW_NG_LAYER } from './state/ngViewerState.store'
export { CHANGE_NAVIGATION, AtlasAction, DESELECT_LANDMARKS, FETCHED_TEMPLATE, NEWVIEWER, SELECT_LANDMARKS, SELECT_PARCELLATION, SELECT_REGIONS, USER_LANDMARKS, ViewerStateInterface, viewerState } from './state/viewerState.store' export { CHANGE_NAVIGATION, AtlasAction, DESELECT_LANDMARKS, FETCHED_TEMPLATE, NEWVIEWER, SELECT_LANDMARKS, SELECT_PARCELLATION, SELECT_REGIONS, USER_LANDMARKS, ViewerStateInterface, viewerState } from './state/viewerState.store'
export { DataEntry, ParcellationRegion, DataStateInterface, DatasetAction, FETCHED_DATAENTRIES, FETCHED_METADATA, FETCHED_SPATIAL_DATA, Landmark, OtherLandmarkGeometry, PlaneLandmarkGeometry, PointLandmarkGeometry, Property, Publication, ReferenceSpace, dataStore, File, FileSupplementData } from './state/dataStore.store' export { DataEntry, ParcellationRegion, DataStateInterface, DatasetAction, FETCHED_DATAENTRIES, FETCHED_SPATIAL_DATA, Landmark, OtherLandmarkGeometry, PlaneLandmarkGeometry, PointLandmarkGeometry, Property, Publication, ReferenceSpace, dataStore, File, FileSupplementData } from './state/dataStore.store'
export { CLOSE_SIDE_PANEL, MOUSE_OVER_LANDMARK, MOUSE_OVER_SEGMENT, OPEN_SIDE_PANEL, TOGGLE_SIDE_PANEL, UIAction, UIStateInterface, uiState } from './state/uiState.store' export { CLOSE_SIDE_PANEL, MOUSE_OVER_LANDMARK, MOUSE_OVER_SEGMENT, OPEN_SIDE_PANEL, TOGGLE_SIDE_PANEL, UIAction, UIStateInterface, uiState } from './state/uiState.store'
export { SPATIAL_GOTO_PAGE, SpatialDataEntries, SpatialDataStateInterface, UPDATE_SPATIAL_DATA, spatialSearchState } from './state/spatialSearchState.store' export { SPATIAL_GOTO_PAGE, SpatialDataEntries, SpatialDataStateInterface, UPDATE_SPATIAL_DATA, spatialSearchState } from './state/spatialSearchState.store'
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment