π§ Neural Brain Real-Time Heatmap Visualization Guide
Overview
The Neural Brain Visualization creates a living, breathing representation of your business intelligence, where every customer interaction fires through neural pathways like synapses in a biological brain. The real-time heatmap functionality provides instant visual feedback of business activity with detailed drill-down capabilities on hover.
How the Real-Time Heatmap Works
1. Visual Representation
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 3D Neural Network β
β β
β Facebook βΒ·Β·Β·Β·Β·Β·Β·Β·β Central Brain βΒ·Β·Β·Β·Β·Β·Β·Β·β Amazon β
β β / \ / | \ / \ β β
β Heat: 85% \ β [Cell03 KG] β / Heat: 92% β
β \ / \ β / \ / β
β Klaviyo βΒ·Β·Β·Β·βΒ·Β·Β·β β Neurons β βΒ·Β·Β·βΒ·Β·Β·Β·β Google β
β β β β
β Heat: 45% Heat: 78% β
β β
β Color Intensity = Activity Level (Red = Hot, Blue = Cool) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
2. Heatmap Layers
The visualization consists of multiple data layers:
Layer 1: Neural Activity
- Base Color: Channel-specific colors (Facebook blue, Amazon orange, etc.)
- Heat Overlay: Red gradient based on activity intensity
- Pulse Effect: Active neurons pulse with configurable intensity
Layer 2: Event Density
- Particle Density: More particles = higher activity
- Glow Intensity: Brighter glow = more recent activity
- Size Scaling: Neurons grow/shrink based on activity volume
Layer 3: Connection Strength
- Line Opacity: Stronger connections are more visible
- Electrical Impulses: Animated particles show data flow
- Path Highlighting: Active paths glow brighter
3. Real-Time Data Flow
// Real-time event processing pipeline
Event Occurs β Channel API β Ingestion Service β Neural Processor β KG Brain β Visualization
// Example: Facebook Purchase Event
{
timestamp: 1698765432,
channel: "facebook",
type: "purchase",
value: 299.99
}
β
Neural Path Activation:
β facebook-neuron (Heat: +15%)
β facebook-neuron-purchase (Heat: +20%)
β cell03-kg-brain (Heat: +10%)
β Pattern Detection: "High-value conversion path"
4. Mouse Hover Interaction
When you hover over any neuron in the heatmap, you get:
Immediate Display (< 50ms)
interface HoveredNeuronInfo {
// Basic Info
id: string; // e.g., "facebook-neuron"
name: string; // e.g., "Facebook Channel"
channel: string; // e.g., "facebook"
// Activity Metrics
activity: number; // 0-100% current activity level
heatmapIntensity: number; // 0-1 heat intensity
eventCount: number; // Total events in last hour
// Real-time Stream
recentEvents: Array<{
eventType: string; // click, view, purchase, etc.
timestamp: number;
value?: number; // Transaction value if applicable
userId?: string;
metadata: any; // Additional event data
}>;
}
Visual Feedback
- Neuron Highlighting: Selected neuron brightens and scales up
- Connection Tracing: All connections to/from the neuron highlight
- Info Panel: Detailed stats appear in a floating panel
- Event Stream: Live feed of events flowing through this neuron
5. Heatmap Calculation Algorithm
def calculate_heatmap_intensity(neuron_id: str, time_window: int = 300):
"""
Calculate heat intensity for a neuron based on:
- Event frequency
- Event recency
- Value flow
- Pattern significance
"""
# Get events in time window
events = get_neuron_events(neuron_id, time_window)
# Base intensity from event count
frequency_heat = min(len(events) / 100, 1.0) # Normalize to 0-1
# Recency factor (exponential decay)
recency_scores = []
for event in events:
age_seconds = (now() - event.timestamp).seconds
decay = exp(-age_seconds / time_window)
recency_scores.append(decay)
recency_heat = mean(recency_scores) if recency_scores else 0
# Value factor (for purchase events)
value_heat = 0
total_value = sum(e.value for e in events if e.value)
if total_value > 0:
value_heat = min(total_value / 10000, 1.0) # Normalize by $10k
# Pattern bonus (if part of detected pattern)
pattern_heat = 0.2 if neuron_in_active_pattern(neuron_id) else 0
# Weighted combination
final_heat = (
frequency_heat * 0.3 +
recency_heat * 0.3 +
value_heat * 0.3 +
pattern_heat * 0.1
)
return min(final_heat, 1.0) # Cap at 1.0
6. Interactive Features
Click Actions
- Single Click: Focus on neuron, zoom camera
- Double Click: Drill down to detailed analytics
- Right Click: Context menu with actions
Keyboard Shortcuts
- Space: Pause/Resume animation
- H: Toggle heatmap overlay
- R: Reset camera position
- F: Toggle fullscreen
- 1-8: Focus on specific channel neurons
Gesture Controls
- Scroll: Zoom in/out
- Drag: Rotate view
- Pinch: Zoom on touch devices
7. Data Resolution & Updates
Update Frequencies:
Neural State: 100ms # Core neuron positions and connections
Event Stream: Real-time # SSE stream, instant updates
Heatmap Data: 1000ms # Heat intensity calculations
Pattern Detection: 5000ms # Pattern analysis updates
Metrics: 2000ms # Dashboard metrics refresh
Resolution Levels:
Neuron Level: Individual channel/event type nodes
Connection Level: Weighted pathways between neurons
Pattern Level: Detected sequences and correlations
Cluster Level: Groups of related neurons
8. Performance Optimization
The visualization uses several techniques for smooth performance:
Level of Detail (LOD)
// Adaptive quality based on distance
if (distanceToCamera < 50) {
// High detail: All particles, full glow effects
particleCount = 100;
glowIntensity = 1.0;
} else if (distanceToCamera < 150) {
// Medium detail: Reduced particles
particleCount = 50;
glowIntensity = 0.5;
} else {
// Low detail: Minimal effects
particleCount = 10;
glowIntensity = 0.2;
}
Culling & Batching
- Frustum Culling: Only render visible neurons
- Instanced Rendering: Batch similar neurons
- Texture Atlasing: Combine textures for fewer draw calls
Progressive Loading
- Initial load: Core neurons only
- After 500ms: Add connections
- After 1s: Add particle effects
- After 2s: Enable full heatmap
9. Example Use Cases
Scenario 1: Spike Detection
TIME: 14:32:15
EVENT: Black Friday Sale Launch
VISUALIZATION:
- Facebook neuron suddenly turns bright red (95% heat)
- Electrical impulses surge through facebookβpurchase path
- Central brain pulses rapidly
- Pattern detected: "Sale Rush Pattern"
HOVER REVEALS:
- 847 events in last minute
- $45,231 in transactions
- 92% are new customers
Scenario 2: Cross-Channel Journey
CUSTOMER PATH:
1. Google Ad Click β google-neuron lights up
2. Email Signup β klaviyo-neuron activates
3. Facebook Retarget β facebook-neuron pulses
4. Amazon Purchase β amazon-neuron flares
VISUALIZATION:
- Sequential lighting of path
- Connection strengths increase
- Pattern forms: "Multi-touch Conversion"
Scenario 3: Anomaly Detection
ANOMALY: Unusual traffic from programmatic channel
VISUALIZATION:
- Programmatic neuron glows yellow (warning)
- Unusual connection pattern highlighted
- Boss Agent notification triggered
HOVER REVEALS:
- 10x normal activity
- Geographic anomaly detected
- Recommended action: Investigate source
10. Configuration Options
const neuralConfig = {
// Heatmap Settings
heatmap: {
enabled: true,
colorScheme: 'thermal', // thermal, rainbow, grayscale
minIntensity: 0.1,
maxIntensity: 1.0,
decayRate: 0.95,
updateInterval: 1000
},
// Interaction Settings
interaction: {
hoverEnabled: true,
hoverDelay: 50, // ms before showing info
clickToFocus: true,
doubleClickZoom: true,
scrollSpeed: 0.5
},
// Performance Settings
performance: {
targetFPS: 60,
adaptiveQuality: true,
maxParticles: 1000,
maxNeurons: 100,
useLOD: true
},
// Data Settings
data: {
sseEndpoint: '/api/neural/stream',
metricsEndpoint: '/api/neural/metrics',
historyWindow: 3600, // seconds
aggregationLevel: 'minute'
}
};
Integration with MIZOKICLOUDRUN
Cell03 KG Brain Connection
The heatmap directly reflects the Knowledge Graph state: - Neuron Creation: Each KG entity becomes a neuron - Connection Mapping: KG relationships become neural connections - Pattern Recognition: KG patterns trigger visual patterns - Learning Updates: KG learning updates neuron properties
Boss Agent Integration
When hovering reveals anomalies or opportunities: - Automatic Analysis: Boss Agent analyzes the pattern - Recommendation Generation: AI suggests actions - One-Click Execution: Implement recommendations directly - Feedback Loop: Results update the visualization
Real-Time Event Flow
Customer Action
β
Channel API (Facebook, Amazon, etc.)
β
Omnichannel Ingestion Service
β
Neural Event Processor
β
Cell03 KG Brain (Learning & Pattern Detection)
β
Redis (State Cache)
β
SSE Stream
β
Three.js Visualization
β
Heatmap Rendering
β
Mouse Hover Detection
β
Information Display
Troubleshooting Heatmap Issues
Issue: Heatmap not updating
Solution: Check SSE connection in browser console
// Debug SSE connection
const eventSource = new EventSource('/api/neural/stream');
eventSource.onerror = (error) => console.error('SSE Error:', error);
Issue: Hover not showing data
Solution: Verify Redis cache has data
redis-cli
> KEYS neural:state:*
> GET neural:state:facebook-neuron
Issue: Performance lag on hover
Solution: Reduce particle count or enable LOD
config.performance.maxParticles = 500;
config.performance.useLOD = true;
Implementation Status β COMPLETE
The Neural Brain Visualization with real-time heatmap has been fully implemented and is now operational.
Key Features Implemented:
- β Real-time Heatmap Calculation - Dynamic heat intensity based on frequency, recency, value, and pattern factors
- β Mouse Hover Interactions - Detailed neuron information display with <50ms response time
- β Interactive Information Panel - Complete activity metrics, event counts, and real-time event streams
- β Visual Feedback System - Neuron highlighting, scaling, and color transitions
- β Camera Focus Control - Click-to-zoom with smooth animation
- β Channel-Specific Mapping - Facebook, Amazon, Klaviyo, Google, Programmatic, Instagram
- β Performance Optimized - Efficient raycasting and rendering pipeline
Access Points:
- Neural Visualization: http://localhost:3004/
- 3D Mode: Interactive 3D neural network with hover functionality
- 2D Mode: Coming soon (placeholder implemented)
- Heatmap Mode: Full 3D visualization with enhanced heat rendering
User Interaction Guide:
- Hover over neurons to see detailed activity information
- Click on neurons to focus the camera with smooth animation
- Use keyboard shortcuts: - Space: Pause/Resume animation - H: Toggle heatmap overlay - R: Reset camera position - F: Toggle fullscreen
Conclusion
The Neural Brain Visualization with real-time heatmap provides an unprecedented view into your business's neural activity. Every mouse hover reveals the living, breathing state of your business intelligence, making complex data patterns instantly understandable and actionable.
The combination of: - Real-time event streaming - Knowledge Graph intelligence - 3D visualization - Interactive heatmap - Detailed hover information
Creates a truly revolutionary way to monitor and understand your omnichannel business operations in real-time.
Built with β€οΈ by the MIZ OKI Team
Making business intelligence as intuitive as human neural activity