Skip to content

Commit 0ffe76d

Browse files
authored
Merge pull request #61 from Ritika8081/web-worker
Implemented web worker and added support for Giga R1 device.
2 parents 9db53c8 + 854e02c commit 0ffe76d

File tree

13 files changed

+532
-474
lines changed

13 files changed

+532
-474
lines changed

next.config.mjs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
/** @type {import('next').NextConfig} */
2-
const nextConfig = {
1+
// next.config.mjs
2+
export default {
33
reactStrictMode: true,
4-
output: 'export', // This is key for static export
4+
output: 'export',
55
images: {
66
unoptimized: true,
77
remotePatterns: [
@@ -11,6 +11,14 @@ const nextConfig = {
1111
},
1212
],
1313
},
14+
webpack(config, { isServer }) {
15+
// If this is the server-side bundle, we don’t need to process worker files
16+
if (!isServer) {
17+
config.module.rules.push({
18+
test: /\.worker\.(js|ts)$/,
19+
use: { loader: 'worker-loader' },
20+
});
21+
}
22+
return config;
23+
},
1424
};
15-
/* module.exports = nextConfig*/
16-
export default nextConfig;

package-lock.json

Lines changed: 48 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
2-
"name": "Chords",
3-
"version": "2.3.0a",
2+
"name": "chords",
3+
"version": "2.3.2a",
44
"private": true,
5+
"type": "module",
56
"scripts": {
67
"dev": "next dev",
78
"build": "next build",
@@ -39,7 +40,7 @@
3940
"html2canvas": "^1.4.1",
4041
"jszip": "^3.10.1",
4142
"lucide-react": "^0.460.0",
42-
"next": "14.2.10",
43+
"next": "14.2.20",
4344
"next-themes": "^0.3.0",
4445
"react": "^18",
4546
"react-dom": "^18",

src/app/not-found.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Link from "next/link";
66
const FourOFourPage = async () => {
77
return (
88
<div className="">
9-
<Navbar />
9+
<Navbar isDisplay={true}/>
1010
<div className="flex flex-col min-h-[85vh] mx-auto justify-center items-center size-full">
1111
<div className="text-center py-10 px-4 sm:px-6 lg:px-8">
1212
<h1 className="text-7xl font-bold sm:text-9xl text-primary">404</h1>

src/app/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import React from "react";
24
import Navbar from "../components/Navbar";
35
import { Skeleton } from "../components/ui/skeleton";

src/components/Canvas.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ const Canvas = forwardRef(
6161
return samplingRate * 4;
6262
case "fourteen":
6363
return samplingRate * 4;
64+
case "sixteen":
65+
return samplingRate * 4;
6466
default:
6567
return 0; // Or any other fallback value you'd like
6668
}
@@ -82,7 +84,7 @@ const Canvas = forwardRef(
8284
if (array3DRef.current[activebuffer.current][i].length >= numX) {
8385
array3DRef.current[activebuffer.current][i] = [];
8486
}
85-
array3DRef.current[activebuffer.current][i].push(incomingData[i+1]);
87+
array3DRef.current[activebuffer.current][i].push(incomingData[i + 1]);
8688

8789
if (array3DRef.current[activebuffer.current][i].length < numX && !pauseRef.current) {
8890
array3DRef.current[activebuffer.current][i] = [];
@@ -289,7 +291,7 @@ const Canvas = forwardRef(
289291
// Use a separate sweep position for each line
290292
currentSweepPos.current[i] = sweepPositions.current[i];
291293
// Plot the new data at the current sweep position
292-
line.setY(currentSweepPos.current[i] % line.numPoints, data[i+1]);
294+
line.setY(currentSweepPos.current[i] % line.numPoints, data[i + 1]);
293295

294296
// Clear the next point to create a gap (optional, for visual effect)
295297
const clearPosition = (currentSweepPos.current[i] + (numX / 100)) % line.numPoints;

0 commit comments

Comments
 (0)