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(brush): show crosshair cursor when brush enabled #243

Merged
merged 2 commits into from
Jun 19, 2019

Conversation

emmacunningham
Copy link
Contributor

Summary

This PR adds the functionality that when onBrushEndListener is defined and the cursor is within the chart bounds (excluding the axes), the cursor will appear as a crosshair instead of the pointer or default.

Notice below (from Kibana Discover) that the bottom version (the original implementation) has the crosshair cursor visible to indicate to the user that the brushing is possible, while in the top version (elastic-charts version), the cursor remains the default.

discover_crosshair

This PR adds a new computed method to the chart store that checks the cursor position and isBrushEnabled to determine if the crosshair cursor should be visible.

crosshair_cursor

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

@codecov-io
Copy link

codecov-io commented Jun 18, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #243      +/-   ##
==========================================
+ Coverage   97.75%   97.75%   +<.01%     
==========================================
  Files          36       36              
  Lines        2626     2632       +6     
  Branches      587      588       +1     
==========================================
+ Hits         2567     2573       +6     
  Misses         52       52              
  Partials        7        7
Impacted Files Coverage Δ
src/state/chart_state.ts 96.9% <100%> (+0.04%) ⬆️

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 ff7340a...99f6809. Read the comment docs.

@emmacunningham emmacunningham added the :interactions Interactions related issue label Jun 18, 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

@emmacunningham emmacunningham merged commit 0b44b87 into elastic:master Jun 19, 2019
markov00 pushed a commit that referenced this pull request Jun 19, 2019
# [6.1.0](v6.0.1...v6.1.0) (2019-06-19)

### Features

* **brush:** show crosshair cursor when brush enabled  ([#243](#243)) ([0b44b87](0b44b87))
@markov00
Copy link
Member

🎉 This PR is included in version 6.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Jun 19, 2019
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
# [6.1.0](elastic/elastic-charts@v6.0.1...v6.1.0) (2019-06-19)

### Features

* **brush:** show crosshair cursor when brush enabled  ([opensearch-project#243](elastic/elastic-charts#243)) ([30aff75](elastic/elastic-charts@30aff75))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:interactions Interactions related issue released Issue released publicly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants