Skip to content
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

feat(axis): log scale limit and base options #1032

Merged
merged 32 commits into from
Feb 18, 2021

Conversation

nickofthyme
Copy link
Collaborator

@nickofthyme nickofthyme commented Feb 17, 2021

Summary

closes #916

The main features added in this PR are the following:

  • Set base of log scales to 10, 2 or e (Common, Binary or Natural), via domain.logBase and xDomain.logBase
  • Set custom min limit of log values, previously hardcoded to 1, via domain.logMinLimit
  • Allow domain to fit full domain of dataset, without crossing 0 via domain.fit option

logMinLimit

Screen Recording 2021-02-04 at 01 16 PM

No logMinLimit set, uses full domain

Screen Recording 2021-02-04 at 01 17 PM

yLogBase

Screen Recording 2021-02-04 at 01 18 PM

Checklist

  • Any consumer-facing exports were added to src/index.ts (and stories only import from ../src except for test data & storybook)
  • Proper documentation or storybook story was added for features that require explanation or tutorials
  • Unit tests were updated or added to match the most common scenarios

@nickofthyme nickofthyme added :axis Axis related issue :data Data/series/scales related issue enhancement New feature or request labels Feb 17, 2021
Copy link
Member

@markov00 markov00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few VRTs to fix and also some unit test to refactor with the new implementation (in particular the ones using computeContinuousDataDomain

integration/tests/scales_stories.test.ts Outdated Show resolved Hide resolved
src/chart_types/xy_chart/domains/types.ts Show resolved Hide resolved
src/chart_types/xy_chart/utils/axis_utils.test.ts Outdated Show resolved Hide resolved
src/chart_types/xy_chart/utils/scales.ts Outdated Show resolved Hide resolved
src/chart_types/xy_chart/utils/specs.ts Show resolved Hide resolved
src/scales/scale_continuous.ts Show resolved Hide resolved
src/scales/scale_continuous.ts Outdated Show resolved Hide resolved
src/chart_types/xy_chart/utils/scales.ts Outdated Show resolved Hide resolved
src/scales/scale_continuous.ts Outdated Show resolved Hide resolved
src/chart_types/xy_chart/utils/axis_utils.ts Outdated Show resolved Hide resolved
Copy link
Member

@markov00 markov00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to merge for me.
If you want, you can go back with the previous api-extractor version and remove the last remaining named tuple ContinuousDomain to clean up the API report

@nickofthyme nickofthyme merged commit b38d110 into elastic:master Feb 18, 2021
@nickofthyme nickofthyme deleted the log-options branch February 18, 2021 23:04
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))
@markov00
Copy link
Member

markov00 commented Mar 1, 2021

🎉 This PR is included in version 25.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Mar 1, 2021
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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:axis Axis related issue :data Data/series/scales related issue enhancement New feature or request released Issue released publicly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto min value on log scale
2 participants