Skip to content

fix(xy): remove wrongly represented null/missing values in tooltip#1415

Merged
markov00 merged 9 commits intoelastic:masterfrom
markov00:2021_10_01-fix_null/missing_values_on_percentage_tooltip
Oct 7, 2021
Merged

fix(xy): remove wrongly represented null/missing values in tooltip#1415
markov00 merged 9 commits intoelastic:masterfrom
markov00:2021_10_01-fix_null/missing_values_on_percentage_tooltip

Conversation

@markov00
Copy link
Copy Markdown
Collaborator

@markov00 markov00 commented Oct 1, 2021

Summary

A regression was introduced and caused null values to show up on the tooltip when rendering stacked bars and areas.
We fixed that issue including proper testing for the use case.

Details

The file chart_types/xy_chart/state/selectors/get_tooltip_values_highlighted_geoms.ts is used to pick the tooltip values from the subset of geometries that the current mouse position intersect. A check was introduced in #1226 to check whenever to include or not a null Y value into a tooltip list.
That PR also altered the current data flow, allowing nullish value in the y1 or initialY1 to flow down within the indexedGeometryMap to be used on the tooltip, but filtered on the rendering side.
This together with a wrong logic and no test on that edge case caused the regression.

Issues

fix #1414

Checklist

  • The proper chart type label has been added (e.g. :xy, :partition)
  • The proper feature labels have been added (e.g. :interactions, :axis)
  • All related issues have been linked (i.e. closes #123, fixes #123)
  • Unit tests have been added or updated to match the most common scenarios
  • The proper documentation and/or storybook story has been added or updated

@markov00 markov00 changed the title 2021 10 01 fix null/missing values on percentage tooltip fix(xy): remove wrongly represented null/missing values in tooltip Oct 1, 2021
Copy link
Copy Markdown
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.

LGTM, tested locally.

Copy link
Copy Markdown
Contributor

@monfera monfera left a comment

Choose a reason for hiding this comment

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

Function-wise looks good!

It'd be prudent to make a VRT test fail if this one regresses in the future, probably via a URL addition in interactions.test.ts plus pointing somewhere

Copy link
Copy Markdown
Contributor

@monfera monfera left a comment

Choose a reason for hiding this comment

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

LGTM 🎉 good to merge when as CI passes. Thanks for the image test 🖼️

@markov00
Copy link
Copy Markdown
Collaborator Author

markov00 commented Oct 7, 2021

jenkins test this please (flaky cross-chart tooltip)

@markov00 markov00 merged commit e5963a3 into elastic:master Oct 7, 2021
@markov00 markov00 deleted the 2021_10_01-fix_null/missing_values_on_percentage_tooltip branch October 7, 2021 10:41
nickofthyme pushed a commit that referenced this pull request Oct 15, 2021
# [38.0.0](v37.0.0...v38.0.0) (2021-10-15)

### Bug Fixes

* **deps:** update dependency @elastic/eui to v39 ([#1422](#1422)) ([2ee97aa](2ee97aa))
* **goal:** reduce whitespace for circular charts ([#1413](#1413)) ([6517523](6517523))
* **interactions:** change allowBrushingLastHistogramBin to true ([#1396](#1396)) ([9fa9783](9fa9783))
* **xy:** remove wrongly represented null/missing values in tooltip ([#1415](#1415)) ([e5963a3](e5963a3)), closes [#1414](#1414)

### Code Refactoring

* scales ([#1410](#1410)) ([a53a2ba](a53a2ba))

### Features

* **scales:** add `LinearBinary` scale type ([#1389](#1389)) ([9f2e427](9f2e427))
* **xy:** adaptive tick raster ([#1420](#1420)) ([200577b](200577b))
* **xy:** apply the data value formatter to data values over bars ([#1419](#1419)) ([e673fc7](e673fc7))

### BREAKING CHANGES

* **interactions:** allowBrushingLastHistogramBucket renamed to allowBrushingLastHistogramBin on the Settings component defaults true and is only applied for histogram type charts
* LogScaleOptions.logBase` is now a `number` instead of the object enum `LogBase`. Some edge case data or configuration _might_, with a deemed low likelihood, lead to a situation where the earlier version would have silently not rendered a bar, line or point, while the new code doesn't `catch`, therefore throw an exception (see the last item). General risk of regressions due to the quantity of code changes (altogether 3.5k)
@nickofthyme
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 38.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nickofthyme nickofthyme added the released Issue released publicly label Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Issue released publicly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stacked as percentage reports null/missing values as 0

3 participants