This document summarizes the documentation overhaul progress and provides context for continuing the work.
/Users/nartc/code/github/angular-threejs/docs # Documentation site (Astro + Starlight)
/Users/nartc/code/github/angular-threejs/angular-three # Source code repository
- Reviewed 18 learning documentation pages
- Made light trims for users who already know Angular + THREE.js
- Filled 8 empty stub introduction pages
- Created ~56 new documentation pages for missing soba APIs
- Added new
gizmoscategory
- Rapier (7 pages): introduction, rigid-body, colliders, joints, instanced-bodies, hooks, attractor
- Theatre (4 pages): introduction, sheet, sheet-object, studio
- Tweakpane (2 pages): introduction, components
- Postprocessing (9 pages): introduction, bloom, vignette, depth-of-field, chromatic-aberration, glitch, noise, outline, smaa
Created 47 demos across categories:
| Category | Demos Created | Location |
|---|---|---|
| Controls | orbit-controls, trackball-controls, pointer-lock-controls, scroll-controls | src/components/soba/controls/ |
| Gizmos | gizmo-helper, transform-controls, pivot-controls | src/components/soba/gizmos/ |
| Materials | mesh-distort-material, mesh-wobble-material, mesh-reflector-material, point-material, mesh-portal-material, mesh-refraction-material, custom-shader-material | src/components/soba/materials/ |
| Staging | environment, sky, float, sparkles, contact-shadows, center, stage, bounds, cloud, lightformer, shadow, backdrop, accumulative-shadows, spot-light, caustics, render-texture, mask | src/components/soba/staging/ |
| Abstractions | rounded-box, line, edges, prism-geometry, helper | src/components/soba/abstractions/ |
| Performances | instances, segments, points, adaptive-events, bvh | src/components/soba/performances/ |
| Misc | animations, html, decal, sampler, fbo, depth-buffer | src/components/soba/misc/ |
These items were not created as they are loader utilities or require additional complex setups:
- matcap-texture-resource / normal-texture-resource - Loader utilities, not visual components
- randomized-lights - Already covered as part of accumulative-shadows demo
- intersect - Utility function, not a visual component
- preload - Utility function for asset preloading
Each demo requires 2-3 files:
src/components/soba/{category}/{component-name}/
├── {component-name}.ts # Canvas wrapper component
└── scene-graph.ts # Scene content component
src/content/references/soba/{category}/{component-name}.md # API reference (YAML frontmatter)
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { SobaWrapper } from '@soba/wrapper.ts';
import { NgtCanvas, provideNgtRenderer } from 'angular-three/dom';
import { SceneGraph } from './scene-graph';
@Component({
selector: 'app-{component-name}',
template: `
<ngt-canvas [camera]="{ position: [3, 3, 3], fov: 50 }">
<app-soba-wrapper *canvasContent>
<app-scene-graph />
</app-soba-wrapper>
</ngt-canvas>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
host: { class: '{component-name}-demo relative block h-full' },
imports: [NgtCanvas, SobaWrapper, SceneGraph],
})
export default class ComponentName {
static clientProviders = [provideNgtRenderer()];
}import { ChangeDetectionStrategy, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { NgtArgs } from 'angular-three';
import { NgtsComponentName } from 'angular-three-soba/{category}';
@Component({
selector: 'app-scene-graph',
template: `
<ngts-component-name [options]="{ /* options */ }">
<!-- content -->
</ngts-component-name>
`,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [NgtArgs, NgtsComponentName],
})
export class SceneGraph {}Update the MDX file to include the demo:
---
title: NgtsComponentName
description: angular-three-soba/{category} NgtsComponentName API
---
import ReferenceWrapper from '@ui/reference/reference-wrapper.astro';
import ComponentName, {
content,
sceneGraphContent,
} from '@soba/{category}/{component-name}/{component-name}?includeContent';
<ReferenceWrapper
path="soba/{category}/{component-name}"
demoContent={content}
demoSceneGraphContent={sceneGraphContent}
>
<ComponentName client:only />
</ReferenceWrapper>astro.config.mjs- Astro configuration (includes noop image service)astro.sidebar.mjs- Sidebar navigation structuretsconfig.json- TypeScript paths (@soba/*,@ui/*, etc.)
src/content/references/soba/- API reference markdown files (YAML frontmatter + content)src/content.config.ts- Content collection schemas
src/components/soba/controls/camera-controls/- Complex demo with Tweakpanesrc/components/soba/abstractions/billboard/- Simple demo patternsrc/components/soba/materials/mesh-transmission-material/- Material demo pattern
When creating demos, reference the source repo for:
- JSDoc comments: All public APIs have comprehensive JSDoc
- README files:
libs/*/README.mdcontain detailed API docs - Stories:
libs/soba/src/{category}/*.stories.tshave working examples - Examples:
apps/examples/src/app/has real-world usage
| Path | Description |
|---|---|
libs/soba/controls/ |
Camera controls |
libs/soba/gizmos/ |
Transform gizmos |
libs/soba/materials/ |
Special materials |
libs/soba/staging/ |
Scene staging helpers |
libs/soba/performances/ |
Performance optimizations |
libs/soba/misc/ |
Miscellaneous utilities |
libs/soba/abstractions/ |
Geometry abstractions |
libs/soba/loaders/ |
Asset loaders |
cd /Users/nartc/code/github/angular-threejs/docs
# Install dependencies
pnpm install
# Development server
pnpm dev
# Production build (verify changes)
pnpm build
# Preview production build
pnpm preview-
SobaWrapper options:
[grid]="false"- Hide grid[lights]="false"- Disable default lights[controls]="null"- Disable default OrbitControlsbackground="#color"- Set background color
-
Import patterns:
- Use
NgtArgsfor*argsdirective - Use
CUSTOM_ELEMENTS_SCHEMAfor THREE.js elements - Import from
angular-three-soba/{category}
- Use
-
Common issues:
- If build fails on Sharp, the noop image service is already configured
- Scene-graph import errors are timing issues (files created in sequence)
- Check export names in source if component not found
- Reference not found errors: Ensure corresponding
.mdfile exists insrc/content/references/soba/{category}/
-
API naming:
- Deprecated:
injectGLTF,injectTexture, etc. - New:
gltfResource,textureResource, etc.
- Deprecated: