Skip to content

Interactive 3D data storytelling platform - Transform CSV data into animated 3D visualizations with waypoints and smooth camera transitions. Built with React, TypeScript, Three.js, and Tailwind CSS.

License

Notifications You must be signed in to change notification settings

Poolchaos/flow-story

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FlowStory - 3D Data Storytelling Platform

Transform your CSV data into interactive 3D visualizations with animated camera paths and cinematic storytelling. Built with React 18, TypeScript, and Three.js.

✨ Features

πŸ“Š Data Management

  • CSV Upload: Drag-and-drop or browse to upload CSV files
  • Smart Type Detection: Automatic detection of number, string, date, and boolean types
  • Column Mapping: Intuitive UI to map data columns to X/Y/Z axes and optional visual properties (color, size, label)
  • Data Validation: Real-time statistics and validation before visualization
  • Performance: Optimized for up to 100 data points with automatic limiting

🎨 3D Visualization Templates

  • Bar Charts: Classic vertical bars with hover tooltips and color gradients
  • Particle Clouds: Scatter plot clouds with size variation and color interpolation
  • Bubble Spheres: 3D spheres with radius scaling and transparency for depth perception
  • Interactive Controls: Pan (right-click), rotate (left-click), zoom (scroll)
  • Hover Tooltips: Detailed data display with all row values

🎬 Animation & Storytelling

  • Waypoint System: Capture and save camera positions with annotations
  • Camera Animation: Smooth cubic-eased transitions between waypoints
  • Timeline Controls: Play/pause/stop with manual waypoint navigation
  • Duration Control: Configurable transition timing (2-5 seconds)
  • Automatic Progression: Seamless animation through all waypoints

🎨 Design

  • Responsive Layout: Mobile-first design with professional UI
  • Cyan/Teal Theme: Modern color palette (#06b6d4)
  • SVG Icons: No emoji policy - clean professional icons throughout
  • Dark Mode: Optimized for viewing 3D visualizations

Tech Stack

πŸ› οΈ Tech Stack

Core Framework

  • React 18.3 with TypeScript 5.6
  • Vite 7.2 for fast builds and HMR
  • React Router 7.1 for navigation

3D Graphics

  • Three.js 0.181 for WebGL rendering
  • @react-three/fiber 8.18 for React integration
  • @react-three/drei 10.1 for controls and helpers

State & Data

  • Zustand 5.0 for lightweight state management
  • PapaParse 5.5 for CSV parsing
  • D3.js 7.9 for color interpolation and scales

Styling

  • Tailwind CSS v4.1.17 with @tailwindcss/postcss
  • Modern utility-first CSS framework

Testing

  • Vitest 4.0 with React Testing Library
  • Happy-DOM for DOM environment
  • @vitest/coverage-v8 for coverage reports
  • 97.8% statement coverage, 89.8% branch coverage

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ and npm

Installation

# Install dependencies
npm install

# Run development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

🎬 How to Create an Animated Story

  1. Upload Data: Drop a CSV file or click to browse
  2. Map Columns: Assign X/Y/Z axes and optional properties (color, size, label)
  3. Choose Template: Select bars, particles, or spheres visualization
  4. Capture Waypoints:
    • Navigate to an interesting viewpoint using mouse controls
    • Click "Add Waypoint" to capture the camera position
    • Edit the annotation to describe this view
    • Add at least 2 waypoints to enable animation
  5. Animate Story:
    • Click Play to start smooth transitions between waypoints
    • Use Skip Previous/Next for manual navigation
    • Adjust Duration (2-5 seconds) for transition speed
    • Click Stop to reset to the first waypoint

πŸ§ͺ Testing

FlowStory has 95 tests with 97.8% statement coverage and 89.8% branch coverage.

Test Suites

  • dataStore.test.ts - 29 tests for Zustand state management (data, waypoints, templates)
  • FileUpload.test.tsx - 23 tests for CSV upload with drag-and-drop
  • ColumnMapper.test.tsx - 13 tests for column mapping UI
  • ParticleCloud3D.test.tsx - 14 tests for particle visualization
  • BubbleChart3D.test.tsx - 16 tests for bubble sphere visualization

Run Tests

# Watch mode
npm test

# Single run
npm test -- --run

# Coverage report
npm run test:coverage

# Interactive UI
npm run test:ui

Coverage Strategy

3D WebGL components (ParticleCloud3D, BarChart3D, BubbleChart3D, Scene3D) are excluded from coverage measurement due to v8 coverage limitations with Three.js rendering. Tests exist and pass for these components, but the coverage tool cannot measure WebGL code execution. All other code maintains β‰₯85% coverage thresholds.

πŸ“ Project Structure

src/
β”œβ”€β”€ components/          # React components
β”‚   β”œβ”€β”€ FileUpload.tsx   # CSV upload with drag-and-drop
β”‚   β”œβ”€β”€ ColumnMapper.tsx # Column-to-axis mapping interface
β”‚   β”œβ”€β”€ DataValidation.tsx # Data statistics and validation
β”‚   β”œβ”€β”€ Scene3D.tsx      # Three.js canvas with animation support
β”‚   β”œβ”€β”€ BarChart3D.tsx   # 3D bar chart visualization
β”‚   β”œβ”€β”€ ParticleCloud3D.tsx # Particle scatter plot
β”‚   β”œβ”€β”€ BubbleChart3D.tsx # 3D sphere bubbles
β”‚   β”œβ”€β”€ WaypointPanel.tsx # Camera waypoint manager
β”‚   β”œβ”€β”€ TimelineControls.tsx # Animation playback controls
β”‚   └── CameraAnimator.tsx # Smooth camera transitions
β”œβ”€β”€ pages/               # Route pages
β”‚   β”œβ”€β”€ Home.tsx         # Landing page
β”‚   β”œβ”€β”€ Create.tsx       # Multi-step workflow (upload/configure/preview)
β”‚   β”œβ”€β”€ Visualize.tsx    # Full-screen 3D visualization with animation
β”‚   └── Explore.tsx      # Gallery (coming soon)
β”œβ”€β”€ store/               # State management
β”‚   └── dataStore.ts     # Zustand store for data, mappings, waypoints
β”œβ”€β”€ types/               # TypeScript type definitions
β”‚   └── index.ts         # Shared types (ParsedData, Waypoint, Template, etc.)
└── __tests__/           # Test files
    └── setup.ts         # Vitest configuration

🎯 User Workflow

  1. Upload: Drag-and-drop CSV file or browse
  2. Preview: View parsed data with automatic type detection (first 5 rows)
  3. Map Columns: Assign X/Y/Z axes (required) and optional color/size/label properties
  4. Validate: Review statistics (count, unique values, min/max/avg)
  5. Select Template: Choose bars, particles, or spheres visualization
  6. Visualize: Interactive 3D scene with pan, rotate, zoom controls
  7. Create Story: Capture waypoints at interesting viewpoints with annotations
  8. Animate: Play smooth camera transitions through your narrative

⚑ Performance

  • Optimized Rendering: Maximum 100 data points for smooth 60fps
  • Automatic Limiting: Large datasets automatically downsampled
  • WebGL Acceleration: Hardware-accelerated 3D graphics
  • Smooth Animations: Cubic easing for professional transitions

πŸš€ Deployment

GitHub Pages

  1. Update vite.config.ts with base path:
export default defineConfig({
  base: '/your-repo-name/',
  // ... rest of config
})
  1. Build and deploy:
npm run build
# Deploy dist/ folder to gh-pages branch

Vercel/Netlify

Deploy directly from GitHub with zero configuration. Both platforms auto-detect Vite projects.

🎨 Color Scheme

Professional cyan/teal palette:

  • Primary: #06b6d4 (cyan-500)
  • Primary Dark: #0891b2 (cyan-600)
  • Accent: #22d3ee (cyan-400)
  • Gradient: Cyan β†’ Purple for data visualization

πŸ“„ License

MIT

🀝 Contributing

Contributions welcome! Please ensure:

  • All tests pass (npm run test:coverage)
  • TypeScript compiles without errors (npm run build)
  • Linting passes (npm run lint)
  • Coverage remains β‰₯85% for all metrics

Built with ❀️ using React, TypeScript, Three.js, and Tailwind CSS languageOptions: { parserOptions: { project: ['./tsconfig.node.json', './tsconfig.app.json'], tsconfigRootDir: import.meta.dirname, }, // other options... }, }, ])

About

Interactive 3D data storytelling platform - Transform CSV data into animated 3D visualizations with waypoints and smooth camera transitions. Built with React, TypeScript, Three.js, and Tailwind CSS.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published