Canvas & Node Overlay Research - Milestone 3
Canvas & Node Overlay Research - Milestone 3
The Node Overlay Challenge
What You're Trying to Achieve
- Visual workflow editor similar to N8N's canvas
- Drag-and-drop nodes onto canvas
- Connect nodes with flow lines
- Interactive node configuration
- Integration within Odoo's interface
N8N Canvas Architecture (Research Needed)
Key Components to Investigate
- Canvas Container: How N8N renders the workspace
- Node Rendering: How individual nodes are drawn and positioned
- Connection Lines: How nodes are connected visually
- Interaction Layer: Mouse events, drag/drop, selection
- Data Flow: How canvas state syncs with workflow data
Research Tasks
- [ ] Examine N8N's frontend source code
- [ ] Identify the main canvas component
- [ ] Document the node overlay implementation
- [ ] Understand the event handling system
- [ ] Map out the data structures used
Odoo OWL Canvas Options
Option 1: Custom OWL Canvas Component
Pros: Full control, native Odoo integration
Cons: Complex to build from scratch
Research: Study existing Odoo diagram components
Option 2: Embed N8N Canvas (iframe)
Pros: Reuse existing functionality
Cons: Limited integration, styling challenges
Research: Test iframe embedding feasibility
Option 3: Third-Party Canvas Library
Pros: Proven solution, faster development
Cons: Additional dependency, integration work
Libraries to Research:
- Fabric.js
- Konva.js
- Paper.js
- D3.js
Option 4: SVG-Based Custom Solution
Pros: Lightweight, web-native
Cons: Manual implementation of all interactions
Research: SVG manipulation in OWL
Immediate Research Session Plan
Session 1: N8N Canvas Deep Dive (2 hours)
- Setup: Get N8N running in development mode
- Explore: Navigate to workflow editor, open browser dev tools
- Document:
- Main canvas element structure
- Node rendering approach
- Event listeners and handlers
- CSS classes and styling approach
- Extract: Key JavaScript/TypeScript files responsible for canvas
Session 2: Odoo OWL Canvas Capabilities (1 hour)
- Research: Existing Odoo components with diagram/canvas features
- Test: Create simple OWL component with SVG or Canvas element
- Document: OWL's capabilities for interactive graphics
- Prototype: Basic draggable element proof of concept
Session 3: Integration Decision (30 minutes)
- Compare: Pros/cons of each approach based on research
- Decide: Choose primary approach and backup option
- Plan: Next steps for implementation
Key Questions to Answer
- How complex is N8N's canvas implementation?
- Can we reasonably recreate core functionality in OWL?
- What's the minimum viable canvas we need for v1?
- How will this integrate with Odoo's existing UI patterns?
Success Criteria for This Milestone
- [ ] Clear understanding of N8N's canvas architecture
- [ ] Documented approach for Odoo integration
- [ ] Working proof of concept for basic node display
- [ ] Decision on implementation strategy
- [ ] Plan for Milestone 4 (actual implementation)