Skip to content
Snippets Groups Projects
Commit 3c7d0fda authored by Xiao Gui's avatar Xiao Gui
Browse files

bugfix: include util module

bugfix: deep css
chore: export default store
parent e6a8220d
No related branches found
No related tags found
No related merge requests found
Showing
with 39 additions and 44 deletions
......@@ -3,6 +3,7 @@ import { NgModule } from "@angular/core";
import { ReactiveFormsModule } from "@angular/forms";
import { SxplrFlatHierarchyModule } from "src/components/flatHierarchy";
import { AngularMaterialModule } from "src/sharedModules";
import { SapiViewsUtilModule } from "../../util";
import { SapiViewsCoreRegionModule } from "../region";
import { HighlightPipe } from "./regionsHierarchy/highlight.pipe";
import { SapiViewsCoreRichRegionsHierarchy } from "./regionsHierarchy/regionsHierarchy.component";
......@@ -15,6 +16,7 @@ import { SapiViewsCoreRichRegionListSearch } from "./regionsListSearch/regionLis
ReactiveFormsModule,
SapiViewsCoreRegionModule,
SxplrFlatHierarchyModule,
SapiViewsUtilModule,
],
declarations: [
SapiViewsCoreRichRegionListSearch,
......
:host >>> canvas
{
max-width: 100%;
max-height: 100%;
}
\ No newline at end of file
......@@ -871,3 +871,9 @@ quick-tour-unit svg
stroke-linecap: round;
stroke-linejoin: round;
}
sxplr-sapiviews-features-receptor-autoradiograph canvas
{
max-width: 100%;
max-height: 100%;
}
export { actions } from "./actions"
export { Annotation, AnnotationState, reducer } from "./store"
export { Annotation, AnnotationState, reducer, defaultState } from "./store"
export { nameSpace } from "./const"
export * as selectors from "./selectors"
\ No newline at end of file
......@@ -8,7 +8,7 @@ export type AnnotationState = {
annotations: Annotation[]
}
const defaultState: AnnotationState = {
export const defaultState: AnnotationState = {
annotations: []
}
......
export * as actions from "./action"
export * as selectors from "./selector"
export { nameSpace, ColorMapCustomLayer, CustomLayer, NgLayerCustomLayer } from "./const"
export { reducer, AtlasAppearanceStore } from "./store"
\ No newline at end of file
export { reducer, AtlasAppearanceStore, defaultState } from "./store"
\ No newline at end of file
......@@ -9,7 +9,7 @@ export type AtlasAppearanceStore = {
customLayers: CustomLayer[]
}
const defaultState: AtlasAppearanceStore = {
export const defaultState: AtlasAppearanceStore = {
octantRemoval: true,
showDelineation: true,
customLayers: []
......
......@@ -3,6 +3,12 @@ import { SapiAtlasModel, SapiParcellationModel, SapiRegionModel, SapiSpaceModel
import * as actions from "./actions"
import { ViewerMode, BreadCrumb } from "./const"
function getRegionLabelIndex(atlas: SapiAtlasModel, tmpl: SapiSpaceModel, parc: SapiParcellationModel, region: SapiRegionModel) {
const lblIdx = Number(region?.hasAnnotation?.internalIdentifier)
if (isNaN(lblIdx)) return null
return lblIdx
}
export type AtlasSelectionState = {
selectedAtlas: SapiAtlasModel
selectedTemplate: SapiSpaceModel
......@@ -87,9 +93,10 @@ const reducer = createReducer(
*
* ignore
*/
const { selectedAtlas, selectedParcellation, selectedTemplate } = state
if (
!region.hasAnnotation?.visualizedIn
&& region.hasAnnotation?.internalIdentifier === 'unknown'
&& !getRegionLabelIndex(selectedAtlas, selectedTemplate, selectedParcellation, region)
) {
return { ...state }
}
......
export * as selectors from "./selectors"
export * as actions from "./actions"
export { reducer, PluginStore } from "./store"
export { reducer, PluginStore, defaultState } from "./store"
export { Effects } from "./effects"
export { nameSpace, INIT_MANIFEST_SRC } from "./const"
\ No newline at end of file
......@@ -6,7 +6,7 @@ export type PluginStore = {
initManifests: Record<string, string>
}
const defaultState: PluginStore = {
export const defaultState: PluginStore = {
initManifests: {}
}
......
import { createAction, props } from "@ngrx/store"
import { nameSpace } from "./const"
import * as atlasSelection from "../atlasSelection"
import { SapiRegionModel, SapiSpatialFeatureModel, SapiVolumeModel } from "src/atlasComponents/sapi"
import * as userInterface from "../userInterface"
import { SapiRegionModel } from "src/atlasComponents/sapi"
import { SapiFeatureModel } from "src/atlasComponents/sapi/type"
export const {
clearSelectedRegions,
clearStandAloneVolumes,
clearNonBaseParcLayer,
} = atlasSelection.actions
export const {
openSidePanel,
closeSidePanel,
expandSidePanelDetailView,
} = userInterface.actions
export const mouseOverAnnotations = createAction(
`${nameSpace} mouseOverAnnotations`,
props<{
......
import { Injectable } from "@angular/core";
import { Actions, createEffect, ofType } from "@ngrx/effects";
import * as actions from "./actions"
import * as atlasSelectionActions from "../atlasSelection/actions"
import * as userInterface from "../userInterface"
import { mapTo } from "rxjs/operators";
@Injectable()
export class Effect {
onStandAloneVolumesExistCloseMatDrawer = createEffect(() => this.action.pipe(
ofType(atlasSelectionActions.clearStandAloneVolumes),
mapTo(actions.closeSidePanel())
mapTo(userInterface.actions.closeSidePanel())
))
constructor(private action: Actions){
......
......@@ -2,4 +2,4 @@ export { Effect } from "./effects"
export { nameSpace } from "./const"
export * as actions from "./actions"
export * as selectors from "./selectors"
export { reducer, UserInteraction } from "./store"
\ No newline at end of file
export { reducer, UserInteraction, defaultState } from "./store"
\ No newline at end of file
......@@ -7,7 +7,7 @@ export type UserInteraction = {
selectedFeature: SapiFeatureModel
}
const defaultState: UserInteraction = {
export const defaultState: UserInteraction = {
selectedFeature: null,
mouseoverRegions: []
}
......
export * as actions from "./actions"
export * as selectors from "./selectors"
export { nameSpace, PanelMode } from "./const"
export { reducer, UiStore } from "./store"
export { reducer, UiStore, defaultState } from "./store"
export { Effects } from "./effects"
......@@ -9,7 +9,7 @@ export type UiStore = {
showDelineation: boolean
}
const defaultStore: UiStore = {
export const defaultState: UiStore = {
panelMode: 'FOUR_PANEL',
panelOrder: '0123',
octantRemoval: false,
......@@ -17,7 +17,7 @@ const defaultStore: UiStore = {
}
export const reducer = createReducer(
defaultStore,
defaultState,
on(
actions.setPanelMode,
(state, { panelMode }) => {
......
export { UserPreference, defaultUserPreferenceStore, reducer } from "./store"
export { UserPreference, reducer, defaultState } from "./store"
export { nameSpace } from "./const"
export * as actions from "./actions"
export * as selectors from "./selectors"
......@@ -15,7 +15,7 @@ export type UserPreference = {
agreeKgTos: boolean
}
export const defaultUserPreferenceStore: UserPreference = {
export const defaultState: UserPreference = {
useMobileUi: JSON.parse(localStorage.getItem(LOCAL_STORAGE_CONST.MOBILE_UI)),
gpuLimit: Number(localStorage.getItem(LOCAL_STORAGE_CONST.GPU_LIMIT)) || defaultGpuLimit,
useAnimation: !localStorage.getItem(LOCAL_STORAGE_CONST.ANIMATION),
......@@ -26,7 +26,7 @@ export const defaultUserPreferenceStore: UserPreference = {
}
export const reducer = createReducer(
defaultUserPreferenceStore,
defaultState,
on(
actions.setAnimationFlag,
(state, { flag }) => {
......
......@@ -11,8 +11,7 @@ import { ContextMenuService, TContextMenuReg } from "src/contextMenuModule";
import { ComponentStore } from "../componentStore";
import { DialogService } from "src/services/dialogService.service";
import { SAPI, SapiRegionModel } from "src/atlasComponents/sapi";
import { actions, fromRootStore } from "src/state/atlasSelection";
import { atlasSelection, userInteraction } from "src/state";
import { atlasSelection, userInteraction, } from "src/state";
import { SapiSpatialFeatureModel, SapiFeatureModel, SapiParcellationModel } from "src/atlasComponents/sapi/type";
type TCStoreViewerCmp = {
......@@ -117,7 +116,7 @@ export class ViewerCmp implements OnDestroy {
)
public allAvailableParcellations$ = this.store$.pipe(
fromRootStore.allAvailParcs(this.sapi)
atlasSelection.fromRootStore.allAvailParcs(this.sapi)
)
public selectedRegions$ = this.store$.pipe(
......@@ -318,13 +317,13 @@ export class ViewerCmp implements OnDestroy {
public clearRoi(){
this.store$.dispatch(
actions.clearSelectedRegions()
atlasSelection.actions.clearSelectedRegions()
)
}
public selectRoi(roi: SapiRegionModel) {
this.store$.dispatch(
actions.selectRegion({
atlasSelection.actions.selectRegion({
region: roi
})
)
......@@ -332,7 +331,7 @@ export class ViewerCmp implements OnDestroy {
public exitSpecialViewMode(){
this.store$.dispatch(
actions.clearViewerMode()
atlasSelection.actions.clearViewerMode()
)
}
......@@ -376,7 +375,7 @@ export class ViewerCmp implements OnDestroy {
if ((feat as SapiSpatialFeatureModel).location) {
const feature = feat as SapiSpatialFeatureModel
this.store$.dispatch(
actions.navigateTo({
atlasSelection.actions.navigateTo({
navigation: {
orientation: [0, 0, 0, 1],
position: feature.location.center.coordinates.map(v => (v.unit as number) * 1e6)
......
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