"use client";
import { motion } from "framer-motion";
import { COLORS, VizFrame } from "./common";
function TabularViz() {
const cols = 5;
const rows = 4;
const cells = Array.from({ length: cols * rows });
return (
{cells.map((_, i) => {
const c = i % cols;
const r = Math.floor(i / cols);
return (
);
})}
);
}
function ImageViz() {
const N = 8;
return (
{Array.from({ length: N * N }, (_, i) => {
const c = i % N;
const r = Math.floor(i / N);
const v = (Math.sin(c * 0.7) + Math.cos(r * 0.6)) * 0.5 + 0.5;
return (
);
})}
);
}
function TextViz() {
const tokens = ["the", "drone", "sees", "a", "gate"];
return (
{tokens.map((t, i) => (
{t}
))}
);
}
function AudioViz() {
const N = 30;
return (
{Array.from({ length: N }, (_, i) => {
const h = Math.abs(Math.sin(i * 0.6)) * 30 + 4 + (i % 3) * 4;
return (
);
})}
);
}
const MODES: {
label: string;
desc: string;
shape: string;
draw: () => JSX.Element;
}[] = [
{ label: "Tabular", desc: "rows × columns", shape: "(N, F)", draw: TabularViz },
{ label: "Image", desc: "pixels with channels", shape: "(H, W, C)", draw: ImageViz },
{ label: "Text", desc: "sequence of tokens", shape: "(T,)", draw: TextViz },
{ label: "Audio", desc: "waveform / spectrogram", shape: "(T,) or (F, T)", draw: AudioViz },
];
export function ModalityGrid({
width = 880,
height = 320,
}: {
width?: number;
height?: number;
}) {
const padX = 30;
const padY = 20;
const cellW = (width - padX * 2) / MODES.length;
return (
);
}