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

Do not show tooltip when we are blurring the chart #637

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sauldom102
Copy link
Contributor

@sauldom102 sauldom102 commented Oct 1, 2024

πŸ”‘ What?

Do not show tooltip when we are blurring the chart.

πŸšͺ Why?

We shouldn't show any tooltip when hovering the chart in case it's blurred.

πŸ‘οΈ Visual proof

Screen.Recording.2024-10-01.at.13.44.14.mov

@sauldom102 sauldom102 requested a review from a team as a code owner October 1, 2024 11:44
Copy link

github-actions bot commented Oct 1, 2024

πŸ” Visual review for your branch is published πŸ”

Here are the links to:

Comment on lines +185 to +195
{!yAxis?.isBlur && (
<ChartTooltip
cursor
content={
<ChartTooltipContent
indicator="dot"
yAxisFormatter={yAxis?.tickFormatter}
/>
}
/>
)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we're pushing too much logic on the charts. I would totally rethink this "blur" thing and try to find a higher-order solution (maybe even a higher-order component / wrapper). It can easily pollute the whole codebase.

Copy link
Contributor

Choose a reason for hiding this comment

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

let's then start rethinking it until it is too late

Copy link
Collaborator

Choose a reason for hiding this comment

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

You mean "before it's too late" because "until it's too late" it's what we want to avoid πŸ˜†

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

If we wanna blur the YAxis, then the chart needs to know if it should be blurred, right? How else will be blur it? Adding an overlay doesn't make a lot of sense and the alternative would be passing down the className prop which would give too much control of the UI. I understand the concern, I just don't see a better option. It makes sense to me that the chart knows how to blur itself.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Creating a and then letting the card act upon its state would help us avoid that blur property in the contract and also encourage a global solution. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants