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

fix: x-scale for linear band charts #384

Merged
merged 5 commits into from
Sep 27, 2019

Conversation

nickofthyme
Copy link
Collaborator

Summary

Add check for bandwidth to avoid computing minInterval for linear band charts.

fixes #364

Checklist

  • Unit tests were updated or added to match the most common scenarios

Add respective local directory to tsconfig (i.e. ./.stroybook and ./.playground)
@codecov-io
Copy link

codecov-io commented Sep 21, 2019

Codecov Report

Merging #384 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #384      +/-   ##
==========================================
+ Coverage   98.25%   98.26%   +0.01%     
==========================================
  Files          38       38              
  Lines        2801     2818      +17     
  Branches      661      670       +9     
==========================================
+ Hits         2752     2769      +17     
  Misses         44       44              
  Partials        5        5
Impacted Files Coverage Δ
src/utils/scales/scale_continuous.ts 93.65% <100%> (-0.1%) ⬇️
src/utils/themes/theme.ts 100% <0%> (ø) ⬆️

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 e1b0cd6...4902a15. Read the comment docs.

@nickofthyme nickofthyme added the :axis Axis related issue label Sep 23, 2019
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. Tested locally
One side note: IIRC you tried to add .nice()on the scale configuration. Can you please write down what didn't work?

@@ -182,13 +199,13 @@ export class ScaleContinuous implements Scale {
return currentDateTime.minus({ minutes: currentOffset }).toMillis();
});
} else {
if (this.minInterval > 0) {
if (minInterval > 0 && bandwidth > 0) {
Copy link
Member

Choose a reason for hiding this comment

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

Would you mind adding a comment before this line specifying that:

  • this case happens only on the xScale (minInterval is > 0 only in that case) and when we want to show bars (bandwidth > 0)
  • the reason is: we want to avoid displaying inner ticks between bars in a bar chart when using linear x scale: this can be misinterpreted because the bar width can be interpreted as an interval along that scale

Screenshot 2019-09-27 at 10 52 52

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@nickofthyme
Copy link
Collaborator Author

Yes the nice ticks were attempted in this PR but after nicing the axis domain the ticks were adjusted to reflect this change but the geometry was not updated to align with the nice axis.

I think the issue could be a simple fix but I couldn't get it.

I opened a new issue to fix this in the future 👉 #397

@nickofthyme nickofthyme merged commit daa3b55 into elastic:master Sep 27, 2019
@nickofthyme nickofthyme deleted the fix/scale-tick-steps branch September 27, 2019 18:14
markov00 pushed a commit that referenced this pull request Sep 27, 2019
## [13.0.1](v13.0.0...v13.0.1) (2019-09-27)

### Bug Fixes

* x-scale for linear band charts ([#384](#384)) ([daa3b55](daa3b55))
@markov00
Copy link
Member

🎉 This PR is included in version 13.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Sep 27, 2019
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

X Linear scale wrongly compute ticks
3 participants