11import { create } from "zustand" ;
22import * as THREE from 'three' ;
33import { GetColorMapTexture } from "@/components/textures" ;
4- import { IcechunkStoreOptions , FetchStoreOptions } from "@/components/zarr/Interfaces" ;
54
65const ESDC = 'https://s3.bgc-jena.mpg.de:9000/esdl-esdc-v3.0.2/esdc-16d-2.5deg-46x72x1440-3.0.2.zarr'
76
@@ -32,7 +31,6 @@ type StoreState = {
3231 plotDim : number ;
3332 flipY :boolean ;
3433 initStore :string ;
35- fetchKey : number ;
3634 variable : string ;
3735 variables : string [ ] ;
3836 openVariables : boolean ;
@@ -48,9 +46,6 @@ type StoreState = {
4846 textureArrayDepths : number [ ] ;
4947 textureData : Uint8Array ;
5048 clampExtremes : boolean ;
51- icechunkOptions : IcechunkStoreOptions | null ;
52- fetchOptions : FetchStoreOptions | null ;
53- abortController : AbortController | null ;
5449
5550 // setters
5651 setDataShape : ( dataShape : number [ ] ) => void ;
@@ -70,7 +65,6 @@ type StoreState = {
7065 setPlotDim : ( plotDim : number ) => void ;
7166 setFlipY : ( flipY :boolean ) => void ;
7267 setInitStore : ( initStore :string ) => void ;
73- bumpFetchKey : ( ) => void ;
7468 setVariable : ( variable : string ) => void ;
7569 setVariables : ( variables : string [ ] ) => void ;
7670 setOpenVariables : ( openVariables : boolean ) => void ;
@@ -86,9 +80,6 @@ type StoreState = {
8680 setDPR : ( DPR : number ) => void ;
8781 setScalingFactor : ( scalingFactor : number | null ) => void ;
8882 setClampExtremes : ( clampExtremes : boolean ) => void ;
89- setIcechunkOptions : ( options : IcechunkStoreOptions | null ) => void ;
90- setFetchOptions : ( options : FetchStoreOptions | null ) => void ;
91- setAbortController : ( controller : AbortController | null ) => void ;
9283} ;
9384
9485export const useGlobalStore = create < StoreState > ( ( set , get ) => ( {
@@ -107,7 +98,6 @@ export const useGlobalStore = create<StoreState>((set, get) => ({
10798 plotDim : 0 ,
10899 flipY : false ,
109100 initStore : ESDC ,
110- fetchKey : 0 ,
111101 variable : 'Default' ,
112102 variables : [ ] ,
113103 openVariables : false ,
@@ -123,9 +113,6 @@ export const useGlobalStore = create<StoreState>((set, get) => ({
123113 DPR : 1 ,
124114 scalingFactor : null ,
125115 clampExtremes : false ,
126- icechunkOptions : null ,
127- fetchOptions : null ,
128- abortController : null ,
129116 // setters
130117
131118 setDataShape : ( dataShape ) => set ( { dataShape } ) ,
@@ -165,7 +152,6 @@ export const useGlobalStore = create<StoreState>((set, get) => ({
165152 setPlotDim : ( plotDim ) => set ( { plotDim } ) ,
166153 setFlipY : ( flipY ) => set ( { flipY } ) ,
167154 setInitStore : ( initStore ) => set ( { initStore } ) ,
168- bumpFetchKey : ( ) => set ( s => ( { fetchKey : s . fetchKey + 1 } ) ) ,
169155 setVariable : ( variable ) => set ( { variable } ) ,
170156 setVariables : ( variables ) => set ( { variables } ) ,
171157 setOpenVariables : ( openVariables ) => set ( { openVariables } ) ,
@@ -180,7 +166,4 @@ export const useGlobalStore = create<StoreState>((set, get) => ({
180166 setDPR : ( DPR ) => set ( { DPR } ) ,
181167 setScalingFactor : ( scalingFactor ) => set ( { scalingFactor } ) ,
182168 setClampExtremes : ( clampExtremes ) => set ( { clampExtremes } ) ,
183- setIcechunkOptions : ( options ) => set ( { icechunkOptions : options } ) ,
184- setFetchOptions : ( options ) => set ( { fetchOptions : options } ) ,
185- setAbortController : ( controller ) => set ( { abortController : controller } ) ,
186169} ) ) ;
0 commit comments