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(xy): negative highlight and click #1109

Merged
merged 6 commits into from
Apr 7, 2021

Conversation

markov00
Copy link
Member

@markov00 markov00 commented Apr 6, 2021

Summary

fix #1100

The logic to compute the intersection between the mouse click coordinates and the geometry doesn't cover bars with negative height.
I've fixed that making the actual geometry renders with positive values instead.
This also fixed the missing highlight of negative bars.

@markov00 markov00 added bug Something isn't working :interactions Interactions related issue :xy Bar/Line/Area chart related labels Apr 6, 2021
@codecov-io
Copy link

codecov-io commented Apr 7, 2021

Codecov Report

Merging #1109 (1ac87f4) into master (a3234fe) will increase coverage by 0.24%.
The diff coverage is 100.00%.

❗ Current head 1ac87f4 differs from pull request most recent head 7538dec. Consider uploading reports for the commit 7538dec to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1109      +/-   ##
==========================================
+ Coverage   71.94%   72.18%   +0.24%     
==========================================
  Files         381      397      +16     
  Lines       11917    12229     +312     
  Branches     2602     2647      +45     
==========================================
+ Hits         8574     8828     +254     
- Misses       3318     3362      +44     
- Partials       25       39      +14     
Flag Coverage Δ
unittests 71.76% <100.00%> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/chart_types/xy_chart/rendering/bars.ts 89.36% <100.00%> (+6.70%) ⬆️
...hart_types/partition_chart/state/selectors/tree.ts 64.10% <0.00%> (-35.90%) ⬇️
src/common/predicate.ts 36.00% <0.00%> (-20.00%) ⬇️
...ypes/partition_chart/state/selectors/geometries.ts 76.97% <0.00%> (-6.48%) ⬇️
src/specs/settings.tsx 90.32% <0.00%> (ø)
...t_types/wordcloud/state/selectors/picked_shapes.ts 20.00% <0.00%> (ø)
..._types/goal_chart/state/selectors/picked_shapes.ts 26.31% <0.00%> (ø)
...ypes/partition_chart/layout/viewmodel/viewmodel.ts 85.08% <0.00%> (ø)
...es/partition_chart/layout/types/viewmodel_types.ts 87.50% <0.00%> (ø)
.../partition_chart/layout/viewmodel/picked_shapes.ts 100.00% <0.00%> (ø)
... and 16 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 a3234fe...7538dec. Read the comment docs.

@markov00 markov00 marked this pull request as ready for review April 7, 2021 10:44
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.

Code changes LGTM. Tested locally on storybook.

@markov00 markov00 merged commit ec17cb2 into elastic:master Apr 7, 2021
@markov00 markov00 deleted the 2021_04_06-fix_negative_highlight branch April 7, 2021 19:55
nickofthyme pushed a commit that referenced this pull request Apr 13, 2021
# [28.1.0](v28.0.1...v28.1.0) (2021-04-13)

### Bug Fixes

* **legend:** sizing for short labels with scrollbar ([#1115](#1115)) ([6e1f223](6e1f223))
* **xy:** negative bar highlight and click ([#1109](#1109)) ([ec17cb2](ec17cb2)), closes [#1100](#1100)

### Features

* **a11y:** improve chart figure ([#1104](#1104)) ([815cf39](815cf39))
* **partition:** order slices and sectors ([#1112](#1112)) ([74df29b](74df29b))
* **partitions:** small multipies events pass on smAccessorValue ([#1106](#1106)) ([a3234fe](a3234fe))
* **xy:** optionally rounds the domain to nice values ([#1087](#1087)) ([f644cc4](f644cc4))
* **xy:** specify pixel and ratio width for bars ([#1114](#1114)) ([58de413](58de413))
* mosaic ([#1113](#1113)) ([64bdd88](64bdd88))
@nickofthyme
Copy link
Collaborator

🎉 This PR is included in version 28.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nickofthyme nickofthyme added the released Issue released publicly label Apr 13, 2021
nickofthyme pushed a commit to nickofthyme/elastic-charts that referenced this pull request Apr 20, 2021
fix elastic#1100
# Conflicts:
#	integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-bar-clicks-and-hovers-visually-looks-correct-1-snap.png
#	src/chart_types/xy_chart/rendering/rendering.bars.test.ts
#	src/chart_types/xy_chart/state/chart_state.interactions.test.ts
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 :xy Bar/Line/Area chart related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[XY] negative bars are not clickable
3 participants