Skip to content

Commit ce77306

Browse files
authored
Merge pull request #573 from EarthyScience/jp/cam-tweaks
Cam Tweak and Other Tweaks
2 parents bdd42f8 + 5814d8b commit ce77306

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/components/plots/AnalysisWG.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const AnalysisWG = ({ setTexture, }: { setTexture: React.Dispatch<React.SetState
6969
xSlice: state.xSlice
7070
})));
7171
const isMounted = useRef(false)
72-
72+
7373
useEffect(() => {
7474
if (!plotOn){
7575
return
@@ -198,6 +198,9 @@ const AnalysisWG = ({ setTexture, }: { setTexture: React.Dispatch<React.SetState
198198
}, [execute]);
199199

200200
useEffect(()=>{
201+
if (!plotOn){
202+
return
203+
}
201204
const shapeInfo = { dataShape, outputShape, strides};
202205
const kernelParams = { kernelDepth, kernelSize };
203206

src/components/plots/Plot.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ const Orbiter = ({isFlat} : {isFlat : boolean}) =>{
127127
controls.update() //Need this extra update to clear the internal inertia buffer. Cant seem to access it in code.
128128
invalidate()
129129
cam.position.copy(cameraPosition)
130-
cam.lookAt(new THREE.Vector3(0, 0, 0))
131-
//@ts-ignore the check means it is ortho
130+
controls.target.copy(new THREE.Vector3(0, 0, 0))
131+
//@ts-ignore the check means cam will have that method
132132
if (useOrtho) cam.updateProjectionMatrix()
133133
else cam.updateMatrix()
134134
controls.update()

src/components/zarr/ZarrLoaderLRU.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,21 +152,20 @@ const maxRetries = 10;
152152
const retryDelay = 500; // 0.5 seconds in milliseconds
153153

154154
export async function GetStore(storePath: string): Promise<zarr.Group<zarr.FetchStore | zarr.Listable<zarr.FetchStore>> | undefined>{
155-
const {setStatus} = useGlobalStore.getState();
156155
for (let attempt = 0; attempt <= maxRetries; attempt++) {
157156
try {
158157
const d_store = zarr.tryWithConsolidated(
159158
new zarr.FetchStore(storePath)
160159
);
161160
const gs = await d_store.then(store => zarr.open(store, {kind: 'group'}));
162-
setStatus(null)
161+
useGlobalStore.setState({ status: null })
163162
return gs;
164163
} catch (error) {
165164
// If this is the final attempt, handle the error
166165
if (attempt === maxRetries) {
167166
if (storePath.slice(0,5) != 'local'){
168167
useErrorStore.getState().setError('zarrFetch')
169-
setStatus(null)
168+
useGlobalStore.setState({ status: null })
170169
}
171170
throw new ZarrError(`Failed to initialize store at ${storePath}`, error);
172171
}

0 commit comments

Comments
 (0)