Skip to content

Commit 772bf94

Browse files
Max Carlsonclaude
andcommitted
docs: add Phase 4 documentation for magnet layouts
- Document magnet layout configuration - Add metadata filtering examples - Show use cases for attractors/repellers - Document all magnet configuration options 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 5ac8b8a commit 772bf94

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

WebSites/spacecraft-viewer/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ Three.js-based spatial visualization viewer with D3-like declarative API.
3030
- ✅ ForceLayout with spring-based physics
3131
- ✅ Type-safe extensibility system
3232

33+
## Features (Phase 4)
34+
35+
- ✅ Rapier physics engine integration
36+
- ✅ Magnet system (attractors/repellers)
37+
- ✅ Metadata-driven force parameters
38+
- ✅ Tag-based filtering for magnets
39+
- ✅ Strength scaling by metadata fields
40+
3341
## Quick Start
3442

3543
```typescript
@@ -95,6 +103,40 @@ viewer.start()
95103
})
96104
```
97105

106+
**Magnet Layout** (Phase 4) - Physics-based layout with metadata filtering
107+
```typescript
108+
await viewer
109+
.data(items)
110+
.into('items', {
111+
layout: 'magnet',
112+
magnets: [
113+
{
114+
position: { x: 30, y: 0, z: 0 },
115+
strength: 50,
116+
radius: 100,
117+
type: 'attractor',
118+
filter: {
119+
field: 'tags',
120+
value: 'cyberpunk',
121+
operator: 'contains'
122+
}
123+
}
124+
],
125+
iterations: 100,
126+
damping: 0.95
127+
})
128+
```
129+
130+
**Magnet Configuration Options:**
131+
- `position`: 3D position of the magnet
132+
- `strength`: Force magnitude
133+
- `radius`: Maximum influence distance
134+
- `type`: 'attractor' or 'repeller'
135+
- `falloff`: 'linear', 'inverse', or 'inverse-square' (default)
136+
- `filter`: Filter by metadata field (equals, contains, greater-than, less-than)
137+
- `strengthField`: Scale force by metadata field value
138+
- `strengthScale`: Multiplier for strength scaling
139+
98140
### Custom Renderers and Layouts
99141

100142
```typescript

0 commit comments

Comments
 (0)