@@ -21,27 +21,27 @@ import {
2121import { Switch } from './switch' ;
2222import Hider from './Hider' ;
2323import { Button } from './button' ;
24- import KeyFrames from './KeyFrames' ;
24+ import { BsBoxArrowRight } from "react-icons/bs" ;
2525
2626const ExportImageSettings = ( ) => {
2727 const {
2828 includeBackground, includeColorbar, doubleSize, cbarLoc, cbarNum,
2929 useCustomRes, customRes, includeAxis, mainTitle, cbarLabel, cbarUnits, animate, timeRate,
30- frames, frameRate, orbit, useTime, loopTime, animViz , preview, pingpong
30+ frames, frameRate, orbit, useTime, loopTime, keyFrameEditor , preview, pingpong
3131 } = useImageExportStore ( useShallow ( state => ( {
3232 includeBackground : state . includeBackground , includeColorbar : state . includeColorbar ,
3333 doubleSize : state . doubleSize , cbarLoc : state . cbarLoc , cbarNum : state . cbarNum , useCustomRes : state . useCustomRes ,
3434 customRes : state . customRes , includeAxis : state . includeAxis , mainTitle : state . mainTitle , cbarLabel : state . cbarLabel ,
3535 cbarUnits :state . cbarUnits , animate : state . animate , timeRate :state . timeRate , frames : state . frames , frameRate : state . frameRate ,
36- orbit : state . orbit , useTime :state . useTime , loopTime : state . loopTime , animViz :state . animViz ,
36+ orbit : state . orbit , useTime :state . useTime , loopTime : state . loopTime , keyFrameEditor :state . keyFrameEditor ,
3737 preview :state . preview , pingpong :state . pingpong
3838 } ) ) )
3939
4040 const { ExportImg, EnableExport, setIncludeBackground, setIncludeColorbar,
4141 setDoubleSize, setCbarLoc, setCbarNum, setUseCustomRes, setCustomRes, setIncludeAxis,
4242 setHideAxis, setHideAxisControls, setMainTitle, setCbarLabel, setAnimate,
43- setFrames, setFrameRate, setTimeRate, setOrbit, setUseTime, setLoopTime, setAnimViz ,
44- setCbarUnits, setPingpong, setPreview} = useImageExportStore . getState ( )
43+ setFrames, setFrameRate, setTimeRate, setOrbit, setUseTime, setLoopTime, setKeyFrameEditor ,
44+ setCbarUnits, setPingpong, setPreview, setPreviewExtent } = useImageExportStore . getState ( )
4545
4646 interface CapitalizeFn {
4747 ( str : string ) : string ;
@@ -58,6 +58,7 @@ const ExportImageSettings = () => {
5858 const [ showTitles , setShowTitles ] = useState ( false )
5959 const [ showAnimation , setShowAnimation ] = useState ( false )
6060 const [ showSettings , setShowSettings ] = useState ( true )
61+ const [ previewState , setPreviewState ] = useState ( false )
6162
6263 useEffect ( ( ) => {
6364 const timeArray = dimArrays [ dimArrays . length - 3 ]
@@ -178,6 +179,14 @@ const ExportImageSettings = () => {
178179 < h1 > Height</ h1 >
179180 < Input id = 'cbarNum' type = "number" value = { customRes [ 1 ] } onChange = { e => setCustomRes ( [ customRes [ 0 ] , parseInt ( e . target . value ) ] ) } />
180181 </ div >
182+ < Button className = { `col-span-2 ${ previewState ? 'bg-red-600' : '' } ` }
183+ variant = 'outline'
184+ disableRipple
185+ onPointerEnter = { ( ) => setPreviewExtent ( true ) }
186+ onPointerLeave = { ( ) => setPreviewExtent ( false ) }
187+ >
188+ Preview Extent
189+ </ Button >
181190 </ div >
182191 </ Hider >
183192
@@ -215,11 +224,17 @@ const ExportImageSettings = () => {
215224 < Input id = "fps" type = 'number' step = { 1 } value = { frameRate } onChange = { e => setFrameRate ( parseInt ( e . target . value ) ) } />
216225 </ div >
217226 < div className = "grid grid-cols-[auto_60px] items-center gap-2" >
218- < label htmlFor = "useOrbit" > Ping-Pong</ label >
219- < Switch id = "useOrbit" checked = { pingpong } onCheckedChange = { e => setPingpong ( e ) } />
227+
220228
221229 < label htmlFor = "useOrbit" > Orbit</ label >
222230 < Switch id = "useOrbit" checked = { orbit } onCheckedChange = { e => setOrbit ( e ) } />
231+
232+ < Hider show = { orbit } className = 'col-span-2' >
233+ < div className = "grid grid-cols-[auto_60px] items-center gap-2 mb-2" >
234+ < label htmlFor = "useOrbit" > Ping-Pong</ label >
235+ < Switch id = "useOrbit" checked = { pingpong } onCheckedChange = { e => setPingpong ( e ) } />
236+ </ div >
237+ </ Hider >
223238
224239 < label htmlFor = "useTime" > Animate Time</ label >
225240 < Switch id = "useTime" checked = { useTime } onCheckedChange = { e => setUseTime ( e ) } />
@@ -235,11 +250,13 @@ const ExportImageSettings = () => {
235250 < div className = 'border-b my-2' />
236251 </ Hider >
237252
238- < label htmlFor = "changeViz" > Animate Visuals</ label >
239- < Switch id = "changeViz" checked = { animViz } onCheckedChange = { e => setAnimViz ( e ) } />
240- < Hider show = { animViz } className = 'col-span-2' >
241- < KeyFrames />
242- </ Hider >
253+ < Button
254+ className = 'col-span-2 cursor-pointer'
255+ onClick = { ( ) => setKeyFrameEditor ( true ) }
256+ >
257+ Keyframe Editor < BsBoxArrowRight />
258+ </ Button >
259+
243260 </ div >
244261 < div className = "grid grid-cols-[auto_60px] items-center gap-2 my-2" >
245262 < label htmlFor = "usePreview" > Export Preview</ label >
0 commit comments