fix(partition): linked label on a larger than 180 degree slice#726
Merged
fix(partition): linked label on a larger than 180 degree slice#726
Conversation
markov00
approved these changes
Jun 30, 2020
Collaborator
markov00
left a comment
There was a problem hiding this comment.
LGTM tested with the example code from the original issue
Collaborator
|
🎉 This PR is included in version 19.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
AMoo-Miki
pushed a commit
to AMoo-Miki/OpenSearch-Dashboards
that referenced
this pull request
Feb 10, 2022
# [19.7.0](elastic/elastic-charts@v19.6.3...v19.7.0) (2020-06-30) ### Bug Fixes * **partition:** linked label on a larger than 180 degree slice ([opensearch-project#726](elastic/elastic-charts#726)) ([7ac128e](elastic/elastic-charts@7ac128e)), closes [opensearch-project#699](elastic/elastic-charts#699) ### Features * add domain padding ([opensearch-project#707](elastic/elastic-charts#707)) ([8084e4b](elastic/elastic-charts@8084e4b)), closes [opensearch-project#706](elastic/elastic-charts#706)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
maximumSectionvalue (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../srcexcept for test data & storybook)Unit tests were updated or added to match the most common scenarios- tested via integration (spec to image) test