Desktop Editor
The MathViz Desktop Editor is a native application for writing MathViz code with syntax highlighting, live preview, and integrated rendering. Built with Tauri for a fast, lightweight experience across Windows, macOS, and Linux.
The desktop editor is currently in beta. Some features may be incomplete or change in future releases.
Installation
Download
Download the latest release for your platform:
Build from Source
To build the editor from source, you need Node.js and Rust installed:
# Clone the repository
git clone https://github.com/CyberSnakeH/MathViz.git
cd MathViz/editor
# Install dependencies
npm install
# Run in development mode
npm run tauri dev
# Build for production
npm run tauri build
Interface Overview
The editor interface is divided into several key areas:
Layout Components
- Menu Bar - Access file operations, settings, and run commands
- File Explorer - Navigate your project files and folders
- Code Editor - Write MathViz code with syntax highlighting
- Preview Panel - See live preview of your animations
- Status Bar - View file info, cursor position, and status messages
Code Editor
The code editor provides a modern editing experience with features designed for MathViz development.
Syntax Highlighting
Full syntax highlighting for MathViz code using the Tokyo Night color scheme:
- Keywords - fn, let, if, for, scene, struct, etc.
- Functions - Function names and calls
- Strings - String literals
- Numbers - Numeric literals
- Comments - Single and multi-line comments
- Types - Type annotations
Auto-completion
Intelligent code completion suggests relevant items as you type:
- Language keywords and built-in functions
- Manim mobjects and animation functions
- User-defined functions and variables
- Module imports and exports
Error Highlighting
Syntax and type errors are highlighted inline with descriptive messages. Hover over underlined code to see the error details.
Code Folding
Collapse functions, scenes, and blocks to focus on specific sections. Click the fold icons in the gutter or use keyboard shortcuts.
Live Preview
The preview panel shows a real-time visualization of your animation as you code.
Preview Modes
| Mode | Description | Use Case |
|---|---|---|
| Static | Shows the final frame of the animation | Positioning and layout |
| Interactive | Step through animation frames manually | Debugging timing |
| Live | Plays animation automatically on save | Rapid iteration |
Preview Controls
- Play/Pause - Start or pause animation playback
- Step Forward/Back - Move one frame at a time
- Timeline Scrubber - Jump to specific points in the animation
- Speed Control - Adjust playback speed (0.25x - 4x)
- Zoom - Zoom in/out of the preview canvas
Preview Quality
Adjust preview quality for faster iteration or higher fidelity:
Preview Quality:
Draft - 480p, 15fps (fastest)
Standard - 720p, 30fps (balanced)
High - 1080p, 60fps (best quality)
Rendering
Export your animations to video files directly from the editor.
Render Dialog
Access via Run > Render or press Ctrl + Shift + R:
| Option | Values | Description |
|---|---|---|
| Quality | 480p, 720p, 1080p, 1440p, 4K | Output resolution |
| Format | MP4, WebM, GIF | Output file format |
| Frame Rate | 24, 30, 60 fps | Frames per second |
| Background | Black, White, Transparent | Background color |
| Scene | All, Specific | Which scenes to render |
Batch Rendering
Render multiple scenes or files at once:
- Select files in the explorer (Ctrl+Click)
- Right-click and choose "Add to Render Queue"
- Configure settings for each item
- Click "Start Batch Render"
Render Progress
Monitor rendering progress in the status bar. Click to open the detailed progress panel showing:
- Current frame / total frames
- Estimated time remaining
- Memory and CPU usage
- Output file location
Settings
Access settings via File > Preferences or Ctrl + ,.
Editor Settings
| Setting | Default | Description |
|---|---|---|
| Font Family | JetBrains Mono | Editor font |
| Font Size | 14px | Editor font size |
| Tab Size | 4 | Spaces per tab |
| Word Wrap | Off | Wrap long lines |
| Line Numbers | On | Show line numbers |
| Minimap | On | Show code minimap |
| Auto Save | After Delay | Auto save behavior |
Theme Settings
The editor uses the Tokyo Night theme by default. Additional themes:
- Tokyo Night - Dark theme with purple/blue accents (default)
- Tokyo Night Storm - Slightly lighter variant
- Tokyo Night Light - Light theme variant
- One Dark - Atom One Dark inspired
- Dracula - Popular dark theme
Preview Settings
| Setting | Default | Description |
|---|---|---|
| Preview Quality | Standard | Preview render quality |
| Auto Preview | On | Update preview on save |
| Preview Delay | 500ms | Debounce time for auto preview |
| Show Grid | Off | Show coordinate grid |
| Show Axes | Off | Show X/Y axes |
Keyboard Shortcuts
File Operations
| Action | Windows/Linux | macOS |
|---|---|---|
| New File | Ctrl + N | Cmd + N |
| Open File | Ctrl + O | Cmd + O |
| Save | Ctrl + S | Cmd + S |
| Save As | Ctrl + Shift + S | Cmd + Shift + S |
| Close Tab | Ctrl + W | Cmd + W |
Editing
| Action | Windows/Linux | macOS |
|---|---|---|
| Undo | Ctrl + Z | Cmd + Z |
| Redo | Ctrl + Y | Cmd + Shift + Z |
| Find | Ctrl + F | Cmd + F |
| Replace | Ctrl + H | Cmd + Option + F |
| Comment Line | Ctrl + / | Cmd + / |
| Duplicate Line | Ctrl + Shift + D | Cmd + Shift + D |
| Move Line Up | Alt + Up | Option + Up |
| Move Line Down | Alt + Down | Option + Down |
| Format Document | Ctrl + Shift + F | Cmd + Shift + F |
Navigation
| Action | Windows/Linux | macOS |
|---|---|---|
| Go to Line | Ctrl + G | Cmd + G |
| Go to File | Ctrl + P | Cmd + P |
| Go to Symbol | Ctrl + Shift + O | Cmd + Shift + O |
| Command Palette | Ctrl + Shift + P | Cmd + Shift + P |
| Toggle Sidebar | Ctrl + B | Cmd + B |
Run & Preview
| Action | Windows/Linux | macOS |
|---|---|---|
| Run/Preview | F5 | F5 |
| Render | Ctrl + Shift + R | Cmd + Shift + R |
| Stop | Shift + F5 | Shift + F5 |
| Toggle Preview | Ctrl + Shift + V | Cmd + Shift + V |
| Play/Pause Preview | Space (in preview) | Space (in preview) |
Troubleshooting
Preview Not Updating
- Check that the file has no syntax errors (red underlines)
- Ensure "Auto Preview" is enabled in settings
- Try manually refreshing with F5
- Check the console for error messages (View > Console)
Rendering Fails
- Verify Manim is installed:
mathviz info --check-deps - Check available disk space in the output directory
- Try rendering at a lower quality first
- Review the render log for specific errors
Performance Issues
- Lower preview quality in settings
- Disable minimap for large files
- Close unused tabs
- Increase preview debounce delay
Next Steps
- Getting Started - Write your first program
- Scenes & Manim - Create animations
- Examples - Browse example code