fix(partition): linked label on a larger than 180 degree slice #726
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #699
The issue arose when a single large (>180 degrees) slice is forced to have a linked label, eg. via a large or infinite
maximumSection
value (the default is, fill text)This:
gets fixed:
The root cause was that the preexisting calculation simply took the midpoint of the start and end angle, and if it was shorter to go along the other arc of the circle, then that's what it did. So it always resulted in an exact overlap with two slices where one was over 180 degrees and linked labels were forced.
There are two other mock updates. While the previous images were OK - as there is a singleton slice - the new version is more correct. It now picks the midpoint between the starting angle (0deg) and the ending angle (360deg) which is 180deg which is on the bottom.
Checklist
Delete any items that are not applicable to this PR.
Any consumer-facing exports were added tosrc/index.ts
(and stories only import from../src
except for test data & storybook)Unit tests were updated or added to match the most common scenarios- tested via integration (spec to image) test