Skip to content

Commit 0db482f

Browse files
committed
2 parents b1d4491 + 31e60ad commit 0db482f

File tree

3 files changed

+23
-24
lines changed

3 files changed

+23
-24
lines changed

src/app/serial-plotter/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,6 @@ const SerialPlotter = () => {
454454
</div>
455455
</div>
456456

457-
458-
459457
{/* Data Display */}
460458
<pre className="text-xs whitespace-pre-wrap break-words px-4 pb-4 flex-grow overflow-auto rounded-xl">
461459
{rawData}

src/components/BandPowerGraph.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@ const Graph
217217
}, [animateGraph]);
218218

219219
return (
220-
<div ref={containerRef} className="w-full h-full max-w-[700px]">
221-
<canvas ref={canvasRef} style={{ width: "100%", height: "100%" }} />
222-
</div>
220+
<div ref={containerRef} className="w-full h-full max-w-[500px] min-h-0 min-w-0">
221+
<canvas ref={canvasRef} className="w-full h-full" />
222+
</div>
223223
);
224224
};
225225

src/components/FFT.tsx

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -325,27 +325,28 @@ const FFT = forwardRef(
325325
}, [plotData]);
326326

327327
return (
328-
<div className="flex flex-col gap-2 w-full h-full">
329-
<main
330-
className="flex flex-col flex-[1_1_50%] h-1/2 bg-highlight rounded-2xl m-4 relative"
331-
ref={canvasContainerRef}
332-
>
333-
</main>
334-
335-
{/* Flex container for side-by-side layout */}
336-
<div className="w-full flex flex-row justify-between items-center max-w-full h-1/2 gap-20">
337-
{/* Canvas container (left side) */}
338-
<div ref={containerRef} className="flex-1 h-full">
339-
<canvas ref={canvasRef} className="w-full h-full" />
340-
</div>
341-
342-
{/* BandPowerGraph (right side) */}
343-
<div className="flex-1 h-full">
344-
<BandPowerGraph fftData={fftData} samplingRate={currentSamplingRate} />
345-
</div>
328+
<div className="flex flex-col w-full h-screen overflow-hidden">
329+
{/* Plotting Data / Main content area */}
330+
<main
331+
ref={canvasContainerRef}
332+
className="flex-1 bg-highlight rounded-2xl m-2 overflow-hidden min-h-0"
333+
>
334+
{/* Main content goes here */}
335+
</main>
336+
337+
{/* Responsive container for FFT (canvas) and BandPowerGraph */}
338+
<div className="flex-1 m-2 flex flex-col md:flex-row overflow-hidden min-h-0 gap-2">
339+
{/* FFT Canvas container */}
340+
<div ref={containerRef} className="flex-1 overflow-hidden min-h-0 min-w-0">
341+
<canvas ref={canvasRef} className="w-full h-full" />
342+
</div>
343+
344+
{/* BandPowerGraph container */}
345+
<div className="flex-1 overflow-hidden min-h-0 min-w-0">
346+
<BandPowerGraph fftData={fftData} samplingRate={currentSamplingRate} />
346347
</div>
347348
</div>
348-
349+
</div>
349350
);
350351
}
351352
);

0 commit comments

Comments
 (0)