Skip to content

Add Interactive and Meaningful Galaxy Visualization#93

Open
honu5 wants to merge 10 commits intoSpiritualData:developfrom
honu5:feat/galaxy-visualization
Open

Add Interactive and Meaningful Galaxy Visualization#93
honu5 wants to merge 10 commits intoSpiritualData:developfrom
honu5:feat/galaxy-visualization

Conversation

@honu5
Copy link
Copy Markdown

@honu5 honu5 commented Oct 26, 2025

Implemented an interactive 3D galaxy visualization using React Three Fiber, Three.js, and Framer Motion.
Each galaxy represents a core topic, with orbiting planets as subtopics. Clicking a galaxy zooms in, reveals planets, and displays floating info cards.

This feature aligns with Spiritual Data’s mission of bringing deeper insights closer to people in an engaging visual form.

here is loom's link

Folders and Files added
src/components/GalaxyScene/
├─ CameraController.tsx # Smooth camera lerp, centering, zoom & awaken animation
├─ Galaxy.tsx # Single galaxy visual: core, halo, ring, tooltip + pointer events
├─ GalaxyData.ts # Static source for galaxy metadata (id, name, planets[], colors)
├─ GalaxyScene.tsx # Orchestrator: Canvas, galaxies, selection, planet spawning, offsets
├─ Planet.tsx # Orbiting planet: emergence, motion, bobbing, hover & click-to-info
├─ PlanetInfoCard.tsx # 2D info card (Framer Motion) rendered outside Canvas
├─ Pulse.tsx # Short-lived pulse effect on galaxy discovery
├─ SceneLights.tsx # Ambient, directional, and point lights
├─ Tooltip.tsx # HTML tooltips for hover labels via @react-three/drei
└─ TwinklingStars.tsx # Twinkling star objects with animated opacity & scale
src/pages/Galaxies.tsx # Page wrapper: mounts GalaxyScene & simple UI background

🛠 Tech Stack / Dependencies

--three.js — 3D engine

--@react-three/fiber — React renderer for three.js

--@react-three/drei — helpers (Stars, Html, etc.)

--framer-motion — 2D modal animations (PlanetInfoCard)

--TypeScript with @types/three for type safety

Safety & Review Notes

-->All 3D logic contained inside src/components/GalaxyScene/

-->Planet placement tunable in GalaxyScene.tsx without touching per-frame math

-->2D modal explicitly outside Canvas avoids R3F DOM pitfalls

-->Safe to merge; isolated feature branch

@honu5 honu5 requested a review from JoshuaMathias November 5, 2025 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant