-
Project Infrastructure
- Vite + React 18 + TypeScript setup
- TailwindCSS styling system
- React Router for navigation
- Responsive mobile-first layout
-
Core Data Models
- TypeScript interfaces for all table types (Fusion, Fission, TwoToTwo, Nuclides, Elements)
- Query filter types
- Cascade parameter types
-
User Interface
- Responsive sidebar navigation
- Home page with feature overview
- Mobile-friendly hamburger menu
-
"Big Three" Query Tools (with mock data)
-
Fusion Query Tool (
src/pages/FusionQuery.tsx)- Element selection
- MeV energy range filters
- Neutrino type selection
- Results table with export to CSV
- SQL preview
-
Fission Query Tool (
src/pages/FissionQuery.tsx)- Similar UI to Fusion
- Fission-specific table structure
-
TwoToTwo Query Tool (
src/pages/TwoToTwoQuery.tsx)- 2-input, 2-output reaction interface
- Enhanced table display
-
-
Supporting Pages
- Show Element Data - Element property viewer
- Tables in Detail - Schema documentation
- All Tables - SQL query editor
- Cascades - Cascade simulation interface
sql.js database integration with Parkhomov tables
-
✅ Installed sql.js and configured Vite
- Added sql.js dependency
- Configured Vite to optimize sql.js module
- Copied WASM file to public directory
-
✅ Created database initialization service (
src/services/database.ts)- Dynamic import pattern for sql.js module
- WASM file loading from public directory
- Database initialization from
/parkhomov.dbfile - Streaming download with progress tracking
- Error handling and logging
-
✅ Created DatabaseContext (
src/contexts/DatabaseContext.tsx)- React Context for global database access
- Automatic database initialization on app load
- Loading and error states with download progress
- Available to all query pages
-
✅ Complete Parkhomov Data Loaded
- Full ElementPropertiesPlus table with all 118 elements
- Complete NuclidesPlus table with all isotopes
- 1,389 fusion reactions (Fus_Fis table)
- 817 fission reactions (Fus_Fis table)
- 516,789 two-to-two reactions (TwoToTwo table)
Real SQL query execution with dynamic filtering
-
✅ Created comprehensive query service (
src/services/queryService.ts)queryFusion()- Fusion reaction queriesqueryFission()- Fission reaction queriesqueryTwoToTwo()- Two-to-two reaction queriesgetAllElements()- Element data retrievalgetElementBySymbol()- Single element lookupgetAllNuclides()- Nuclide data retrievalgetNuclideBySymbol()- Single nuclide lookup by element and mass numbergetNuclidesByElement()- All isotopes for an element (by atomic number)executeCustomQuery()- Custom SQL execution- Dynamic WHERE clause builder
- ORDER BY and LIMIT support
- Performance timing
-
✅ Updated all query pages to use real database
- FusionQuery.tsx - Connected to queryFusion()
- FissionQuery.tsx - Connected to queryFission()
- TwoToTwoQuery.tsx - Connected to queryTwoToTwo()
- ShowElementData.tsx - Connected to getAllElements()
- AllTables.tsx - Connected to executeCustomQuery()
- Error handling for SQL errors
- Loading states
- Execution time display
-
✅ Implemented advanced filters and UI enhancements
- PeriodicTableSelector Component (
src/components/PeriodicTableSelector.tsx)- Visual periodic table grid (18 groups × 7 periods)
- All 118 elements displayed
- Lanthanides and Actinides in separate rows
- Multi-select element picker
- Unavailable elements shown in disabled state
- Select All / Clear Selection functionality
- Selected element badges with remove buttons
- Click-outside-to-close
- Multi-element selection for all query types
- Element1List and Element2List support in filters
- Boson/Fermion filters (nBorF, aBorF) supported in query builder
- Complex WHERE clauses with IN operators
- Dynamic SQL preview in query UI
- PeriodicTableSelector Component (
Complete database loading with caching, progress tracking, and enhanced UI
-
✅ Database Caching System (
src/services/dbCache.ts)- IndexedDB storage for offline database access
- Version management with metadata tracking
- Automatic cache invalidation on updates
- Persistent storage API integration
- Old version cleanup
-
✅ Download Progress & Loading UX
- Streaming fetch with progress tracking
DatabaseLoadingCardcomponent with progress barDatabaseUpdateBannercomponent for version updates- Graceful degradation for browsers without streaming support
-
✅ Theme System (
src/contexts/ThemeContext.tsx)- Dark/light mode toggle
- System preference detection
- Persistent theme selection in localStorage
- Smooth transitions between themes
-
✅ Enhanced Element & Nuclide Display
- New Components:
PeriodicTable.tsx- Standalone periodic table with responsive scalingElementDetailsCard.tsx- Detailed element properties displayNuclideDetailsCard.tsx- Nuclide/isotope details with quantum properties
- Show Element Data Page Enhancements:
- Interactive periodic table selector (replaces dropdown)
- Isotope/nuclide grid with B/F badges and stability indicators
- Click-to-view nuclide details
- Comprehensive element properties display
- New Components:
-
✅ Query Page Enhancements
- Dual-card system: element details vs nuclide details
- Nuclide selection on hover/click
- Context-aware detail cards based on selection type
- Unified database loading indicators across all pages
-
✅ Attribution & Documentation
- Link to original nanosoft.co.nz PHP application
- Credits to R.W. Greenyer and P.W. Power
- Home page attribution section
-
✅ Production Deployment
- Deployed to lenr.academy
- Optimized build configuration
- Database served via CDN
Full implementation of recursive cascade simulation with Web Worker processing
Status: Complete implementation in draft PR #93. All acceptance criteria met for issues #15, #16, #17.
-
✅ Cascade Engine (
src/services/cascadeEngine.ts)- Recursive algorithm querying fusion and two-to-two reactions
- Multiple termination modes:
max-loops: Stop after N iterations (default: 10)no-new-products: Stop when no new nuclides appearmax-nuclides: Stop when product count reaches threshold
- Parses fuel nuclides in multiple formats (H-1, H1, D, T)
- Tracks complete reaction history with loop/generation metadata
- Returns comprehensive results: reactions, products, energy, timing
- 17 comprehensive unit tests covering all functionality
-
✅ Web Worker Background Processing (
src/workers/cascadeWorker.ts)- Background execution keeps UI responsive during heavy computation
- Real-time progress updates with granular feedback:
- Initialization phase (parsing, validation)
- Loop-by-loop progress with reaction counts
- Finalization with batched energy calculation
- Cancellation support via AbortController pattern
- Automatic cleanup on component unmount
- React hook wrapper (
src/hooks/useCascadeWorker.ts)
-
✅ Feedback Rules System (
src/services/cascadeFeedbackRules.ts)- Temperature constraints: Filter by element melting/boiling points
- Boson/Fermion classification: Prioritize nuclear spin properties
- Element allowlist: Restrict cascade to specific elements
- Database-driven limits prevent unrealistic parameter values
- All rules optional and independently configurable
- 27 comprehensive unit tests for all rule combinations
-
✅ Cascade Visualizations
- Network Diagram (
CascadeNetworkDiagram.tsx): Interactive force-directed graph using ReactFlow - Sankey Diagram (
CascadeSankeyDiagram.tsx): Energy flow visualization across cascade loops - Pathway Browser (
PathwayBrowserTable.tsx): Searchable table with virtual scrolling (react-window) - Nuclide Selector (
NuclidePickerModal.tsx): Visual picker with natural abundance data - Progress Card (
CascadeProgressCard.tsx): Real-time loop tracking with cancel button
- Network Diagram (
-
✅ Supporting Services
- Isotope Service (
src/services/isotopeService.ts): Nuclide parsing and natural abundance data - Pathway Analyzer (
src/services/pathwayAnalyzer.ts): Reaction tree analysis and statistics
- Isotope Service (
-
✅ Testing & Quality
- 44 unit tests total (17 engine + 27 feedback rules) - All passing ✓
- E2E tests (
e2e/cascade-simulation.spec.ts): User flow validation with Playwright - Performance optimizations: debouncing, virtualization, batched calculations
-
✅ UX Enhancements
- Database-driven sliders with automatic min/max from element properties
- Accessible keyboard navigation and ARIA labels
- Mobile-responsive layout with collapsible panels
- Dark mode support throughout
Files Added:
src/services/cascadeEngine.ts+ testssrc/services/cascadeFeedbackRules.ts+ testssrc/services/isotopeService.tssrc/services/pathwayAnalyzer.tssrc/workers/cascadeWorker.tssrc/hooks/useCascadeWorker.tssrc/components/CascadeNetworkDiagram.tsxsrc/components/CascadeSankeyDiagram.tsxsrc/components/CascadeProgressCard.tsxsrc/components/CascadeTabs.tsxsrc/components/NuclidePickerModal.tsxsrc/components/PathwayBrowserTable.tsxe2e/cascade-simulation.spec.tsvitest.config.ts
Metrics:
- 7,124+ lines of code added
- 44 unit tests passing
- E2E test coverage for critical user flows
- Handles cascades with 500+ reactions smoothly
Add charts and graphs for better insight into reaction data
Completed:
- ✅ Cascade-specific visualizations (Network diagram, Sankey diagram) - See Phase 5.1
- ✅ Periodic table heatmap for query results - Implemented in query pages
- ✅ Visualization libraries installed: ReactFlow, Recharts, D3
Remaining Work:
-
Energy Distribution Histogram Charts (Issue #18)
- Histogram showing energy (MeV) distribution across query results
- Integration with Fusion, Fission, and TwoToTwo query pages
- Toggle between table and chart views
- Export charts as images
-
Reaction Network Force-Directed Graphs (Issue #19 - Partial)
⚠️ Currently implemented for cascade results only- Need to extend to general query results (Fusion, Fission, TwoToTwo)
- Allow users to visualize any query result as a network graph
- Shared component that works across all query types
-
Isotope Chart (Segré Chart) Visualization (Issue #20)
- Interactive chart of nuclides (N vs Z plot)
- Color-coded by stability, decay mode, or half-life
- Click nuclide to show details
- Overlay query results on the chart
- Educational tool for understanding nuclear stability
Completed:
- ✅ Persistent query state across navigation (PR #82)
- ✅ CSV export for all query results
- ✅ Enhanced error reporting with expandable details (PR #91, in progress)
- ✅ Advanced element/nuclide filtering and pinning
- ✅ SQL preview in all query pages
- ✅ Comprehensive element and nuclide detail views
- ✅ Privacy-friendly analytics with consent management
Remaining Work:
-
Query History & Bookmarks System (Issue #22)
- LocalStorage persistence of query history
- Save favorite queries with custom names
- Quick recall of previous searches
- Export/import saved queries
-
Advanced Export: JSON and PDF (Issue #23)
- JSON export for programmatic access
- PDF reports with charts and visualizations
- Customizable export templates
- Batch export functionality
-
URL Query Sharing System (Issue #24)
- Encode query parameters in URL
- Shareable links for specific searches
- Deep linking to exact query state
- QR code generation for sharing
-
Help System with Interactive Tutorials (Issue #25)
- Interactive walkthrough for new users
- Contextual help tooltips
- Example queries library
- Video tutorials
- Field glossary with definitions
- FAQ section
Completed:
- ✅ Web Workers for cascade simulations (Phase 5.1)
- ✅ Virtual scrolling for large tables (react-window in PathwayBrowserTable)
- ✅ Database indexing and optimization
- ✅ Unit tests (44 tests for cascade engine + feedback rules)
- ✅ E2E tests with Playwright (
e2e/directory) - ✅ PWA support with offline mode (PR #69)
- ✅ Deployed to production at lenr.academy
- ✅ Custom domain setup complete
- ✅ Performance optimizations:
- Debounced input handling
- Batched calculations
- Lazy loading of components
- Optimized bundle size with code splitting
Remaining Work:
-
Web Workers for Heavy SQL Queries (Issue #26)
- Currently: Only cascade simulations use Web Workers
- Extend to regular query pages (Fusion, Fission, TwoToTwo)
- Background processing for large result sets
- Prevent UI blocking on complex SQL queries
- Progress indicator for long-running queries
-
Additional Testing & Quality
- Expand unit test coverage beyond cascade features
- Integration tests for query service functions
- Performance regression tests
- Accessibility testing (a11y compliance)
-
Further Optimizations
- Query result pagination for very large datasets
- Memoization of expensive computations
- Service worker caching strategies
- Bundle size reduction (tree-shaking, compression)
- Download from nanosoft.co.nz or MFMP sources
- Convert Excel/CSV to SQL INSERT statements
- Bundle with app or load on-demand
- Create backend API to serve data
- Use React Query for data fetching
- Server-side query optimization
- Pre-process tables to JSON
- Load incrementally
- Client-side filtering/sorting
Week 1-2: Data integration
- Set up sql.js
- Convert and load Parkhomov tables
- Update query pages to use real data
Week 3: Polish query tools
- Advanced filters
- Better result displays
- Export improvements
Week 4: Cascade logic
- Implement cascade algorithm
- Add progress tracking
- Test with known examples
Week 5-6: Visualization & UX
- Add charts and graphs
- Query history
- Help system
Week 7+: Optimization & deployment
- Performance tuning
- Testing
- Production deployment
- Start with small datasets - Test with 100-row subsets before loading full tables
- Use Web Workers - Keep UI responsive during heavy processing
- Cache aggressively - Query results, parsed nuclides, etc.
- Progressive enhancement - Basic functionality first, fancy features later
- Mobile-first - Ensure usability on tablets/phones
- sql.js documentation: https://sql.js.org/
- Recharts: https://recharts.org/
- React Query: https://tanstack.com/query/latest
- Vite: https://vitejs.dev/
- Data source: Where will the Parkhomov tables come from?
- Hosting: Static site or with backend API?
- Scale: Support 1000+ users or personal use?
- Offline: Should it work offline (PWA)?
- Collaboration: Multiple users sharing queries?
Phase 1-4: ✅ COMPLETE
- Project infrastructure, data models, query tools, database integration, caching, theme system
Phase 5.1 (Cascade Simulations): ✅ COMPLETE (in PR #93, pending merge)
- Full cascade engine with Web Workers, feedback rules, visualizations, and comprehensive testing
- 7,124+ lines of code, 44 unit tests passing, E2E test coverage
- Issues #15, #16, #17 resolved (pending closure after PR merge)
Phase 5.2 (Data Visualization): 🟡 PARTIALLY COMPLETE (3/5 features)
- ✅ Cascade network diagrams (ReactFlow)
- ✅ Cascade Sankey diagrams (energy flow)
- ✅ Periodic table heatmaps
- ❌ Energy distribution histograms (Issue #18)
⚠️ Reaction network graphs (Issue #19 - needs extension to query results)- ❌ Segré Chart (Issue #20)
Phase 5.3 (Enhanced Features): 🟡 PARTIALLY COMPLETE (5/9 features)
- ✅ Persistent query state, CSV export, enhanced error reporting, element/nuclide filtering, SQL preview
- ❌ Query history/bookmarks (Issue #22)
- ❌ JSON/PDF export (Issue #23)
- ❌ URL sharing (Issue #24)
- ❌ Help system (Issue #25)
Phase 5.4 (Performance & PWA): ✅ MOSTLY COMPLETE (8/9 features)
- ✅ PWA support, virtual scrolling, unit tests, E2E tests, performance optimizations
- ❌ Web Workers for SQL queries (Issue #26 - only cascades use workers currently)
Deployed: ✅ Live at lenr.academy
Next Milestone Priorities:
- Immediate: Merge PR #93 (Phase 5.1 complete) and close issues #15, #16, #17
- Short-term (Phase 5.2): Energy histograms (#18), Segré Chart (#20), extend network graphs (#19)
- Medium-term (Phase 5.3): Query history (#22), URL sharing (#24), help system (#25)
- Long-term: Additional testing, Web Workers for SQL queries (#26), advanced exports (#23)
Est. Time to Full Feature Set: 6-8 weeks for remaining Phase 5.2-5.4 features