diff --git a/src/App.tsx b/src/App.tsx index c392bf2..1b43c99 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,8 @@ import Box from '@mui/material/Box'; -import Grid from '@mui/material/Grid2'; +import Stack from '@mui/material/Stack'; +import Drawer from '@mui/material/Drawer'; +import IconButton from '@mui/material/IconButton'; +import MenuIcon from '@mui/icons-material/Menu'; import ConfigBar from './ConfigBar'; import Visualizer from './Visualizer'; import { Graph } from './Graph'; @@ -27,6 +30,7 @@ function App() { const [showCellId, setShowCellId] = React.useState(false); const [showGoals, setShowGoals] = React.useState(true); const [showGoalVectors, setShowGoalVectors] = React.useState(false); + const [drawerOpen, setDrawerOpen] = React.useState(true); const handleSkipBackward = () => { if (pixiAppRef.current?.skipBackward) { @@ -60,54 +64,77 @@ function App() { return ( - - - - - - - setGraph(graph), [])} - onSolutionChange={useCallback((solution: Solution | null) => setSolution(solution), [])} - playAnimation={playAnimation} - onPlayAnimationChange={setPlayAnimation} - onSkipBackward={handleSkipBackward} - onSkipForward={handleSkipForward} - onRestart={handleRestart} - stepSize={stepSize} - onStepSizeChange={setStepSize} - loopAnimation={loopAnimation} - onLoopAnimationChange={setLoopAnimation} - onFitView={handleFitView} - showAgentId={showAgentId} - onShowAgentIdChange={setShowAgentId} - tracePaths={tracePaths} - onTracePathsChange={setTracePaths} - canScreenshot={canScreenshot} - takeScreenshot={handleTakeScreenshot} - showCellId={showCellId} - setShowCellId={setShowCellId} - showGoals={showGoals} - setShowGoals={setShowGoals} - showGoalVectors={showGoalVectors} - setShowGoalVectors={setShowGoalVectors} - /> - - + + setDrawerOpen(true)} + sx={{ + position: 'absolute', + top: 16, + right: 16, + zIndex: 1000, + backgroundColor: 'background.paper', + '&:hover': { + backgroundColor: 'action.hover', + }, + }} + > + + + + + + setDrawerOpen(false)} + keepMounted + sx={{ + '& .MuiDrawer-paper': { + width: 400, + }, + }} + > + setGraph(graph), [])} + onSolutionChange={useCallback((solution: Solution | null) => setSolution(solution), [])} + playAnimation={playAnimation} + onPlayAnimationChange={setPlayAnimation} + onSkipBackward={handleSkipBackward} + onSkipForward={handleSkipForward} + onRestart={handleRestart} + stepSize={stepSize} + onStepSizeChange={setStepSize} + loopAnimation={loopAnimation} + onLoopAnimationChange={setLoopAnimation} + onFitView={handleFitView} + showAgentId={showAgentId} + onShowAgentIdChange={setShowAgentId} + tracePaths={tracePaths} + onTracePathsChange={setTracePaths} + canScreenshot={canScreenshot} + takeScreenshot={handleTakeScreenshot} + showCellId={showCellId} + setShowCellId={setShowCellId} + showGoals={showGoals} + setShowGoals={setShowGoals} + showGoalVectors={showGoalVectors} + setShowGoalVectors={setShowGoalVectors} + /> + ); diff --git a/src/PixiApp.tsx b/src/PixiApp.tsx index 5554b9b..078ee9d 100644 --- a/src/PixiApp.tsx +++ b/src/PixiApp.tsx @@ -391,9 +391,9 @@ const PixiApp = forwardRef(({ hudRef.current.addChild( new PIXI.Text({ - x: width - width / 100, - y: height / 100, - anchor: new PIXI.Point(1, 0), + x: width / 100, + y: height - height / 100, + anchor: new PIXI.Point(0, 1), text: "Click and drag to pan. Scroll to zoom.", style: textStyle, }) @@ -449,8 +449,8 @@ const PixiApp = forwardRef(({ if (hudRef.current) { hudRef.current.children[0].x = width / 100; hudRef.current.children[0].y = height / 100; - hudRef.current.children[1].x = width - width / 100; - hudRef.current.children[1].y = height / 100; + hudRef.current.children[1].x = width / 100; + hudRef.current.children[1].y = height - height / 100; } fit(); }