Skip to content

Conversation

@FelixTJDietrich
Copy link
Collaborator

@FelixTJDietrich FelixTJDietrich commented Oct 8, 2025

Summary

  • Remove CSS variable dependencies from SVG exports for better compatibility with presentation software (Keynote, PowerPoint)
  • Add InlineMarker component that renders markers as actual path elements instead of <marker> references (which don't survive "Break Apart" operations)
  • Fix pixel-perfect edge endpoint alignment with node boundaries
  • Improve required interface (ball-and-socket) rendering with concentric circles and 90° arc span
  • Fix sidebar rendering issues for SFC and Petri Net diagrams

Changes

SVG Export Improvements

  • Replace CSS variables with hardcoded color values in all SVG components
  • Consolidate constants from multiple files into single constants.ts
  • Add pathParsing.ts utility for extracting endpoint info from SVG paths

Edge Rendering Fixes

  • Add MARKER_PADDING (-3) to compensate for React Flow handle offset
  • Add SOURCE_CONNECTION_POINT_PADDING (3) to align source endpoints
  • Update useStepPathEdge to always use adjusted coordinates

Required Interface (Ball-and-Socket) Improvements

  • Socket arc is now perfectly concentric with the ball (same center point)
  • Socket radius = ball radius + 2px gap for proper UML notation
  • 90° arc span allows 4 connections (N,S,E,W) without overlap
  • Use exact floating-point coordinates (no rounding) for precision

Sidebar Fixes

  • Fix SFC diagram crash: handle undefined actionRows in SfcActionTableNodeSVG sidebar preview
  • Fix Petri Net label overlap: add marginTop to Transition element config

Server

  • Add conversionRouter for model-to-SVG conversion API endpoint

Test plan

  • Export diagrams as SVG and verify they open correctly in Inkscape
  • Verify "Break Apart" in Keynote preserves all markers
  • Check edge endpoints align with node boundaries (no gaps)
  • Verify required interface sockets are concentric with provided interface balls
  • Test multiple required interfaces connecting to same provided interface at 90° angles
  • Verify SFC diagram sidebar renders all elements without crashing
  • Verify Petri Net sidebar shows Place and Transition labels without overlapping

🤖 Generated with Claude Code

@FelixTJDietrich
Copy link
Collaborator Author

FelixTJDietrich commented Oct 15, 2025

Class Diagram
Edit Diagram

@tamang29
Copy link
Contributor

In PowerPoint, elements are rendered properly, but edge connectors are not.
Screenshot 2025-11-19 at 10 00 51

@FelixTJDietrich
Copy link
Collaborator Author

@tamang29 or @FadyGergesRezk can one of you take over this PR and the other one reviews?

FelixTJDietrich and others added 3 commits December 19, 2025 14:39
This PR improves SVG export compatibility with presentation software
(Keynote, PowerPoint) by removing CSS variable dependencies and
rendering markers as inline path elements.

Key changes:

SVG Export Improvements:
- Replace CSS variables with hardcoded color values in all SVG components
- Add InlineMarker component that renders markers as actual path elements
  instead of <marker> references (which don't survive "Break Apart" operations)
- Consolidate constants from multiple files into single constants.ts

Edge Rendering Fixes:
- Fix pixel-perfect edge endpoint alignment with node boundaries
- Add MARKER_PADDING (-3) to compensate for React Flow handle offset
- Add SOURCE_CONNECTION_POINT_PADDING (3) to align source endpoints
- Update useStepPathEdge to always use adjusted coordinates

Required Interface (Ball-and-Socket) Improvements:
- Socket arc is now perfectly concentric with the ball (same center point)
- Socket radius = ball radius + 2px gap for proper UML notation
- 90° arc span allows 4 connections (N,S,E,W) without overlap
- Use exact floating-point coordinates (no rounding) for precision

Path Parsing:
- Add robust pathParsing.ts utility for extracting endpoint info from SVG paths
- Handles all SVG path commands including relative coordinates and bezier curves

Server:
- Add conversionRouter for model-to-SVG conversion API endpoint

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@FelixTJDietrich FelixTJDietrich changed the title Fix SVG export to inline colors feat: remove CSS variables from SVG exports and add inline markers Feb 3, 2026
FelixTJDietrich and others added 2 commits February 3, 2026 15:27
…el overlap

- SfcActionTableNodeSVG: default actionRows to empty array when undefined,
  preventing crash in sidebar preview
- PetriNet: add marginTop to Transition element config to prevent
  "Transition" and "Place" labels from overlapping in sidebar

Co-Authored-By: Claude Opus 4.5 <[email protected]>
…al content

Reduced height from 70 to 40 to match the header height, eliminating
empty space below the underlined "Object" text in the sidebar preview.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants