Skip to content

Commit e71e550

Browse files
authored
Merge pull request #446 from EarthyScience/jp/country-borders
Border Follow new Offset
2 parents c62b726 + 4f0b81f commit e71e550

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/components/plots/CountryBorders.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ const CountryBorders = () => {
231231

232232
const isPC = plotType == 'point-cloud'
233233
const isFlatMap = plotType == "flat"
234-
const depthScale = dataShape[0]/dataShape[2]*timeScale
234+
const timeRatio = Math.max(dataShape[0]/dataShape[2],2)
235+
const depthScale = timeRatio*timeScale
236+
235237
const globalScale = isPC ? dataShape[2]/500 : 1
236238

237239
return(
@@ -241,7 +243,7 @@ const CountryBorders = () => {
241243
>
242244
<group
243245
visible={showBorders && !(analysisMode && axis != 0)}
244-
position={(spherize || isFlatMap) ? [0,0,(isFlatMap ? 0.001 : 0)] : [0, 0, swapSides ? zRange[0]*(isPC ? depthScale + pointSize/10000 : 1) : zRange[1]*(isPC ? depthScale + pointSize/10000 : 1)]} // I don't know what value to use here. THis seems okay but not perfect
246+
position={(spherize || isFlatMap) ? [0,0,(isFlatMap ? 0.001 : 0)] : [0, 0, swapSides ? zRange[0]*(isPC ? depthScale + pointSize/10000 : timeRatio/2) : zRange[1]*(isPC ? depthScale + pointSize/10000 : timeRatio/2)]} // I don't know what value to use here. THis seems okay but not perfect
245247
>
246248
{coastLines && <Borders features={coastLines} />}
247249
{borders && <Borders features={borders} />}

src/components/plots/Plot.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,10 @@ const Plot = ({ZarrDS}:{ZarrDS: ZarrDataset}) => {
306306
setTextures(updated as THREE.Data3DTexture[] | THREE.DataTexture[]);
307307
},[interpPixels])
308308

309+
useEffect(()=>{ // Rotates flat back when changing away
310+
usePlotStore.setState({rotateFlat: false})
311+
},[plotType])
312+
309313
const Nav = useMemo(()=>Navbar,[])
310314
return (
311315
<div id='main-canvas-div' className='main-canvas'

0 commit comments

Comments
 (0)