summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nodes/Fourier.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nodes/Fourier.tsx b/src/nodes/Fourier.tsx
index f95f26d..b9bda3f 100644
--- a/src/nodes/Fourier.tsx
+++ b/src/nodes/Fourier.tsx
@@ -2,11 +2,11 @@ import { NodeShell, InputArray, OutputNumber, NodeComponentProps, NodeInfo } fro
import { fft } from '../wasm.ts';
export interface FourierInputs {
- data: Float32Array,
+ data: Float32Array | null,
}
export interface FourierOutputs {
- data: Float32Array,
+ data: Float32Array | null,
}
export const Fourier = ({ id, x, y, inputs }: NodeComponentProps<FourierInputs>) => {
@@ -20,6 +20,6 @@ export const Fourier = ({ id, x, y, inputs }: NodeComponentProps<FourierInputs>)
export const FourierNode: NodeInfo<FourierInputs, FourierOutputs> = {
component: Fourier,
- func: ({ data }) => ({ data: fft(data) }),
- inputs: { data: new Float32Array(0) },
-}; \ No newline at end of file
+ func: ({ data }) => ({ data: data ? fft(data) : null }),
+ inputs: { data: null },
+};