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(crosshair): limit the width of the cursor band on edges #353

Merged
merged 4 commits into from
Aug 27, 2019

Conversation

markov00
Copy link
Member

Summary

If the xDomain doesn't cover a full interval on the min or max edges, the crosshair is drawn outside the chart as shown in the screenshot.

This commit will fix that behaviour limiting the cursor band width and position to be
always inside the chart

fix #352

Screenshot 2019-08-27 at 13 09 36

Screenshot 2019-08-27 at 13 09 41

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

  • Any consumer-facing exports were added to src/index.ts (and stories only import from ../src except for test data & storybook)
  • This was checked for cross-browser compatibility, including a check against IE11
  • [ ] 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
  • Each commit follows the convention

If the xDomain doesn't cover a full interval on the min or max edges, the crosshair is drawn outside
the chart. This commit will fix that behaviour limiting the cursor band width and position to be
always inside the chart
@markov00 markov00 added bug Something isn't working :interactions Interactions related issue labels Aug 27, 2019
@markov00 markov00 requested a review from nickofthyme August 27, 2019 11:10
@codecov-io
Copy link

codecov-io commented Aug 27, 2019

Codecov Report

Merging #353 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #353      +/-   ##
=========================================
+ Coverage   98.29%   98.3%   +<.01%     
=========================================
  Files          38      38              
  Lines        2753    2765      +12     
  Branches      648     652       +4     
=========================================
+ Hits         2706    2718      +12     
  Misses         43      43              
  Partials        4       4
Impacted Files Coverage Δ
.../chart_types/xy_chart/crosshair/crosshair_utils.ts 97.53% <100%> (+0.42%) ⬆️

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 5e1446c...2e695b0. Read the comment docs.

Copy link
Collaborator

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

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

Created separate 👉 issue #354

Copy link
Collaborator

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

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

Tested locally looks good.

I Noticed issue that is also in master #354

@markov00 markov00 merged commit 1177e59 into elastic:master Aug 27, 2019
@markov00 markov00 deleted the fix-crosshair-on-edge branch August 27, 2019 17:15
markov00 pushed a commit that referenced this pull request Aug 27, 2019
## [11.0.4](v11.0.3...v11.0.4) (2019-08-27)

### Bug Fixes

* **crosshair:** limit the width of the cursor band on edges ([#353](#353)) ([1177e59](1177e59)), closes [#352](#352)
@markov00
Copy link
Member Author

🎉 This PR is included in version 11.0.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Aug 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
bug Something isn't working :interactions Interactions related issue released Issue released publicly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cursor band outside chart for custom domains
3 participants