BinaryVis is a web-based 3D visualization tool for binary data that helps users identify patterns and structures in binary files by mapping data to 3D space.
Inspired by: This project is inspired by Veles and reimplements binary visualization using modern web technologies.
- Trigram 3D Visualization: Maps consecutive 3 bytes to 3D coordinates
- File Fingerprinting: Automatic duplicate detection to avoid re-uploading same files
- Real-time Sampling: Intelligent downsampling for large files (up to 128MB)
- Multiple Geometries: Cube, cylinder, sphere with smooth transitions
- Streaming Transfer: WebSocket-based real-time data transfer
- High-Performance Rendering: Supports tens of millions of points
- Internationalization: Auto-detects browser language (Chinese/English)
- Rust 1.75+
- Axum 0.7+ (Web framework)
- Tokio (Async runtime)
- Rayon (Parallel processing)
- MessagePack (Data serialization)
- Vite 5.0 (Build tool)
- Three.js r160+ (3D rendering)
- JavaScript ES2022
- Vanilla CSS
- Rust 1.75+ (1.75 or higher recommended)
- Node.js 18+
- npm or yarn
# Run the startup script in project root
./start.shThe script will automatically:
- Start backend server (runs in background)
- Install frontend dependencies (if needed)
- Start frontend dev server
Frontend will be available at http://localhost:5173 (automatically opens in browser)
cd backend
# Create upload directory
mkdir -p uploads
# Run backend server (development mode)
cargo run
# Or build and run release version
cargo build --release
cargo run --releaseBackend server will start at http://0.0.0.0:3000
cd frontend
# Install dependencies
npm install
# Start development server
npm run devFrontend dev server will start at http://localhost:5173
- Open browser and navigate to
http://localhost:5173 - Upload File: Click "Choose File" button to select a binary file
- Set Sample Size: Use slider to adjust sample size (1-128 MB)
- Start Sampling: Click "Start Sampling" button and wait for WebSocket streaming
- View Visualization: After data loads, it will automatically render as 3D point cloud
- Adjust Display: Use control panel to adjust visualization parameters:
- Geometry Shape: Cube, cylinder, sphere (smooth transitions)
- Point Size: Adjust rendering size of points
- Brightness: Control point brightness
- Color Gradient: Start and end colors
- Scale Mode: Enable/disable depth scaling
- Max 50M Points: Supports up to 50 million points
- Real-time Rendering: GPU-accelerated with WebGL
- Streaming Transfer: WebSocket chunks of 256KB each
- Smart Sampling: Auto-downsamples large files to specified size
Edit backend/.env:
PORT=3000
UPLOAD_DIR=./uploads
MAX_FILE_SIZE=10737418240 # 10GB
MAX_SAMPLE_SIZE=134217728 # 128MB
CACHE_SIZE=536870912 # 512MB
MAX_CONNECTIONS=100
RUST_LOG=infoEdit frontend/src/config.js:
export const CONFIG = {
API_URL: 'http://localhost:3000/api',
WS_URL: 'ws://localhost:3000/ws',
MAX_FILE_SIZE: 10 * 1024 * 1024 * 1024, // 10GB
MAX_SAMPLE_SIZE: 128 * 1024 * 1024, // 128MB
DEFAULT_SAMPLE_SIZE: 1 * 1024 * 1024, // 1MB
};GET /api/check?fingerprint={fp}- Check if file fingerprint existsPOST /api/upload- Upload file (multipart/form-data with fingerprint)GET /api/files/:id- Get file informationDELETE /api/files/:id- Delete filePOST /api/sample/:id- Synchronous sampling (for small data)GET /api/health- Health checkGET /api/metrics- Get cache and performance metrics
ws://localhost:3000/ws/:file_id- WebSocket connection- Message Format: MessagePack (Map format) encoding
- Control Commands:
sample- Request sample data
- Data Transfer: Chunked streaming, 256KB per chunk
See docs/API_DESIGN.md for detailed API documentation
| Metric | Target |
|---|---|
| Max File Size | 10 GB |
| Max Sample Size | 128 MB |
| Target FPS | 60 FPS |
| Sampling Latency | < 500ms (1GB → 1MB) |
- Fast-Fail: Fail immediately on errors, no fallback
- Minimal Dependencies: Only use necessary libraries
- High Performance: Supports tens of millions of points in real-time
- Simple Architecture: Direct frontend-backend connection
- Smart Deduplication: File fingerprinting to avoid duplicate uploads
-
File Fingerprinting:
- Fingerprint based on filename hash + size + modification time
- Frontend pre-check to avoid duplicate uploads
- Fingerprint as filename for natural deduplication
- Persistent storage, survives page refresh
-
High-Performance Sampling:
memmap2memory-mapped files to avoid full loading- Rayon parallel processing for faster sampling
- LRU cache to reduce redundant computation
-
Streaming Data Transfer:
- WebSocket bidirectional communication
- MessagePack binary serialization (30-50% smaller than JSON)
- 256KB chunks for balanced latency and throughput
-
GPU-Accelerated Rendering:
- Custom GLSL shaders
- Three.js
BufferGeometryfor efficient rendering - Additive blending for brightness accumulation
-
Internationalization:
- Auto-detects browser language
- Supports Chinese/English interface
- Page title and description auto-switch
- Frontend-Backend Separation: Rust backend + JavaScript frontend
- Minimal Dependencies: Only essential libraries
- Vanilla Stack: Frontend uses native JavaScript + CSS, no frameworks
- Type Safety: Rust provides compile-time type checking
- Port Already in Use: Change
PORTin.env - Upload Directory Permissions: Ensure
uploadsdirectory is writable - Missing Dependencies: Run
cargo buildto reinstall
- Cannot Connect to Backend: Check if backend is running, verify URL config
- WebSocket Connection Failed: Check firewall settings
- Poor Rendering Performance: Reduce sample size, check graphics drivers
This project is licensed under the Apache 2.0 License. See LICENSE for details.
This project is inspired by Veles - an open-source binary analysis and visualization tool developed by CodiLime.
Thanks to the Veles project for its excellent design concepts and visualization principles. BinaryVis maintains the core visualization principles while adopting modern web technologies for easier deployment and use.
