A modern, interactive graph editor built with Rust and the egui framework, featuring GPU-accelerated particle effects and a flexible canvas system.
- Interactive Node-Based Graph Editor: Create, connect and manipulate nodes on a zoomable, pannable canvas.
- Multiple Edge Types: Support for different connection styles including Bezier curves and straight lines.
- GPU-Accelerated Particle System: Visually stunning effects rendered directly on the GPU.
- Serialization Support: Save and load your graph structures.
- Multi-select and Manipulation: Select multiple nodes and modify them simultaneously.
- Customizable Appearance: Adjust colors, node styles, and edge appearances.
Cognitheon is built using a modular architecture with the following components:
- Core Graph Model: Implemented with the petgraph library, providing a solid foundation for graph operations.
- Canvas System: Handles coordinate transformations between screen and canvas space, allowing for infinite zooming and panning.
- Input Management: A state-based input handling system that manages different interaction modes.
- Rendering System: Built on top of egui and wgpu for efficient 2D rendering and GPU-accelerated effects.
- Resource Management: Thread-safe shared resources using Arc and RwLock for state management.
- Latest stable Rust toolchain
- Graphics drivers that support wgpu (most modern systems are compatible)
-
Clone the repository:
git clone https://github.com/yourusername/cognitheon.git cd cognitheon -
Build and run the application:
cargo run --release
- Create Nodes: Right-click on empty canvas space
- Connect Nodes: Drag from one node to another
- Delete Elements: Select and press Delete
- Select Multiple: Drag selection rectangle or Ctrl+Click
- Pan Canvas: Middle mouse button or Alt+Left drag
- Zoom: Mouse wheel
- New Project: File > New
- Save Project: File > Save
- Load Project: File > Open
Switch between different edge types through the Edge Type dropdown in the UI panel:
- Bezier curves: Smooth, adjustable paths with control points
- Straight lines: Direct connections between nodes
Cognitheon can be compiled to WebAssembly and deployed as a web application:
-
Install the WASM target:
rustup target add wasm32-unknown-unknown -
Install Trunk:
cargo install --locked trunk -
Build for web:
trunk build --release -
The generated
distdirectory can be deployed to any static web hosting service.
src/app.rs: Main application structure and UI layoutsrc/graph/: Graph data structures and operationssrc/canvas.rs: Canvas system for coordinate managementsrc/ui/: UI components and renderingsrc/input/: Input handling and state managementsrc/gpu_render/: GPU-accelerated rendering components
cargo run
We welcome contributions to Cognitheon! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is dual-licensed under either:
- MIT License (LICENSE-MIT)
- Apache License, Version 2.0 (LICENSE-APACHE)
at your option.