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: add domain padding #707

Merged
merged 16 commits into from
Jun 30, 2020
Merged

Conversation

nickofthyme
Copy link
Collaborator

@nickofthyme nickofthyme commented Jun 12, 2020

Summary

fixes #706

  • add margin option to domain
  • allow unconstrained padded domains, basically allow domains with padding to go beyond the zero baseline. By default, the domain is constrained to zero.
  • create specific y domain type
  • deprecate yScaleToDataExtent in favor of domain.fit

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 requested review from markov00 and monfera June 12, 2020 19:12
@nickofthyme nickofthyme added :axis Axis related issue :xy Bar/Line/Area chart related labels Jun 12, 2020
@codecov-commenter
Copy link

codecov-commenter commented Jun 12, 2020

Codecov Report

Merging #707 into master will decrease coverage by 0.31%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #707      +/-   ##
==========================================
- Coverage   74.80%   74.48%   -0.32%     
==========================================
  Files         265      282      +17     
  Lines        8541     8890     +349     
  Branches     1714     1754      +40     
==========================================
+ Hits         6389     6622     +233     
- Misses       2099     2211     +112     
- Partials       53       57       +4     
Impacted Files Coverage Δ
src/chart_types/goal_chart/state/chart_state.tsx 59.18% <0.00%> (ø)
src/chart_types/index.ts 100.00% <ø> (ø)
...types/partition_chart/layout/types/config_types.ts 100.00% <ø> (ø)
.../chart_types/partition_chart/state/chart_state.tsx 74.50% <0.00%> (ø)
src/chart_types/xy_chart/utils/specs.ts 100.00% <ø> (ø)
src/components/portal/utils.ts 21.42% <0.00%> (-78.58%) ⬇️
src/scales/constants.ts 100.00% <ø> (ø)
src/specs/constants.ts 100.00% <ø> (ø)
src/state/chart_state.ts 87.09% <ø> (ø)
src/utils/chart_size.ts 100.00% <ø> (ø)
... and 47 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 88123f5...6397484. Read the comment docs.

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.

There are some issues with the computed padding in percentage that can be shown in the following story: http://localhost:9001/?path=/story/bar-chart--scale-to-extent
The positive and negative added padding doesn't represent exactly the applied values
Screenshot 2020-06-24 at 12 22 35

@nickofthyme nickofthyme force-pushed the feat/add-domain-padding branch from 55137a9 to 053fd69 Compare June 25, 2020 16:04
- avoid mutating stack/non-stacked domains before combining
- update scale to extent story
@nickofthyme nickofthyme force-pushed the feat/add-domain-padding branch from 053fd69 to 8374e5f Compare June 25, 2020 20:03
@nickofthyme nickofthyme requested a review from markov00 June 25, 2020 21:47
@nickofthyme nickofthyme requested a review from markov00 June 30, 2020 03:11
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.

LGTM

@markov00 markov00 merged commit 15c78c1 into elastic:master Jun 30, 2020
markov00 pushed a commit that referenced this pull request Jun 30, 2020
# [19.7.0](v19.6.3...v19.7.0) (2020-06-30)

### Bug Fixes

* **partition:** linked label on a larger than 180 degree slice ([#726](#726)) ([2504bbe](2504bbe)), closes [#699](#699)

### Features

* add domain padding ([#707](#707)) ([15c78c1](15c78c1)), closes [#706](#706)
@markov00
Copy link
Member

🎉 This PR is included in version 19.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Jun 30, 2020
@nickofthyme nickofthyme deleted the feat/add-domain-padding branch June 30, 2020 13:36
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:axis Axis related issue released Issue released publicly :xy Bar/Line/Area chart related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Domain margins
3 participants