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(scales): bisect correctly on continuous scales #346

Merged
merged 5 commits into from
Aug 26, 2019

Conversation

markov00
Copy link
Member

@markov00 markov00 commented Aug 25, 2019

Summary

fix #227, fix #221, fix #347

This commit fix the wrong behaviour of the current invertWithStep implementation.

Aug-25-2019 22-25-39

Aug-25-2019 22-26-52

It also fix the behaviour of cursor sync between charts with only lines and charts with only bars and empty intervals.

Aug-25-2019 22-25-02

It finally fix also the missing line/rect annotation that are dependent on ticks to be shown. The PR removed the dependency with the ticks and allows us to place correctly the annotations depending on chart type

Notes
I've the impression that we need an absolute refactoring of the current scale system for linear band scales. The current implementation is a bit hacky because it's a mix of a linear scale adapted to work as a band/ordinal scale.
Right now these two scales differs by 1 pixel, it's not noticeable but it create a bit of confusion on the code and testing.

The playground is updated with an example of multi-chart synched with various configurations

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

This commit fix the wrong behaviour of the current invertWithStep implementation. It also fix the
behaviour of cursor sync between charts with only lines and charts with only bars and empty
intervals.

fix elastic#227, fix elastic#221
@codecov-io
Copy link

codecov-io commented Aug 25, 2019

Codecov Report

Merging #346 into master will decrease coverage by 0.04%.
The diff coverage is 89.28%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #346      +/-   ##
=========================================
- Coverage   98.34%   98.3%   -0.05%     
=========================================
  Files          38      38              
  Lines        2726    2719       -7     
  Branches      646     642       -4     
=========================================
- Hits         2681    2673       -8     
  Misses         42      42              
- Partials        3       4       +1
Impacted Files Coverage Δ
src/utils/themes/light_theme.ts 100% <ø> (ø) ⬆️
src/utils/scales/scales.ts 100% <ø> (ø) ⬆️
src/utils/scales/scale_band.ts 94.59% <100%> (+0.3%) ⬆️
...art_types/xy_chart/annotations/annotation_utils.ts 100% <100%> (ø) ⬆️
.../chart_types/xy_chart/crosshair/crosshair_utils.ts 97.1% <83.33%> (+1.15%) ⬆️
src/chart_types/xy_chart/store/chart_state.ts 96.5% <85.18%> (-0.61%) ⬇️
src/utils/scales/scale_continuous.ts 94.82% <94.73%> (+0.75%) ⬆️

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 02a313b...46793d4. Read the comment docs.

@markov00 markov00 marked this pull request as ready for review August 25, 2019 22:47
@markov00 markov00 added :annotation Annotation (line, rect, text) related issue :interactions Interactions related issue bug Something isn't working labels Aug 25, 2019
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 did notice some strange behaviour with one of the charts and the legend toggle 👇
Screen Recording 2019-08-26 at 08 09 AM

Have you seen this before?

src/chart_types/xy_chart/store/chart_state.ts Show resolved Hide resolved
src/chart_types/xy_chart/store/chart_state.ts Show resolved Hide resolved
src/chart_types/xy_chart/store/chart_state.ts Show resolved Hide resolved
src/utils/themes/light_theme.ts Show resolved Hide resolved
@markov00
Copy link
Member Author

Tested locally, looks good!

I did notice some strange behaviour with one of the charts and the legend toggle 👇
Screen Recording 2019-08-26 at 08 09 AM

Have you seen this before?

Yes it's visible on https://elastic.github.io/elastic-charts/?path=/story/mixed-charts--bar-and-lines if you hide the bar

@markov00 markov00 merged commit 5112208 into elastic:master Aug 26, 2019
markov00 pushed a commit that referenced this pull request Aug 26, 2019
## [10.3.1](v10.3.0...v10.3.1) (2019-08-26)

### Bug Fixes

* **scales:** bisect correctly on continuous scales ([#346](#346)) ([5112208](5112208)), closes [#227](#227) [#221](#221)
@markov00
Copy link
Member Author

🎉 This PR is included in version 10.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Aug 26, 2019
@markov00 markov00 deleted the fix-crosshair-mouseover branch November 25, 2020 11:44
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
:annotation Annotation (line, rect, text) related issue bug Something isn't working :interactions Interactions related issue released Issue released publicly
Projects
None yet
3 participants