Broken Arrow Connections in Specific Flowchart Configurations #6208
Labels
Status: Triage
Needs to be verified, categorized, etc
Type: Bug / Error
Something isn't working or is incorrect
Description
Thank you for your help, work, and time!
When creating certain flowcharts (examples in "Steps to Reproduce"), the resulting diagrams have arrows that fail to connect shapes. The connections fall short of their intended target. This behavior appears to be tied to specific edge cases involving the circle and double circle shapes and with largely vertical diagrams.
Expected Behavior:
Arrows should connect properly between the source and destination shapes, regardless of their types (e.g., circle, rectangle, double circle) and or placement in subgraphs.
Actual Behavior:
Arrows are either misaligned or fail to connect in specific configurations.
Observations:
Reproducibility:
Example 1: The issue is only reproducible on mermaid.live.
Example 2: The issue is reproducible on both mermaid.live and mmdc (version 11.4.2).
Discrepancies in Outputs:
In Example 1, mermaid.live and mmdc output for the same diagram is different.
In Example 2, changing D from a double circle to a rectangle results in different outputs between mermaid.live and mmdc.
Suggestion for Improvement:
Not sure if you all already do, maybe longer term, incorporating or increasing the amount of fuzzy testing could help with these sorts of things.
If you have a way to verify correctness could help catch edge cases.
Potentially one naive way of checking for incorrectness would be by leveraging the inconsistency in mmdc and mermaid.live outputs. In my Example 1, the outputs between mermaid.live and mmdc were different. Maybe in your fuzzy testing suite, you could diff the outputs of mermaid.live and mmdc and when the outputs are different, you could mark the testcase as failed.
Steps to reproduce
Example 1: Broken Connection Between Box One and D
Input the following diagram into mermaid.live:
Observe that the arrow between Two and D does not connect properly.
Example 2: Broken Connection Between Box Two and Circle A
Input the following diagram into mermaid.live:
Observe that the arrow between Two and A fails to connect.
The issue is also reproducible using mmdc (version 11.4.2) with the following command:
npx mmdc -i t.mmd -o t.svg
Screenshots
No response
Code Sample
Setup
Suggested Solutions
Possible Cause:
Seems like a length miscalculation when calculating connection lengths, particularly for edge cases around the circle or dbl-circle shapes?
Additional Context
No response
The text was updated successfully, but these errors were encountered: