-
Notifications
You must be signed in to change notification settings - Fork 122
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(goal): chart placement and overlap issues #1620
Merged
Merged
Conversation
This file contains 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
nickofthyme
added
:chart
Chart element related issue
:goal/gauge (old)
Old Goal/Gauge chart related issues
labels
Mar 4, 2022
nickofthyme
changed the title
fix: goal chart placement, overlap and sizing issues
fix(goal): chart placement, overlap and sizing issues
Mar 4, 2022
nickofthyme
force-pushed
the
fix-goal-placement
branch
from
March 4, 2022 21:46
0527c57
to
2fa9897
Compare
markov00
reviewed
Mar 7, 2022
packages/charts/src/chart_types/goal_chart/layout/viewmodel/geoms.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/goal_chart/layout/viewmodel/utils.ts
Outdated
Show resolved
Hide resolved
markov00
approved these changes
Mar 10, 2022
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.
It looks good to me now, tested on hosted storybook!
packages/charts/src/chart_types/goal_chart/layout/viewmodel/utils.test.ts
Show resolved
Hide resolved
markov00
reviewed
Mar 10, 2022
packages/charts/src/chart_types/goal_chart/layout/viewmodel/utils.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/goal_chart/layout/viewmodel/utils.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/goal_chart/layout/viewmodel/utils.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/goal_chart/layout/viewmodel/utils.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/goal_chart/layout/viewmodel/utils.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/goal_chart/layout/viewmodel/utils.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/goal_chart/layout/viewmodel/utils.test.ts
Show resolved
Hide resolved
markov00
reviewed
Mar 10, 2022
nickofthyme
changed the title
fix(goal): chart placement, overlap and sizing issues
fix(goal): chart placement and overlap issues
Mar 14, 2022
nickofthyme
pushed a commit
that referenced
this pull request
Mar 29, 2022
# [45.1.0](v45.0.1...v45.1.0) (2022-03-29) ### Bug Fixes * **axis:** ordinal number ending fix for the weekly resolution ([#1634](#1634)) ([18b4077](18b4077)) * **deps:** update dependency @elastic/eui to ^52.2.0 ([#1632](#1632)) ([7e0be07](7e0be07)) * **deps:** update dependency @elastic/eui to v50 ([#1622](#1622)) ([0eb7975](0eb7975)) * **deps:** update dependency @elastic/eui to v51 ([#1624](#1624)) ([64d87e5](64d87e5)) * **deps:** update dependency @elastic/eui to v52 ([#1630](#1630)) ([ada254e](ada254e)) * **goal:** chart placement and overlap issues ([#1620](#1620)) ([b5d375b](b5d375b)) ### Features * **goal:** expose max sizing limits in theme.goal options ([#1621](#1621)) ([60a14ba](60a14ba))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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
This PR fixes several issues related to goal/gauge charts:
Corrects placement of goal charts #1598 (2fa9897)
Screen.Recording.2022-03-04.at.03.13.46.PM.mp4
Prevent overlapping angles (3982d31)
We now limit the angle provided by the user to prevent overlapping gauge/goal charts. This limit of 2π is taken from the
angleStart
as the baseline accounting for the original angular direction (i.e. clockwise). A warning will print out below to inform the user the value has been replaced.Screen.Recording.2022-03-04.at.04.13.14.PM.mp4
Details
The sagitta offset calculations did not account for inverted angles nor a gap at the top of the chart. This PR fixes these cases however this is a tedious solution that requires case-by-case logic just to improve the positioning of the chart and is limited to what angles can be used (i.e. only applicable to angles where -2π > θ > 2π with the smallest angle from 0).
A better solution would be to update a rectangular box that contains all geoms of the goal/gauge content, including text labels, then using the centroid of the rectangle to correctly place the chart inside the available area.
Issues
fix #1598
Checklist
:xy
,:partition
):interactions
,:axis
)closes #123
,fixes #123
)packages/charts/src/index.ts