Skip to content

Commit f932720

Browse files
authored
Merge pull request #70 from Ritika8081/board-support
updated logic to get all information about board from board_list file
2 parents 9b115bb + 81f770b commit f932720

File tree

4 files changed

+189
-153
lines changed

4 files changed

+189
-153
lines changed

src/components/Canvas.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import { WebglPlot, ColorRGBA, WebglLine } from "webgl-plot";
1212

1313
interface CanvasProps {
1414
pauseRef: React.RefObject<boolean>;
15-
selectedBits: BitSelection;
15+
selectedBits?: BitSelection; // Add `?` to make it optional
1616
isDisplay: boolean;
1717
canvasCount?: number;
1818
timeBase?: number;
19-
currentSamplingRate:number;
19+
currentSamplingRate: number;
2020
Zoom: number;
2121
currentSnapshot: number;
2222
snapShotRef: React.MutableRefObject<boolean[]>;
@@ -60,17 +60,17 @@ const Canvas = forwardRef(
6060
//select point
6161
const getpoints = useCallback((bits: BitSelection): number => {
6262
switch (bits) {
63-
case "ten":
63+
case 10:
6464
return 250;
65-
case "twelve":
66-
case "fourteen":
67-
case "sixteen":
65+
case 12:
66+
case 14:
67+
case 16:
6868
return 500;
6969
default:
7070
return 500; // Default fallback
7171
}
7272
}, []);
73-
73+
7474

7575
useEffect(() => {
7676
numXRef.current = (currentSamplingRate * timeBase);
@@ -188,7 +188,7 @@ const Canvas = forwardRef(
188188
const opacityLightMajor = "0.4"; // Opacity for every 5th line in light theme
189189
const opacityLightMinor = "0.1"; // Opacity for other lines in light theme
190190
const distanceminor = samplingRate * 0.04;
191-
const numGridLines = getpoints(selectedBits) * 4 / distanceminor;
191+
const numGridLines = getpoints(selectedBits ?? 10) * 4 / distanceminor;
192192
for (let j = 1; j < numGridLines; j++) {
193193
const gridLineX = document.createElement("div");
194194
gridLineX.className = "absolute bg-[rgb(128,128,128)]";

0 commit comments

Comments
 (0)