Task 19: 軌道遷移図のインタラクティブアニメーション
完了 ← タスク一覧
Task 019: 軌道遷移図のインタラクティブアニメーション
Status: DONE
Human Directive
軌道遷移の図に、時間を操作できるインタラクティブ要素を追加する。
時間スライダーで遷移の進行を操作し、その間の天体との位置関係がどう変わるかを視覚的にわかりやすくする。
Implementation Summary
Design (Codex-reviewed)
- Canonical timeline: t in seconds from 0 to durationSeconds
- Animation data as
<script type="application/json">per diagram,data-animated="true"as discovery flag - Ship position via
getPointAtLength()along actual SVG transfer paths (avoids physics/rendering mismatch) - Body positions via
angle + meanMotion * t(circular orbit approximation)
Changes
- report-types.ts: Added
AnimationConfigtype,meanMotion?to OrbitDefinition,startTime?/endTime?to TransferArc,animation?to OrbitalDiagram - templates.ts: Updated
renderOrbitalDiagram()for animated mode — addsdata-animated,data-orbit-id,data-transfer-pathattributes, embeds animation JSON, renders slider/play controls. Added CSS for animation controls. - orbital-animation.js: New browser module — discovers animated diagrams, creates time slider + play/pause, animates body positions and ship markers using requestAnimationFrame
- build.ts: Copies orbital-animation.js to dist/
- Episode reports: All 5 diagrams across ep01-03 now have animation data (meanMotion, startTime/endTime, animation config)
Test Coverage
- 15 new tests in templates.test.ts (all passing)
- Total: 346 TS tests (343 pass, 3 pre-existing build test failures)
- Rust: all passing
Depends on
- Task 014 (orbital diagrams — DONE)