Fix Plotly display issues

This commit is contained in:
James Ketr 2025-04-26 16:47:54 -07:00
parent f70fe8e225
commit 901ed3f9c0
2 changed files with 13 additions and 13 deletions

View File

@ -1,4 +1,4 @@
.js-plotly-plot { /* .js-plotly-plot {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
@ -16,4 +16,4 @@
.plotly .svg-container { .plotly .svg-container {
width: 100% !important; width: 100% !important;
height: 100% !important; height: 100% !important;
} } */

View File

@ -312,6 +312,7 @@ const VectorVisualizer: React.FC<VectorVisualizerProps> = (props: VectorVisualiz
<Box className="VectorVisualizer" <Box className="VectorVisualizer"
sx={{ sx={{
display: 'flex', display: 'flex',
position: 'relative',
flexDirection: 'column', flexDirection: 'column',
flexGrow: 1, flexGrow: 1,
...sx ...sx
@ -324,15 +325,16 @@ const VectorVisualizer: React.FC<VectorVisualizerProps> = (props: VectorVisualiz
</Typography> </Typography>
</Card> </Card>
} }
<FormControlLabel sx={{ <FormControlLabel
display: "inline-flex", sx={{
width: "fit-content", display: "flex",
mb: '-2.5rem', position: "absolute",
zIndex: 100, width: "fit-content",
ml: 1, ml: 1,
flexBasis: 0, zIndex: 100,
flexGrow: 0 flexBasis: 0,
}} flexGrow: 0
}}
control={<Switch checked={!view2D} />} onChange={() => setView2D(!view2D)} label="3D" /> control={<Switch checked={!view2D} />} onChange={() => setView2D(!view2D)} label="3D" />
<Plot <Plot
onClick={(event: any) => { onClick={(event: any) => {
@ -360,8 +362,6 @@ const VectorVisualizer: React.FC<VectorVisualizerProps> = (props: VectorVisualiz
style={{ style={{
display: "flex", display: "flex",
flexGrow: 1, flexGrow: 1,
justifyContent: 'center',
alignItems: 'center',
minHeight: '240px', minHeight: '240px',
padding: 0, padding: 0,
margin: 0, margin: 0,