Commit graph

6 commits

Author SHA1 Message Date
DJP
89c8c78331 Fix UX: Import Project now available immediately
UX IMPROVEMENTS:
🔧 Import Project button always visible:
   - No longer hidden until after D3 rendering
   - Available immediately when page loads
   - Logical workflow: Import → Render (not Render → Import)

📥 Better import workflow:
   1. Page loads → Import Project button visible
   2. Click Import Project → Select .json file
   3. Project imports → Automatically renders with D3
   4. D3 buttons appear → Ready for editing

 Smart auto-rendering:
   - Import automatically switches to D3 mode
   - Preserves exact positioning from imported project
   - Shows D3-specific buttons (Export, Clear Positions)
   - Updated success message explains D3 auto-rendering

🎯 Now supports proper workflow:
   - Start fresh → Import existing project → Continue editing
   - No need to render first just to access import
   - Intuitive user experience

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-11 09:48:19 -04:00
DJP
708a9af042 Add comprehensive project export/import system
NEW FEATURES:
📦 Complete Project Export (.json):
   - Mermaid code + exact node positions + styling
   - Metadata (export date, title, description)
   - Version tracking and validation
   - Filename: mermaid-project-YYYY-MM-DD.json

📥 Complete Project Import:
   - Restores exact layout and positioning
   - Validates file format before import
   - Updates both code textarea and D3 visualization
   - Preserves all styling and properties
   - Shows import confirmation with metadata

🔄 Workflow:
   1. Create your diagram with D3 renderer
   2. Drag nodes to perfect positions
   3. Customize colors, text, shapes
   4. Click 'Export Project' → Downloads .json
   5. Later: Click 'Import Project' → Select .json
   6. Diagram restores with EXACT same layout\!

💾 Project File Contents:
   - version: File format version
   - mermaidCode: Pure Mermaid syntax
   - d3Data: Complete node/edge data with positions
   - renderSettings: Canvas size and renderer info
   - metadata: Title, description, export timestamp

 Perfect for:
   - Sharing diagrams with exact layouts
   - Version control of visual designs
   - Backing up complex positioning work
   - Collaborative editing workflows

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-11 09:44:55 -04:00
DJP
a88afcf4b5 Fix D3 renderer critical issues
FIXES:
🔧 Shape Detection: Now properly honors Mermaid syntax
   - A[text] → Rectangle 
   - B(text) → Circle 
   - C{text} → Diamond 
   - Added debug logging for shape parsing

💾 Position Persistence: localStorage integration
   - Positions save automatically when dragging
   - Positions restore on page refresh/reload
   - Positions preserved during sync operations
   - 'Reset Positions' button to clear saved positions

🔄 Sync Position Preservation:
   - generateMermaidCode() now saves positions before updating
   - No more position loss during visual-to-code sync
   - LocalStorage acts as position memory between operations

🎯 Better Initial Positioning:
   - Smarter random positioning (avoids edges)
   - Saved positions take priority over automatic layout
   - Clear debugging for position loading/saving

The three major issues are now resolved:
 Shapes honor Mermaid syntax (B(Go shopping) = circle)
 Positions persist across sessions (localStorage)
 Sync operations preserve layout (no jumping\!)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-11 09:27:28 -04:00
DJP
96fc8af786 Complete D3.js property panel integration
Features added:
- Full property panel integration with D3 renderer
- Node editing: text, shape, colors with live visual updates
- Edge editing: labels, types, colors, widths with live updates
- Element selection with visual highlighting
- Delete functionality for nodes and edges with cascade cleanup
- Bidirectional sync: D3 visual changes → Mermaid code updates
- Shape transformation support (rectangle ↔ circle ↔ diamond)
- Real-time code generation preserving all styling

D3 renderer now has feature parity with Mermaid renderer plus:
 Persistent positioning (no jumping back!)
 Smooth drag & drop interactions
 Live property editing with instant visual feedback
 Complete bidirectional synchronization

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-11 09:24:06 -04:00
DJP
c86a3cf7aa Add D3.js hybrid renderer
Features:
- D3.js renderer using existing Mermaid parser
- True drag & drop with persistent positioning
- Force simulation for automatic initial layout
- Support for node shapes (rectangle, circle, diamond)
- Edge labels and styling from Mermaid syntax
- Click handlers for nodes and edges (ready for property editing)
- Maintains full compatibility with Mermaid syntax

Usage:
- Click 'Render with D3' to use D3 renderer instead of Mermaid
- Drag nodes to reposition - positions stay fixed
- All existing Mermaid code parsing works unchanged

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-11 09:17:19 -04:00
DJP
c4c3e02b41 Initial commit: Interactive Mermaid Editor
Features implemented:
- Visual node/edge editing with property panels
- Drag and drop node positioning
- Color customization for nodes and edges
- Text editing with real-time updates
- Bidirectional Mermaid code synchronization
- Subgraph/grouping support for layout control
- Export functionality to JSON with position data
- Layout lock system (experimental)
- Edge label editing and styling
- Comprehensive Mermaid syntax parser

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-11 09:14:26 -04:00