Skip to content

Commit 8ff3a09

Browse files
committed
webR App: Maximize plot pane if files pane hidden
1 parent 5aad845 commit 8ff3a09

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/repl/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ function App() {
257257
const group2 = <>
258258
<Files hidden={hideFiles} webR={webR} filesInterface={filesInterface} />
259259
<PanelResizeHandle hidden={hideFiles || hidePlot} />
260-
<Plot hidden={hidePlot} webR={webR} plotInterface={plotInterface} />
260+
<Plot hidden={hidePlot} maximize={hideFiles} webR={webR} plotInterface={plotInterface}/>
261261
</>;
262262

263263
return (

src/repl/components/Plot.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ import { WebR } from '../../webR/webr-main';
88
export function Plot({
99
webR,
1010
plotInterface,
11+
maximize,
1112
hidden,
1213
}: {
1314
webR: WebR;
1415
plotInterface: PlotInterface;
16+
maximize: boolean,
1517
hidden: boolean;
1618
}) {
1719
const plotContainerRef = React.useRef<HTMLDivElement | null>(null);
@@ -117,7 +119,8 @@ export function Plot({
117119
hidden={hidden}
118120
role="region"
119121
aria-label="Plotting Pane"
120-
minSize={20}
122+
minSize={maximize ? 100 : 20}
123+
defaultSize={maximize ? 100 : 50}
121124
onResize={onResize}
122125
ref={panelRef}
123126
>

0 commit comments

Comments
 (0)