Skip to content

JixianLi/webuvisbox

Repository files navigation

WebUVisBox

WebUVisBox (Web-based Uncertainty Visualization Toolbox) is a flexible, scenario-based framework for interactive visualization of scientific uncertainty data. Built with modern web technologies, it provides powerful tools for exploring ensemble simulations, scalar fields, and uncertainty quantification.

Features

  • 🎨 Interactive Visualization: Real-time 3D rendering with Three.js and React Three Fiber
  • πŸ“Š Advanced Analytics: Integrated statistical visualizations using Chart.js and D3
  • πŸ”„ Reactive State Management: MobX-powered reactive updates across all components
  • 🎯 Scenario-Based Architecture: Modular design supporting multiple domain-specific visualizations
  • πŸ“ Flexible Layout System: Drag-and-drop panel management with React Grid Layout
  • 🎨 Customizable Transfer Functions: Interactive colormap and opacity editors
  • 🌐 Data Server Integration: Fetch and visualize remote ensemble datasets

Tech Stack

  • Frontend: React 19+ with TypeScript
  • 3D Graphics: Three.js, React Three Fiber, Drei
  • State Management: MobX 6.13+
  • UI Components: Material-UI (MUI) v7
  • Charting: Chart.js 4.5, D3.js 7.9
  • Layout: React Grid Layout
  • Build Tool: Vite 7

Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn

Data Server

Note: The data server backend is not provided by default with this repository. If you plan to use WebUVisBox with your own data, please email the author with details about your planned usage for inquiry. Example server code will be provided in future releases.

For development and testing, you can modify the data_server_address in scenario configuration files to point to your own data source.

Installation

# Clone the repository
git clone https://github.com/JixianLi/webuvisbox.git
cd webuvisbox

# Install dependencies
npm install

Development

# Start development server
npm run dev

The application will be available at http://localhost:5173

Build

# Build for production
npm run build

# Preview production build
npm run preview

Project Structure

webuvisbox/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ Scenarios/              # Scenario plugin system
β”‚   β”‚   β”œβ”€β”€ index.ts            # Scenario discovery (imports all scenarios)
β”‚   β”‚   β”œβ”€β”€ ScenarioRegistry.ts # Registry singleton
β”‚   β”‚   β”œβ”€β”€ Wildfire/           # Wildfire simulation visualization
β”‚   β”‚   β”‚   β”œβ”€β”€ index.ts        # Self-registration entry point
β”‚   β”‚   β”‚   β”œβ”€β”€ WildfireGlobalContext.ts
β”‚   β”‚   β”‚   └── Views/          # Panel components
β”‚   β”‚   └── UncertaintyTube/    # Flow uncertainty visualization
β”‚   β”‚       β”œβ”€β”€ index.ts        # Self-registration entry point
β”‚   β”‚       β”œβ”€β”€ UncertaintyTubeGlobalData.ts
β”‚   β”‚       └── Views/          # Panel components
β”‚   β”œβ”€β”€ Renderers/              # Shared rendering components
β”‚   β”‚   β”œβ”€β”€ Colormaps/          # Color and opacity mapping
β”‚   β”‚   β”œβ”€β”€ Mesh/               # 3D mesh components
β”‚   β”‚   └── Chartjs/            # Chart utilities
β”‚   β”œβ”€β”€ LayoutManager/          # Panel layout management
β”‚   β”œβ”€β”€ Panels/                 # Reusable panel components
β”‚   β”œβ”€β”€ Types/                  # TypeScript type definitions
β”‚   └── Helpers/                # Utility functions
β”œβ”€β”€ public/
β”‚   └── ScenarioConfigs/        # Scenario configuration files
└── package.json

Scenarios

Wildfire Simulation

Visualize WRF-SFIRE ensemble simulations with:

  • 3D terrain visualization with scalar field overlays
  • Wind glyph rendering
  • Contour boxplots and band depth analysis
  • Interactive time navigation
  • Customizable colormaps and opacity transfer functions

Uncertainty Tube

Explore flow field uncertainty with:

  • Seed placement and trajectory visualization
  • Uncertainty tube rendering
  • Ensemble member path analysis

Configuration

Scenarios are configured via JSON files in public/ScenarioConfigs/. Each scenario defines:

  • Panel layouts (responsive grid configurations)
  • Data sources and ensemble members
  • Initial visualization parameters
  • UI configurations

Example structure:

{
  "name": "Wildfire",
  "description": "WRF-SFire simulation data visualization",
  "panel_layouts": { ... },
  "global_data": { ... }
}

Key Features

Interactive Colormap Editor

  • Histogram-based scalar distribution visualization
  • Click to add control points
  • Right-click to remove control points
  • Real-time colormap updates

Opacity Transfer Function Editor

  • Y-position represents opacity (0-1)
  • Line plot shows opacity function
  • Interactive control point editing
  • Light gray histogram background

Responsive Layout Management

  • Drag-and-drop panel repositioning
  • Resizable panels
  • Breakpoint-based layouts (xl, lg, sm)
  • Panel visibility toggling

Development

Adding a New Scenario

Scenarios self-register via a registry pattern. To add a new scenario:

  1. Create your scenario folder:
src/Scenarios/YourScenario/
β”œβ”€β”€ index.ts                      # Entry point (registers the scenario)
β”œβ”€β”€ YourScenarioGlobalContext.ts  # State management (implements GlobalContext)
β”œβ”€β”€ yourScenarioPanelMapping.tsx  # Maps panel IDs to components
└── Views/                        # Panel components
    └── YourPanel/
        └── YourPanel.tsx
  1. Create index.ts to register your scenario:
import { scenarioRegistry } from "../ScenarioRegistry";
import { YourScenarioGlobalContext } from "./YourScenarioGlobalContext";
import { yourScenarioPanelMapping } from "./yourScenarioPanelMapping";

scenarioRegistry.register({
  name: "Your Scenario",
  description: "Description of your scenario",
  createGlobalContext: () => new YourScenarioGlobalContext(),
  panelMapping: yourScenarioPanelMapping,
  defaultConfigPath: "ScenarioConfigs/YourScenario.json",
});
  1. Implement GlobalContext interface in your GlobalContext class:
interface GlobalContext {
  initialize(global_data_object: any): void;
  asyncInitialize(): Promise<void>;
  toObject(): any;
}
  1. Create configuration JSON in public/ScenarioConfigs/YourScenario.json

  2. Add one import to src/Scenarios/index.ts:

import "./YourScenario";

That's it! Your scenario is now available in the application.

Creating Custom Panels

Panels extend the base Panel component and integrate with the MobX reactive system:

import Panel from "@/Panels/Panel";
import { observer } from "mobx-react-lite";

export const MyPanel = observer(() => {
  const global_context = useScenario().global_context;
  
  return (
    <Panel panel_name="My Panel">
      {/* Your content */}
    </Panel>
  );
});

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

License

[Add your license information here]

Acknowledgments

This project builds upon research in uncertainty visualization and ensemble data analysis.

Contact

For questions and support, please open an issue on GitHub.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages