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(tooltip): show true opaque colors in tooltips #629

Merged
merged 3 commits into from
Jun 10, 2020

Conversation

nickofthyme
Copy link
Collaborator

@nickofthyme nickofthyme commented Apr 11, 2020

Summary

Add backgroundColor to tooltip colors to show true color. Uses background color from theme.background.color per #608.

Most noticeable with light colors.

fixes #628

Before

Screen Recording 2020-06-08 at 05 13 PM

After

Screen Recording 2020-06-08 at 05 00 PM

@nickofthyme nickofthyme added :styling Styling related issue :tooltip Related to hover tooltip labels Apr 11, 2020
@codecov-io
Copy link

codecov-io commented Apr 11, 2020

Codecov Report

Merging #629 into master will increase coverage by 2.84%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #629      +/-   ##
==========================================
+ Coverage   67.78%   70.63%   +2.84%     
==========================================
  Files         236      220      -16     
  Lines        6914     6439     -475     
  Branches     1312     1237      -75     
==========================================
- Hits         4687     4548     -139     
+ Misses       2208     1872     -336     
  Partials       19       19              
Impacted Files Coverage Δ
src/components/tooltip/index.tsx 71.42% <ø> (ø)
...chart_types/xy_chart/utils/stacked_series_utils.ts 97.80% <100.00%> (ø)
...hart_types/partition_chart/layout/config/config.ts 67.74% <0.00%> (-1.01%) ⬇️
src/index.ts 100.00% <0.00%> (ø)
.../chart_types/goal_chart/state/selectors/tooltip.ts
...art_types/goal_chart/layout/viewmodel/viewmodel.ts
...t_types/goal_chart/layout/types/viewmodel_types.ts
...s/goal_chart/state/selectors/is_tooltip_visible.ts
src/chart_types/goal_chart/specs/index.ts
...art_types/goal_chart/state/selectors/geometries.ts
... and 11 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 de7df75...9586b0f. Read the comment docs.

Copy link
Contributor

@rshen91 rshen91 left a comment

Choose a reason for hiding this comment

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

I opened the stories locally and it rendered correctly for the vast majority. I did notice in there might be some weirdness with treemap stories with the tooltip that I could use clarification on. For instance, Treemap - Percentage story that the tooltips show the continents with a $euiColorGhost fill vs. no fill. I'm not sure if this is an intended change? The Treemap- Multi Color shows something similar.

The Treemap - Two Layers Stress Test shows the tooltip item color next to the tooltip text as a different size than the other layer in the tooltip. In master it looks like these are the same size. I'm including a giph to explain it better than I can hopefully:
Apr-13-2020 08-26-46

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.

We should adapt the background color with the used theme background color

position: relative;
width: $euiSizeXS;
margin-right: 3px;
background-color: $euiColorGhost;
Copy link
Member

Choose a reason for hiding this comment

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

This color will be always #fff independently of the background color. I think, for a first fix, we should use a EUI theme color dependant, like the $euiColorFullShade that is white with the light theme and near black for the dark theme.

@rshen91 is working on adding a background prop to the chart to handle various background color, this will then needs to be connected with this component to pass the right color if specified

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok good idea. I'll wait on #608

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

see 58cf176

@nickofthyme
Copy link
Collaborator Author

Good eye @rshen91 I'll test that case when I merge with your changes. 👍

@markov00 markov00 added the wip work in progress label Apr 20, 2020
@markov00 markov00 marked this pull request as draft April 20, 2020 09:16
@codecov-commenter
Copy link

codecov-commenter commented Jun 8, 2020

Codecov Report

Merging #629 into master will increase coverage by 0.14%.
The diff coverage is 79.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #629      +/-   ##
==========================================
+ Coverage   73.13%   73.27%   +0.14%     
==========================================
  Files         271      271              
  Lines        8784     8786       +2     
  Branches     1747     1747              
==========================================
+ Hits         6424     6438      +14     
+ Misses       2309     2297      -12     
  Partials       51       51              
Impacted Files Coverage Δ
...art_types/goal_chart/layout/viewmodel/viewmodel.ts 3.12% <0.00%> (ø)
.../chart_types/goal_chart/state/selectors/tooltip.ts 41.66% <ø> (ø)
src/chart_types/index.ts 100.00% <ø> (ø)
..._types/partition_chart/layout/circline_geometry.ts 98.43% <0.00%> (ø)
src/chart_types/partition_chart/layout/geometry.ts 77.77% <ø> (ø)
...types/partition_chart/layout/types/config_types.ts 100.00% <ø> (ø)
...es/partition_chart/layout/types/viewmodel_types.ts 83.33% <ø> (ø)
...c/chart_types/partition_chart/layout/utils/math.ts 100.00% <ø> (ø)
...hart_types/partition_chart/layout/utils/measure.ts 100.00% <ø> (ø)
...tion_chart/layout/viewmodel/hierarchy_of_arrays.ts 88.88% <ø> (ø)
... and 340 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 0a91351...b0e6eb9. Read the comment docs.

@nickofthyme nickofthyme marked this pull request as ready for review June 8, 2020 22:09
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, tested on safari, chrome and firefox

@markov00 markov00 self-requested a review June 9, 2020 08:18
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.

Testing locally on playground looks good, but I've taken a deeper look at the CI errors and all of them seems legit errors:
There are two errors that are significant:

  • the sunburst tooltip shows the old color version:
    interactions-test-ts-interactions-tooltips-should-show-tooltip-on-sunburst-1-diff
  • in this other screenshot I can see that values are not pushed to the edge
    interactions-test-ts-interactions-tooltips-should-render-corrent-tooltip-for-split-and-y-accessors-1-diff

@nickofthyme
Copy link
Collaborator Author

nickofthyme commented Jun 9, 2020

@markov00!!! thanks, good catch! The first issue I think is expected, what do you mean by the sunburst tooltip shows the old color version? The color is the only diff in that png.

The second one I will fix now.

@markov00
Copy link
Member

markov00 commented Jun 9, 2020

@monfera thanks, good catch! The first issue I think is expected, what do you mean by the sunburst tooltip shows the old color version? The color is the only diff in that png.

The second one I will fix now.

The review was mine :D
by the sunburst tooltip shows the old color version I mean: this error was expected, the screenshot diff shows that we forgot to update that screenshot

@nickofthyme
Copy link
Collaborator Author

Sorry Marco, I don't know why I thought that was Robert. Gotcha, thanks I'll update both bullets.

- Add flex value to inner item container
- Update screenshots per color changes
@nickofthyme
Copy link
Collaborator Author

@markov00 Fixed both in b0e6eb9. I verified the tooltip style changes in IE11, safari, firefox and chrome, but feel free to check yourself.

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

@markov00 markov00 removed the wip work in progress label Jun 10, 2020
@nickofthyme nickofthyme merged commit 23290be into elastic:master Jun 10, 2020
@nickofthyme nickofthyme deleted the fix/tooltip-colors branch June 10, 2020 01:37
markov00 pushed a commit that referenced this pull request Jun 15, 2020
# [19.5.0](v19.4.1...v19.5.0) (2020-06-15)

### Bug Fixes

* **tooltip:** show true opaque colors in tooltips ([#629](#629)) ([23290be](23290be)), closes [#628](#628)
* path of stacked area series with missing values ([#703](#703)) ([2541180](2541180))
* remove double rendering ([#693](#693)) ([ebf2748](ebf2748)), closes [#690](#690)

### Features

* **partition:** add 4.5 contrast for text in partition slices ([#608](#608)) ([eded2ac](eded2ac)), closes [#606](#606)
* add screenshot functions to partition/goal ([#697](#697)) ([5581c3c](5581c3c))
@markov00
Copy link
Member

🎉 This PR is included in version 19.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Jun 15, 2020
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
# [19.5.0](elastic/elastic-charts@v19.4.1...v19.5.0) (2020-06-15)

### Bug Fixes

* **tooltip:** show true opaque colors in tooltips ([opensearch-project#629](elastic/elastic-charts#629)) ([323b325](elastic/elastic-charts@323b325)), closes [opensearch-project#628](elastic/elastic-charts#628)
* path of stacked area series with missing values ([opensearch-project#703](elastic/elastic-charts#703)) ([93f063f](elastic/elastic-charts@93f063f))
* remove double rendering ([#693](elastic/elastic-charts#693)) ([1a9bbb9](elastic/elastic-charts@1a9bbb9)), closes [#690](elastic/elastic-charts#690)

### Features

* **partition:** add 4.5 contrast for text in partition slices ([opensearch-project#608](elastic/elastic-charts#608)) ([59d6d49](elastic/elastic-charts@59d6d49)), closes [opensearch-project#606](elastic/elastic-charts#606)
* add screenshot functions to partition/goal ([opensearch-project#697](elastic/elastic-charts#697)) ([6d2ff64](elastic/elastic-charts@6d2ff64))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Issue released publicly :styling Styling related issue :tooltip Related to hover tooltip
Projects
None yet
Development

Successfully merging this pull request may close these issues.

True tooltip colors
5 participants