|
1 | 1 | import * as THREE from 'three' |
2 | 2 | THREE.Cache.enabled = true; |
3 | 3 | import { Canvas } from '@react-three/fiber'; |
4 | | -import { Center, OrbitControls, Environment, Html } from '@react-three/drei' |
| 4 | +import { Center, OrbitControls, Environment } from '@react-three/drei' |
5 | 5 | // import * as zarr from 'zarrita' |
6 | 6 | import { variables, ZarrDataset } from '@/components/ZarrLoaderLRU' |
7 | 7 | import { useEffect, useState, useMemo } from 'react'; |
8 | 8 | // import { useEffect, useState } from 'react'; |
9 | 9 | import { useControls } from 'leva' |
10 | 10 | // import { Leva } from 'leva' |
11 | 11 | // import { lightTheme } from '@/utils/levaTheme' |
12 | | -import { ArrayToTexture, DefaultCube } from './TextureMakers'; |
13 | | -import { DataCube, PointCloud, UVCube, PlotLine } from './PlotObjects'; |
14 | | -import { TimeSeries } from './TimeSeries'; |
| 12 | +import { ArrayToTexture, DefaultCube } from './Textures/TextureMakers'; |
| 13 | +import { DataCube, PointCloud, UVCube, PlotLine } from './PlotObjects/PlotObjects'; |
15 | 14 | // import { PlaneAxis } from './PlaneAxis'; |
16 | | -import { PlotArea } from './PlotArea' |
17 | | -import { GetColorMapTexture } from '@/utils/colormap'; |
| 15 | +import { PlotArea } from './PlotObjects/PlotArea/PlotArea' |
| 16 | +import { GetColorMapTexture } from '@/components/Textures/colormap'; |
18 | 17 |
|
19 | 18 | const colormaps = ['viridis', 'plasma', 'inferno', 'magma', 'Accent', 'Blues', |
20 | 19 | 'CMRmap', 'twilight', 'tab10', 'gist_earth', 'cividis', |
@@ -58,7 +57,6 @@ export function CanvasGeometry() { |
58 | 57 | const [shape, setShape] = useState<THREE.Vector3 | THREE.Vector3>(new THREE.Vector3(2, 2, 2)) |
59 | 58 | const [timeSeriesLocs,setTimeSeriesLocs] = useState<TimeSeriesLocs>({uv:new THREE.Vector2(.5,.5), normal:new THREE.Vector3(0,0,1)}) |
60 | 59 | const [valueScales,setValueScales] = useState({maxVal:1,minVal:-1}) |
61 | | - const [showTimeSeries,setShowTimeSeries] = useState<boolean>(false) |
62 | 60 | const [colormap,setColormap] = useState<THREE.DataTexture>(GetColorMapTexture()) |
63 | 61 | const [timeSeries, setTimeSeries] = useState<number[]>([0]); |
64 | 62 | const [showLoading, setShowLoading] = useState<boolean>(false); |
@@ -147,37 +145,7 @@ export function CanvasGeometry() { |
147 | 145 | <Environment preset="city" /> |
148 | 146 |
|
149 | 147 | </Canvas> |
150 | | - </div> |
151 | | - {showTimeSeries && <> |
152 | | - |
153 | | - <TimeSeries timeSeriesLocs={timeSeriesLocs} DSInfo={{variable:variable, storePath:storeURL}} scaling={{...valueScales,colormap}}/> |
154 | | - <Html |
155 | | - fullscreen |
156 | | - style={{ |
157 | | - pointerEvents: 'none', // Prevents capturing mouse events |
158 | | - }} |
159 | | - > |
160 | | - {/* Stand in button to remove time-series stuff */} |
161 | | - <button style={{ |
162 | | - position: 'absolute', |
163 | | - bottom: '100px', |
164 | | - right: '100px', |
165 | | - padding: '8px 16px', |
166 | | - backgroundColor: '#3498db', |
167 | | - color: 'white', |
168 | | - border: 'none', |
169 | | - borderRadius: '4px', |
170 | | - cursor: 'pointer', |
171 | | - pointerEvents: 'auto' |
172 | | - |
173 | | - }} |
174 | | - onClick={()=>setShowTimeSeries(false)} |
175 | | - > |
176 | | - Hide Time Series |
177 | | - </button> |
178 | | - </Html> |
179 | | - </>} |
180 | | - |
| 148 | + </div> |
181 | 149 | <PlotArea > |
182 | 150 | <PlotLine |
183 | 151 | data={timeSeries} |
|
0 commit comments