-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Could not find a suitable point for the given distance #6329
Fix: Could not find a suitable point for the given distance #6329
Conversation
…ld_not_find_a_suitable_point_for_the_given_distance
|
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
commit: |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6329 +/- ##
==========================================
- Coverage 3.88% 3.88% -0.01%
==========================================
Files 398 398
Lines 42040 42043 +3
Branches 637 637
==========================================
Hits 1634 1634
- Misses 40406 40409 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
📑 Summary
Fixes an error thrown when calculating points for an edge:
Could not find a suitable point for the given distance
. This is caused by a division by zero error giving a NaN result for the point due to the vectorDistance between two points being zero (the points are stacked on top of each other)const distanceRatio = remainingDistance / vectorDistance;
This is an issue only seen in Mermaid Chart where you can use the fixed layout as the regular layout algorithms won't have points in an edge with a distance of zero in between them.📏 Design Decisions
If the vectorDistance is zero it will simply return the previous point avoiding errors.
📋 Tasks
Make sure you
MERMAID_RELEASE_VERSION
is used for all new features.pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.