fix: rounding values on stacked w percentage charts#1039
Merged
markov00 merged 3 commits intoelastic:masterfrom Mar 1, 2021
Merged
fix: rounding values on stacked w percentage charts#1039markov00 merged 3 commits intoelastic:masterfrom
markov00 merged 3 commits intoelastic:masterfrom
Conversation
github-actions bot
pushed a commit
that referenced
this pull request
Mar 1, 2021
# [25.1.0](v25.0.1...v25.1.0) (2021-03-01) ### Bug Fixes * rounding values on stacked w percentage charts ([#1039](#1039)) ([ee63a70](ee63a70)) ### Features * **axis:** log scale limit and base options ([#1032](#1032)) ([b38d110](b38d110)) * **partition:** clip text in partition chart fill label ([#1033](#1033)) ([be9bea0](be9bea0))
Collaborator
Author
|
🎉 This PR is included in version 25.1.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
# [25.1.0](elastic/elastic-charts@v25.0.1...v25.1.0) (2021-03-01) ### Bug Fixes * rounding values on stacked w percentage charts ([opensearch-project#1039](elastic/elastic-charts#1039)) ([021e836](elastic/elastic-charts@021e836)) ### Features * **axis:** log scale limit and base options ([#1032](elastic/elastic-charts#1032)) ([11f94c6](elastic/elastic-charts@11f94c6)) * **partition:** clip text in partition chart fill label ([opensearch-project#1033](elastic/elastic-charts#1033)) ([7626441](elastic/elastic-charts@7626441))
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
With stacked charts, in percentage mode, we use a default data domain of
[0,1]instead of computing it from the stacked data.On the rendering side, we remove geometries in which the data point falls outside the computed domain.
There are cases where the stack computes function, returns floating-point errors, and in particular, with such a small interval
[0,1]this can cause a geometry not to be rendered because the value falls, for example, right above the1by a floating-point error. If the floating-point error falls internally on the domain, is fine, the rendering will take place and the error is barely noticeable if the error falls externally then the geometry is not rendered at all as in the example below.This PR fixes this issue, clamping the stacked as percentage values in the exact interval between 0 and 1.
The floating-point error on the computed value in the example is
1.0000000000000002Before:

After:

Checklist
Delete any items that are not applicable to this PR.
src/index.ts(and stories only import from../srcexcept for test data & storybook)