Files
William Manzoli c604e5983c feat: add Gaussian Splatting support (#259)
* feat: add @json-render/gsplat package

Standalone Gaussian Splatting renderer using Hugging Face's gsplat.js.
Provides GaussianSplat and GaussianSplatViewer components with progress
indicator, orbit controls, and Zod-based catalog definitions — no
Three.js dependency required.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: add GaussianSplat component to react-three-fiber

Adds GaussianSplat to the R3F renderer using drei's Splat loader,
bringing the component count to 20. Splats are composable with all
existing R3F components (lights, controls, post-processing, etc.).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: add standalone gsplat example

Demo app showcasing @json-render/gsplat with 5 scenes (bonsai, garden,
bicycle, kitchen, stump) loaded from Hugging Face datasets. Includes
scene selector, live JSON spec viewer, and progress indicator.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: add react-three-fiber gsplat example

Demo app showcasing GaussianSplat in R3F with 5 scenes: splat showroom,
splat with primitives, multi-splat, post-processing effects (bloom +
vignette), and animated floating splat with sparkles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: add gsplat API reference and update navigation

Adds API documentation for @json-render/gsplat, updates the R3F docs
to reflect 20 components, and registers both example apps in the
docs navigation, examples list, and page titles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: add changeset and update lockfile for gsplat

Adds @json-render/gsplat to the fixed version group and creates a
changeset for the minor release of gsplat and react-three-fiber.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: wire up GaussianSplatViewer props to gsplat.js API

The catalog declared controls, autoRotate, autoRotateSpeed,
cameraPosition, cameraTarget, and fov props but the component
silently ignored them. Now:
- cameraPosition sets camera.position via SPLAT.Vector3
- cameraTarget calls controls.setCameraTarget()
- fov converts to focal length via camera.data.fx/fy
- controls=false skips OrbitControls creation
- autoRotate rotates the camera around Y in the render loop
- Updated gsplat.d.ts with full Camera/OrbitControls type surface

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(gsplat): address review issues — transforms, progress bar, themeable colors

- Apply per-splat position/rotation/scale after LoadAsync (splats were
  rendering at origin regardless of config)
- Add eulerToQuaternion helper to convert Vec3 degrees to Quaternion
- Expose Splat class and correct LoadAsync return type (Promise<Splat>)
  in gsplat.d.ts so transforms can be applied imperatively
- Forward visible prop through GaussianSplatHandle and SplatEntry
- Fix progress bar regression: use Math.max so bar never jumps backwards
- Make ProgressIndicator colors themeable via progressBarColor,
  progressTrackColor, progressTextColor, progressBackgroundColor props
  on GaussianSplatViewer
- Remove quality/alphaHash/toneMapped from standalone gsplat catalog —
  these gsplat.js renderer has no equivalent API for them (they remain
  in @json-render/react-three-fiber where drei's Splat supports them)
- Fix pre-existing TS2769/TS2322 Vec3 type errors in GaussianSplat.tsx

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(gsplat): pass required progress color props in example

The new themeable progress indicator props are nullable (required keys
that accept null) in the catalog schema. The example was missing them,
causing TS2739 in CI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor(gsplat): drop standalone @json-render/gsplat package

Per discussion in #259, the standalone gsplat viewer is better positioned
as an experimental example than as a published package — there's no real
spec tree to compose, and the R3F GaussianSplat component already covers
the productized use case.

- Remove packages/gsplat (was @json-render/gsplat)
- Inline the viewer component into examples/gsplat as an experimental demo
- Drop @json-render/{core,react,gsplat} deps from the example
- Remove gsplat from changeset config and feat-gsplat.md
- Remove docs/api/gsplat page and its navigation entries
- Update README to drop the standalone install/snippet

* fix(gsplat): address review issues, add ExtrudedText component, improve a11y

- Fix GridHelper prop names (color1/color2 → color/secondaryColor) in all R3F scene files
- Fix Text3D prop mismatch in splat-with-primitives (size → fontSize, remove unsupported bevel/font props)
- Fix autoRotate to orbit around camera target instead of world origin
- Add ExtrudedText component to @json-render/react-three-fiber (geometry-based 3D text with depth, bevel, and custom font support)
- Add multi-offset scene to gsplat example to demonstrate off-center orbit
- Redesign splat-with-primitives scene (triangle logo + extruded label, remove floor plane)
- Improve gsplat example accessibility (ARIA labels, keyboard nav, semantic HTML, focus management)
- Debounce resize handler and use consistent 100dvh in gsplat viewer

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Lucian Fialho <lucianfialhobp@hotmail.com>
2026-04-10 22:18:19 -05:00

177 lines
5.2 KiB
TypeScript

export type Example = {
slug: string;
title: string;
description: string;
tags: string[];
githubPath: string;
demoUrl?: string;
};
const GITHUB_BASE =
"https://github.com/vercel-labs/json-render/tree/main/examples";
export const examples: Example[] = [
{
slug: "chat",
title: "Chat",
description:
"AI chat app with tool calling, streaming UI, and rich components powered by the AI SDK.",
tags: ["React", "Next.js", "AI"],
githubPath: "examples/chat",
demoUrl: "https://chat-demo.json-render.dev",
},
{
slug: "dashboard",
title: "Dashboard",
description:
"AI-generated dashboard with drag-and-drop, charts, and real-time data binding.",
tags: ["React", "Next.js", "AI"],
githubPath: "examples/dashboard",
demoUrl: "https://dashboard-demo.json-render.dev",
},
{
slug: "no-ai",
title: "No AI",
description:
"Static specs rendered without any AI — forms, cards, tables, and more from hardcoded JSON.",
tags: ["React", "Next.js"],
githubPath: "examples/no-ai",
demoUrl: "https://no-ai-demo.json-render.dev",
},
{
slug: "svelte",
title: "Svelte",
description:
"Svelte renderer demo with counter, todo list, and two-way data binding.",
tags: ["Svelte", "Vite"],
githubPath: "examples/svelte",
demoUrl: "https://svelte-demo.json-render.dev",
},
{
slug: "svelte-chat",
title: "Svelte Chat",
description: "AI chat app built with SvelteKit and the Svelte renderer.",
tags: ["Svelte", "SvelteKit", "AI"],
githubPath: "examples/svelte-chat",
demoUrl: "https://json-render-svelte-chat-demo.labs.vercel.dev",
},
{
slug: "vue",
title: "Vue",
description:
"Vue renderer demo with counter, todo list, and two-way data binding.",
tags: ["Vue", "Vite"],
githubPath: "examples/vue",
demoUrl: "https://vue-demo.json-render.dev",
},
{
slug: "solid",
title: "Solid",
description:
"Solid renderer demo with counter, todo list, and two-way data binding.",
tags: ["Solid", "Vite"],
githubPath: "examples/solid",
demoUrl: "https://solid-demo.json-render.dev",
},
{
slug: "vite-renderers",
title: "Multi-Framework Renderers",
description:
"Same spec rendered with React, Vue, Svelte, and Solid side by side — hot-swappable at runtime.",
tags: ["React", "Vue", "Svelte", "Solid", "Vite"],
githubPath: "examples/vite-renderers",
},
{
slug: "react-email",
title: "React Email",
description:
"Generate HTML and plain-text emails from json-render specs using React Email.",
tags: ["React", "Email"],
githubPath: "examples/react-email",
demoUrl: "https://react-email-demo.json-render.dev",
},
{
slug: "react-pdf",
title: "React PDF",
description:
"Generate PDF documents from json-render specs with @react-pdf/renderer.",
tags: ["React", "PDF"],
githubPath: "examples/react-pdf",
demoUrl: "https://react-pdf-demo.json-render.dev",
},
{
slug: "react-three-fiber",
title: "React Three Fiber",
description:
"3D scenes generated from json-render specs using Three.js and React Three Fiber.",
tags: ["React", "3D"],
githubPath: "examples/react-three-fiber",
demoUrl: "https://react-three-fiber-demo.json-render.dev",
},
{
slug: "gsplat",
title: "Gaussian Splatting (experimental)",
description:
"Experimental standalone gaussian splat viewer using gsplat.js — no Three.js dependency.",
tags: ["React", "3D", "Next.js"],
githubPath: "examples/gsplat",
},
{
slug: "react-three-fiber-gsplat",
title: "R3F + Gaussian Splatting",
description:
"Gaussian splats composed with 3D primitives and lights in React Three Fiber scenes.",
tags: ["React", "3D", "Next.js"],
githubPath: "examples/react-three-fiber-gsplat",
},
{
slug: "react-native",
title: "React Native",
description:
"Mobile app rendering json-render specs with Expo and React Native.",
tags: ["React Native", "Expo"],
githubPath: "examples/react-native",
},
{
slug: "remotion",
title: "Remotion",
description: "Generate videos from json-render specs using Remotion.",
tags: ["React", "Video"],
githubPath: "examples/remotion",
demoUrl: "https://remotion-demo.json-render.dev",
},
{
slug: "image",
title: "Image",
description:
"Generate OG images and social cards from json-render specs using Satori.",
tags: ["React", "Image"],
githubPath: "examples/image",
demoUrl: "https://image-demo.json-render.dev",
},
{
slug: "ink-chat",
title: "Ink Chat",
description:
"Terminal chat agent that streams rich json-render UIs using Ink and the AI Gateway.",
tags: ["Ink", "Terminal", "AI"],
githubPath: "examples/ink-chat",
},
{
slug: "mcp",
title: "MCP App",
description:
"MCP server that serves shadcn UIs to Claude, ChatGPT, Cursor, and VS Code.",
tags: ["React", "MCP", "Vite"],
githubPath: "examples/mcp",
},
];
export const allTags = Array.from(
new Set(examples.flatMap((e) => e.tags)),
).sort();
export function getGitHubUrl(example: Example): string {
return `${GITHUB_BASE}/${example.slug}`;
}