A modular, web-based visualization tool for phase field simulation data built with Dash and VTK.
- Interactive VTK Viewer: Visualize 2D slices from VTK files (.vti, .vtp, .vtr, .vts)
- Time Series Analysis: Plot grain size evolution, stress-strain curves, and other metrics
- Multi-Dataset Comparison: Compare multiple VTK files side-by-side
- Project Management: Automatically scan and load multiple simulation projects
- Modular Architecture: Clean separation of UI, callbacks, data handling, and utilities
Each platform has a single script that handles everything automatically: finds or installs Python, creates a virtual environment, installs all dependencies, starts the server, and opens the browser.
Double-click run.bat or run from a terminal:
run.batPrerequisite: Python 3.12 or 3.13 must be installed and on PATH.
# Install Python via winget (Windows 10/11)
winget install Python.Python.3.12
# Or download from https://www.python.org/downloads/
# Make sure to check "Add Python to PATH" during installationchmod +x run.sh # one time
./run.shThe script auto-installs missing system libraries (OpenGL, X11) via your package manager and the Python venv module if needed. Python 3.12 or 3.13 must be available on the system.
# If Python is not installed:
# Ubuntu/Debian
sudo apt install python3.13 python3.13-venv
# Fedora/RHEL
sudo dnf install python3.13chmod +x run-macos.sh # one time
./run-macos.shThe script checks for Xcode Command Line Tools, finds Python via Homebrew (Apple Silicon and Intel paths), and auto-installs python@3.13 via Homebrew if no supported version is found.
# If Homebrew is not installed:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"- Find Python 3.12 or 3.13 (install system dependencies if needed)
- Create a
myenvvirtual environment (or reuse an existing one) - Install/update all dependencies from
requirements.txt - Start the OPView server and open http://127.0.0.1:8050 in the browser
Press Ctrl+C to stop the server.
Click to expand manual setup steps
Windows:
cd E:\path\to\OPView
py -3.12 -m venv myenv
myenv\Scripts\activate
pip install -r requirements.txt
python OPView.pyLinux / macOS / WSL:
cd /path/to/OPView
chmod +x setup.sh
./setup.sh
source myenv/bin/activate
python OPView.pyOpen http://127.0.0.1:8050 in your browser. Stop the server with Ctrl+C, and exit the virtual environment with deactivate.
OPView scans immediate subfolders for simulation projects containing:
VTK/directory with VTK files (.vti, .vtp, .vtr, .vts)TextData/directory with time series data (optional)
Example structure:
OPView/
├── Project1/
│ ├── VTK/ # VTK simulation outputs
│ └── TextData/ # Time series data files
├── Project2/
│ └── VTK/
└── OPView.py
Place your simulation data in project folders before launching the app.
OPView uses a modular architecture with clear separation of concerns:
OPView.py (Entry Point, ~1,000 lines)
├── app/ - Application orchestration and state management
├── callbacks/ - Dash callback managers (tab, project, data)
├── comparisonmgr/ - Multi-dataset comparison feature
├── config/ - Configuration and dataset registry
├── data/ - Data sources and loaders (OOP pattern)
├── ui/ - UI components and layout builders
├── utils/ - Utility functions (charts, VTK, paths, docs)
└── viewer/ - VTK 2D slice viewer panel
Each module has a single, well-defined responsibility for maintainability.
- Python: 3.12 or 3.13 (VTK is not compatible with 3.14+)
- Dependencies: Listed in
requirements.txt- dash, dash-mantine-components
- plotly, kaleido
- numpy, scipy, pandas
- vtk, pyvista
- markdown
- plyer (for file chooser dialogs)
- pywin32 (Windows only - required for plyer on Windows)
Windows:
# Remove existing environment
Remove-Item -Recurse -Force myenv
# Recreate from scratch
py -3.12 -m venv myenv
myenv\Scripts\activate
pip install -r requirements.txtLinux:
rm -rf myenv
./run.sh # Recreate from scratchmacOS:
rm -rf myenv
./run-macos.sh # Recreate from scratchWindows:
py -3.12 --version
# or
python --versionLinux/macOS/WSL:
python --version
# or
python3 --versionIf port 8050 is occupied, modify the port in OPView.py:
app.run(host='127.0.0.1', port=8050, debug=False)The codebase follows OOP patterns for managers and functional patterns for utilities. See CLAUDE.md for detailed coding standards and architecture guidelines.
Key Design Principles:
- Separation of concerns across modules
- Lazy imports for heavy dependencies (VTK, ViewerPanel)
- Manager-based callback registration
- Modular UI component system
This project is licensed under the MIT License - see the LICENSE file for details.
Part of the OpenPhase simulation framework.